/* Toast Notifications */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.toast.hiding {
    animation: toastSlideOut 0.2s ease-out forwards;
}

.toast-icon {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.3;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.3;
}

.toast-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    font-size: 1.2rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

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

/* Toast variants */
.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

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

.toast.warning {
    border-left: 4px solid #f59e0b;
}

/* Progress bar for auto-dismiss */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    opacity: 0.3;
    animation: toastProgress 3s linear forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(120%) translateY(0);
        opacity: 0;
    }
    to {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0) translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(120%) translateY(0) scale(0.95);
        opacity: 0;
    }
}

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

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

    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .toast {
        animation: toastFadeIn 0.2s ease;
    }

    .toast.hiding {
        animation: toastFadeOut 0.2s ease forwards;
    }

    @keyframes toastFadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    @keyframes toastFadeOut {
        from { opacity: 1; }
        to { opacity: 0; }
    }

    .toast-progress {
        animation: toastProgress 3s linear forwards;
    }
}
