/* Synced from mlab.sh (assets/css/mlab-custom.css, "MLAB TOAST NOTIFICATIONS"),
   used with assets/js/mlab-toast.js (same origin file). Keep the two in step. */
/* ═══════════════════════════════════════════════════
   MLAB TOAST NOTIFICATIONS
═══════════════════════════════════════════════════ */
.mlab-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 40px);
}

.mlab-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--mlab-radius-md);
    border: 1px solid;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.06);
    font-size: 0.875rem;
    line-height: 1.45;
    animation: mlabToastIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.mlab-toast.removing {
    opacity: 0;
    transform: translateX(30px) scale(0.96);
}

.mlab-toast-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: var(--mlab-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mlab-toast-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.mlab-toast-body {
    flex: 1;
    min-width: 0;
}

.mlab-toast-title {
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.mlab-toast-msg {
    opacity: 0.85;
    word-break: break-word;
}

.mlab-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--mlab-radius-xs);
    opacity: 0.4;
    transition: opacity 0.15s, background 0.15s;
    line-height: 0;
}

.mlab-toast-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
}

.mlab-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 var(--mlab-radius-md) var(--mlab-radius-md);
    animation: mlabToastProgress 5s linear forwards;
}

/* ── Success ── */
.mlab-toast--success {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: #065f46;
}
.mlab-toast--success .mlab-toast-icon {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}
.mlab-toast--success .mlab-toast-progress {
    background: linear-gradient(90deg, #10b981, #34d399);
}

/* ── Error / Danger ── */
.mlab-toast--danger,
.mlab-toast--error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #991b1b;
}
.mlab-toast--danger .mlab-toast-icon,
.mlab-toast--error .mlab-toast-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}
.mlab-toast--danger .mlab-toast-progress,
.mlab-toast--error .mlab-toast-progress {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* ── Warning ── */
.mlab-toast--warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
    color: #92400e;
}
.mlab-toast--warning .mlab-toast-icon {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}
.mlab-toast--warning .mlab-toast-progress {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* ── Info ── */
.mlab-toast--info {
    background: rgba(99, 134, 255, 0.08);
    border-color: rgba(99, 134, 255, 0.2);
    color: #1e3a8a;
}
.mlab-toast--info .mlab-toast-icon {
    background: rgba(99, 134, 255, 0.12);
    color: #6386ff;
}
.mlab-toast--info .mlab-toast-progress {
    background: linear-gradient(90deg, #6386ff, #93b0ff);
}

/* ── Dark mode overrides ── */
html[data-bs-theme=dark] .mlab-toast--success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.18);
    color: #a7f3d0;
}
html[data-bs-theme=dark] .mlab-toast--danger,
html[data-bs-theme=dark] .mlab-toast--error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.18);
    color: #fecaca;
}
html[data-bs-theme=dark] .mlab-toast--warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.18);
    color: #fde68a;
}
html[data-bs-theme=dark] .mlab-toast--info {
    background: rgba(99, 134, 255, 0.1);
    border-color: rgba(99, 134, 255, 0.18);
    color: #bfdbfe;
}
html[data-bs-theme=dark] .mlab-toast-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

@keyframes mlabToastIn {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes mlabToastProgress {
    from { width: 100%; }
    to   { width: 0%; }
}

@media (max-width: 480px) {
    .mlab-toast-container {
        top: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
    }
    .mlab-toast {
        padding: 12px 14px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .mlab-toast, .mlab-toast.removing { animation: none; }
    .mlab-toast-progress { animation: none; display: none; }
}
