/* notifications.css */
:root {
    --success: #10b981;
    --danger: #ef4444;
    --info: #3b82f6;
    --warning: #f59e0b;
    --text-main: #1e293b;
    --border: #e5e7eb;
}

body.dark {
    --text-main: #f1f5f9;
    --border: #334155;
}

#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    max-width: calc(100vw - 48px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    position: relative;
    min-width: 300px;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transform: translateX(120%) scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-sizing: border-box;
}

body.dark .toast {
    background: rgba(30, 30, 35, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* animation classes */
.toast.show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.toast.hide {
    transform: translateX(120%) scale(0.9);
    opacity: 0;
}

/* Internal Layout */
.toast-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 14px;
}

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

.toast-icon svg {
    width: 100%;
    height: 100%;
}

.toast-message {
    flex-grow: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    word-wrap: break-word;
}

.toast-close {
    background: transparent;
    border: none;
    color: rgba(0, 0, 0, 0.4);
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
    outline: none;
}

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

body.dark .toast-close {
    color: rgba(255, 255, 255, 0.6);
}

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

/* Progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.08);
}

body.dark .toast-progress {
    background: rgba(255, 255, 255, 0.1);
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    background: currentColor;
    transform-origin: right;
    animation: toast-progress linear forwards;
}

@keyframes toast-progress {
    100% {
        transform: scaleX(0);
    }
}

/* colors (Light theme default) */
.toast-success .toast-icon,
.toast-success .toast-progress-bar {
    color: var(--success); 
}
.toast-error .toast-icon,
.toast-error .toast-progress-bar {
    color: var(--danger);
}
.toast-info .toast-icon,
.toast-info .toast-progress-bar {
    color: var(--info);
}
.toast-warning .toast-icon,
.toast-warning .toast-progress-bar {
    color: var(--warning);
}

/* colors (Dark theme) */
/* (Handled globally via var() in body.dark) */

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    #toast-container {
        top: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* System Alerts Header UI */
.nav-icon-btn {
    background: transparent;
    border: 1px solid var(--border, #e5e7eb);
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main, #1e293b);
    transition: background 0.2s ease;
}

body.dark .nav-icon-btn {
    border-color: var(--border, #2d2d35);
    color: var(--text-main, #f1f5f9);
}

.nav-icon-btn:hover {
    background: var(--hover, #f1f5f9);
}

body.dark .nav-icon-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-alert-wrapper {
    position: relative;
    display: inline-flex;
}

.nav-alert-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    box-sizing: border-box;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-surface);
    box-shadow: 0 2px 4px var(--danger-shadow);
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--danger-pulse);
    }
    70% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes bell-shake {
    0% { transform: rotate(0); }
    10% { transform: rotate(15deg); }
    20% { transform: rotate(-15deg); }
    30% { transform: rotate(10deg); }
    40% { transform: rotate(-10deg); }
    50% { transform: rotate(5deg); }
    60% { transform: rotate(-5deg); }
    70% { transform: rotate(0); }
    100% { transform: rotate(0); }
}

.bell-shake {
    animation: bell-shake 3s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
    transform-origin: top center;
    color: var(--danger);
}

body.dark .nav-alert-badge {
    border-color: var(--bg-surface);
}

.nav-alert-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 320px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.dark .nav-alert-dropdown {
    background: var(--bg-surface);
    border-color: var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.nav-alert-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.alert-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-soft);
}

body.dark .alert-dropdown-header {
    background: rgba(0, 0, 0, 0.2);
}

.alert-dropdown-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.alert-dropdown-header .badge-count {
    font-size: 11px;
    background: var(--danger-soft);
    color: var(--danger);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.alert-dropdown-body {
    max-height: 350px;
    overflow-y: auto;
}

.alert-item {
    display: flex;
    padding: 12px 16px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    transition: background 0.15s;
    align-items: flex-start;
}

.alert-item:hover {
    background: var(--bg-hover);
}

body.dark .alert-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.alert-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-notification-item.type-warning .nav-notif-icon {
    color: var(--warning);
    background: var(--warning-soft);
}

.nav-notification-item.type-info .nav-notif-icon {
    color: var(--info);
    background: var(--info-soft);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main, #334155);
    margin-bottom: 4px;
}

.alert-desc {
    font-size: 12px;
    color: var(--text-soft, #64748b);
    line-height: 1.4;
}

.alert-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-soft, #94a3b8);
    font-size: 13px;
}

.alert-dropdown-footer {
    padding: 12px;
    text-align: center;
    background: var(--bg-soft, #f8fafc);
    border-top: 1px solid var(--border, #e5e7eb);
}

body.dark .alert-dropdown-footer {
    background: rgba(0, 0, 0, 0.2);
}

.alert-dropdown-footer a {
    color: var(--primary, #3b82f6);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s;
}

.alert-dropdown-footer a:hover {
    color: var(--primary-hover, #2563eb);
}
