/* ============================================================
   Jobscout Notification Bell — left-side full-page slide-in drawer.
   Vertical scrolling only; no horizontal scroll.
   Responsive: desktop / tablet / mobile.
   Image support for notices that have a featured image.
   ============================================================ */

.jnb-bell-wrap {
    --jnb-500: #4277E0;
    --jnb-600: #2159E5;
    --jnb-50: #f4f7ff;
    --jnb-red: #ef4444;
    --jnb-panel-w: min(360px, 100vw);
    --jnb-overlay: rgba(15, 23, 42, 0.45);

    position: relative;
    display: inline-flex;
    align-items: center;
    font-family: 'Hind Siliguri', sans-serif;
}
.jnb-bell-wrap * {
    box-sizing: border-box;
}

/* ---------- Bell button ---------- */
.jnb-bell-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #ffffff29;
    color: #fff !important;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.jnb-bell-btn:hover {
    background: #ececec;
    color: #000 !important;
}
.jnb-bell-btn:focus-visible {
    outline: 2px solid var(--jnb-600);
    outline-offset: 2px;
}
.jnb-bell-icon {
    width: 20px;
    height: 20px;
    display: block;
}

/* Red "new notification" dot */
.jnb-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--jnb-red);
    border: 2px solid #fff;
}

/* ---------- Overlay (behind drawer) ---------- */
.jnb-overlay {
    position: fixed;
    inset: 0;
    background: var(--jnb-overlay);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    pointer-events: none;
}
.jnb-overlay.jnb-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ---------- Left slide-in panel (drawer) ---------- */
.jnb-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--jnb-panel-w);
    max-width: 400px;
    height: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: none;
    border-radius: 0;
    box-shadow: 8px 0 40px -8px rgba(20, 40, 90, 0.35);
    z-index: 99999;
    overflow: hidden; /* no horizontal scroll */
    overflow-x: hidden;
    transform: translateX(-105%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    visibility: hidden;
}
.jnb-panel.jnb-open {
    transform: translateX(0);
    visibility: visible;
}

/* Full-page mode (optional class when very narrow or forced) */
.jnb-panel.jnb-full {
    width: 100vw;
    max-width: 400px;
}

.jnb-panel-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 16px 14px;
    border-bottom: 1px solid rgba(66, 119, 224, 0.12);
    background: linear-gradient(180deg, var(--jnb-50), #ffffff);
}
.jnb-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: #10192e;
    margin: 0;
}
.jnb-panel-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.jnb-mark-all-btn {
    border: none;
    background: transparent;
    color: var(--jnb-600);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.15s ease;
}
.jnb-mark-all-btn:hover {
    background: var(--jnb-50);
}
.jnb-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #4b5768;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}
.jnb-close-btn:hover {
    background: var(--jnb-50);
    color: #10192e;
}
.jnb-close-btn svg {
    width: 20px;
    height: 20px;
}

/* List: vertical scroll only */
.jnb-list {
    list-style: none;
    margin: 0;
    padding: 8px 0 24px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.jnb-empty {
    padding: 32px 16px;
    text-align: center;
    color: #7c8aa8;
    font-size: 13px;
}

.jnb-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(66, 119, 224, 0.06);
    overflow: hidden; /* prevent any horizontal bleed */
}
.jnb-item:last-child {
    border-bottom: none;
}
.jnb-item:hover {
    background: var(--jnb-50);
}

.jnb-item-status {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 8px;
    border-radius: 50%;
    background: transparent;
}
.jnb-item.jnb-unread .jnb-item-status {
    background: var(--jnb-red);
}

.jnb-item-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

/* Title row: title left + time right on same line */
.jnb-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.jnb-item-title {
    color: #10192e;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
    text-decoration: none;
    word-break: break-word;
    overflow-wrap: anywhere;
    flex: 1 1 auto;
    min-width: 0;
}
a.jnb-item-title:hover {
    color: var(--jnb-600);
    text-decoration: underline;
}
.jnb-item:not(.jnb-unread) .jnb-item-title {
    font-weight: 700;
    color: #4b5768;
}

.jnb-item-time {
    flex-shrink: 0;
    font-size: 10.5px;
    color: #7c8aa8;
    line-height: 1.45;
    white-space: nowrap;
    text-align: right;
    padding-top: 1px;
}

/* Image support — object-fit: contain so full image is visible */
.jnb-item-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    margin: 4px 0 2px;
}
.jnb-item-image-wrap {
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    background: #f1f5f9;
}

/* Full notice text — never clamped; vertical only */
.jnb-item-desc {
    margin: 0;
    color: #3d4a63;
    font-size: 12.5px;
    line-height: 1.55;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.jnb-item-more {
    display: inline-block;
    margin-top: 2px;
    color: var(--jnb-600);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}
.jnb-item-more:hover {
    text-decoration: underline;
}

/* Type accent (optional subtle left bar) */
.jnb-item[data-type="breaking"] .jnb-item-status { background: #ef4444; }
.jnb-item[data-type="deadline"] .jnb-item-status { background: #3b82f6; }
.jnb-item[data-type="new"] .jnb-item-status { background: #22c55e; }
.jnb-item[data-type="update"] .jnb-item-status { background: #eab308; }
.jnb-item.jnb-unread[data-type="breaking"] .jnb-item-status,
.jnb-item.jnb-unread[data-type="deadline"] .jnb-item-status,
.jnb-item.jnb-unread[data-type="new"] .jnb-item-status,
.jnb-item.jnb-unread[data-type="update"] .jnb-item-status {
    /* keep type color for unread too */
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Keep 300–400px on tablet/desktop (same feel as mobile width) */
@media (max-width: 1024px) {
    .jnb-bell-wrap {
        --jnb-panel-w: min(340px, 100vw);
    }
}

/* Mobile: full-width drawer */
@media (max-width: 767px) {
    .jnb-bell-wrap {
        --jnb-panel-w: 100vw;
    }
    .jnb-panel {
        width: 100vw;
        max-width: 400px;
        box-shadow: none;
    }
    .jnb-panel-head {
        padding: 14px 14px 12px;
    }
    .jnb-panel-title {
        font-size: 14.5px;
    }
    .jnb-item {
        padding: 12px 14px;
        gap: 10px;
    }
    .jnb-item-image {
        max-height: 200px;
    }
    .jnb-mobile-slot .jnb-bell-btn {
        width: 36px;
        height: 36px;
    }
    .jnb-mobile-slot .jnb-bell-icon {
        width: 18px;
        height: 18px;
    }
}

/* Desktop: keep narrow 300–400px (not wide) */
@media (min-width: 768px) {
    .jnb-bell-wrap {
        --jnb-panel-w: min(360px, 100vw);
    }
}
@media (min-width: 1200px) {
    .jnb-bell-wrap {
        --jnb-panel-w: min(380px, 100vw);
    }
}

/* Auto-injected placement helpers (unchanged logic) */
.jnb-auto-injected.jnb-mobile-slot {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 2147483000;
}

/* When panel is open, prevent body scroll (applied via JS class on body) */
body.jnb-drawer-open {
    overflow: hidden;
    touch-action: none;
}

/* Native-hamburger look */
.jnb-bell-wrap.jnb-mobile-slot[data-jnb-mode="ixnav-trigger"] .jnb-bell-btn,
.ixnav-trigger + .jnb-bell-wrap .jnb-bell-btn,
.jnb-bell-wrap:has(+ .ixnav-trigger) .jnb-bell-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    color: inherit;
}
.ixnav-trigger + .jnb-bell-wrap .jnb-bell-btn:hover,
.jnb-bell-wrap:has(+ .ixnav-trigger) .jnb-bell-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: inherit;
}
.ixnav-trigger + .jnb-bell-wrap .jnb-bell-icon,
.jnb-bell-wrap:has(+ .ixnav-trigger) .jnb-bell-icon {
    width: 22px;
    height: 22px;
}
