/* ============================================================================
   NOTIFICATION CENTRE (bell + dropdown panel)
   PRO feature — header bell with unread badge, opens a navy/gold panel listing
   recent notifications (DMs, follow requests, challenges, payments, coach/PT).
   Theme: navy #0a1628 / #0f1a2e / #16223c, gold #c8a03c, white. No emoji icons.
   ============================================================================ */

/* Bell button lives in .app-header-right, just left of the profile avatar. */
.notif-bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    margin-right: 0.35rem;
    border: 1px solid rgba(200, 160, 60, 0.22);
    border-radius: 50%;
    background: rgba(15, 26, 46, 0.6);
    color: #e7ecf5;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}
.notif-bell-btn:hover {
    background: #16223c;
    border-color: rgba(200, 160, 60, 0.5);
    color: #c8a03c;
}
.notif-bell-btn svg { display: block; }

/* Unread count badge on the bell. */
.notif-bell-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #c8a03c;
    color: #0a1628;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #0a1628;
    pointer-events: none;
}
.notif-bell-badge[hidden] { display: none; }

/* Dropdown panel. Hidden by default; .open toggles it. */
.notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: min(70vh, 560px);
    display: none;
    flex-direction: column;
    background: #0f1a2e;
    border: 1px solid rgba(200, 160, 60, 0.28);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    z-index: 1200;
}
.notif-panel.open { display: flex; }

/* Anchor wrapper so the absolute panel positions to the bell. */
.notif-wrap { position: relative; display: inline-flex; align-items: center; }

.notif-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: linear-gradient(180deg, #16223c 0%, #0f1a2e 100%);
}
.notif-panel-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
}
.notif-mark-all {
    border: none;
    background: none;
    color: #c8a03c;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    border-radius: 6px;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-mark-all[disabled] { color: #6b7686; cursor: default; text-decoration: none; }

.notif-list {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    width: 100%;
    text-align: left;
    padding: 0.8rem 1rem;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent;
    color: #e7ecf5;
    cursor: pointer;
    transition: background 0.15s ease;
}
.notif-item:hover { background: #16223c; }
.notif-item.unread { background: rgba(200, 160, 60, 0.07); }
.notif-item.unread:hover { background: rgba(200, 160, 60, 0.12); }

.notif-item-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #16223c;
    border: 1px solid rgba(200, 160, 60, 0.25);
    color: #c8a03c;
}
.notif-item-icon svg { display: block; }

.notif-item-body { flex: 1 1 auto; min-width: 0; }
.notif-item-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.12rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item-msg {
    font-size: 0.78rem;
    color: #aab4c4;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-item-time {
    font-size: 0.7rem;
    color: #6b7686;
    margin-top: 0.22rem;
}

/* Unread dot on the right edge of an item. */
.notif-item-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c8a03c;
    margin-top: 0.45rem;
}

.notif-empty {
    padding: 2.4rem 1rem;
    text-align: center;
    color: #6b7686;
    font-size: 0.85rem;
}
.notif-empty svg { color: #2a3a57; margin-bottom: 0.6rem; }

.notif-loading {
    padding: 2rem 1rem;
    text-align: center;
    color: #6b7686;
    font-size: 0.85rem;
}

/* Mobile: panel becomes a CENTRED, width-capped sheet under the header. Centring via
   left:50% + translateX keeps it on-screen even if an ancestor's transform would
   otherwise make position:fixed resolve oddly (it was bleeding off the top-left). */
@media (max-width: 768px) {
    .notif-panel {
        position: fixed !important;
        top: calc(env(safe-area-inset-top, 0px) + 54px) !important;
        /* Pin BOTH edges so it always fits the screen, no matter the containing block. */
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-width: none !important;
        transform: none !important;
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 70px) !important;
    }
}
