/* ===== Toast Notification System ===== */

.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: var(--z-tooltip);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.toast {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-xl);
    padding: var(--space-lg) var(--space-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--toast-color, var(--primary-color));
}

.toast.toast-success::before {
    background: var(--success-color);
}

.toast.toast-error::before {
    background: var(--error-color);
}

.toast.toast-warning::before {
    background: var(--warning-color);
}

.toast.toast-info::before {
    background: var(--info-color);
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    background: var(--toast-bg, rgba(59, 130, 246, 0.1));
    color: var(--toast-color, var(--primary-color));
}

.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    flex-shrink: 0;
}

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

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--toast-color, var(--primary-color));
    animation: progress 3s linear;
}

.toast-success .toast-progress {
    background: var(--success-color);
}

.toast-error .toast-progress {
    background: var(--error-color);
}

.toast-warning .toast-progress {
    background: var(--warning-color);
}

.toast-info .toast-progress {
    background: var(--info-color);
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

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

.toast.hiding {
    animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 1, 1);
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
}
