/* ═══════════════════════════════════════════════
   TOAST NOTIFICATION SYSTEM
   ═══════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    bottom: calc(var(--taskbar-h) + 16px);
    right: 16px;
    z-index: 95000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
    max-width: 360px;
    width: 100%;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    line-height: 1.4;
    pointer-events: auto;
    animation: toastIn 0.35s var(--ease-spring) both;
    overflow: hidden;
    position: relative;
}

.toast.removing {
    animation: toastOut 0.3s var(--ease-out) forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
}

/* Icon */
.toast-icon {
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon .ti {
    font-size: 1.2rem;
}

.toast-success .toast-icon { color: var(--accent-green); }
.toast-error .toast-icon   { color: #ff5c5c; }
.toast-warning .toast-icon { color: #ffb84d; }
.toast-info .toast-icon    { color: var(--accent); }

/* Message */
.toast-msg {
    flex: 1;
    min-width: 0;
}

/* Close button */
.toast-close {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Progress bar at bottom */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: var(--accent);
    animation: toastTimer linear forwards;
}

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

/* ─── Type variants ─── */
.toast.toast-success {
    border-left: 3px solid var(--accent-green);
}

.toast.toast-error {
    border-left: 3px solid #ff5c5c;
}

.toast.toast-warning {
    border-left: 3px solid #ffb84d;
}

.toast.toast-info {
    border-left: 3px solid var(--accent);
}

/* ─── Light theme ─── */
[data-theme="light"] .toast {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .toast-close:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
    .toast-container {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}
