/* ================================================================
   TOAST COMPONENT
   4 variants + auto-dismiss + stack
   Budget: < 2KB minified
   ================================================================ */

/* ── CONTAINER ───────────────────────────────────────────────── */

.toast-container {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--toast-gap);
    padding: var(--space-4);
    pointer-events: none;
    max-height: 100vh;
    overflow: hidden;
}
.toast-container--top-right    { top: 0; right: 0; }
.toast-container--top-center   { top: 0; left: 50%; transform: translateX(-50%); }
.toast-container--bottom-right { bottom: 0; right: 0; }

/* ── TOAST ───────────────────────────────────────────────────── */

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    min-width: var(--toast-min-width);
    max-width: var(--toast-max-width);
    padding: var(--toast-padding);
    background: var(--toast-bg);
    border: 1px solid var(--toast-border);
    border-radius: var(--toast-radius);
    box-shadow: var(--toast-shadow);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 200ms ease-out, transform 200ms ease-out;
}
.toast--visible {
    opacity: 1;
    transform: translateX(0);
}
/* Spring entrance for success toasts */
.toast--success.toast--visible {
    animation: toast-spring 400ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes toast-spring {
    0% { opacity: 0; transform: translateX(40px) scale(0.92); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}
.toast--leaving {
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 150ms ease-in, transform 150ms ease-in;
}

/* ── ICON ────────────────────────────────────────────────────── */

.toast__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}
.toast__icon svg { width: 100%; height: 100%; }

/* ── CONTENT ─────────────────────────────────────────────────── */

.toast__content { flex: 1; min-width: 0; }
.toast__title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    margin-bottom: 2px;
}
.toast__message {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ── CLOSE ───────────────────────────────────────────────────── */

.toast__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: color var(--dur-fast) var(--ease-out);
}
.toast__close:hover { color: var(--text-primary); }

/* ── VARIANTS (icon + left border accent) ────────────────────── */

.toast--info    { border-left: 3px solid #3B82F6; }
.toast--success { border-left: 3px solid var(--success); }
.toast--warning { border-left: 3px solid #D97706; }
.toast--error   { border-left: 3px solid var(--danger); }

.toast--info .toast__icon    { color: #3B82F6; }
.toast--success .toast__icon { color: var(--success); }
.toast--warning .toast__icon { color: #D97706; }
.toast--error .toast__icon   { color: var(--danger); }

/* ── MOBILE ──────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .toast { min-width: auto; max-width: none; }
    .toast-container { left: 0; right: 0; padding: var(--space-2); }
}
