/* /public_html/assets/css/ui-toast.css */

/* ================================================
   TOAST / NOTIFICATION FLOTANTE
   Utilisation JS : showToast({ message, type, autoClose, actionLabel, onAction })
   Types : info | success | warning | error
   ================================================= */

.ui-toast-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none; /* pour laisser passer les clics en dehors des toasts */
}

.ui-toast {
    min-width: 260px;
    max-width: 420px;
    background: var(--toast-bg, rgba(15, 23, 42, 0.98)); /* slate-900-ish */
    color: var(--toast-text, #f9fafb);
    border-radius: 0.75rem;
    padding: 0.7rem 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    box-shadow:
        0 10px 25px rgba(15, 23, 42, 0.45),
        0 0 0 1px rgba(148, 163, 184, 0.2);
    font-size: 0.9rem;
    pointer-events: auto; /* les toasts eux-mêmes sont cliquables */
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    animation: ui-toast-slide-in 0.22s ease-out forwards;
}

/* Une fois visible (classe ajoutée en JS) */
.ui-toast--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Anim de sortie */
.ui-toast--leaving {
    animation: ui-toast-slide-out 0.18s ease-in forwards;
}

@keyframes ui-toast-slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ui-toast-slide-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-5px) scale(0.96);
    }
}

.ui-toast-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
    line-height: 1;
    margin-top: 0.15rem;
}

.ui-toast-content {
    flex: 1;
}

/* Colonne droite : bouton action + close */
.ui-toast-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    margin-left: 0.25rem;
}

.ui-toast-action-btn {
    font-size: 0.75rem;
    line-height: 1;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: rgba(148, 163, 184, 0.2); /* slate-400/20 */
    color: inherit;
    white-space: nowrap;
}

.ui-toast-action-btn:hover {
    background: rgba(148, 163, 184, 0.35);
}

.ui-toast-close-btn {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1.05rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    opacity: 0.7;
}

.ui-toast-close-btn:hover {
    opacity: 1;
}

/* Variantes de type */
.ui-toast--info {
    border-left: 3px solid #38bdf8; /* sky-400 */
}

.ui-toast--success {
    border-left: 3px solid #22c55e; /* green-500 */
}

.ui-toast--warning {
    border-left: 3px solid #facc15; /* yellow-400 */
}

.ui-toast--error {
    border-left: 3px solid #f97373; /* red-400 */
}
