﻿/* Conteneur principal en haut à droite */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* La carte du toast */
.custom-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    width: 380px;
    padding: 16px 20px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 2px 5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    animation: slideInRight 0.3s ease-out;
    /* ✅ La bordure prend la couleur du type de message (ou gris clair par défaut) */
    border: 1px solid var(--toast-accent, rgba(0, 0, 0, 0.08));
}

/* Bordure colorée sur le côté gauche */
.toast-accent-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    /* ✅ Utilise aussi la variable */
    background-color: var(--toast-accent, #64748b);
}

/* Wrapper de l'icône */
.toast-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0;
    font-weight: 900;
    /* ✅ Bordure de l'icône assortie */
    border: 2px solid var(--toast-accent, #64748b);
    /* Couleur du texte (icône) */
    color: var(--toast-accent, #64748b);
    /* Fond de l'icône légèrement teinté (nécessite un navigateur récent) */
    background-color: color-mix(in srgb, var(--toast-accent, #64748b) 15%, transparent);
}

/* Contenu texte */
.toast-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.toast-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
    /* ✅ Titre assorti à la couleur */
    color: var(--toast-accent, #1e293b);
}

.toast-message {
    color: #475569;
    line-height: 1.4;
    font-size: 14px !important;
    font-weight: 500;
}

/* Bouton de fermeture */
.toast-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

    .toast-close-btn:hover {
        background-color: #f3f4f6;
        color: #374151;
    }

/* ==========================================
   Définition des couleurs par type
   ========================================== */

.toast-success {
    --toast-accent: #10b981;
}

.toast-error {
    --toast-accent: #ef4444;
}

.toast-warning {
    --toast-accent: #f59e0b;
}

.toast-info {
    --toast-accent: #3b82f6;
}

/* Animation d'entrée */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}
