/**
 * Timeline Escalier Coloré - Historique Ludothèque
 * Style colonnes en escalier avec bandes de couleur
 *
 * Couleurs utilisées :
 * - Primary (Orange): #e36c1d
 * - Accent (Magenta): #e5007d
 * - Peach: #f7ceac
 */

/* ==========================================================================
   Conteneur principal
   ========================================================================== */

.ludo-history-timeline {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    position: relative;
    overflow: hidden;
}

.ludo-history-timeline h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--ludo-text-dark, #374151);
    margin-bottom: 15px;
}

.timeline-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--ludo-text, #6b7280);
    margin-bottom: 50px;
    font-weight: 500;
}

/* ==========================================================================
   Conteneur des colonnes en escalier
   ========================================================================== */

.timeline-stairs-container {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    min-height: 550px;
    overflow-x: auto;
    padding-bottom: 20px;
}

/* Ligne horizontale de connexion - en bas des colonnes */
.timeline-stairs-container::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg,
        var(--ludo-primary, #e36c1d) 0%,
        var(--ludo-accent, #e5007d) 50%,
        var(--ludo-primary, #e36c1d) 100%);
    z-index: 5;
    border-radius: 3px;
}

/* ==========================================================================
   Chaque colonne (étape)
   ========================================================================== */

.timeline-step {
    position: relative;
    flex: 1 1 0;
    min-width: 140px;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Palette de couleurs pastels alternées */
.timeline-step:nth-child(6n+1) .timeline-step-column { background: #f8b4b4; } /* Rose clair */
.timeline-step:nth-child(6n+2) .timeline-step-column { background: #fcd5ce; } /* Pêche */
.timeline-step:nth-child(6n+3) .timeline-step-column { background: #fef3c7; } /* Jaune clair */
.timeline-step:nth-child(6n+4) .timeline-step-column { background: #d1fae5; } /* Vert clair */
.timeline-step:nth-child(6n+5) .timeline-step-column { background: #bfdbfe; } /* Bleu clair */
.timeline-step:nth-child(6n+6) .timeline-step-column { background: #ddd6fe; } /* Violet clair */

/* Effet escalier : hauteur croissante puis décroissante (9 colonnes) */
.timeline-step:nth-child(1) .timeline-step-column { height: 220px; }  /* 1979 */
.timeline-step:nth-child(2) .timeline-step-column { height: 300px; }  /* 2017 */
.timeline-step:nth-child(3) .timeline-step-column { height: 380px; }  /* 2018 */
.timeline-step:nth-child(4) .timeline-step-column { height: 440px; }  /* 2019 */
.timeline-step:nth-child(5) .timeline-step-column { height: 480px; }  /* 2020 - pic */
.timeline-step:nth-child(6) .timeline-step-column { height: 420px; }  /* 2021 */
.timeline-step:nth-child(7) .timeline-step-column { height: 460px; }  /* 2023 */
.timeline-step:nth-child(8) .timeline-step-column { height: 340px; }  /* 2024 */
.timeline-step:nth-child(9) .timeline-step-column { height: 400px; }  /* 2025 */

/* ==========================================================================
   Colonne colorée
   ========================================================================== */

.timeline-step-column {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px 15px 30px;
    transition: all 0.3s ease;
}

.timeline-step:hover .timeline-step-column {
    filter: brightness(0.95);
    transform: translateY(-5px);
}

/* ==========================================================================
   Icône ronde en haut
   ========================================================================== */

.timeline-step-icon {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border: 4px solid currentColor;
    z-index: 10;
}

/* Couleurs des icônes selon la colonne */
.timeline-step:nth-child(6n+1) .timeline-step-icon { color: #dc2626; border-color: #dc2626; }
.timeline-step:nth-child(6n+2) .timeline-step-icon { color: #ea580c; border-color: #ea580c; }
.timeline-step:nth-child(6n+3) .timeline-step-icon { color: #ca8a04; border-color: #ca8a04; }
.timeline-step:nth-child(6n+4) .timeline-step-icon { color: #16a34a; border-color: #16a34a; }
.timeline-step:nth-child(6n+5) .timeline-step-icon { color: #2563eb; border-color: #2563eb; }
.timeline-step:nth-child(6n+6) .timeline-step-icon { color: #7c3aed; border-color: #7c3aed; }

/* ==========================================================================
   Année / Date
   ========================================================================== */

.timeline-step-year {
    font-size: 2rem;
    font-weight: 800;
    color: var(--ludo-text-dark, #374151);
    text-align: center;
    margin-top: 40px;
    margin-bottom: 15px;
    line-height: 1;
}

/* ==========================================================================
   Contenu texte
   ========================================================================== */

.timeline-step-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.timeline-step-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ludo-text-dark, #374151);
    line-height: 1.4;
    margin: 0 0 8px 0;
    text-align: left;
    padding-left: 12px;
    position: relative;
}

.timeline-step-title:last-child {
    margin-bottom: 0;
}

.timeline-step-title::before {
    content: '•';
    position: absolute;
    left: 0;
    color: inherit;
    font-weight: 800;
}

/* ==========================================================================
   Point sur la ligne horizontale
   ========================================================================== */

.timeline-step-dot {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    border: 4px solid var(--ludo-primary, #e36c1d);
    z-index: 10;
    transition: all 0.3s ease;
}

.timeline-step:nth-child(even) .timeline-step-dot {
    border-color: var(--ludo-accent, #e5007d);
}

.timeline-step:hover .timeline-step-dot {
    transform: translateX(-50%) scale(1.3);
    background: var(--ludo-primary, #e36c1d);
}

.timeline-step:nth-child(even):hover .timeline-step-dot {
    background: var(--ludo-accent, #e5007d);
}

/* ==========================================================================
   Animations d'entrée
   ========================================================================== */

.timeline-step {
    opacity: 0;
    transform: translateY(50px);
    animation: stepSlideUp 0.6s ease forwards;
}

.timeline-step:nth-child(1) { animation-delay: 0.1s; }
.timeline-step:nth-child(2) { animation-delay: 0.2s; }
.timeline-step:nth-child(3) { animation-delay: 0.3s; }
.timeline-step:nth-child(4) { animation-delay: 0.4s; }
.timeline-step:nth-child(5) { animation-delay: 0.5s; }
.timeline-step:nth-child(6) { animation-delay: 0.6s; }
.timeline-step:nth-child(7) { animation-delay: 0.7s; }
.timeline-step:nth-child(8) { animation-delay: 0.8s; }
.timeline-step:nth-child(9) { animation-delay: 0.9s; }

@keyframes stepSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Barre de scroll personnalisée
   ========================================================================== */

.timeline-stairs-container::-webkit-scrollbar {
    height: 8px;
}

.timeline-stairs-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.timeline-stairs-container::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--ludo-primary, #e36c1d), var(--ludo-accent, #e5007d));
    border-radius: 4px;
}

/* ==========================================================================
   Indicateur de scroll
   ========================================================================== */

.timeline-scroll-hint {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--ludo-text, #6b7280);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.timeline-scroll-hint::before,
.timeline-scroll-hint::after {
    content: '←';
    font-size: 1.2rem;
    animation: scrollHint 1.5s ease-in-out infinite;
}

.timeline-scroll-hint::after {
    content: '→';
}

@keyframes scrollHint {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ==========================================================================
   Responsive - Tablette
   ========================================================================== */

@media (max-width: 1200px) {
    .timeline-step {
        min-width: 120px;
        max-width: 160px;
    }

    .timeline-step-year {
        font-size: 1.5rem;
    }

    .timeline-step-title {
        font-size: 0.75rem;
    }

    .timeline-step-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        top: -25px;
    }
}

/* ==========================================================================
   Responsive - Mobile
   ========================================================================== */

@media (max-width: 768px) {
    .ludo-history-timeline {
        padding: 30px 15px 40px;
    }

    .ludo-history-timeline h2 {
        font-size: 1.8rem;
    }

    .timeline-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .timeline-stairs-container {
        min-height: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .timeline-stairs-container::before {
        display: none;
    }

    .timeline-step {
        width: 100%;
        flex-direction: row;
        align-items: stretch;
    }

    .timeline-step-column {
        height: auto !important;
        min-height: 100px;
        flex-direction: row;
        align-items: center;
        padding: 20px;
        gap: 15px;
    }

    .timeline-step-icon {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
        flex-shrink: 0;
    }

    .timeline-step-year {
        font-size: 1.3rem;
        margin: 0;
        min-width: 80px;
        text-align: center;
    }

    .timeline-step-content {
        flex: 1;
    }

    .timeline-step-title {
        font-size: 0.9rem;
    }

    .timeline-step-dot {
        display: none;
    }

    .timeline-scroll-hint {
        display: none;
    }

    /* Bordure entre les éléments */
    .timeline-step-column {
        border-bottom: 3px solid rgba(255, 255, 255, 0.5);
    }
}

/* ==========================================================================
   Responsive - Très petit écran
   ========================================================================== */

@media (max-width: 480px) {
    .ludo-history-timeline h2 {
        font-size: 1.5rem;
    }

    .timeline-step-column {
        padding: 15px;
        flex-wrap: wrap;
    }

    .timeline-step-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .timeline-step-year {
        font-size: 1.1rem;
        min-width: 70px;
    }

    .timeline-step-title {
        font-size: 0.85rem;
        width: 100%;
        margin-top: 10px;
    }
}
