/* Timeline CSS - Histoire de France */

/* Variables CSS héritées du système principal */
:root {
    --primary-color: var(--bleu-france, #000091);
    --primary-color-light: #3558A0;
    --primary-color-dark: #000074;
    --secondary-color: var(--rouge-france, #E1000F);
    --secondary-color-light: #ff4757;
    --text-color: var(--gris-fonce, #666666);
    --text-color-light: #4A4A4A;
    --background-color: #FFFFFF;
    --background-color-alt: #F8F9FA;
    --white: #FFFFFF;
    --border-color: #E5E5E5;
    --border-color-light: #F0F0F0;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-strong: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Timeline Container */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

/* Timeline Line */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom,
        var(--primary-color) 0%,
        var(--primary-color-light) 50%,
        var(--secondary-color) 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(0, 0, 145, 0.3);
}

/* Timeline Item */
.timeline-item {
    position: relative;
    margin-bottom: var(--spacing-xl);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item.left {
    text-align: right;
    padding-right: calc(50% + 30px);
}

.timeline-item.right {
    text-align: left;
    padding-left: calc(50% + 30px);
}

/* Timeline Content */
.timeline-content {
    background-color: var(--white);
    border-radius: 12px;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color-light);
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
}

.timeline-item.left .timeline-content::before {
    content: '';
    position: absolute;
    right: -15px;
    top: 30px;
    width: 0;
    height: 0;
    border: 15px solid transparent;
    border-left-color: var(--white);
    z-index: 1;
}

.timeline-item.right .timeline-content::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 30px;
    width: 0;
    height: 0;
    border: 15px solid transparent;
    border-right-color: var(--white);
    z-index: 1;
}

/* Period Labels */
.period {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-light) 100%);
    color: var(--white);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
    box-shadow: var(--shadow-light);
}

.period.prehistoire { background: linear-gradient(135deg, #8B4513, #CD853F); }
.period.antiquite { background: linear-gradient(135deg, #DAA520, #FFD700); }
.period.moyen-age { background: linear-gradient(135deg, #800080, #9932CC); }
.period.moderne { background: linear-gradient(135deg, #DC143C, #FF6347); }
.period.revolution { background: linear-gradient(135deg, #FF0000, #FF4500); }
.period.empire { background: linear-gradient(135deg, #4B0082, #8A2BE2); }
.period.republicain { background: linear-gradient(135deg, #008080, #20B2AA); }
.period.contemporain { background: linear-gradient(135deg, #2E8B57, #3CB371); }

/* Date */
.timeline-date {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color-dark);
    margin-bottom: var(--spacing-xs);
}

/* Title */
.timeline-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

/* Description */
.timeline-description {
    color: var(--text-color-light);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

/* Character info */
.character {
    background-color: var(--background-color-alt);
    border-left: 4px solid var(--secondary-color-light);
    padding: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    border-radius: 0 8px 8px 0;
}

.character-name {
    font-weight: 700;
    color: var(--primary-color-dark);
    font-size: 1rem;
}

.character-dates {
    font-size: 0.9rem;
    color: var(--text-color-light);
    font-style: italic;
}

.character-description {
    margin-top: var(--spacing-xs);
    font-size: 0.95rem;
    color: var(--text-color);
}

/* Timeline Dot */
.timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 30px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    border: 4px solid var(--white);
    box-shadow: var(--shadow-medium);
    z-index: 10;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-dot {
    transform: translateX(-50%) scale(1.2);
    box-shadow: 0 0 20px rgba(0, 0, 145, 0.5);
}

/* Navigation Controls */
.timeline-controls {
    text-align: center;
    margin: var(--spacing-xl) 0;
    background-color: var(--white);
    padding: var(--spacing-lg);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
}

.period-filter {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.filter-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 2px solid var(--border-color);
    background-color: var(--white);
    color: var(--text-color);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Marianne', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-light));
    color: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        text-align: left !important;
        padding-left: 60px !important;
        padding-right: 0 !important;
    }

    .timeline-item.left,
    .timeline-item.right {
        text-align: left;
        padding-left: 60px;
        padding-right: 0;
    }

    .timeline-content::before {
        display: none;
    }

    .timeline-dot {
        left: 30px;
        transform: translateX(-50%);
    }

    .timeline-item:hover .timeline-dot {
        transform: translateX(-50%) scale(1.2);
    }

    .period-filter {
        gap: var(--spacing-xs);
    }

    .filter-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .timeline-content {
        padding: var(--spacing-sm);
    }

    .timeline-title {
        font-size: 1.1rem;
    }

    .timeline-date {
        font-size: 1rem;
    }
}

/* Animation pour l'apparition des éléments */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.timeline-item.left.visible {
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.timeline-item.right.visible {
    animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.timeline-dot:hover {
    animation: pulse 0.6s ease-in-out;
}
