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

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

/* Styles pour le conteneur global des notifications */
.ttb-global-notifications-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    box-sizing: border-box;
}

/* Styles pour chaque notification individuelle (toast) */
.ttb-notification-toast {
    padding: var(--space-md, 16px);
    background-color: var(--clr-bg-element-hover, #202831);
    border: 1px solid var(--clr-border-secondary, #353F4D);
    border-left-width: 5px;
    clip-path: var(--chamfer-sm);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    color: var(--clr-text-primary, #C8C8C8);
    min-width: 18.75rem;
    max-width: 31.25rem;
    margin-bottom: var(--space-md, 16px);
    pointer-events: auto;

    /* Animation d'apparition/disparition */
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.ttb-notification-toast.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Couleurs pour les types de notifications */
.ttb-notification-toast.ttb-toast-error {
    border-left-color: #CD4A4A;
}
.ttb-notification-toast.ttb-toast-error .ttb-toast-title {
    color: #CD4A4A;
}

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

.ttb-notification-toast.ttb-toast-success {
    border-left-color: #4CAF50;
}
.ttb-notification-toast.ttb-toast-success .ttb-toast-title {
    color: #4CAF50;
}

.ttb-notification-toast a {
    color: var(--clr-text-link, #CDA158);
    text-decoration: underline;
}
.ttb-notification-toast a:hover {
    color: var(--clr-text-link-hover, #E8C37E);
}

.ttb-notification-toast .ttb-toast-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-sm, 8px);
}
.ttb-notification-toast .ttb-toast-icon {
    margin-right: var(--space-sm, 8px);
    font-size: 1.2em;
}
.ttb-notification-toast .ttb-toast-title {
    font-weight: bold;
}
.ttb-notification-toast .ttb-toast-message {
    font-size: 0.95em;
}

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

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

.ttb-replying-to-info.highlight-active {
    animation: ttb-highlight-flash 0.3s ease-out forwards,
               ttb-highlight-border 1s ease-in-out 0.3s forwards;
    position: relative;
    z-index: 5;
}

@keyframes ttb-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);
    }
    50% {
        background-color: rgba(var(--clr-accent-gold-rgb, 205, 161, 88), 0.3);
        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 ttb-highlight-border {
    0% {
        border-color: var(--clr-border-accent);
        outline: 0px solid rgba(var(--clr-accent-gold-rgb, 205, 161, 88), 0.0);
    }
    25% {
        border-color: var(--clr-accent-gold);
        outline: 3px solid rgba(var(--clr-accent-gold-rgb, 205, 161, 88), 0.3);
    }
    50% {
        border-color: var(--clr-accent-gold-darker);
        outline: 1px solid rgba(var(--clr-accent-gold-rgb, 205, 161, 88), 0.1);
    }
    100% {
        border-color: var(--clr-border-accent);
        outline: 0px solid rgba(var(--clr-accent-gold-rgb, 205, 161, 88), 0.0);
    }
}

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

/* Notifications Toast */
html.light-mode .ttb-notification-toast {
    background-color: var(--color-component-background);
    border-color: var(--clr-border-secondary, #D4C0A5);
    color: var(--color-text);
    box-shadow: 0 5px 15px rgba(74, 59, 49, 0.15);
}
html.light-mode .ttb-notification-toast a {
    color: var(--clr-text-link);
}
html.light-mode .ttb-toast-close-button {
    color: var(--color-text-secondary);
}
html.light-mode .ttb-toast-close-button:hover {
    color: var(--color-text);
}

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

/* ── Ajustements barre admin WordPress ── */
.admin-bar .ttb-global-notifications-container {
    top: 32px;
}
@media screen and (max-width: 782px) {
    .admin-bar .ttb-global-notifications-container {
        top: 46px;
    }
}
