/* Timeline Horizontal Premium - Yeshiva Eshel */
/* Design horizontal avec effets spectaculaires */

/* Section Timeline Container */
.timeline-section {
    position: relative;
    padding: 100px 0;
    /* Fond identique aux autres pages du site */
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    overflow: hidden;
}

/* Suppression des motifs de fond animés pour un rendu plus propre */

/* Container principal */
.timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 1;
}

/* Timeline Item - Box Horizontale */
.timeline-item {
    position: relative;
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(50px);
    animation: slideInUp 0.8s ease-out forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.3s; }
.timeline-item:nth-child(3) { animation-delay: 0.5s; }
.timeline-item:nth-child(4) { animation-delay: 0.7s; }
.timeline-item:nth-child(5) { animation-delay: 0.9s; }

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

/* Badge Année - Collé en haut à gauche de la box */
.timeline-year-badge {
    position: absolute;
    top: -3px;
    left: -3px;
    z-index: 10;
    
    /* Design compact et élégant */
    background: linear-gradient(135deg, #1a5490 0%, #2a7abd 50%, #ffd700 100%);
    color: white;
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: 800;
    
    /* Coins arrondis pour s'intégrer à la box */
    border-radius: 17px 0 20px 0;
    
    /* Effets visuels */
    box-shadow: 
        0 5px 20px rgba(26, 84, 144, 0.4),
        0 3px 10px rgba(255, 215, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    
    /* Bordure dorée subtile */
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-top: none;
    border-left: none;
    
    /* Animation de pulsation */
    animation: yearPulse 2s ease-in-out infinite;
    
    /* Effet de brillance */
    overflow: hidden;
    
    /* Transition pour les effets de hover */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Petit accent visuel pour connecter le badge à la box */
.timeline-year-badge::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at top left, transparent 70%, rgba(255, 215, 0, 0.2));
    pointer-events: none;
}

.timeline-year-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.5) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
    z-index: 1;
}

@keyframes yearPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Icône dans le badge année */
.timeline-year-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 1rem;
    animation: iconRotate 4s linear infinite;
    position: relative;
    z-index: 2;
}

@keyframes iconRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Content Box - Design Premium */
.timeline-content-box {
    background: white;
    border-radius: 20px;
    padding: 50px;
    position: relative;
    overflow: visible;
    
    /* Ombres multiples pour profondeur */
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.1),
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 5px 15px rgba(0, 0, 0, 0.05);
    
    /* Bordure gradient animée */
    background: 
        linear-gradient(white, white) padding-box,
        linear-gradient(135deg, #1a5490, #ffd700, #1a5490) border-box;
    border: 3px solid transparent;
    
    /* Transition pour hover */
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Hover effect spectaculaire */
.timeline-content-box:hover {
    transform: translateY(-10px);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.15),
        0 15px 40px rgba(0, 0, 0, 0.1),
        0 5px 20px rgba(255, 215, 0, 0.3);
}

/* Effet sur le badge au hover de la box */
.timeline-content-box:hover .timeline-year-badge {
    transform: scale(1.1);
    box-shadow: 
        0 8px 30px rgba(26, 84, 144, 0.5),
        0 5px 15px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 215, 0, 0.5);
}

/* Pattern décoratif dans les boxes */
.timeline-content-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(50%, -50%);
}

/* Bande colorée à gauche */
.timeline-content-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 100%;
    background: linear-gradient(180deg, #1a5490 0%, #ffd700 100%);
    border-radius: 10px 0 0 10px;
}

/* Contenu avec grille */
.timeline-content-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: start;
    position: relative;
    z-index: 1;
    padding-top: 20px;
}

/* Texte principal */
.timeline-text {
    flex: 1;
}

.timeline-text h3 {
    color: #1a5490;
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: 700;
    position: relative;
    
    /* Soulignement animé */
    padding-bottom: 15px;
}

.timeline-text h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #1a5490 0%, #ffd700 100%);
    transition: width 0.6s ease;
}

.timeline-content-box:hover .timeline-text h3::after {
    width: 100%;
}

.timeline-text h4 {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.timeline-text p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 1.05rem;
}

/* Citation spéciale */
.timeline-quote {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    padding: 35px 30px;
    margin: 30px 0;
    border-radius: 15px;
    position: relative;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 215, 0, 0.2),
        inset 0 0 30px rgba(26, 84, 144, 0.03);
    overflow: hidden;
    transition: all 0.3s ease-out;
    width: 100%;
}

.timeline-quote:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.15),
        0 0 0 2px rgba(255, 215, 0, 0.3),
        inset 0 0 40px rgba(26, 84, 144, 0.05);
}

/* Style spécifique pour la citation de 1962 */
.quote-1962 {
    width: calc(100% - 60px);
    margin: 40px auto 30px;
    padding: 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 215, 0, 0.3),
        inset 0 0 30px rgba(26, 84, 144, 0.05);
    position: relative;
    transform: translateZ(0);
    overflow: hidden;
}

.full-width-quote::before {
    content: '\201C'; /* Guillemet ouvrant stylisé */
    position: absolute;
    top: -30px;
    left: 30px;
    font-size: 120px;
    color: #ffd700;
    opacity: 0.2;
    font-family: 'Times New Roman', serif;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    z-index: 0;
}

.full-width-quote::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, transparent 80%),
        linear-gradient(45deg, transparent 70%, rgba(26, 84, 144, 0.1) 100%);
    pointer-events: none;
    z-index: 1;
}

.timeline-quote::before {
    content: '✦';
    position: absolute;
    top: -15px;
    left: 20px;
    font-size: 100px;
    color: #ffd700;
    opacity: 0.15;
    font-family: Arial, sans-serif;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    z-index: 0;
}

.timeline-quote::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, transparent 80%),
        linear-gradient(45deg, transparent 70%, rgba(26, 84, 144, 0.08) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Images avec effet masonry */
.timeline-images-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 400px;
}

.timeline-images-section img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
}

/* Effet hover sur les images */
.timeline-images-section img:hover {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        0 0 30px rgba(255, 215, 0, 0.4);
    z-index: 10;
}

/* Stats avec compteurs animés */
.timeline-stats {
    display: flex;
    gap: 30px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px dashed rgba(26, 84, 144, 0.2);
}

.stat-item {
    text-align: center;
    flex: 1;
    position: relative;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1a5490 0%, #ffd700 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
    display: block;
    
    /* Animation de comptage */
    animation: countUp 2s ease-out;
}

@keyframes countUp {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
    margin-top: 5px;
}

/* Effet de vague au scroll */
@keyframes waveEffect {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.timeline-content-box.in-view::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: waveEffect 1s ease-out;
}

/* Responsive */
@media (max-width: 968px) {
    .timeline-container {
        padding: 0 20px;
    }
    
    .timeline-content-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline-images-section {
        max-width: 100%;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .timeline-content-box {
        padding: 30px;
    }
    
    .timeline-year-badge {
        font-size: 1rem;
        padding: 10px 20px;
    }
}

@media (max-width: 600px) {
    .timeline-images-section {
        grid-template-columns: 1fr;
    }
    
    .timeline-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .timeline-text h3 {
        font-size: 1.5rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .timeline-year-badge {
        font-size: 0.9rem;
        padding: 8px 16px;
        border-radius: 15px 0 15px 0;
        top: -2px;
        left: -2px;
        border-width: 1px;
    }
    
    .timeline-year-icon {
        font-size: 0.9rem;
        margin-right: 6px;
    }
}

/* Styles améliorés pour la citation */
.quote-intro {
    font-style: italic;
    color: #666;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1rem;
}

.hebrew-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a5490;
    margin-bottom: 25px;
    direction: rtl;
    text-align: center;
    line-height: 1.8;
    padding: 25px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    box-shadow: 
        0 5px 20px rgba(26, 84, 144, 0.15),
        inset 0 0 0 1px rgba(255, 215, 0, 0.3),
        inset 0 1px 5px rgba(255, 215, 0, 0.1);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    transform: translateZ(0);
    will-change: transform, box-shadow;
}

.hebrew-text:hover {
    box-shadow: 
        0 8px 25px rgba(26, 84, 144, 0.2),
        inset 0 0 0 2px rgba(255, 215, 0, 0.4),
        inset 0 1px 8px rgba(255, 215, 0, 0.15);
}

.hebrew-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    pointer-events: none;
    z-index: -1;
}

/* Animation pour le texte qui s'écrit lettre par lettre - version améliorée */
@keyframes typeWriter {
    0% { width: 0; opacity: 0.7; }
    10% { width: 100%; opacity: 1; }
    80% { width: 100%; opacity: 1; }
    90%, 100% { width: 0; opacity: 0.7; }
}

@keyframes blink {
    0%, 100% { border-right-color: transparent; }
    50% { border-right-color: #a37e00; }
}

@keyframes glowText {
    0%, 100% { text-shadow: 0 0 5px rgba(26, 84, 144, 0.1); }
    50% { text-shadow: 0 0 15px rgba(255, 215, 0, 0.3), 0 0 5px rgba(26, 84, 144, 0.2); }
}

.hebrew-verse {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #051629 0%, #0d2a4d 50%, #a37e00 100%);
    color: rgba(0, 0, 0, 0.85); /* Fallback color */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
    margin-bottom: 15px;
    padding: 10px;
    position: relative;
    z-index: 2;
    letter-spacing: 0.03em;
    transform: perspective(1000px) translateZ(0);
    white-space: nowrap;
    overflow: hidden;
    border-right: 3px solid #a37e00;
    animation: 
        typeWriter 12s cubic-bezier(0.44, 0.05, 0.55, 0.95) infinite forwards,
        blink 0.8s infinite normal,
        glowText 12s infinite ease-in-out;
}

@keyframes hebrewGlow {
    0% {
        filter: drop-shadow(0 0 2px rgba(26, 84, 144, 0.3));
    }
    100% {
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
    }
}

.hebrew-blessing {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: #1a5490;
    font-style: normal;
    background: linear-gradient(135deg, #1a5490 0%, #0d2a4d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
    position: relative;
    z-index: 2;
    padding: 8px 15px;
    line-height: 1.6;
    letter-spacing: 0.01em;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.hebrew-blessing-first {
    display: block;
    margin-top: 15px;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    padding-top: 10px;
    border-right: 2px solid #1a5490;
    animation: 
        typeWriter 12s 2s cubic-bezier(0.44, 0.05, 0.55, 0.95) infinite forwards,
        blink 0.8s 2s infinite normal,
        glowText 12s 2s infinite ease-in-out;
}

.hebrew-blessing-second {
    display: block;
    margin-top: 10px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 10px;
    border-right: 2px solid #1a5490;
    animation: 
        typeWriter 12s 4s cubic-bezier(0.44, 0.05, 0.55, 0.95) infinite forwards,
        blink 0.8s 4s infinite normal,
        glowText 12s 4s infinite ease-in-out;
}

.quote-translation {
    font-style: italic;
    color: #555;
    font-size: 1.05rem;
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed rgba(26, 84, 144, 0.2);
}

/* Media queries pour l'adaptation sur petits écrans */
@media only screen and (max-width: 768px) {
    .hebrew-text {
        font-size: 1.5rem;
        padding: 15px;
    }
    
    .hebrew-verse {
        font-size: 1.8rem;
        white-space: normal;
        overflow: visible;
        line-height: 1.5;
        animation: glowText 12s infinite ease-in-out;
        border-right: none;
    }
    
    .hebrew-blessing {
        font-size: 1.2rem;
        white-space: normal;
        overflow: visible;
        line-height: 1.5;
        animation: glowText 12s infinite ease-in-out;
        border-right: none;
    }
    
    .hebrew-blessing-first {
        animation: glowText 12s 2s infinite ease-in-out;
    }
    
    .hebrew-blessing-second {
        animation: glowText 12s 4s infinite ease-in-out;
    }
    
    .quote-intro {
        font-size: 1.1rem;
    }

    .quote-translation {
        font-size: 0.95rem;
    }
}

@media only screen and (max-width: 480px) {
    .hebrew-text {
        font-size: 1.3rem;
        padding: 10px;
    }
    
    .hebrew-verse {
        font-size: 1.5rem;
    }
    
    .hebrew-blessing {
        font-size: 1rem;
    }
    
    .quote-intro {
        font-size: 1rem;
    }

    .quote-translation {
        font-size: 0.9rem;
    }
}