/* ================================================================
   NOTIFICATION SYSTEM — notification.css
   Include this file in your main layout <head>
   ================================================================ */


/* ── 1. HEADER BELL ICON ─────────────────────────────────────── */

.notif-bell-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgb(173 138 138 / 22%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .18s, border-color .18s, transform .15s;
    flex-shrink: 0;
}

.notif-bell-btn:hover {
        background: rgb(0 85 241 / 13%);
    border-color: rgb(167 167 167 / 38%);
    transform: scale(1.05);
}

.notif-bell-btn svg {
    color: #fff;
    display: block;
}

/* Red dot badge on the bell */
.notif-bell-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e24b4a;
    border: 2px solid #1e3a5f; /* match your header bg colour */
    pointer-events: none;
}

/* If your header is WHITE, use this variant instead of .notif-bell-btn */
.notif-bell-btn-light {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #f3f5f8;
    border: 1.5px solid #e5e9f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .18s, transform .15s;
    flex-shrink: 0;
}

.notif-bell-btn-light:hover {
    background: #e8ecf2;
    transform: scale(1.05);
}

.notif-bell-btn-light svg { color: #374151; }

.notif-bell-badge-light {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e24b4a;
    border: 2px solid #fff;
    pointer-events: none;
}


/* ── 2. DROPDOWN PANEL ────────────────────────────────────────── */

.notif-panel-dropdown {
    position: fixed;
    top: 10%;
    right: 16px;
    z-index: 9999;
    width: 460px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.13);
    border: 1px solid #e5e9f0;
    overflow: hidden;
    animation: notifSlideIn .18s ease;
}

@keyframes notifSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ── 3. PANEL HEAD ───────────────────────────────────────────── */

.notif-panel-head {
    padding: 16px 18px 0;
}

.notif-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.notif-icon-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notif-head-bell-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f3f5f8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    flex-shrink: 0;
}

.notif-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.2;
}

.notif-panel-sub {
    font-size: 12px;
    color: #8a94a6;
    margin-top: 2px;
}

.notif-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 22px;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 7px;
    transition: background .15s, color .15s;
    margin-top: -2px;
}

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


/* ── 4. TABS ─────────────────────────────────────────────────── */

.notif-tabs {

    display: flex;
    align-items: center;

    width: 100%;

    border-bottom: 1.5px solid #eef0f4;

    /* IMPORTANT FIX */
    overflow-x: auto;
    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: none;

    white-space: nowrap;

    /* space so last tab is never cut */
    padding-right: 12px;
}

.notif-tabs::-webkit-scrollbar {
    display: none;
}

/* =========================
   TAB BUTTON
========================= */

.notif-tab {

    flex: 0 0 auto;   /* prevents shrinking */

    white-space: nowrap;

    padding: 9px 18px;

    background: none;
    border: none;

    border-bottom: 2.5px solid transparent;

    font-size: 13px;
    font-weight: 500;

    color: #8a94a6;

    cursor: pointer;

    display: inline-flex;
    align-items: center;
    gap: 7px;

    transition: color .18s, border-color .18s;
}

/* active tab */
.notif-tab.active {
    color: #1a1a2e;
    border-bottom-color: #1a1a2e;
}

/* badge */
.notif-tab-badge {

    font-size: 11px;
    font-weight: 600;

    padding: 1px 7px;

    border-radius: 20px;

    line-height: 1.6;
}

.notif-tab.active .notif-tab-badge {
    background: #e24b4a;
    color: #fff;
}

.notif-tab:not(.active) .notif-tab-badge {
    background: #f0f2f5;
    color: #6b7280;
}

/* =========================
   DESKTOP (extra safety)
========================= */

@media (min-width: 768px) {

    .notif-tabs {

        justify-content: flex-start;

        overflow-x: auto; /* still allow scroll if overflow */
    }
}

/* =========================
   MOBILE IMPROVEMENT
========================= */

@media (max-width: 480px) {

    .notif-tab {
        padding: 8px 14px;
        font-size: 12.5px;
    }

    .notif-tabs {
        padding-right: 18px; /* extra safety on small screens */
    }
}

@media (max-width: 768px) {
    #notif-bell-trigger svg,
    #leave-bell-trigger svg,
    #checkin-trigger svg {
        width: 14px !important;
        height: 14px !important;
    }

    #notif-bell-trigger,
    #leave-bell-trigger,
    #checkin-trigger {
        width: 28px !important;
        height: 28px !important;
        padding: 5px !important;
    }

    div[style*="display:flex"][style*="gap:10px"] {
        gap: 5px !important;
    }
}

/* ── 5. PANEL BODY & LIST ────────────────────────────────────── */

.notif-panel-body {
    display: none;
}

.notif-panel-body.active {
    display: block;
}

.notif-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 320px;
    overflow-y: auto;
}

.notif-list::-webkit-scrollbar { width: 3px; }
.notif-list::-webkit-scrollbar-track { background: transparent; }
.notif-list::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 3px;
}


/* ── 6. NOTIFICATION ITEM ────────────────────────────────────── */

.notif-item {
    padding: 13px 18px;
    border-bottom: 1px solid #f3f5f8;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    transition: background .12s;
}

.notif-item:hover { background: #fafbfc; }
.notif-item:last-child { border-bottom: none; }

/* Unread blue dot */
.notif-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e24b4a;
    flex-shrink: 0;
    margin-top: 5px;
    transition: background .2s;
}

.notif-unread-dot.is-read {
    background: transparent;
}

/* Message text */
.notif-item-msg {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
    line-height: 1.45;
    margin-bottom: 6px;
}

/* Meta row: time + actions */
.notif-item-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.notif-item-time {
    font-size: 11px;
    color: #aab0bc;
    display: flex;
    align-items: center;
    gap: 3px;
}

.notif-view-link {
    font-size: 12px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.notif-view-link:hover { text-decoration: underline; }

.notif-mark-read-link {
    font-size: 12px;
    color: #aab0bc;
    text-decoration: none;
    margin-left: auto;
    white-space: nowrap;
}

.notif-mark-read-link:hover { color: #6b7280; }

/* Send Mail button */
.notif-send-mail-btn {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 14px;
    border-radius: 20px;
    border: 1.5px solid #1a1a2e;
    background: #fff;
    color: #1a1a2e;
    cursor: pointer;
    transition: background .15s, color .15s;
    line-height: 1.6;
}

.notif-send-mail-btn:hover {
    background: #1a1a2e;
    color: #fff;
}


/* ── 7. EMPTY STATE ──────────────────────────────────────────── */

.notif-empty {
    text-align: center;
    padding: 36px 20px;
    color: #aab0bc;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.notif-empty p { margin: 0; }


/* ── 8. FOOTER ───────────────────────────────────────────────── */

.notif-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 18px;
    border-top: 1px solid #f0f2f5;
    background: #fafbfd;
}

.notif-footer-mark {
    font-size: 13px;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-weight: 400;
    transition: color .15s;
}

.notif-footer-mark:hover { color: #374151; }

.notif-footer-all {
    font-size: 13px;
    color: #185fa5;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color .15s;
}

.notif-footer-all:hover {
    text-decoration: underline;
    color: #0c447c;
}


/* ── 9. RESPONSIVE ───────────────────────────────────────────── */

@media (max-width: 480px) {
    .notif-panel-dropdown {
        right: 8px;
        left: 8px;
        width: auto;
        border-radius: 14px;
        top: 8%;
        position: fixed;
    }
}



.loader-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #ddd;
    border-top: 3px solid #4a90e2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

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

.notif-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

#leave-date-picker {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    width: 160px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#leave-date-picker:focus {
    border-color: #007bff;
    box-shadow: 0 0 4px rgba(0, 123, 255, 0.4);
}

.notif-date-picker {
    margin: 10px 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    font-family: sans-serif;
    font-size: 14px;
}
