/**
 * Toast Notification System
 *
 * Provides temporary, non-intrusive notifications for user actions.
 * Supports different types: success, error, info, warning
 */

.toast-container {
    position: fixed;
    top: 80px; /* Below navbar */
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none; /* Allow clicks through container */
    max-width: 400px;
}

.toast {
    pointer-events: auto; /* But toasts themselves are clickable */
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 400px;
    animation: toast-slide-in 0.3s ease-out;
    border-left: 4px solid var(--color-accent);
    transition: all 0.3s ease;
}

.toast:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateX(-4px);
}

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

/* Toast types */
.toast.toast-success {
    border-left-color: #00d084;
}

.toast.toast-error {
    border-left-color: #e74c3c;
}

.toast.toast-warning {
    border-left-color: #ff9500;
}

.toast.toast-info {
    border-left-color: #5b7fff;
}

/* Toast icon */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toast-success .toast-icon {
    background: #00d08420;
    color: #00d084;
}

.toast-error .toast-icon {
    background: #e74c3c20;
    color: #e74c3c;
}

.toast-warning .toast-icon {
    background: #ff950020;
    color: #ff9500;
}

.toast-info .toast-icon {
    background: #5b7fff20;
    color: #5b7fff;
}

/* Toast content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9375rem;
    margin: 0 0 0.25rem 0;
    color: #333;
}

.toast-message {
    font-size: 0.875rem;
    color: #666;
    margin: 0;
    word-wrap: break-word;
}

/* Only show message if title exists */
.toast-title:only-child {
    margin-bottom: 0;
}

/* Toast close button */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

/* Progress bar for auto-dismiss */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    background: var(--color-accent);
    width: 100%;
    animation: toast-progress 5s linear forwards;
}

.toast-success .toast-progress-bar {
    background: #00d084;
}

.toast-error .toast-progress-bar {
    background: #e74c3c;
}

.toast-warning .toast-progress-bar {
    background: #ff9500;
}

.toast-info .toast-progress-bar {
    background: #5b7fff;
}

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

@keyframes toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

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

/* Mobile responsiveness */
@media (max-width: 768px) {
    .toast-container {
        right: 1rem;
        left: 1rem;
        top: 70px;
        max-width: none;
    }

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