/**
 * Toaster (Toast Notifications) CSS
 * Minimalist design with border for success and error messages
 * 
 * @version 1.0.0
 * @since 2026-02-17
 */

/* Toast Container - Fixed in top right */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-10);
    pointer-events: none;
}

/* Individual Toast */
.toast {
    background: white;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: all var(--transition-slow);
    border-left: 4px solid #ccc;
    font-size: var(--font-base);
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Toast Active State */
.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Toast Success */
.toast.success {
    border-left-color: #28a745;
    color: #155724;
}

/* Toast Error */
.toast.error {
    border-left-color: #dc3545;
    color: #721c24;
}

/* Toast Message */
.toast-message {
    flex: 1;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    font-size: var(--font-xl);
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-base);
    line-height: 1;
}

.toast-close:hover {
    color: #333;
}

/* Progress Bar (optional indicator) */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
    transform-origin: left;
}

.toast.success .toast-progress {
    background: #28a745;
}

.toast.error .toast-progress {
    background: #dc3545;
}

/* Progress animation */
@keyframes progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

.toast-progress.animate {
    animation: progress linear forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* ===== DARK MODE ===== */
body.dark-mode .toast {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-left-color: var(--border-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

body.dark-mode .toast.success {
    border-left-color: var(--success);
    color: #6ee7b7;
}

body.dark-mode .toast.error {
    border-left-color: var(--error);
    color: #fca5a5;
}

body.dark-mode .toast-close {
    color: var(--text-tertiary);
}

body.dark-mode .toast-close:hover {
    color: var(--text-primary);
}

body.dark-mode .toast.success .toast-progress {
    background: var(--success);
}

body.dark-mode .toast.error .toast-progress {
    background: var(--error);
}
