/* =======================================================================
   1. ÉTIQUETTES DES TUILLES (H5P/ÉLÉA)
   ======================================================================= */
.h5p-tile .module-label {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    background-color: white;
    border: 1px solid;
    opacity: 0;
    transition: none;
}

.h5p-tile:hover .module-label {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.h5p-label {
    border-image: linear-gradient(to left, #0659B8, #0976E7) 1;
    color: #0976E7; /* Fallback */
}

.h5p-label span {
    background: linear-gradient(to left, #0659B8, #0976E7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.elea-label {
    border-image: linear-gradient(to left, #32038D, #B9459B) 1;
    color: #B9459B; /* Fallback */
}

.elea-label span {
    background: linear-gradient(to left, #32038D, #B9459B);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
/* =======================================================================
   2. ÉTIQUETTES DANS LA MODALE
   ======================================================================= */
.modal-description-label {
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid;
    margin-right: 8px;
}

.h5p-label-modal {
    border-image: linear-gradient(to left, #0659B8, #0976E7) 1;
    color: #0976E7;
}

.elea-label-modal {
    border-image: linear-gradient(to left, #32038D, #B9459B) 1;
    color: #B9459B;
}
/* =======================================================================
   3. STYLE DU TEXTE D'AIDE POUR L'IA
   ======================================================================= */
/* Scoped IA guidance (modal footer only) */
.modal-panel-footer .ia-guidance-text {
    font-size: 13px;
    color: #333; /* Couleur de texte plus foncée pour le contraste */
    text-align: left;
    padding: 10px 15px;
    margin: 0;
    line-height: 1.4;
    background-color: #eaf2fa; /* Fond bleu clair */
    border-left: 4px solid #037aff; /* Bordure gauche bleu-vert */
    position: relative;
}

.modal-panel-footer .ia-guidance-text a {
    color: #0976E7; /* Bleu vif pour les liens */
    text-decoration: none;
    font-weight: bold;
}

.modal-panel-footer .ia-guidance-text a:hover {
    text-decoration: underline;
}

/* Masque le bouton de copie uniquement dans la zone RAG du mode Avancé */
#unified-rag-area .floating-toolbar #ocr-copy-btn {
    display: none;
}

/* =======================================================================
   4. MODALE DE MISE � JOUR DE VERSION
   ======================================================================= */
.version-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 2100; /* Au-dessus du header (1100), même niveau que les autres modales */
}

.version-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.version-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 11, 25, 0.55);
    backdrop-filter: blur(2px);
}

.version-modal__dialog {
    position: relative;
    width: min(420px, calc(100% - 32px));
    margin: 0 16px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1.25rem 2.5rem rgba(7, 11, 25, 0.25);
    transform: translateY(12px);
    transition: transform 0.25s ease;
    overflow: hidden;
}

.version-modal.visible .version-modal__dialog {
    transform: translateY(0);
}

.version-modal__content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    align-items: stretch;
}

.version-modal__icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #0659B8, #0976E7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    box-shadow: 0 8px 20px rgba(9, 118, 231, 0.35);
    margin: 0 auto 12px;
}

.version-modal__text h3 {
    margin: 0 0 8px;
    font-size: 1.125rem;
    color: #050b21;
}

.version-modal__text p {
    margin: 0;
    color: #2f3546;
    line-height: 1.4;
}

.version-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.version-modal__actions .action-btn {
    white-space: nowrap;
    min-width: 0;
}

.version-modal__dismiss {
    border: none;
    background: none;
    color: #0976E7;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 4px;
    transition: color 0.2s ease;
    text-align: center;
}

.version-modal__dismiss:hover,
.version-modal__dismiss:focus-visible {
    color: #0659B8;
}

body.version-modal-open {
    overflow: hidden;
}

@media (max-width: 520px) {
    /* Reserved for future tweaks */
}

/* =======================================================================
   5. BANDEAU DE NOTIFICATION D'URGENCE
   ======================================================================= */

/* Conteneur dédié au bandeau d'urgence */
#emergency-notification-container {
    position: sticky;
    top: 0; /* Colle en haut de l'écran quand on scroll */
    z-index: 1050; /* Entre le header (1100) et le contenu, sous les modales (2100) */
    width: 100%;
    transition: all 0.3s ease;
}

/* Le bandeau lui-même */
.emergency-banner {
    display: flex;
    align-items: center;
    justify-content: center; /* Centre le contenu */
    gap: 16px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(238, 90, 82, 0.25);
    border-bottom: 3px solid rgba(0, 0, 0, 0.1);
    font-weight: 500;
    line-height: 1.5;
    width: 100%; /* Pleine largeur */

    /* État initial : masqué */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-100%);
    transition: max-height 0.4s ease, opacity 0.3s ease, transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* État visible du bandeau */
.emergency-banner.is-visible {
    max-height: 200px; /* Hauteur max pour permettre le multi-lignes */
    opacity: 1;
    transform: translateY(0);
}

/* Icône d'alerte */
.emergency-banner__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid #ffffff;
    border-radius: 50%;
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
}

/* Message du bandeau */
.emergency-banner__message {
    flex: 1;
    margin: 0;
    font-size: 15px;
    color: #ffffff;
}

/* Animation subtile pour attirer l'attention */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(238, 90, 82, 0.25);
    }
    50% {
        box-shadow: 0 4px 20px rgba(238, 90, 82, 0.45);
    }
}

.emergency-banner.is-visible {
    animation: pulse-glow 3s ease-in-out infinite;
}

/* =======================================================================
   RESPONSIVE - MODE MOBILE
   ======================================================================= */

@media (max-width: 768px) {
    .emergency-banner {
        gap: 12px;
        padding: 12px 16px;
        border-bottom-width: 2px;
    }

    .emergency-banner__icon {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .emergency-banner__message {
        font-size: 14px;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .emergency-banner {
        gap: 10px;
        padding: 10px 12px;
    }

    .emergency-banner__icon {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .emergency-banner__message {
        font-size: 13px;
    }
}

/* =======================================================================
   ACCESSIBILITÉ & PRÉFÉRENCES UTILISATEUR
   ======================================================================= */

/* Respect de la préférence "réduire les mouvements" */
@media (prefers-reduced-motion: reduce) {
    .emergency-banner {
        transition: opacity 0.2s ease, max-height 0.2s ease;
        transform: none;
        animation: none;
    }

    .emergency-banner.is-visible {
        animation: none;
    }
}

/* Mode contrasté élevé */
@media (prefers-contrast: high) {
    .emergency-banner {
        border-bottom-width: 4px;
        border-bottom-color: #000000;
    }

    .emergency-banner__icon {
        border-width: 3px;
    }
}

