/* === TOAST NOTIFICATIONS === */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 400px;
}

.toast {
    pointer-events: auto;
    padding: 14px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: toast-in 0.3s ease-out;
    border-left: 4px solid;
    background: var(--surface, #1a1f2e);
    color: var(--text, #fff);
}

.toast.removing {
    animation: toast-out 0.3s ease-in forwards;
}

.toast-icon {
    flex-shrink: 0;
    font-size: 20px;
    line-height: 1;
    margin-top: 1px;
}

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

.toast-title {
    font-weight: 600;
    margin: 0 0 2px 0;
    font-size: 0.95rem;
}

.toast-message {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.85;
    line-height: 1.4;
    word-break: break-word;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    margin-left: 8px;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.toast-close:hover {
    opacity: 1;
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}
.toast-progress-bar {
    height: 100%;
    width: 100%;
    background: currentColor;
    opacity: 0.7;
    transform: translateX(0);
    will-change: transform;
}
.toast-success .toast-progress-bar { background: #10b981; opacity: 0.8; }
.toast-error .toast-progress-bar { background: #ef4444; opacity: 0.8; }
.toast-warning .toast-progress-bar { background: #f59e0b; opacity: 0.8; }
.toast-info .toast-progress-bar { background: #3b82f6; opacity: 0.8; }

.toast.paused {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4), 0 8px 24px rgba(0,0,0,0.3);
}
.toast.paused .toast-progress-bar {
    opacity: 1;
    animation: toast-pause-pulse 1.5s infinite;
}
@keyframes toast-pause-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Toast types */
.toast-success {
    border-left-color: #10b981;
    background: #064e3b;
    color: #d1fae5;
}
body.light-mode .toast-success {
    background: #d1fae5;
    color: #064e3b;
}

.toast-error {
    border-left-color: #ef4444;
    background: #7f1d1d;
    color: #fee2e2;
}
body.light-mode .toast-error {
    background: #fee2e2;
    color: #7f1d1d;
}

.toast-warning {
    border-left-color: #f59e0b;
    background: #78350f;
    color: #fef3c7;
}
body.light-mode .toast-warning {
    background: #fef3c7;
    color: #78350f;
}

.toast-info {
    border-left-color: #3b82f6;
    background: #1e3a8a;
    color: #dbeafe;
}
body.light-mode .toast-info {
    background: #dbeafe;
    color: #1e3a8a;
}

@keyframes toast-in {
    from {
        transform: translateX(420px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    to {
        transform: translateX(420px);
        opacity: 0;
    }
}

@media (max-width: 640px) {
    .toast-container {
        top: 70px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    .toast {
        min-width: 0;
    }
}

/* === LOADING SPINNER for buttons === */
.btn {
    position: relative;
    transition: all 0.15s ease;
}
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}