/* Bandeau d'alerte défilant (espace visiteur, tous espaces) — design validé « Direction B ».
   Cf. Views/Shared/_BandeauAlerte.cshtml (rendu) + wwwroot/js/bandeau.js (rotation/réduction).
   EVA le 17/07/2026 */

/* Le header du site est en position:fixed (top:0, z-index 1030) : sans intervention il RECOUVRE le
   bandeau. On fixe donc la barre tout en haut, au-dessus du header, et — uniquement quand le bandeau
   est déployé (classe posée sur <body> par bandeau.js) — on décale le header fixe et le contenu de la
   hauteur de la barre (46px). À la réduction, la classe est retirée => le header revient en haut. */
.bandeau-alerte {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
}

body.bandeau-deploye header.sticky-header,
body.bandeau-deploye header.black-header {
    top: 46px;
}

body.bandeau-deploye .page-wrapper {
    padding-top: 176px; /* 130px d'origine + 46px de bande */
}

.bandeau-alerte-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 46px;
    box-sizing: border-box;
    background: #fff5e6;
    color: #b9720d;
    border-bottom: 2px solid #b9720d;
    padding: 0 18px;
    font-family: inherit;
    box-shadow: 0 2px 6px rgba(185, 114, 13, .18);
}

.bandeau-alerte-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #b9720d;
    font-size: 18px;
}

.bandeau-alerte-bell.bandeau-alerte-anim i {
    animation: bandeauAlerteRing 3.2s ease-in-out infinite;
    transform-origin: top center;
    display: inline-block;
}

@keyframes bandeauAlerteRing {
    0%, 78%, 100% { transform: rotate(0deg); }
    80% { transform: rotate(9deg); }
    82% { transform: rotate(-9deg); }
    84% { transform: rotate(6deg); }
    86% { transform: rotate(-6deg); }
    88% { transform: rotate(0deg); }
}

.bandeau-alerte-pastille {
    position: absolute;
    top: -7px;
    right: -9px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #d0342c;
    /* !important : le compteur doit rester blanc même face au CSS du header/thème greffe (sinon texte noir illisible). */
    color: #fff !important;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    display: grid;
    place-items: center;
    border: 2px solid #fff5e6;
    line-height: 1;
}

/* Pastille verte des alertes ACQUITTÉES, à gauche (la rouge « en cours » reste à droite). */
.bandeau-alerte-pastille-acquit {
    background: #1c7a43;
    left: -9px;
    right: auto;
}

.bandeau-alerte-messages {
    flex: 1;
    min-width: 0;
    position: relative;
}

.bandeau-alerte-message {
    display: none;
    font-size: 14px;
    color: #5a3a06;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
}

.bandeau-alerte-message.actif {
    display: block;
}

.bandeau-alerte-message-txt {
    display: inline-block;
    white-space: nowrap;
    will-change: transform;
}

/* Message plus large que la barre : défilement horizontal doux (aller-retour). bandeau.js détecte le
   débordement et pose la distance (--defile-dist, négative) et la durée (--defile-duree). Les messages
   qui tiennent dans la barre restent fixes (pas de classe .defile). */
.bandeau-alerte-message.defile .bandeau-alerte-message-txt {
    animation: bandeauDefile var(--defile-duree, 10s) ease-in-out infinite alternate;
}

@keyframes bandeauDefile {
    from { transform: translateX(0); }
    to { transform: translateX(var(--defile-dist, 0px)); }
}

.bandeau-alerte-message b {
    color: #b9720d;
    margin-right: 6px;
}

.bandeau-alerte-message.bandeau-alerte-fige {
    cursor: default;
}

.bandeau-alerte-dots {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.bandeau-alerte-dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e2b877;
    display: block;
    cursor: pointer;
}

.bandeau-alerte-dots i.actif {
    background: #b9720d;
    width: 18px;
    border-radius: 4px;
}

.bandeau-alerte-fleche {
    background: transparent;
    border: 1px solid #b9720d;
    color: #b9720d;
    border-radius: 6px;
    width: 24px;
    height: 24px;
    line-height: 1;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
}

.bandeau-alerte-fleche:hover {
    background: #b9720d;
    color: #fff;
}

.bandeau-alerte-reduire {
    margin-left: 2px;
}

/* Bandeau réduit : la bande disparaît (masquée en JS), seule la cloche + pastille restent, déplacées
   dans le header (#bandeauAlerteAncrageHeader, cf. Views/Shared/_Header.cshtml). */
.bandeau-alerte-strip.bandeau-alerte-masque {
    display: none;
}

.bandeau-alerte-cloche-reduite {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0b3d6e;
    cursor: pointer;
    font-size: 18px;
    /* Le bouton Assistance (.off-canvas-area-wrap a) a margin-right:30px : on compense par une marge
       négative pour coller la cloche juste après lui (ancrage dans _Header.cshtml). */
    margin-left: -22px;
}

.bandeau-alerte-cloche-reduite i {
    animation: bandeauAlerteRing 3.2s ease-in-out infinite;
    transform-origin: top center;
    display: inline-block;
}

.bandeau-alerte-cloche-reduite .bandeau-alerte-pastille {
    border-color: #fff;
}

@media (max-width: 767.98px) {
    /* On garde une seule ligne (hauteur 46px stable pour le décalage du header) : le message
       est tronqué (ellipsis) plutôt que de passer à la ligne. Espacements resserrés. */
    .bandeau-alerte-strip {
        gap: 8px;
        padding: 0 10px;
    }

    .bandeau-alerte-message {
        font-size: 13px;
    }
}

/* ===================== Écran d'administration /Gestion/MessagesAlerte ===================== */

.badge-categorie {
    font-size: 10.5px;
    font-weight: 700;
    background: #fff5e6;
    color: #b9720d;
    border: 1px solid #e6c48a;
    border-radius: 20px;
    padding: 1px 8px;
}

.badge-statut {
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 20px;
    padding: 1px 8px;
    white-space: nowrap;
}

.badge-statut.st-on {
    background: #e6f5ec;
    color: #1c7a43;
    border: 1px solid #b6e2c6;
}

.badge-statut.st-off {
    background: #f0f2f5;
    color: #788396;
    border: 1px solid #dfe4ec;
}

.badge-statut.st-soon {
    background: #fff5e6;
    color: #b9720d;
    border: 1px solid #e6c48a;
}

.item-message-alerte[data-actif="false"] {
    opacity: .65;
}

/* Espaces de diffusion : interrupteurs à glisser (form-switch Bootstrap) présentés en tuiles alignées.
   Tuile verte quand l'espace est activé. */
.bandeau-espace-switch {
    padding: 8px 12px 8px 3em; /* garde la place du toggle (form-switch = padding-left 2.5em) */
    border: 1px solid #dde3ec;
    border-radius: 8px;
    background: #fafbfd;
    margin: 0;
    min-height: auto;
}

.bandeau-espace-switch .form-check-input {
    cursor: pointer;
}

.bandeau-espace-switch .form-check-input:checked {
    background-color: #1c7a43;
    border-color: #1c7a43;
}

.bandeau-espace-switch .form-check-label {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #1f2733;
}

.bandeau-espace-switch:has(.form-check-input:checked) {
    border-color: #b6e2c6;
    background: #e6f5ec;
}

/* ===================== Cloche cliquable + panneau acquitter / remettre ===================== */
.bandeau-alerte-bell { cursor: pointer; }

.bandeau-alerte-vide { font-size: 13px; color: #8a6d3b; font-style: italic; }

.bandeau-alerte-panneau {
    position: absolute;
    top: 50px;
    left: 8px;
    width: 380px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid #dde3ec;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(20, 40, 80, .18);
    z-index: 1060;
    overflow: hidden;
    color: #1f2733;
}

.bandeau-alerte-panneau[hidden] { display: none; }

.bandeau-alerte-panneau-tete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #eef1f5;
    font-weight: 700;
    font-size: 13px;
    color: #b9720d;
}

.bandeau-alerte-panneau-fermer {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: #8a94a6;
    line-height: 1;
}

.bandeau-alerte-panneau-corps {
    max-height: 320px;
    overflow-y: auto;
}

.bandeau-alerte-panneau-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f2f5f9;
}

.bandeau-alerte-panneau-item:last-child { border-bottom: 0; }

.bandeau-alerte-panneau-txt {
    flex: 1;
    font-size: 13px;
    color: #333;
    line-height: 1.35;
}

.bandeau-alerte-panneau-txt b { color: #b9720d; margin-right: 6px; }

.bandeau-alerte-panneau-item.acquitte .bandeau-alerte-panneau-txt {
    color: #9aa4b2;
    text-decoration: line-through;
}

.bandeau-alerte-acquitter,
.bandeau-alerte-remettre {
    flex-shrink: 0;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid;
}

.bandeau-alerte-acquitter { border-color: #b9720d; color: #b9720d; background: #fff; }
.bandeau-alerte-acquitter:hover { background: #b9720d; color: #fff; }
.bandeau-alerte-remettre { border-color: #1c7a43; color: #1c7a43; background: #e6f5ec; }
.bandeau-alerte-remettre:hover { background: #1c7a43; color: #fff; }

