/* Toast Notifications - Glassmorphism Style */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    /* Allow clicking through container */
}

.toast {
    position: relative;
    padding: 1rem 1.5rem;
    min-width: 300px;
    max-width: 400px;
    background: rgba(30, 30, 40, 0.85);
    /* Dark Glass */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    /* Re-enable clicks on toasts */
    cursor: pointer;
    overflow: hidden;

    /* Animation */
    animation: toastSlideIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    transition: all 0.3s ease;
}

[data-theme="light"] .toast {
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Slide In Animation */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Exit Animation Class */
.toast.hiding {
    opacity: 0;
    transform: translateX(20%) scale(0.95);
}

/* Toast Variants */
.toast-success {
    border-left-color: var(--success, #10b981);
}

.toast-success .toast-icon {
    color: var(--success, #10b981);
}

.toast-error {
    border-left-color: var(--danger, #ef4444);
}

.toast-error .toast-icon {
    color: var(--danger, #ef4444);
}

.toast-warning {
    border-left-color: var(--warning, #f59e0b);
}

.toast-warning .toast-icon {
    color: var(--warning, #f59e0b);
}

.toast-info {
    border-left-color: var(--secondary, #3b82f6);
}

.toast-info .toast-icon {
    color: var(--secondary, #3b82f6);
}

/* Content Layout */
.toast-icon {
    font-size: 1.2rem;
    margin-top: 2px;
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-title {
    font-weight: 700;
    font-size: 0.9rem;
    opacity: 0.9;
}

.toast-message {
    font-size: 0.85rem;
    opacity: 0.8;
    line-height: 1.4;
}

.toast-close {
    opacity: 0.5;
    transition: opacity 0.2s;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
}

.toast-close:hover {
    opacity: 1;
}

/* Progress Bar (Optional) */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    width: 100%;
    transform-origin: left;
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}