/*
 * Warm BFS — BFS portal (SSO hub).
 * Scoped entirely under body.warm-bfs (default value of {% block body_class %}).
 * Loaded AFTER bfs-theme.css and style.css. Overrides only; never edit the theme.
 *
 * FILE CONTRACT (see bfs-infrastructure/docs/plans/2026-07-02-warm-bfs-portal-rollout.md):
 * two sections. The GENERIC section is byte-identical across every portal running
 * Warm BFS — fix bugs there in ALL portals in the same session, never fork it.
 * Portal-specific overrides live only in the STRAGGLERS section below it.
 */

/* ==== GENERIC WARM BFS (identical across all portals — do not fork) ==== */

/* ---- Design tokens: LIGHT ---- */
body.warm-bfs {
  --wb-page: #eef6fb;                                    /* cooler than theme #e8f4fc */
  --wb-border: rgba(var(--bfs-blue-rgb), 0.12);         /* hairline, replaces hard #93c5fd */
  --wb-shadow: 0 2px 10px rgba(1, 112, 185, 0.06),
               0 8px 24px rgba(15, 42, 61, 0.05);
  --wb-header-tint: rgba(var(--bfs-blue-rgb), 0.06);
  --wb-row-tint: rgba(var(--bfs-blue-rgb), 0.03);
  background: var(--wb-page);
}

/* ---- Design tokens: DARK (html carries data-theme / .dark-mode) ---- */
[data-theme="dark"] body.warm-bfs,
.dark-mode body.warm-bfs {
  --wb-page: var(--bg-page);                             /* keep theme's #0f172a */
  --wb-border: rgba(148, 163, 184, 0.16);
  --wb-shadow: 0 2px 10px rgba(0, 0, 0, 0.35),
               0 8px 24px rgba(0, 0, 0, 0.25);
  --wb-header-tint: rgba(148, 163, 184, 0.06);
  --wb-row-tint: rgba(148, 163, 184, 0.04);
}

/* ---- Cards: rounded, soft depth, hairline border, blue-tinted header ---- */
body.warm-bfs .card {
  border-radius: 20px;
  border: 1px solid var(--wb-border);
  box-shadow: var(--wb-shadow);
}

body.warm-bfs .card-header {
  background: var(--wb-header-tint);
  border-bottom: 1px solid var(--wb-border);
}

body.warm-bfs .card-title {
  color: var(--bfs-blue);
}

/* ---- Tables: hairline dividers, clean headers, roomier rows, subtle zebra ----
   Covers the theme's standard .table and the .data-table variant. */
body.warm-bfs .data-table th,
body.warm-bfs .table th {
  background: transparent;
  border-bottom: 1px solid var(--wb-border);
  color: var(--text-muted);
}

body.warm-bfs .data-table td,
body.warm-bfs .table td {
  padding: 0.85rem var(--space-md);
  border-bottom: 1px solid var(--wb-border);
}

/* Subtle zebra (wins over the theme's stronger .table-striped tint) */
body.warm-bfs .data-table tbody tr:nth-child(even),
body.warm-bfs .table tbody tr:nth-child(even) {
  background: var(--wb-row-tint);
}

/* Hover wins over zebra */
body.warm-bfs .data-table tbody tr:hover,
body.warm-bfs .data-table tbody tr:nth-child(even):hover,
body.warm-bfs .table tbody tr:hover,
body.warm-bfs .table tbody tr:nth-child(even):hover {
  background: var(--bg-hover);
}

/* Theme table wrapper carries its own hard border → hairline + rounder */
body.warm-bfs .table-container {
  border: 1px solid var(--wb-border);
  border-radius: 16px;
}

/* ---- Badges as pills ---- */
body.warm-bfs .badge {
  border-radius: var(--radius-full);
  padding: 0.2rem 0.65rem;
  font-weight: 600;
}

/* ---- Buttons: rounder, primary gets a soft blue lift ---- */
body.warm-bfs .btn {
  border-radius: 10px;
}

body.warm-bfs .btn-primary {
  box-shadow: 0 2px 8px rgba(var(--bfs-blue-rgb), 0.25);
  transition: box-shadow 150ms ease, transform 150ms ease;
}

body.warm-bfs .btn-primary:hover {
  box-shadow: 0 4px 12px rgba(var(--bfs-blue-rgb), 0.32);
  transform: translateY(-1px);
}

/* Shrink the tinted card-header band — the blue tint made its 1rem padding
   read as a tall bar. Tighten vertical padding; keep horizontal. */
body.warm-bfs .card-header {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

/* Light/dark parity for the page hero. bfs-theme.css gives .page-header a
   dark-mode-only panel (gradient bg + border + 1.5rem padding) that light mode
   never gets, so the hero is taller in dark. Neutralize it (scoped) so dark
   matches the panel-free light layout. */
[data-theme="dark"] body.warm-bfs .page-header,
.dark-mode body.warm-bfs .page-header {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: var(--space-md);
}

/* ==== BFS-PORTAL STRAGGLERS (portal-specific bespoke classes) ==== */

/* style.css restyles .card-header as an underlined heading INSIDE the card
   (margin/padding-bottom + border-bottom, no background band). The generic
   tint + band padding would paint an awkward inset rectangle — neutralize
   them, keep the hairline underline + blue title. */
body.warm-bfs .card-header {
  background: transparent;
  padding-top: 0;
  padding-bottom: var(--space-sm);
}

/* Admin dashboard stat strip (existing count UI — restyled in place) */
body.warm-bfs .stats-grid {
  border-color: var(--wb-border);
  border-radius: 16px;
  box-shadow: var(--wb-shadow);
}

body.warm-bfs .stat-card {
  border-right-color: var(--wb-border);
}

/* Admin section nav panel */
body.warm-bfs .admin-nav {
  border-color: var(--wb-border);
  border-radius: 16px;
  box-shadow: var(--wb-shadow);
}

/* Landing page side widgets (inline-styled bg-card panels w/ hard borders) */
body.warm-bfs .tickets-widget {
  border-color: var(--wb-border);
  border-radius: 16px;
  box-shadow: var(--wb-shadow);
}

body.warm-bfs .recent-item {
  border-color: var(--wb-border);
}

/* Intentionally left alone: the landing .portal-item cards (inline styles
   already give them a premium multi-layer shadow + accent border — a
   body.warm-bfs override would out-specify and downgrade them), colored
   callouts (.announcement, .card-highlight, .danger-zone), and the
   standalone non-base pages (auth/login, dev_login, orientation/pdf). */
