/* ==========================================================================
   Module : Modales, Toasts & Animations
   ========================================================================== */

/* --- Dark Mode (défaut) --- */

/* Styles pour le conteneur global des notifications */
.msb-global-notifications-container {
    position: fixed; /* Reste visible même en scrollant */
    top: 0; 
    left: 0; /* Changé de left: 50%; transform: translateX(-50%); */
    width: 100%; /* Prend toute la largeur pour que align-items: center fonctionne */
    z-index: 10000; /* Très élevé pour être au-dessus de tout */
    display: flex;
    flex-direction: column; /* Les notifications s'empileront verticalement */
    align-items: center; /* Centrer les notifications (les toasts eux-mêmes) horizontalement */
    /* padding-top: 80px; /* SUPPRIMÉ ou COMMENTÉ: Sera géré par JavaScript */
    pointer-events: none; /* Permet de cliquer "à travers" le conteneur s'il est vide ou entre les notifications */
    box-sizing: border-box; /* Bon à avoir pour les calculs de padding/width */
}

/* Styles pour chaque notification individuelle (toast) */
.msb-notification-toast {
    /* ... (styles existants du toast restent inchangés) ... */
    padding: var(--space-md, 16px);
    background-color: var(--clr-bg-element-hover, #202831); /* Fond du toast */
    border: 1px solid var(--clr-border-secondary, #353F4D);
    border-left-width: 5px; /* Bordure latérale colorée pour indiquer le type */
    border-radius: var(--border-radius, 3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4); /* Ombre portée plus prononcée */
    color: var(--clr-text-primary, #C8C8C8);
    min-width: 300px;  /* Largeur minimale du toast */
    max-width: 500px;  /* Largeur maximale, s'adapte au contenu */
    margin-bottom: var(--space-md, 16px); /* Espace entre les toasts s'il y en a plusieurs */
    pointer-events: auto; /* Les toasts eux-mêmes doivent être cliquables/interactifs */

    /* Animation d'apparition/disparition */
    opacity: 0;
    transform: translateY(-30px) scale(0.95); /* Commence un peu au-dessus et plus petit */
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.msb-notification-toast.visible {
    opacity: 1;
    transform: translateY(0) scale(1); /* Revient à sa position et taille normale */
}

/* Couleurs pour les types de notifications */
.msb-notification-toast.msb-toast-error {
    border-left-color: #CD4A4A; /* Rouge pour erreur */
}
.msb-notification-toast.msb-toast-error .msb-toast-title { /* Si vous ajoutez un titre au toast */
    color: #CD4A4A;
}

.msb-notification-toast.msb-toast-info {
    border-left-color: var(--clr-accent-blue-highlight, #0BC6E3); /* Bleu pour info */
}
.msb-notification-toast.msb-toast-info .msb-toast-title {
    color: var(--clr-accent-blue-highlight, #0BC6E3);
}

.msb-notification-toast.msb-toast-success {
    border-left-color: #4CAF50; /* Vert pour succès */
}
.msb-notification-toast.msb-toast-success .msb-toast-title {
    color: #4CAF50;
}

.msb-notification-toast a {
    color: var(--clr-text-link, #CDA158); /* Utiliser la couleur des liens de votre thème */
    text-decoration: underline;
}
.msb-notification-toast a:hover {
    color: var(--clr-text-link-hover, #E8C37E);
}

/* Optionnel : Pour ajouter une icône et un titre au toast */
.msb-notification-toast .msb-toast-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-sm, 8px);
}
.msb-notification-toast .msb-toast-icon {
    margin-right: var(--space-sm, 8px);
    font-size: 1.2em; /* Ajustez la taille de l'icône */
}
.msb-notification-toast .msb-toast-title {
    font-weight: bold;
}
.msb-notification-toast .msb-toast-message {
    font-size: 0.95em;
}

/* Optionnel : Bouton de fermeture pour le toast */
.msb-toast-close-button {
    background: none;
    border: none;
    color: var(--clr-text-secondary);
    font-size: 1.2em;
    padding: 0 var(--space-xs);
    margin-left: auto; /* Pousse le bouton à droite */
    cursor: pointer;
    line-height: 1;
}
.msb-toast-close-button:hover {
    color: var(--clr-text-primary);
}

/* ==========================================================================
   Animations et Highlights
   ========================================================================== */

.msb-replying-to-info.highlight-active {
    animation: msb-highlight-flash 0.3s ease-out forwards, 
               msb-highlight-border 1s ease-in-out 0.3s forwards; /* Démarre après le flash */
    position: relative; /* Nécessaire si on utilise z-index dans l'animation */
    z-index: 5; /* Pour s'assurer que le highlight est visible */
}

@keyframes msb-highlight-flash {
    0% {
        background-color: var(--clr-bg-element);
        box-shadow: 0 0 0 0 rgba(var(--clr-accent-gold-rgb, 205, 161, 88), 0); /* Assurez-vous d'avoir --clr-accent-gold-rgb */
    }
    50% {
        background-color: rgba(var(--clr-accent-gold-rgb, 205, 161, 88), 0.3); /* Flash doré semi-transparent */
        box-shadow: 0 0 15px 5px rgba(var(--clr-accent-gold-rgb, 205, 161, 88), 0.5);
    }
    100% {
        background-color: var(--clr-bg-element);
        box-shadow: 0 0 0 0 rgba(var(--clr-accent-gold-rgb, 205, 161, 88), 0);
    }
}

@keyframes msb-highlight-border {
    0% {
        border-color: var(--clr-border-accent); /* Couleur de bordure initiale */
        outline: 0px solid rgba(var(--clr-accent-gold-rgb, 205, 161, 88), 0.0);
    }
    25% {
        border-color: var(--clr-accent-gold); /* Bordure plus vive */
        outline: 3px solid rgba(var(--clr-accent-gold-rgb, 205, 161, 88), 0.3);
    }
    50% {
        border-color: var(--clr-accent-gold-darker); /* Retour à une couleur plus sombre */
        outline: 1px solid rgba(var(--clr-accent-gold-rgb, 205, 161, 88), 0.1);
    }
    100% {
        border-color: var(--clr-border-accent); /* Retour à la couleur de bordure initiale */
        outline: 0px solid rgba(var(--clr-accent-gold-rgb, 205, 161, 88), 0.0);
    }
}

/* --- Light Mode --- */

/* Notifications Toast */
html.light-mode .msb-notification-toast {
    background-color: var(--color-component-background); /* Fond beige pour le toast */
    border-color: var(--clr-border-secondary, #D4C0A5); /* Bordure beige */
    color: var(--color-text);
    box-shadow: 0 5px 15px rgba(74, 59, 49, 0.15); /* Ombre plus douce */
}
html.light-mode .msb-notification-toast a {
    color: var(--clr-text-link); /* Doré */
}
html.light-mode .msb-toast-close-button {
    color: var(--color-text-secondary);
}
html.light-mode .msb-toast-close-button:hover {
    color: var(--color-text);
}

/* Boutons de modération (admin) - spinner */
html.light-mode .msb-ajax-spinner {
    border-color: var(--clr-accent-gold);
    border-top-color: transparent;
}
