/* Notifications — ported from Pawn Marketplace v3.0.1 (2026-10-06), translated to v3.1 conventions.
   Source: v3.0.1 wwwroot/CSS/Components/Notifications.css.
   Kept from v3.0.1: the features (bell, unread badge, Notification Center) and the motion — the bell's
   200ms ease push-off collapse, exactly as v3.0.1 times it.
   v3.1's language for everything else: the header controls reuse their row's own classes
   (.topbar-tab-container on the desktop tab row, .menu-btn beside the ☰), so look, focus ring and press
   come from Home.css / Accessibility.css / PressFeedback.css; the dialog takes app.css's chrome and
   motion; .fc-iconbtn ✕, the link-button look (.fc-item-storelink) and the blue navigation chevron
   (.fc-addr-option-arrow) are reused as they are. Momento 8px scale; tokens only. */

/* ══ Bell triggers ══════════════════════════════════════════════════════════════════════════════
   · #notifications_tab — the desktop tab (Components/Topbar.razor, ≥1025px), first in the tab row.
   · .fc-bell-btn — the icon bell just left of the ☰ on tablets: Topbar's logo row at 768–1024px and
     NativeHeader on MAUI tablets (search · ⓘ · bell · ☰). Hidden ≤767px in Home.css (phones get no bell).
   Both render for signed-in users only and stay mounted while Push is off, so they can collapse. */

/* The glyph wrap anchors the unread badge to the icon. */
.fc-bell-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Unread badge: count of unread rows, "9+" above 9, hidden at 0 (Topbar / NativeHeader). Decorative —
   the count reaches screen readers as text (hidden text on the tab, the icon bell's aria-label).
   v3.0.1's look: 16px pill, Inter 10 bold, hot-badge colours, a 2px header-blue ring that reads as a
   cutout against the header. Offsets snapped to the 8px scale: top −6px → −8px, right −4px → −8px,
   padding 0 4px → 0 (the 16px minimum width already fits "9+").
   DECIDED (right: -4px below): on the desktop tab the icon box is 18px (MudIcon's 1em), so at −8px the badge's edge
   meets the "N" of the label and its 2px ring overlaps it by 2px — what v3.0.1's −4px (Kelly's
   2026-07-09 tuning) avoided. right: 0 clears the label but covers most of the bell. */
.fc-bell-badge {
  position: absolute;
  top: calc(-1 * var(--space-1));
  /* −4px: Kelly's named exception (2026-07-09, recorded in v3.0.1's V3-CHANGES-HANDOFF): the badge clears
     the label's first letters, which the 8px-scale −8px overlaps. */
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--color-badge-hot-bg);
  color: var(--color-badge-hot-text);
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: var(--fw-bold);
  line-height: 16px;
  text-align: center;
  box-sizing: border-box;
  box-shadow: 0 0 0 2px var(--color-topbar-bg);
  pointer-events: none;
}
/* The icon bell's glyph sits in Font Awesome 7's wider 1.25em box (a plain <i>), so right: 0 already puts
   the badge on the glyph's top-right corner, about as far past it as −8px does on the desktop tab. */
.fc-bell-btn .fc-bell-badge { right: 0; }

/* Desktop tab: clips its label and badge while the width moves (v3.0.1 keeps this on at all times — the
   tab has a visible label and no tooltip), and never wraps the label mid-collapse. */
.topbar-tab-container.fc-bell-tab {
  overflow: hidden;
  white-space: nowrap;
}

/* Icon bell, web logo row: pushed right beside the ☰, 8px apart (side-by-side controls). NativeHeader's
   row already spaces its controls 8px apart with its own gap. */
#web-mobile-header .fc-bell-btn {
  margin-inline-start: auto;
  margin-inline-end: var(--space-1);
}

/* ── Push off (Profile's "Enable Push Notification" toggle → LoanSessionState.PushEnabled) ──
   v3.0.1's collapse: no width, no side padding, faded and settled to 0.94, then visibility:hidden so it
   also leaves the Tab order and the accessibility tree (the markup adds `inert` straight away).
   `scale`, not `transform`, so the catch-all press (transform: scale(.99)) stays separate.
   The negative end margin cancels the gap the bell leaves behind, so its neighbours keep v3.1's spacing:
   desktop row gap 16 − 8 → Saved sits 16px from the search box, as with no bell; NativeHeader's 8px gap
   → the ⓘ and ☰ stay 8px apart; the web logo row's own 8px margin simply goes to 0.
   The icon bell carries a tooltip, so it clips only while collapsed (see the transition below). */
.fc-bell-tab.fc-bell--off,
#web-mobile-header .fc-bell-btn.fc-bell--off,
#native-sticky-header .fc-bell-btn.fc-bell--off {
  width: 0;
  padding-inline: 0;
  opacity: 0;
  scale: 0.94;
  visibility: hidden;
  overflow: hidden;
}
.fc-bell-tab.fc-bell--off,
#native-sticky-header .fc-bell-btn.fc-bell--off {
  margin-inline-end: calc(-1 * var(--space-1));
}
#web-mobile-header .fc-bell-btn.fc-bell--off {
  margin-inline-end: 0;
}

/* Micro-transition — browser only (Kelly, 2026-10-05, v3.0.1): 200ms ease, the house micro-transition,
   and the search field beside the desktop tab glides instead of jumping. The app snaps (.page.has-bottomnav
   is MainLayout's native-host class). interpolate-size lets the width animate to and from auto, as in
   v3.0.1; a browser without it (Safari, Firefox) snaps the width and still plays the fade and settle.
   visibility is listed so the hide lands at the END of the ramp and the fade-out is seen.
   background-color keeps the tab's own 0.15s hover fade (Home.css), which this list replaces. */
.page:not(.has-bottomnav) .fc-bell-tab {
  interpolate-size: allow-keywords;
  transition: width 200ms ease, padding-inline 200ms ease, margin-inline-end 200ms ease,
              opacity 200ms ease, scale 200ms ease, visibility 200ms, background-color 0.15s ease;
}
/* The icon bell clips only while collapsed, so its tooltip is never cut off when it's showing. Turning
   Push back on keeps the clip for the whole 200ms ramp (overflow is released at the end, a discrete
   transition) so the glyph and badge never spill while the width grows; turning it off clips at once. */
.page:not(.has-bottomnav) .fc-bell-btn {
  interpolate-size: allow-keywords;
  transition: width 200ms ease, padding-inline 200ms ease, margin-inline-end 200ms ease,
              opacity 200ms ease, scale 200ms ease, visibility 200ms, overflow 0s 200ms;
  transition-behavior: allow-discrete;
}
.page:not(.has-bottomnav) .fc-bell-btn.fc-bell--off {
  transition-delay: 0s;
}
@media (prefers-reduced-motion: reduce) {
  .page:not(.has-bottomnav) .fc-bell-tab,
  .page:not(.has-bottomnav) .fc-bell-btn {
    transition: none;
  }
}

/* ══ Phone menus (≤767): the Notifications row ═══════════════════════════════════════════════════
   Topbar's ☰ drawer (web) and NativeHeader's sheet (app), right after Pawn Loans ▾ (Kelly, 2026-10-06).
   The row is the Layaway row's markup and classes (Home.css .drawer_*, MegaMenu.css
   button.drawer_items_div), so only the gap after the accordion and the unread pill are new here.
   Signed in only; not rendered while Push is off. */

/* 8px under the Pawn Loans accordion, like every pair of rows (.drawer_items_div + .drawer_items_div). */
.fc-menu-acc + .fc-menu-notif {
  margin-top: var(--space-1);
}

/* Unread pill at the row's trailing edge, just before the chevron (the row's own 8px gap). v3.1's
   Momento pill (PawnLoans.css .fc-pawn-itembadge: 24px line box, 0 8px, label-md bold) in the bell
   badge's hot colours; min-width keeps one digit round, "9+" above 9. Decorative (aria-hidden): the
   row's name carries the count. */
.fc-menu-notif-count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 0 var(--space-1);
  box-sizing: border-box;
  border-radius: var(--radius-full);
  background: var(--color-badge-hot-bg);
  color: var(--color-badge-hot-text);
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  font-weight: var(--fw-bold);
  line-height: 24px;
  white-space: nowrap;
}

/* ══ Notification Center (Components/Modals/NotificationCenterModal.razor) ══════════════════════
   NoHeader MudDialog; the head stays put and only the list scrolls (Momento modal layout). In the app
   the list caps at 500px inside app.css's min(800px, 100dvh − safe-top) dialog cap; on the web the
   dialog's own max-height (MudBlazor) is the cap. MudBlazor's 8px content margin is dropped so the
   handle hugs the top at 8px (Item Detail address-options precedent). 700px wide (v3.0.1). */
.mud-dialog.fc-notif {
  width: 100%;
  max-width: 700px;
  overflow: hidden;
}
.fc-notif .mud-dialog-content {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
html:has(.page.has-bottomnav) .mud-dialog.fc-notif .mud-dialog-content { max-height: none; }
.fc-notif-sheet {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 0 1 auto;
  min-height: 0;
}
.fc-notif-sheet > .fc-sheet-handle { margin-bottom: 0; }

/* Head: v3.1's modal header type (Inter Bold 20/24) with a 20px icon in a 24px frame, the summary
   right under it (no gap). The 40px ✕ overhangs the 24px title line by 8px above and below instead of
   making the row taller (Profile modal precedent, ProfileMenu.css). */
.fc-notif-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-1);
  flex-shrink: 0;
}
.fc-notif-head > .fc-iconbtn {
  flex-shrink: 0;
  margin: calc(-1 * var(--space-1)) 0;
}
.fc-notif-headtext {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.fc-notif-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-heading);
  font-size: var(--text-heading-sm-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-heading-sm-lh);
  color: var(--color-text-primary);
}
.fc-notif-headicon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--color-text-primary);
}
.fc-notif-sub {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-label-md-lh);
  color: var(--color-text-muted);
}

/* "Mark all as read" — the link-button look, right-aligned as in v3.0.1 (button.fc-item-storelink is
   full width by default). */
.fc-notif-markall-row {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}
button.fc-item-storelink.fc-notif-markall { width: auto; }

/* List: the scroller. Rows 8px apart (v3.1's menu-row rhythm). */
.fc-notif-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
html:has(.page.has-bottomnav) .fc-notif-list { max-height: 500px; }

/* Rows: real <button>s with spans inside; press from PressFeedback.css's catch-all, focus from
   Accessibility.css. 16px icon → text, 16px top/bottom inside the tappable row, 8px sides (v3.0.1's
   12/12/8 snapped). justify-content: MudBlazor's global `button { justify-content: center }` would
   centre the content. */
.fc-notif-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--space-2);
  width: 100%;
  flex-shrink: 0;
  padding: var(--space-2) var(--space-1);
  text-align: left;
  background-color: transparent;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font: inherit;
  color: inherit;
}
/* The list is the scroller (overflow clips on both axes) and the rows fill its width, so the generic
   button ring (2px, 2px out, Accessibility.css) would lose its sides and the first row's top edge. It is
   drawn inside the row instead, as the Mega Menu's clipped sub-links do (MegaMenu.css). !important: the
   generic rule's :not() chain outranks a class selector. */
.fc-notif-row:focus-visible { outline-offset: -2px !important; }
.fc-notif-row--unread { background-color: color-mix(in srgb, var(--color-brand-primary) 5%, transparent); }
.fc-notif-row-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: color-mix(in srgb, var(--color-brand-primary) 8%, transparent);
  color: var(--color-brand-primary);
  font-size: 16px;
}
.fc-notif-row-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.fc-notif-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
}
.fc-notif-row-title {
  min-width: 0;
  font-family: var(--font-heading);
  font-size: var(--text-body-md-size);
  font-weight: var(--fw-bold);
  line-height: var(--text-body-md-lh);
  letter-spacing: 0.2px;
  color: var(--color-text-primary);
}
.fc-notif-row-meta {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.fc-notif-row-time {
  font-family: var(--font-body);
  font-size: var(--text-xs-size);
  line-height: var(--text-xs-lh);
  color: var(--color-text-muted);
}
.fc-notif-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--color-brand-primary);
}
.fc-notif-row-msg {
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-label-md-lh);
  color: var(--color-text-muted);
}
.fc-notif-row > .fc-notif-row-chev { align-self: center; }

/* Empty state (also what a real build shows until a notification feed exists). */
.fc-notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-5) var(--space-2);
  text-align: center;
}
.fc-notif-empty i {
  font-size: 24px;
  color: var(--color-text-muted);
}
.fc-notif-empty p {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-label-md-size);
  line-height: var(--text-label-md-lh);
  color: var(--color-text-muted);
}
