/* ==========================================================================
   Ba7ath SlideMapper - High-End Story Format
   ========================================================================== */

#ba7ath-slidemapper {
    width: 100%;
    max-width: 500px;
    /* Dimension optimisée pour une lecture focus type mobile */
    margin: 3rem auto;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    font-family: 'DM Sans', sans-serif;
    background-color: #001f3f;
}

/* Zone d'affichage (Viewport vertical) */
.slider-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    /* Format portrait premium */
    overflow: hidden;
}

.slides-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Base de la Slide (Masquée par défaut) */
.slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 2.5rem;
    box-sizing: border-box;

    opacity: 0;
    visibility: hidden;
    transform: translateX(100px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1;
}

/* État : Diapositive Active */
.slide-item.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
    z-index: 10;
}

/* État : Diapositive Précédente (sortie par la gauche) */
.slide-item.prev {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-100px) scale(0.95);
    z-index: 1;
}

/* Thèmes Graphiques */
.theme-light {
    background-color: #0b111a;
    /* Fond très sombre pour contraster avec l'argenté */
    color: #cbd5e1;
}

.theme-dark {
    background-color: #005088;
    /* Retour à la couleur bleue originale appréciée */
    color: #f3f0df;
}

/* ==========================================================================
   Animations en Cascade (Stagger)
   ========================================================================== */
.anim-stagger-1,
.anim-stagger-2,
.anim-stagger-3,
.anim-stagger-4 {
    opacity: 0;
    transform: translateY(30px);
}

.active .anim-stagger-1 {
    animation: slideUpFade 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.2s;
}

.active .anim-stagger-2 {
    animation: slideUpFade 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.4s;
}

.active .anim-stagger-3 {
    animation: slideUpFade 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.6s;
}

.active .anim-stagger-4 {
    animation: slideUpFade 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.8s;
}

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

/* ==========================================================================
   Typographie et Éléments Internes
   ========================================================================== */
.slide-title-large {
    font-family: 'Merriweather', serif;
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
    /* Effet Argenté Premium */
    background: linear-gradient(90deg, #ffffff, #a8b2c1) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.slide-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    line-height: 1.5;
    color: #e0e0e0;
}

.slide-title {
    font-family: 'Merriweather', serif;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #11caa0;
    padding-left: 1rem;
    font-weight: 700;
    /* Effet Argenté Premium */
    background: linear-gradient(90deg, #ffffff, #a8b2c1) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.theme-light .slide-title,
.theme-dark .slide-title {
    background: linear-gradient(90deg, #ffffff, #a8b2c1) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.slide-value {
    font-size: 4.5rem;
    font-weight: 800;
    color: #11caa0;
    margin-bottom: 1rem;
    line-height: 1;
    text-shadow: 0 4px 10px rgba(17, 202, 160, 0.2);
}

.slide-desc {
    font-size: 1.15rem;
    line-height: 1.6;
    opacity: 0.9;
}

.slide-quote {
    font-size: 1.4rem;
    font-style: italic;
    border-left: 3px solid #11caa0;
    padding-left: 1.2rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.slide-quote-large {
    font-size: 1.8rem;
    font-style: italic;
    font-weight: 700;
    color: #11caa0;
    line-height: 1.4;
    margin-bottom: 1.5rem;
}

.slide-source {
    font-size: 0.95rem;
    opacity: 0.7;
    display: block;
    font-weight: 500;
}

.swipe-indicator {
    margin-top: 3rem;
    font-size: 0.9rem;
    color: #11caa0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

/* ==========================================================================
   Graphiques Dynamiques (Charts)
   ========================================================================== */
.chart-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    margin-top: 1rem;
}

.bar-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bar-label {
    font-weight: 700;
    font-size: 1rem;
}

.bar-track {
    background: rgba(0, 0, 0, 0.08);
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

.theme-dark .bar-track {
    background: rgba(255, 255, 255, 0.1);
}

.bar-fill {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    font-weight: 700;
    color: white;
    border-radius: 8px;
    width: 0;
    /* État initial pour l'animation */
    white-space: nowrap;

    /* Animation de remplissage dynamique déclenchée lors de l'activation */
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.6s;
}

/* ==========================================================================
   Contrôles du Lecteur (HUD)
   ========================================================================== */
.slider-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #00284d;
    /* Fond très sombre pour contraster */
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.slider-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
    padding: 0.5rem;
}

.slider-btn:hover {
    color: #11caa0;
    transform: scale(1.1);
}

.slider-progress {
    flex-grow: 1;
    margin: 0 1.5rem;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #11caa0;
    width: 0%;
    /* Géré par JS */
    transition: width 0.4s ease-out;
    box-shadow: 0 0 10px rgba(17, 202, 160, 0.5);
}

/* ==========================================================================
   Support RTL (Arabe) - À AJOUTER À LA FIN DU FICHIER
   ========================================================================== */
[dir="rtl"] .slide-item {
    text-align: right;
    transform: translateX(-100px) scale(0.95);
    /* Inverse la position de départ */
}

[dir="rtl"] .slide-item.active {
    transform: translateX(0) scale(1);
}

[dir="rtl"] .slide-item.prev {
    transform: translateX(100px) scale(0.95);
    /* Inverse la position de sortie */
}

[dir="rtl"] .slide-title {
    border-left: none;
    border-right: 4px solid #11caa0;
    padding-left: 0;
    padding-right: 1rem;
}

[dir="rtl"] .slide-quote {
    border-left: none;
    border-right: 3px solid #11caa0;
    padding-left: 0;
    padding-right: 1.2rem;
}

[dir="rtl"] .slide-title-large,
[dir="rtl"] .slide-title,
[dir="rtl"] .slide-desc,
[dir="rtl"] .slide-subtitle,
[dir="rtl"] .slide-quote,
[dir="rtl"] .slide-quote-large,
[dir="rtl"] .slide-source,
[dir="rtl"] .bar-label,
[dir="rtl"] .swipe-indicator {
    font-family: 'Cairo', sans-serif;
}

[dir="rtl"] .bar-fill {
    justify-content: flex-start;
    padding-right: 0;
    padding-left: 12px;
}