/**
 * 🔔 LA TANDA TOAST NOTIFICATION SYSTEM STYLES
 * Modern, accessible toast notifications
 * Version: 1.0.0
 * Date: October 27, 2025
 */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9500;  /* 🔧 FIX: Reduced from 999999 - above modals (9000) but not absurdly high */
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 40px);
}

@media (max-width: 480px) {
    .toast-container {
        top: 70px;  /* 🔧 FIX: Increased from 10px - below mobile header to avoid overlap */
        right: 10px;
        left: 10px;
        width: calc(100% - 20px);
        max-width: 380px;  /* 🔧 FIX: Added max-width to prevent full-width invasive bubbles */
    }
}

/* Toast Base Styles */
.toast {
    background: var(--bg-secondary, #1e293b);
    border-radius: 12px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    margin-bottom: 12px;
    overflow: hidden;
    pointer-events: auto;
    transform: translateX(calc(100% + 20px));
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
}

/* 🔧 FIX: Reduce backdrop-filter on mobile for better performance */
@media (max-width: 768px) {
    .toast {
        backdrop-filter: blur(4px);  /* Reduced from 10px */
        background: rgba(30, 41, 59, 0.95);  /* More opaque background */
    }
}

.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-hiding {
    transform: translateX(calc(100% + 20px));
    opacity: 0;
}

/* Toast Content */
.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    position: relative;
}

.toast-icon {
    flex-shrink: 0;
    font-size: 20px;
    margin-top: 2px;
}

.toast-message {
    flex: 1;
    color: var(--text-primary, #f8fafc);
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--text-secondary, rgba(248, 250, 252, 0.6));
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

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

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

.toast-success .toast-icon {
    color: #10b981;
}

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

.toast-error .toast-icon {
    color: #ef4444;
}

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

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info {
    border-left: 4px solid var(--tanda-cyan, #00FFFF);
}

.toast-info .toast-icon {
    color: var(--tanda-cyan, #00FFFF);
}

/* Toast Action Button */
.toast-action {
    padding: 0 16px 12px;
}

.toast-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--text-primary, #f8fafc);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.2s ease;
    width: 100%;
}

.toast-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Toast Progress Bar */
.toast-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--tanda-cyan, #00FFFF), 
        var(--tanda-cyan-light, #7FFFD8)
    );
    animation: toastProgress linear forwards;
    transform-origin: left;
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Success Progress Bar */
.toast-success .toast-progress-bar {
    background: linear-gradient(90deg, #10b981, #34d399);
}

/* Error Progress Bar */
.toast-error .toast-progress-bar {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Warning Progress Bar */
.toast-warning .toast-progress-bar {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* Accessibility */
.toast:focus-within {
    outline: 2px solid var(--tanda-cyan, #00FFFF);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast-visible,
    .toast-hiding {
        transition: none;
        animation: none;
    }
    
    .toast-progress-bar {
        animation: none;
    }
}

/* Dark Theme Support (already included in base styles) */
/* Light Theme Override */
@media (prefers-color-scheme: light) {
    .toast {
        background: #ffffff;
        box-shadow: 
            0 10px 40px rgba(0, 0, 0, 0.1),
            0 0 0 1px rgba(0, 0, 0, 0.05);
    }
    
    .toast-message {
        color: #1e293b;
    }
    
    .toast-close {
        color: #64748b;
    }
    
    .toast-close:hover {
        color: #1e293b;
        background: rgba(0, 0, 0, 0.05);
    }
    
    .toast-action-btn {
        background: rgba(0, 0, 0, 0.05);
        border-color: rgba(0, 0, 0, 0.1);
        color: #1e293b;
    }
    
    .toast-action-btn:hover {
        background: rgba(0, 0, 0, 0.1);
        border-color: rgba(0, 0, 0, 0.2);
    }
}
