/* ========================================
   TOAST SYSTEM — Notifications éphémères
   ======================================== */

.toast-container {
    position: fixed !important;
    top: 90px !important;
    right: 20px !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    pointer-events: none !important;
    max-width: calc(100% - 40px);
    left: auto !important;
    bottom: auto !important;
}

.toast {
    pointer-events: auto !important;
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    min-width: 320px;
    max-width: 420px;
    padding: 14px 16px;
    background: white !important;
    color: #1a1a1a !important;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--toast-accent, #00C853);
    /* État visible par défaut (au cas où l'animation ne jouerait pas) */
    opacity: 1;
    transform: translateX(0) scale(1);
    animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    visibility: visible !important;
}
.toast.closing {
    animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(120%) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); max-height: 120px; margin-bottom: 10px; }
    to   { opacity: 0; transform: translateX(120%); max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--toast-accent, #00C853);
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}
.toast-icon i { color: white !important; }

.toast-body {
    flex: 1;
    min-width: 0;
    padding-top: 4px;
}
.toast-title {
    font-weight: 700;
    color: #1a1a1a !important;
    font-size: 0.9rem;
    margin-bottom: 2px;
    line-height: 1.3;
}
.toast-message {
    color: #475569 !important;
    font-size: 0.85rem;
    line-height: 1.45;
}

.toast-close {
    background: transparent;
    border: none;
    color: #94a3b8 !important;
    cursor: pointer;
    padding: 4px;
    font-size: 0.9rem;
    transition: color 0.15s ease;
    flex-shrink: 0;
    margin-top: 2px;
}
.toast-close:hover { color: #1a1a1a !important; }

/* Barre de progression en bas (timer) */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--toast-accent, #00C853);
    border-radius: 0 0 0 14px;
    animation: toastProgress var(--toast-duration, 4s) linear forwards;
    opacity: 0.4;
}
@keyframes toastProgress {
    from { width: 100%; }
    to   { width: 0%; }
}

/* ==== Variantes de type ==== */
.toast.success { --toast-accent: #00C853; }
.toast.error   { --toast-accent: #dc2626; }
.toast.warning { --toast-accent: #f59e0b; }
.toast.info    { --toast-accent: #0ea5e9; }

/* ==== Responsive ==== */
@media (max-width: 576px) {
    .toast-container {
        top: 80px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
    .toast {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}
