/* ============================================
   Toast Notifications — ChatSpy Premium
   ============================================ */

#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px;
    width: 100%;
    pointer-events: none;
}

/* === Toast Base === */
.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px 14px 0;
    border-radius: 12px;
    background: rgba(22, 28, 38, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    pointer-events: all;
    transform: translateX(110%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
}

/* === Accent Bar (left) === */
.toast-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 12px 0 0 12px;
}

/* === Icon === */
.toast-icon-wrap {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 16px;
    margin-top: 1px;
}

/* === Body === */
.toast-body {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.toast-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
    letter-spacing: 0.01em;
}

.toast-msg {
    color: var(--text-secondary, #94a3b8);
    font-size: 12.5px;
    line-height: 1.45;
    word-break: break-word;
}

/* === Close Button === */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted, #475569);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-top: 2px;
    opacity: 0.5;
}

.toast:hover .toast-close {
    opacity: 1;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* === Progress Bar === */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    border-radius: inherit;
    transform-origin: left;
    animation: toast-countdown linear forwards;
}

@keyframes toast-countdown {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* === Show / Hide === */
.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-hide {
    transform: translateX(110%);
    opacity: 0;
}

/* ==========================================
   TYPE VARIANTS
   ========================================== */

/* --- Success --- */
.toast-success .toast-accent {
    background: linear-gradient(to bottom, #00d4aa, #00b894);
}

.toast-success .toast-icon-wrap {
    background: rgba(0, 212, 170, 0.12);
    color: #00d4aa;
}

.toast-success .toast-title {
    color: #00d4aa;
}

.toast-success .toast-progress-bar {
    background: linear-gradient(90deg, #00d4aa, rgba(0, 212, 170, 0.3));
}

/* --- Error --- */
.toast-error .toast-accent {
    background: linear-gradient(to bottom, #ef4444, #dc2626);
}

.toast-error .toast-icon-wrap {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.toast-error .toast-title {
    color: #ef4444;
}

.toast-error .toast-progress-bar {
    background: linear-gradient(90deg, #ef4444, rgba(239, 68, 68, 0.3));
}

/* --- Warning --- */
.toast-warning .toast-accent {
    background: linear-gradient(to bottom, #f59e0b, #d97706);
}

.toast-warning .toast-icon-wrap {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.toast-warning .toast-title {
    color: #f59e0b;
}

.toast-warning .toast-progress-bar {
    background: linear-gradient(90deg, #f59e0b, rgba(245, 158, 11, 0.3));
}

/* --- Info --- */
.toast-info .toast-accent {
    background: linear-gradient(to bottom, #3b82f6, #2563eb);
}

.toast-info .toast-icon-wrap {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.toast-info .toast-title {
    color: #3b82f6;
}

.toast-info .toast-progress-bar {
    background: linear-gradient(90deg, #3b82f6, rgba(59, 130, 246, 0.3));
}

/* === Responsive === */
@media (max-width: 480px) {
    #toast-container {
        top: auto;
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }

    .toast {
        transform: translateY(120%);
    }

    .toast-show {
        transform: translateY(0);
    }

    .toast-hide {
        transform: translateY(120%);
    }
}