/* ============================================
   SECTION CONTEXTE
   ============================================ */

.context-section {
    position: relative;
    padding: 3rem 0;
    background: linear-gradient(135deg, #F0FDF4 0%, #FFFFFF 50%, #F0FDF4 100%);
    overflow: hidden;
}

/* Pattern de fond */
.context-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230a7734' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

/* Film strip en bas */
.context-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 1200 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='filmStripContext' x='0' y='0' width='120' height='120' patternUnits='userSpaceOnUse'%3E%3Crect width='120' height='120' fill='none'/%3E%3Crect x='5' y='0' width='15' height='120' fill='%230a7734' fill-opacity='0.05'/%3E%3Crect x='95' y='0' width='15' height='120' fill='%230a7734' fill-opacity='0.05'/%3E%3Crect x='30' y='0' width='3' height='120' fill='%23FFD700' fill-opacity='0.04'/%3E%3Crect x='45' y='0' width='3' height='120' fill='%23FFD700' fill-opacity='0.04'/%3E%3Crect x='70' y='0' width='3' height='120' fill='%23FF0000' fill-opacity='0.04'/%3E%3Crect x='85' y='0' width='3' height='120' fill='%23FF0000' fill-opacity='0.04'/%3E%3Ccircle cx='12' cy='20' r='3' fill='%23FFFFFF' fill-opacity='0.06'/%3E%3Ccircle cx='12' cy='60' r='3' fill='%23FFFFFF' fill-opacity='0.06'/%3E%3Ccircle cx='12' cy='100' r='3' fill='%23FFFFFF' fill-opacity='0.06'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23filmStripContext)'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 120px 120px;
    opacity: 0.3;
    pointer-events: none;
}

.context-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

/* Badge */
.context-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(10, 119, 52, 0.1), rgba(10, 119, 52, 0.05));
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    margin-bottom: 2rem;
    border: 1px solid rgba(10, 119, 52, 0.2);
}

.badge-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #0a7734, #085c28);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-icon i {
    font-size: 0.9rem;
    color: #FFFFFF;
}

.context-badge span:last-child {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0a7734;
    letter-spacing: 1px;
}

/* Header */
.context-header {
    text-align: center;
    margin-bottom: 3rem;
}

.context-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: #1F2937;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.title-wave {
    animation: wave 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(15deg); }
}

.context-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.context-divider .divider-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #0a7734, #085c28, transparent);
}

.context-divider i {
    font-size: 1.2rem;
    color: #FF0000;
}

/* Contenu principal */
.context-content {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 3rem;
    background: #FFFFFF;
    border-radius: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.context-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.1);
}

/* ============================================
   TIMELINE (Partie gauche) - ANIMATIONS AMÉLIORÉES
   ============================================ */

.context-timeline {
    background: linear-gradient(135deg, #0a2e1a 0%, #0a7734 100%);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* SVG Fond animé */
.context-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='filmContext' x='0' y='0' width='100' height='100' patternUnits='userSpaceOnUse'%3E%3Cg opacity='0.1'%3E%3Crect x='20' y='20' width='40' height='25' rx='3' fill='none' stroke='%23FFFFFF' stroke-width='1'/%3E%3Ccircle cx='40' cy='32' r='5' fill='none' stroke='%23FFFFFF' stroke-width='0.8'/%3E%3C/g%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23filmContext)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    opacity: 0.2;
    pointer-events: none;
    animation: slowFloat 30s linear infinite;
}

@keyframes slowFloat {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 100px 100px;
    }
}

/* Effet de lumière traversante */
.context-timeline::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: lightSweep 8s linear infinite;
    pointer-events: none;
}

@keyframes lightSweep {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.timeline-container {
    position: relative;
    z-index: 10;
    width: 100%;
}

.timeline-item {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0.8rem;
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Effet de fond au survol */
.timeline-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.15), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.timeline-item:hover::before {
    left: 100%;
}

.timeline-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(8px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Animation de pulsation au survol du dot */
.timeline-item:hover .timeline-dot {
    transform: scale(1.5);
    background: #FFFFFF;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

.timeline-year {
    font-size: 1.2rem;
    font-weight: 800;
    color: #FFD700;
    min-width: 70px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-year {
    color: #FFFFFF;
    transform: scale(1.05);
}

.timeline-dot {
    width: 12px;
    height: 12px;
    background: #FFD700;
    border-radius: 50%;
    margin: 0 1rem;
    position: relative;
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ligne de connexion avec animation */
.timeline-line {
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, #FFD700, rgba(255, 215, 0, 0.3));
    margin: 0 1rem;
    position: relative;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-line {
    background: linear-gradient(to bottom, #FFFFFF, #FFD700);
    transform: scaleX(1.5);
}

.timeline-text {
    flex: 1;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-text {
    color: #FFFFFF;
    transform: translateX(5px);
}

/* Dernier item sans ligne */
.timeline-item:last-child .timeline-line {
    display: none;
}

/* Dot pulsant spécial pour 2024 */
.pulse-dot {
    animation: dotPulseEnhanced 2s ease-in-out infinite;
}

@keyframes dotPulseEnhanced {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(255, 215, 0, 0);
        transform: scale(1.2);
    }
}

/* Animation d'apparition des items avec stagger */
.timeline-item {
    opacity: 0;
    animation: fadeInLeftEnhanced 0.6s ease forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInLeftEnhanced {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   TEXTE CONTEXTE (Partie droite) - AVEC ARMOIRIE
   ============================================ */

.context-text {
    padding: 2rem;
    background: #FFFFFF;
    position: relative;
    overflow: hidden;
}

/* Armoirie du Burkina Faso en filigrane */
.context-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    height: 320px;
    background-image: url('../../../frontend/img/armoirie.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

/* Version alternative avec SVG plus détaillé */
.context-text::after {
    content: '';
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 120px;
    height: 120px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cdefs%3E%3Cstyle%3E .star { fill: %23FFD700; opacity: 0.06; } .text { fill: %230a7734; opacity: 0.05; } %3C/style%3E%3C/defs%3E%3Cg%3E%3Ccircle cx='100' cy='100' r='90' fill='none' stroke='%230a7734' stroke-width='1.5' opacity='0.08'/%3E%3Cpolygon points='100,30 115,70 158,70 123,95 138,135 100,110 62,135 77,95 42,70 85,70' class='star'/%3E%3Ctext x='100' y='165' text-anchor='middle' font-size='10' class='text'%3EBURKINA%3C/text%3E%3Ctext x='100' y='178' text-anchor='middle' font-size='8' class='text'%3EFASO%3C/text%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
}

.text-quote {
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.text-quote i {
    font-size: 2.5rem;
    color: rgba(10, 119, 52, 0.2);
}

.text-subtitle {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0a7734;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 4px solid #FFD700;
    position: relative;
    z-index: 2;
}

.text-content-wrapper {
    position: relative;
    z-index: 2;
}

.text-content {
    color: #4B5563;
    line-height: 1.7;
    max-height: 280px;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.text-content.expanded {
    max-height: 2000px;
}

.text-content-wrapper.collapsed .text-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, #FFFFFF);
    pointer-events: none;
    z-index: 3;
}

.text-content p {
    margin-bottom: 1.2rem;
    position: relative;
    z-index: 2;
}

/* Highlight Box amélioré */
.highlight-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(10, 119, 52, 0.08), rgba(255, 215, 0, 0.08));
    border-radius: 20px;
    margin-top: 1.5rem;
    border-left: 4px solid #0a7734;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.highlight-box:hover {
    transform: translateX(5px);
    background: linear-gradient(135deg, rgba(10, 119, 52, 0.12), rgba(255, 215, 0, 0.12));
}

.highlight-box i {
    font-size: 1.5rem;
    color: #FFD700;
    flex-shrink: 0;
}

.highlight-box p {
    margin: 0;
    font-style: italic;
    color: #1F2937;
}

/* Bouton Toggle */
.text-toggle {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    position: relative;
    z-index: 2;
}

.toggle-btn-context {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.8rem;
    background: transparent;
    border: 2px solid rgba(10, 119, 52, 0.3);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0a7734;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.toggle-btn-context::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(10, 119, 52, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.toggle-btn-context:hover::before {
    width: 300px;
    height: 300px;
}

.toggle-btn-context:hover {
    border-color: #0a7734;
    background: rgba(10, 119, 52, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(10, 119, 52, 0.2);
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.text-content-wrapper.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* Décoration */
.context-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
}

.deco-line {
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #0a7734, #FFD700, #FF0000, transparent);
}

.deco-camera {
    width: 40px;
    height: 40px;
    background: rgba(10, 119, 52, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.deco-camera:hover {
    transform: scale(1.1);
    background: rgba(10, 119, 52, 0.2);
}

.deco-camera i {
    font-size: 1.2rem;
    color: #0a7734;
}

/* Responsive */
@media (max-width: 1024px) {
    .context-content {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .context-timeline {
        padding: 2rem;
        order: 2;
    }
    
    .context-text {
        order: 1;
    }
    
    .context-text::before {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 768px) {
    .context-section {
        padding: 3rem 0;
    }
    
    .context-container {
        padding: 0 1rem;
    }
    
    .timeline-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .timeline-year {
        font-size: 1rem;
        min-width: 60px;
    }
    
    .timeline-text {
        font-size: 0.8rem;
    }
    
    .text-content {
        max-height: 250px;
    }
    
    .highlight-box {
        padding: 1rem;
    }
    
    .highlight-box i {
        font-size: 1.2rem;
    }
    
    .context-text::before {
        width: 200px;
        height: 200px;
    }
    
    .context-text::after {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .timeline-dot, .timeline-line {
        display: none;
    }
    
    .timeline-year {
        background: rgba(255, 215, 0, 0.2);
        padding: 0.2rem 0.8rem;
        border-radius: 20px;
        display: inline-block;
        margin-bottom: 0.5rem;
    }
    
    .text-subtitle {
        font-size: 1rem;
    }
    
    .text-content {
        max-height: 200px;
    }
    
    .toggle-btn-context {
        padding: 0.6rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .context-text::before {
        width: 150px;
        height: 150px;
    }
}