/**
 * SLIDESHOW CSS - Version 4.1
 * Structure aplatie avec les nouveaux attributs data-block-id et data-slide-id
 */

/* ============================================
   MODE SLIDESHOW - Masquer les blocs par défaut
   ============================================ */
body[data-slideshow="true"] [data-block-id][data-slide-id] {
    display: none !important;
}

/* Afficher les blocs du slide actif (slide 0 = page unique, toujours visible si ce mode est forcé) */
body[data-slideshow="true"] [data-block-id][data-slide-id].active-slide {
    display: block !important;
}

/* Cas spéciaux pour le display */
body[data-slideshow="true"] .row-date-time[data-block-id][data-slide-id].active-slide {
    display: grid !important;
}

body[data-slideshow="true"] .ticker-simple[data-block-id][data-slide-id].active-slide {
    display: flex !important;
}

body[data-slideshow="true"] .weather-full[data-block-id][data-slide-id].active-slide {
    display: flex !important;
    flex-direction: column !important;
}

/* ============================================
   MODE PAGE UNIQUE - Tout visible sauf blocs masqués
   ============================================ */
body:not([data-slideshow="true"]) [data-block-id] {
    display: block !important;
}

body:not([data-slideshow="true"]) .row-date-time[data-block-id] {
    display: grid !important;
}

body:not([data-slideshow="true"]) .ticker-simple[data-block-id] {
    display: flex !important;
}

/* Masquer les blocs non présents dans la config de la page unique */
body:not([data-slideshow="true"]) [data-block-id][data-slide-id="0"] {
    display: none !important;
}
/* Afficher ceux qui sont dans la liste (reçoivent la classe via JS) */
body:not([data-slideshow="true"]) [data-block-id][data-slide-id="0"].active-slide {
     display: block !important;
}
/* Gérer les display spéciaux pour la page unique aussi */
body:not([data-slideshow="true"]) .row-date-time[data-block-id][data-slide-id="0"].active-slide {
    display: grid !important;
}
body:not([data-slideshow="true"]) .ticker-simple[data-block-id][data-slide-id="0"].active-slide {
    display: flex !important;
}
body:not([data-slideshow="true"]) .weather-full[data-block-id][data-slide-id="0"].active-slide {
    display: flex !important;
    flex-direction: column !important;
}


/* ============================================
   STYLES COMMUNS
   ============================================ */
body[data-slideshow="true"] .container {
    align-content: start;
}

body[data-slideshow="true"] .row-date-time {
    height: 120px;
    min-height: 120px;
    max-height: 120px;
}
body[data-slideshow="true"] .row-date-time .card {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
body[data-slideshow="true"] [data-block-id="announcements"].active-slide {
    min-height: calc(100vh - 60px);
    display: flex !important;
    flex-direction: column;
}
body[data-slideshow="true"] [data-block-id="announcements"].active-slide .panel-body,
body[data-slideshow="true"] [data-block-id="announcements"].active-slide .ann-grid {
    flex: 1;
}

/* ============================================
   TRANSITIONS
   ============================================ */
body[data-transition="fade"] [data-block-id].active-slide {
    animation: slideFadeIn 0.5s ease;
}

body[data-transition="slide"] [data-block-id].active-slide {
    animation: slideSlideIn 0.5s ease;
}

@keyframes slideFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ============================================
   INDICATEURS ET BARRE DE PROGRESSION
   ============================================ */
.slideshow-indicators {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
}
.slideshow-indicators.hidden {
    display: none !important;
}
.slideshow-indicators .indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}
.slideshow-indicators .indicator.active {
    background: white;
    transform: scale(1.2);
}

.slideshow-progress {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1000;
}
.slideshow-progress.hidden {
    display: none !important;
}
.slideshow-progress .progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent, #667eea), var(--accent2, #764ba2));
    transition: width 0.1s linear;
}
.slideshow-progress .progress-bar.animate {
    width: 100%;
    transition: width var(--slideshow-duration, 10s) linear;
}