/* ============================================
   Notification Bell Dropdown
   ============================================ */

.notification-bell-wrapper {
    position: relative;
    display: inline-block;
}

.notification-dropdown,
.notification-sidebar,
.notification-modal {
    font-family: var(--font-support);
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
}

.notification-dropdown.active {
    display: block;
}

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.notification-dropdown-link {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 500;
}

.notification-dropdown-link:hover {
    text-decoration: underline;
    color: var(--accent-orange-deep);
}

.notification-pin-btn {
    background: none;
    border: none;
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--accent-orange);
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.notification-pin-btn:hover {
    text-decoration: underline;
    color: var(--accent-orange-deep);
}

.notification-dropdown-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-dropdown-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    font-family: var(--font-support);
}

/* ============================================
   Notification Item (shared by dropdown & sidebar)
   ============================================ */

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--bg);
}

.notification-item.unread {
    border-left: 3px solid var(--accent-orange);
}

.notification-item.requires-ack {
    border-left: 3px solid #b45309;
    background: rgba(180, 83, 9, 0.04);
}

.notification-item.unread .notification-item-message {
    font-weight: 600;
}

.notification-item-chip,
.notif-required-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 6px;
    padding: 2px 8px;
    border: 1px solid rgba(180, 83, 9, 0.25);
    border-radius: 999px;
    background: rgba(180, 83, 9, 0.08);
    color: #92400e;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.notification-item-date {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums lining-nums;
}

.notification-item-message {
    font-family: var(--font-support);
    font-size: 14px;
    color: var(--text);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ============================================
   Notification Sidebar
   ============================================ */

.notification-sidebar {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    flex-direction: column;
    overflow: hidden;
}

.notification-sidebar.active {
    display: flex;
    animation: notificationSlideIn 0.2s ease-out;
}

@keyframes notificationSlideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.notification-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

.notification-sidebar-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    padding: 0;
}

.notification-sidebar-close:hover {
    color: var(--text);
}

.notification-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* ============================================
   Notification Detail Modal
   ============================================ */

.notification-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1200;
    justify-content: center;
    align-items: center;
}

.notification-modal-overlay.active {
    display: flex;
}

.notification-modal-overlay.requires-ack {
    background: rgba(0, 0, 0, 0.62);
}

.notification-modal-overlay.requires-ack .notification-modal-close {
    display: none;
}

.notification-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 480px;
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.notification-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.notification-modal-header h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

.notification-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    padding: 0;
}

.notification-modal-close:hover {
    color: var(--text);
}

.notification-modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.notification-modal-date {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums lining-nums;
}

.notification-modal-message {
    font-family: var(--font-support);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
}

.notification-modal-footer {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

.notification-modal-footer .btn {
    font-family: var(--font-ui);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.notification-modal-footer .btn:hover {
    background: var(--bg);
}

.notification-modal-footer .btn-primary {
    background: var(--accent-orange);
    color: #fff;
    border-color: var(--accent-orange);
}

.notification-modal-footer .btn-primary:hover {
    background: var(--accent-orange-deep);
    border-color: var(--accent-orange-deep);
}

.notification-modal-footer .btn-danger-outline {
    color: #dc3545;
    border-color: #dc3545;
}

.notification-modal-footer .btn-danger-outline:hover {
    background: #dc3545;
    color: #fff;
}

.notif-modal-transfer-actions {
    display: flex;
    gap: 8px;
    margin-right: auto;
}

.notif-modal-unread-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    user-select: none;
}

.notif-modal-unread-toggle:hover {
    background: var(--bg);
}

.notif-modal-unread-toggle input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* ============================================
   Notifications Page — Table Enhancements
   ============================================ */

.data-table tr.unread-row {
    border-left: 3px solid var(--accent-orange);
}

.data-table tr.notification-requires-ack-row {
    border-left: 3px solid #b45309;
}

.data-table tr.unread-row td.notif-title-cell,
.data-table tr.unread-row td.notif-msg-cell {
    font-weight: 600;
}

.data-table td.notif-title-cell,
.data-table td.notif-msg-cell {
    cursor: pointer;
}

.data-table td.notif-title-cell:hover,
.data-table td.notif-msg-cell:hover {
    color: var(--accent-orange);
}

.data-table td.notif-msg-cell {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge.status-unread {
    background: rgba(229, 122, 0, 0.08);
    color: var(--accent-orange);
    border: 1px solid var(--accent-orange);
}

.notifications-empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
}

/* ============================================
   Notification Settings Modal / Page
   ============================================ */

#settingsTable,
#notificationSettingsTable {
    min-width: 0;
}

/* ============================================
   Toggle Switch (Notification Settings)
   ============================================ */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    vertical-align: middle;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 22px;
    transition: 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* Mini toggle for inline use */
.toggle-switch[style*="width:32px"] .toggle-slider::before {
    height: 12px;
    width: 12px;
}
.toggle-switch[style*="width:32px"] input:checked + .toggle-slider::before {
    transform: translateX(14px);
}
