/* ============================================ */
/* TIMELINE 3D IMMERSIVE - VERSION PREMIUM     */
/* ============================================ */

.timeline-section {
    padding: 80px 0 60px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease;
}

/* Dégradé subtil en arrière-plan */
.timeline-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(59, 130, 246, 0.02), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.section-header {
    position: relative;
    z-index: 1;
    margin-bottom: 48px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 560px;
    margin: 0 auto;
    transition: color 0.3s ease;
}

/* Wrapper de la timeline */
.timeline-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    z-index: 1;
}

/* Ligne de temps verticale */
.timeline-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(59, 130, 246, 0.2) 10%,
        rgba(59, 130, 246, 0.3) 50%,
        rgba(59, 130, 246, 0.2) 90%,
        transparent 100%
    );
    border-radius: 4px;
}

/* Élément de la timeline */
.timeline-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

/* Carte */
.timeline-card {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.4s ease;
    width: 100%;
    max-width: 820px;
    position: relative;
    backdrop-filter: blur(4px);
}

.timeline-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(59, 130, 246, 0.1);
}

/* Image */
.timeline-image {
    flex: 1 1 40%;
    min-height: 200px;
    overflow: hidden;
    position: relative;
}

.timeline-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.4s ease;
    display: block;
}

.timeline-card:hover .timeline-image img {
    transform: scale(1.04);
    filter: brightness(1.02);
}

/* Contenu */
.timeline-content {
    flex: 1 1 50%;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.timeline-content h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.timeline-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
    transition: color 0.3s ease;
}

/* Année (badge) */
.timeline-year {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-main);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 20px;
    border-radius: 50px;
    letter-spacing: 1px;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
    z-index: 2;
    white-space: nowrap;
}

/* Point lumineux sur la ligne */
.timeline-item::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-blue);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 0 20px rgba(59, 130, 246, 0.1);
    z-index: 1;
    transition: all 0.3s ease;
}

.timeline-item:hover::before {
    background: var(--primary-purple);
    box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.15), 0 0 30px rgba(139, 92, 246, 0.2);
}

/* Alternance des cartes (gauche / droite) sur desktop */
@media (min-width: 992px) {
    .timeline-item:nth-child(odd) .timeline-card {
        margin-right: auto;
        margin-left: 0;
    }
    .timeline-item:nth-child(even) .timeline-card {
        margin-left: auto;
        margin-right: 0;
    }
    .timeline-item:nth-child(odd) .timeline-year {
        left: calc(50% - 80px);
    }
    .timeline-item:nth-child(even) .timeline-year {
        left: calc(50% + 80px);
    }
}

/* Responsive */
@media (max-width: 991px) {
    .timeline-wrapper::before {
        left: 20px;
    }
    .timeline-item {
        padding-left: 48px;
    }
    .timeline-item::before {
        left: 20px;
        top: 20px;
        transform: none;
    }
    .timeline-item .timeline-year {
        left: 20px !important;
        top: -10px;
        transform: none;
    }
    .timeline-card {
        flex-direction: column;
        max-width: 100%;
    }
    .timeline-image {
        min-height: 160px;
        flex: 1 1 auto;
    }
    .timeline-content {
        padding: 24px 20px;
    }
}

/* Mode clair */
body[data-theme="light"] .timeline-section {
    background: #f8fafc;
}

body[data-theme="light"] .timeline-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

body[data-theme="light"] .timeline-item::before {
    border-color: #f8fafc;
}

body[data-theme="light"] .timeline-card:hover {
    border-color: rgba(59, 130, 246, 0.2);
}

/* Animation AOS (optionnelle) */
.timeline-item[data-aos] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.timeline-item[data-aos].aos-animate {
    opacity: 1;
    transform: translateY(0);
}