body.reloading {
    visibility: hidden;
}

.header-container {
    max-width: 1250px;
    height: 90px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 40px;
    padding: 24px 16px;
    width: 100%; 
    box-sizing: border-box;
}

.header-container> :last-child {
    margin-left: auto;
}

.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
}
/* ==================== USER MENU DROPDOWN (Fixed) ==================== */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    min-width: 220px;
    max-width: min(320px, 92vw); /* Added max-width constraint */
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    display: none;
    padding: 8px; /* Matches landing page padding */
    z-index: 10002; /* Increased Z-index */
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a,
.user-dropdown button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #111;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    /* CHANGED: Removed "font-size: 18px" and set to standard body size */
    font-size: 14.5px; 
    font-weight: 500; /* Added weight for better readability */
    transition: all 0.2s ease;
    box-sizing: border-box; /* Ensures padding doesn't break layout */
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: #f5f5f7;
}

.user-dropdown .dropdown-logout:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.icon-btn {
    position: relative;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

.icon-btn:hover {
    color: #4f46e5;
}

.icon-btn .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: red;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
    padding: 2px 6px;
}

/* NOTIF MENU DROPDOWN */

.notif-menu {
    position: relative;
}

.notif-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    min-width: 360px;
    max-width: 380px;
    width: 380px;
    max-height: 70vh;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: none;
    padding: 0;
    z-index: 1000;
    overflow: hidden;
    flex-direction: column;
}

.notif-dropdown.show {
    display: flex;
}

.notif-header {
    padding: 12px 20px 8px;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.notif-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.notif-content {
    max-height: calc(70vh - 200px);
    overflow-y: auto;
    padding: 8px 4px;
    min-height: 0;
    width: 100%;
}

.notif-content::-webkit-scrollbar {
    width: 6px;
}

.notif-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.notif-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.notif-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #111;
    align-items: flex-start;
    margin: 2px 8px;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.notif-item:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.notif-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-item.unread .notif-avatar {
    background: #dbeafe;
}

.notif-details {
    flex: 1;
    min-width: 0;
}

.notif-text {
    font-size: 14px;
    line-height: 1.4;
    color: #374151;
    margin-bottom: 4px;
    word-wrap: break-word;
    font-weight: 500;
    min-height: 1.4em;
}

.notif-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.no-notifications {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.no-notifications p {
    margin: 0;
    font-size: 14px;
}

.notif-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #f1f5f9;
    background: #fff;
    border-radius: 0 0 12px 12px;
    position: sticky;
    bottom: 0;
    flex-shrink: 0;
}

.notif-footer a {
    display: block;
    text-align: center;
    color: #4f46e5;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.15s ease;
    width: 100%;
}

.notif-footer a:hover {
    background: #f3f4f6;
}

.notif-item.unread {
    background-color: #f0f9ff !important;
    border-color: #e0f2fe;
}

.notif-item.unread:hover {
    background-color: #e0f2fe !important;
}

.notif-item.unread .notif-text {
    color: #1e40af;
}

.notif-item.unread .notif-avatar i {
    color: #3b82f6 !important;
}

.notif-amount {
    font-weight: 600;
    color: #10b981;
    font-size: 12px;
    margin-top: 2px;
}

/* ========================================================== */
/* CHANGE: Updated to support "Grab and Drag" styles */
/* ========================================================== */
.notif-tabs {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-bottom: 8px;
    position: relative;
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    
    /* CHANGE: Add cursor grab to indicate swipeability */
    cursor: grab; 
    /* CHANGE: Prevent text highlighting while dragging */
    user-select: none; 

    /* Lowkey Scrollbar Styles */
    scrollbar-width: thin;
    scrollbar-color: transparent transparent; 
}

/* CHANGE: Active state for when user is clicking down */
.notif-tabs.active {
    cursor: grabbing;
    cursor: -webkit-grabbing;
}

.notif-tabs:hover {
    scrollbar-color: #cbd5e1 transparent;
}

.notif-tabs::-webkit-scrollbar {
    height: 4px;
    background: transparent;
}

.notif-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.notif-tabs::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 10px;
}

.notif-tabs:hover::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
}

.notif-tab {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* Ensure tabs don't block the drag on the parent */
    pointer-events: auto; 
}

.notif-tab:hover {
    background: #f3f4f6;
    color: #374151;
}

.notif-tab.active {
    background: #4f46e5;
    color: white;
}

.notif-tab.active:hover {
    background: #4338ca;
}

.notif-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.mark-all-read-btn {
    background: transparent;
    border: 1px solid #e5ebe5;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mark-all-read-btn:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.tab-dot {
    background: #ef4444;
    border-radius: 50%;
    width: 6px;
    height: 6px;
    margin-left: 6px;
    display: none;
}

.notif-tab.active .tab-dot {
    background: rgba(255, 255, 255, 0.8);
}

/* ===== NOTIFICATIONS MODAL STYLES ===== */
.notifications-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

.notifications-modal.show {
    display: block;
}

.notifications-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.notifications-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 650px;
    height: 80%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 10001;
}

.notifications-modal-header {
    display: flex;
    flex-direction: column;
    padding: 20px 24px 0;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.notifications-modal-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-right: 40px;
}

.notifications-modal-header-top h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.notifications-mark-all-read-btn {
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.notifications-mark-all-read-btn:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.notifications-modal-tabs {
    display: flex;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.notifications-modal-tab {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notifications-modal-tab:hover {
    background: #f3f4f6;
    color: #374151;
}

.notifications-modal-tab.active {
    background: #4f46e5;
    color: white;
}

.notifications-modal-tab.active:hover {
    background: #4338ca;
}

.notifications-modal-close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    z-index: 1;
    transition: all 0.15s ease;
}

.notifications-modal-close-btn:hover {
    background: transparent;
    /* Removes the grey box */
    color: #374151;
    /* Keeps the color change for the icon */
    transform: scale(1.2);
    /* Optional: Adds a slight zoom effect for better feedback */
}

.notifications-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    /* Hide scrollbar for all browsers */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* Internet Explorer 10+ */
}

/* Hide scrollbar for WebKit browsers (Chrome, Safari, Edge) */
.notifications-modal-body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

/* Updated modal notification items with avatar and hover styles */
.notifications-modal-body .notifications-modal-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #111;
    align-items: flex-start;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    flex: 1;
}

.notifications-modal-body .notifications-modal-item:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
    text-decoration: none;
}

.notifications-modal-body .notifications-modal-item.unread {
    background-color: #f0f9ff !important;
    border-color: #e0f2fe;
}

.notifications-modal-body .notifications-modal-item.unread:hover {
    background-color: #e0f2fe !important;
}

.notifications-modal-body .notifications-modal-item.unread .notifications-modal-text {
    color: #1e40af;
}

/* Updated modal avatar styles */
.notifications-modal-body .notifications-modal-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notifications-modal-body .notifications-modal-item.unread .notifications-modal-avatar {
    background: #dbeafe;
}

.notifications-modal-body .notifications-modal-avatar i {
    font-size: 18px;
    color: #6b7280;
}

.notifications-modal-body .notifications-modal-item.unread .notifications-modal-avatar i {
    color: #3b82f6 !important;
}

.notifications-modal-body .notifications-modal-details {
    flex: 1;
    min-width: 0;
}

.notifications-modal-body .notifications-modal-text {
    font-size: 14px;
    line-height: 1.4;
    color: #374151;
    margin-bottom: 4px;
    word-wrap: break-word;
    font-weight: 500;
    min-height: 1.4em;
}

.notifications-modal-body .notifications-modal-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.notifications-modal-body .notifications-modal-amount {
    font-weight: 600;
    color: #10b981;
    font-size: 12px;
    margin-top: 2px;
}

.notifications-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

.notifications-modal-footer .notifications-mark-all-read-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notifications-modal-footer .notifications-mark-all-read-btn:hover {
    background: #2563eb;
}

/* Empty state for modal */
.notifications-modal-empty {
    text-align: center;
    color: #6b7280;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.notifications-modal-empty p {
    margin: 0;
    font-size: 14px;
}

.notifications-modal-item-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.notification-checkbox {
    flex-shrink: 0;
    margin-top: 8px;
    /* Align with the content */
}

.notification-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.notifications-modal-item {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding: 8px 0;
}

.notifications-bulk-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.notifications-delete-all-btn,
.notifications-delete-selected-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.notifications-delete-all-btn:hover,
.notifications-delete-selected-btn:hover {
    background: #dc2626;
}

/* Delete Mode Styles */
.notifications-modal-content.delete-mode .notifications-modal-item-wrapper {
    padding-left: 16px;
    padding-right: 16px;
    align-items: center;
}

.notifications-modal-content.delete-mode .notifications-modal-item {
    padding: 12px 16px;
    align-items: center;
}

.notifications-modal-content.delete-mode .notification-checkbox {
    display: block;
    margin-top: 0;
}

.notifications-modal-content.delete-mode .notifications-modal-avatar {
    width: 36px;
    height: 36px;
}

.notifications-modal-content.delete-mode .notifications-modal-avatar i {
    font-size: 16px;
}

/* Delete Button Styles */
.notifications-delete-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.notifications-delete-btn:hover {
    background: #dc2626;
}

/* Cancel Button Styles */
.notifications-cancel-delete-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.notifications-cancel-delete-btn:hover {
    background: #4b5563;
}

/* Checkbox Styles */
.notification-checkbox {
    flex-shrink: 0;
    margin-top: 0;
    display: none;
}

.notification-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Bulk Actions */
.notifications-bulk-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ================= MOBILE RESPONSIVE STYLES ================= */
@media (max-width: 600px) {

    /* 1. Maximize Modal Size on Mobile */
    .notifications-modal-content {
        width: 95%;
        /* Take up almost full width */
        height: 85%;
        /* Take up 90% of height */
        max-width: none;
        /* Remove desktop restriction */
        border-radius: 12px;
    }

    /* 2. Adjust Header Layout for space */
    .notifications-modal-header {
        padding: 16px 16px 0;
        /* Reduce outer padding */
    }

    .notifications-modal-header-top {
        flex-wrap: wrap;
        /* Allow buttons to drop to next line if needed */
        gap: 12px;
        padding-right: 30px;
        /* Keep space for the X close button */
    }

    .notifications-modal-header-top h3 {
        font-size: 16px;
        /* Slightly smaller title */
        width: 100%;
        /* Force title to its own line on very small screens */
        margin-bottom: 4px;
    }

    /* 3. Make Action Buttons Compact */
    .notifications-bulk-actions {
        width: 100%;
        justify-content: flex-start;
        /* Spread buttons out */
        gap: 8px;
    }

    .notifications-modal-close-btn {
        top: 8px;
        /* Move closer to the top edge */
        right: 8px;
        /* Move closer to the right edge */
        padding: 4px;
        /* Reduce padding slightly so it fits in the corner better */
        font-size: 20px;
        /* Slightly smaller icon on mobile */
    }

    .notifications-mark-all-read-btn,
    .notifications-delete-btn,
    .notifications-cancel-delete-btn {
        font-size: 11px;
        /* Smaller text */
        padding: 6px 10px;
        white-space: nowrap;
        /* Prevent text breaking */
    }

    /* 4. Fix Tab Spacing */
    .notifications-modal-tabs {
        overflow-x: auto;
        /* Allow horizontal scrolling if tabs don't fit */
        white-space: nowrap;
        padding-bottom: 8px;
        /* Space for scrollbar */
        /* Hide scrollbar visually but allow scroll */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .notifications-modal-tabs::-webkit-scrollbar {
        display: none;
    }

    .notifications-modal-tab {
        padding: 6px 12px;
        font-size: 13px;
        flex-shrink: 0;
        /* Prevent tabs from squishing */
    }

    /* 5. Compact Notification Items */
    .notifications-modal-item-wrapper {
        padding: 10px 12px;
        /* Reduce padding */
    }

    .notifications-modal-avatar {
        width: 32px;
        /* Smaller avatar */
        height: 32px;
    }

    .notifications-modal-avatar i {
        font-size: 16px;
    }

    .notifications-modal-text {
        font-size: 13px;
        /* Slightly smaller text */
    }

    /* 6. FIX FOR DELETE MODE ON MOBILE */
    /* This ensures your checkbox and content fit perfectly on small screens */
    .notifications-modal-content.delete-mode .notifications-modal-item-wrapper {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* When animating in delete mode on mobile, keep avatar small */
    .notifications-modal-content.delete-mode .notifications-modal-avatar {
        width: 32px;
        height: 32px;
    }

    .notifications-modal-content.delete-mode .notifications-modal-item {
        padding: 10px 12px;
        /* Ensure content doesn't touch checkbox */
    }

    /* === MOBILE NOTIFICATION DROPDOWN === */
    .notif-dropdown {
        /* Make it fit mobile screens */
        width: 400px;
        /* Reduce width from 380px */
        min-width: auto;
        /* Remove minimum limit */
        max-width: 90vw;
        /* Ensure it never exceeds screen width */

        /* Adjust positioning to prevent it cutting off */
        right: -155px;
        /* Shift it slightly right to align with screen edge better */
    }

    /* Adjust the header inside the dropdown */
    .notif-header {
        padding: 12px 16px 8px;
        /* Slightly more compact */
    }

    /* Prevent horizontal scrolling on inner content */
    .notif-content {
        width: 100%;
        overflow-x: hidden;
    }

    /* Ensure text wraps correctly in smaller box */
    .notif-text {
        font-size: 13px;
        white-space: normal;
        /* Force text wrapping */
    }
}

.loading-spinner .spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
