/* ===== FRISE HISTORIQUE HIÉRARCHIQUE - STYLE TEMPLATE ORIGINAL ===== */

/* Section Souverains - Fond bois comme le template */
.sovereigns-timeline {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #8B4513 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.sovereigns-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="wood-grain" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M0,50 Q25,40 50,50 T100,50" stroke="%23654321" stroke-width="0.5" fill="none" opacity="0.3"/><path d="M0,25 Q25,15 50,25 T100,25" stroke="%23654321" stroke-width="0.3" fill="none" opacity="0.2"/><path d="M0,75 Q25,65 50,75 T100,75" stroke="%23654321" stroke-width="0.3" fill="none" opacity="0.2"/></pattern></defs><rect width="100" height="100" fill="url(%23wood-grain)"/></svg>');
    pointer-events: none;
}

/* En-tête de la timeline */
.timeline-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 2;
}

.timeline-header .section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8em;
    color: #F5DEB3;
    margin-bottom: 20px;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.timeline-header .section-title i {
    color: #FFD700;
    font-size: 0.9em;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.timeline-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1.3em;
    color: #F5DEB3;
    margin-bottom: 30px;
    font-weight: 400;
    line-height: 1.6;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Instructions */
.timeline-instructions {
    text-align: center;
    margin-top: 40px;
    position: relative;
    z-index: 2;
}

.timeline-instructions p {
    font-family: 'Inter', sans-serif;
    font-size: 1.1em;
    color: #F5DEB3;
    opacity: 0.8;
    font-style: italic;
}

.timeline-instructions i {
    color: #FFD700;
    margin-right: 8px;
}

/* Conteneur de la timeline */
.timeline-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Piste de la timeline */
.timeline-track {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding: 40px 0;
    scroll-behavior: smooth;
    position: relative;
    justify-content: flex-start;
}

.timeline-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
    border-radius: 3px;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Éléments de la timeline */
.timeline-item {
    flex: 0 0 350px;
    position: relative;
    z-index: 2;
}

/* Cartes des régimes - Style template exact */
.regime-card {
    background: linear-gradient(145deg, #F5DEB3 0%, #DEB887 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.3);
    transition: all 0.4s ease;
    border: 3px solid #D2691E;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.regime-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
}

.regime-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.4);
    border-color: #FFD700;
}

/* Portrait du régime */
.regime-portrait {
    text-align: center;
    margin-bottom: 25px;
}

.regime-portrait img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #D2691E;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.regime-card:hover .regime-portrait img {
    transform: scale(1.1);
    border-color: #FFD700;
    box-shadow: 0 6px 20px rgba(255,215,0,0.4);
}

/* Informations du régime */
.regime-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6em;
    color: #8B4513;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.regime-period {
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 1.2em;
    color: #D2691E;
    font-weight: 700;
    margin-bottom: 15px;
    padding: 12px 25px;
    background: rgba(210, 105, 30, 0.15);
    border-radius: 25px;
    border: 2px solid rgba(210, 105, 30, 0.3);
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
}

.regime-type {
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 1em;
    color: #A0522D;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: #F5DEB3;
    border-radius: 20px;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
}

.regime-nickname {
    text-align: center;
    font-style: italic;
    color: #A0522D;
    margin-bottom: 18px;
    font-size: 1em;
    font-family: 'Playfair Display', serif;
}

/* Événements du régime */
.regime-events {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.regime-events span {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: #F5DEB3;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 1px solid rgba(245, 222, 179, 0.3);
}

.regime-events span:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.4);
}

/* Compteur de dirigeants */
.rulers-count {
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.95em;
    color: #D2691E;
    font-weight: 600;
    margin-bottom: 10px;
    padding: 6px 15px;
    background: rgba(210, 105, 30, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(210, 105, 30, 0.3);
}

/* Indicateur d'expansion */
.expand-indicator {
    text-align: center;
    margin-top: 15px;
}

.expand-indicator i {
    color: #D2691E;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.regime-card:hover .expand-indicator i {
    color: #FFD700;
    transform: scale(1.2);
}

/* Détails des dirigeants (section dépliable) */
.rulers-details {
    background: linear-gradient(145deg, rgba(245, 222, 179, 0.95) 0%, rgba(222, 184, 135, 0.95) 100%);
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
    border: 2px solid rgba(210, 105, 30, 0.3);
    backdrop-filter: blur(10px);
}

.rulers-details h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4em;
    color: #8B4513;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

/* Grille des dirigeants */
.rulers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.ruler-mini-card {
    background: linear-gradient(145deg, #F5DEB3 0%, #DEB887 100%);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid rgba(210, 105, 30, 0.2);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.ruler-mini-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    border-color: #D2691E;
}

.ruler-mini-portrait {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #D2691E;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.ruler-mini-card:hover .ruler-mini-portrait {
    border-color: #FFD700;
    transform: scale(1.1);
}

.ruler-mini-info h5 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1em;
    color: #8B4513;
    margin-bottom: 5px;
    font-weight: 600;
}

.ruler-mini-period {
    font-family: 'Inter', sans-serif;
    font-size: 0.9em;
    color: #D2691E;
    font-weight: 600;
    margin-bottom: 5px;
}

.ruler-mini-nickname {
    font-family: 'Playfair Display', serif;
    font-size: 0.85em;
    color: #A0522D;
    font-style: italic;
}

/* États de chargement */
.timeline-loading {
    text-align: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(245, 222, 179, 0.3);
    border-top: 4px solid #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.timeline-loading p {
    font-family: 'Inter', sans-serif;
    font-size: 1.2em;
    color: #F5DEB3;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sovereigns-timeline {
        padding: 60px 0;
    }
    
    .timeline-header .section-title {
        font-size: 2.2em;
        flex-direction: column;
        gap: 15px;
    }
    
    .timeline-subtitle {
        font-size: 1.1em;
        padding: 0 20px;
    }
    
    .timeline-track {
        gap: 20px;
        padding: 30px 0;
    }
    
    .timeline-item {
        flex: 0 0 300px;
    }
    
    .regime-card {
        padding: 25px;
    }
    
    .regime-portrait img {
        width: 80px;
        height: 80px;
    }
    
    .regime-info h3 {
        font-size: 1.4em;
    }
    
    .regime-period {
        font-size: 1.1em;
        padding: 10px 20px;
    }
    
    .rulers-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .rulers-details {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .timeline-header .section-title {
        font-size: 1.8em;
    }
    
    .timeline-item {
        flex: 0 0 280px;
    }
    
    .regime-card {
        padding: 20px;
    }
    
    .regime-events {
        gap: 8px;
    }
    
    .regime-events span {
        padding: 6px 12px;
        font-size: 0.85em;
    }
    
    .ruler-mini-portrait {
        width: 50px;
        height: 50px;
    }
}

/* Scrollbar personnalisée pour la frise */
.timeline-track::-webkit-scrollbar {
    height: 10px;
}

.timeline-track::-webkit-scrollbar-track {
    background: rgba(245, 222, 179, 0.2);
    border-radius: 5px;
}

.timeline-track::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #D2691E 0%, #FFD700 100%);
    border-radius: 5px;
}

.timeline-track::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
}

/* Animations d'entrée */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-item {
    animation: fadeInUp 0.8s 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; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }

