/* =========================================================
   NOTIFICATIONS - TOAST SYSTEM
   ========================================================= */

/* Container */
.notifications-container {
    position: fixed;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.notifications-top-right {
    top: 20px;
    right: 20px;
}

.notifications-top-left {
    top: 20px;
    left: 20px;
}

.notifications-bottom-right {
    bottom: 20px;
    right: 20px;
}

.notifications-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Toast */
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: 0 8px 24px rgba(13, 27, 62, 0.15);
    pointer-events: all;
    animation: slideUp 0.3s var(--ease) forwards;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.toast.toast-enter {
    animation: slideUp 0.3s var(--ease) forwards;
}

.toast.toast-exit {
    animation: slideDown 0.3s var(--ease) forwards;
}

/* Toast Content */
.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toast-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-message {
    font-size: 14px;
    color: var(--text);
    line-height: 1.4;
    word-break: break-word;
}

/* Toast Types */

/* Success */
.toast.toast-success {
    border-color: rgba(5, 150, 105, 0.2);
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

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

.toast.toast-success .toast-message {
    color: #065f46;
}

/* Error */
.toast.toast-error {
    border-color: rgba(220, 38, 38, 0.2);
    background: linear-gradient(135deg, #fef2f2 0%, #fef2f2 100%);
}

.toast.toast-error .toast-icon {
    color: var(--danger);
}

.toast.toast-error .toast-message {
    color: #7f1d1d;
}

/* Warning */
.toast.toast-warning {
    border-color: rgba(217, 119, 6, 0.2);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

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

.toast.toast-warning .toast-message {
    color: #78350f;
}

/* Info */
.toast.toast-info {
    border-color: rgba(59, 130, 246, 0.2);
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
}

.toast.toast-info .toast-icon {
    color: #1d4ed8;
}

.toast.toast-info .toast-message {
    color: #1e40af;
}

/* Action Button */
.toast-action {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    background: rgba(26, 86, 219, 0.1);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.toast-action:hover {
    background: rgba(26, 86, 219, 0.2);
}

.toast-action:active {
    transform: scale(0.98);
}

/* Close Button */
.toast-close {
    position: relative;
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 20px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: var(--text);
}

.toast-close:focus-visible {
    outline: 2px solid var(--primary);
    border-radius: 4px;
}

/* =========================================================
   DARK MODE
   ========================================================= */

[data-theme="dark"] .toast {
    background: rgba(30, 40, 65, 0.95);
    border-color: rgba(100, 150, 255, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .toast.toast-success {
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(5, 46, 22, 0.6);
}

[data-theme="dark"] .toast.toast-success .toast-message {
    color: #a7f3d0;
}

[data-theme="dark"] .toast.toast-error {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(60, 20, 20, 0.6);
}

[data-theme="dark"] .toast.toast-error .toast-message {
    color: #fca5a5;
}

[data-theme="dark"] .toast.toast-warning {
    border-color: rgba(245, 158, 11, 0.2);
    background: rgba(60, 40, 0, 0.6);
}

[data-theme="dark"] .toast.toast-warning .toast-message {
    color: #fcd34d;
}

[data-theme="dark"] .toast.toast-info {
    border-color: rgba(59, 130, 246, 0.2);
    background: rgba(20, 35, 70, 0.6);
}

[data-theme="dark"] .toast.toast-info .toast-message {
    color: #93c5fd;
}

[data-theme="dark"] .toast-action {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

[data-theme="dark"] .toast-action:hover {
    background: rgba(59, 130, 246, 0.25);
}

/* =========================================================
   MOBILE RESPONSIVE
   ========================================================= */

@media (max-width: 480px) {
    .notifications-container {
        max-width: calc(100vw - 20px);
        gap: 8px;
    }
    
    .notifications-top-right,
    .notifications-bottom-right {
        right: 10px;
    }
    
    .notifications-top-left,
    .notifications-bottom-left {
        left: 10px;
    }
    
    .notifications-top-right,
    .notifications-top-left {
        top: 10px;
    }
    
    .notifications-bottom-right,
    .notifications-bottom-left {
        bottom: 10px;
    }
    
    .toast {
        padding: 12px;
        font-size: 13px;
    }
    
    .toast-action {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .toast-close {
        width: 20px;
        height: 20px;
    }
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.toast:focus-within {
    box-shadow: 0 8px 24px rgba(13, 27, 62, 0.2), 0 0 0 3px var(--primary-glow);
}

.toast-action:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.toast-close:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: more) {
    .toast {
        border-width: 2px;
    }
    
    .toast-action,
    .toast-close {
        border: 1px solid currentColor;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast.toast-enter,
    .toast.toast-exit {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
