/**
 * Chipo Avant/Après Widget - Styles
 * Version: 1.0.0
 */

/* ===============================================
   CONTENEUR PRINCIPAL
   =============================================== */

.chipo-avant-apres-wrapper {
    width: 100%;
    overflow: hidden;
}

.chipo-avant-apres-container {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    min-height: 400px;
}

/* ===============================================
   COLONNES (AVANT / AVEC CHIPO)
   =============================================== */

.chipo-avant-column,
.chipo-apres-column {
    flex: 1;
    min-width: 300px;
    padding: 60px 30px;
    position: relative;
}

/* Effet de séparation visuelle entre les deux colonnes */
.chipo-avant-column::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.1) 20%,
        rgba(0, 0, 0, 0.1) 80%,
        transparent 100%
    );
}

/* ===============================================
   TITRES DES SECTIONS
   =============================================== */

.chipo-avant-section-title,
.chipo-apres-section-title {
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 40px 0;
    text-align: center;
    position: relative;
    padding-bottom: 20px;
}

/* Ligne décorative sous les titres */
.chipo-avant-section-title::after,
.chipo-apres-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: currentColor;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(81, 164, 180, 0.3);
}

/* ===============================================
   CONTENEUR DES CARTES
   =============================================== */

.chipo-cartes-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===============================================
   CARTES INDIVIDUELLES
   =============================================== */

.chipo-carte {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Effet au survol */
.chipo-carte:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(81, 164, 180, 0.25);
    border-left: 3px solid #51a4b4;
}

/* Effet de brillance au survol */
.chipo-carte::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    transition: transform 0.6s;
}

.chipo-carte:hover::before {
    transform: translateX(100%) translateY(100%) rotate(45deg);
}

/* ===============================================
   VIGNETTES (IMAGES)
   =============================================== */

.chipo-carte-vignette {
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    position: relative;
}

.chipo-carte-vignette img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    border: 4px solid #000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.chipo-carte:hover .chipo-carte-vignette img {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* ===============================================
   CONTENU DES CARTES
   =============================================== */

.chipo-carte-contenu {
    flex: 1;
    display: flex;
    align-items: center;
    padding-left: 15px;
}

.chipo-carte-texte {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #333333;
    font-weight: 500;
}

/* ===============================================
   ANIMATIONS
   =============================================== */

/* État initial des cartes animées - FIX: Ne pas masquer par défaut */
.chipo-animated .chipo-carte {
    opacity: 1;
    transform: translateY(0);
}

/* Seulement masquer avant l'animation si JS est chargé */
.chipo-animated.chipo-js-ready .chipo-carte:not(.chipo-visible) {
    opacity: 0;
    transform: translateY(30px);
}

/* Animation d'apparition */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation de pulsation légère */
@keyframes subtlePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Appliquer l'animation aux cartes visibles */
.chipo-animated .chipo-carte.chipo-visible {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Vitesses d'animation */
.chipo-animated[data-animation-speed="slow"] .chipo-carte.chipo-visible {
    animation-duration: 0.9s;
}

.chipo-animated[data-animation-speed="normal"] .chipo-carte.chipo-visible {
    animation-duration: 0.6s;
}

.chipo-animated[data-animation-speed="fast"] .chipo-carte.chipo-visible {
    animation-duration: 0.4s;
}

/* Animation des titres */
.chipo-animated.chipo-js-ready .chipo-avant-section-title,
.chipo-animated.chipo-js-ready .chipo-apres-section-title {
    opacity: 0;
    transform: translateY(-20px);
    animation: fadeInDown 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Si JS ne charge pas, afficher quand même */
.chipo-animated:not(.chipo-js-ready) .chipo-avant-section-title,
.chipo-animated:not(.chipo-js-ready) .chipo-apres-section-title,
.chipo-animated:not(.chipo-js-ready) .chipo-carte {
    opacity: 1 !important;
    transform: none !important;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

/* Tablettes */
@media (max-width: 1024px) {
    .chipo-avant-column,
    .chipo-apres-column {
        padding: 50px 25px;
    }
    
    .chipo-avant-section-title,
    .chipo-apres-section-title {
        font-size: 28px;
    }
    
    .chipo-carte-texte {
        font-size: 15px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .chipo-avant-apres-container {
        flex-direction: column;
    }
    
    .chipo-avant-column,
    .chipo-apres-column {
        width: 100%;
        padding: 40px 20px;
    }
    
    /* Retirer la ligne de séparation sur mobile */
    .chipo-avant-column::after {
        display: none;
    }
    
    /* Ajouter une ligne de séparation horizontale */
    .chipo-avant-column {
        border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    }
    
    .chipo-avant-section-title,
    .chipo-apres-section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }
    
    .chipo-carte {
        padding: 15px;
    }
    
    .chipo-carte-vignette {
        width: 150px;
        height: 150px;
    }
    
    .chipo-carte-texte {
        font-size: 13px;
    }
}

/* Petits mobiles */
@media (max-width: 480px) {
    .chipo-avant-column,
    .chipo-apres-column {
        padding: 30px 15px;
    }
    
    .chipo-avant-section-title,
    .chipo-apres-section-title {
        font-size: 20px;
        letter-spacing: 1px;
    }
    
    .chipo-cartes-container {
        gap: 15px;
    }
    
    .chipo-carte {
        flex-direction: row;
        text-align: left;
        padding: 12px;
    }
    
    .chipo-carte-vignette {
        width: 150px;
        height: 150px;
        margin: 0;
    }
    
    .chipo-carte-contenu {
        padding-left: 12px;
    }
    
    .chipo-carte-texte {
        font-size: 12px;
    }
}

/* ===============================================
   ACCESSIBILITÉ
   =============================================== */

/* Respect des préférences utilisateur pour les animations */
@media (prefers-reduced-motion: reduce) {
    .chipo-carte,
    .chipo-carte-vignette img,
    .chipo-carte::before {
        transition: none !important;
        animation: none !important;
    }
    
    .chipo-animated .chipo-carte {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Focus visible pour la navigation au clavier */
.chipo-carte:focus-within {
    outline: 2px solid #51a4b4;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(81, 164, 180, 0.2);
}

/* ===============================================
   PRINT STYLES
   =============================================== */

@media print {
    .chipo-avant-apres-container {
        flex-direction: column;
    }
    
    .chipo-carte {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .chipo-avant-column::after {
        display: none;
    }
}

/* ===============================================
   DARK MODE (optionnel)
   =============================================== */

@media (prefers-color-scheme: dark) {
    .chipo-carte {
        background-color: #2d2d2d;
    }
    
    .chipo-carte-texte {
        color: #e0e0e0;
    }
}
