/* Design system tokens for the standalone hub.
   Replaces Claude's --cds-* and --color-* vars with a clean, modern
   dark-first look. Override anything here to rebrand. */

:root {
  /* Spacing (8pt scale) */
  --cds-gap-xs: 4px;
  --cds-gap-sm: 8px;
  --cds-gap-md: 16px;
  --cds-gap-lg: 24px;
  --cds-gap-xl: 40px;

  /* Padding */
  --cds-pad-xs: 4px;
  --cds-pad-sm: 8px;
  --cds-pad-md: 16px;
  --cds-pad-lg: 24px;

  /* Type */
  --font-anthropic-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, "Helvetica Neue", sans-serif;
  --font-anthropic-serif: ui-serif, Georgia, "Times New Roman", serif;
  --cds-font-size-caption: 12px;
  --cds-font-size-body: 14px;
  --cds-font-size-heading: 18px;
  --cds-font-size-title: 28px;
  --cds-font-weight-medium: 550;

  /* Shape */
  --cds-radius: 12px;
  --cds-border: 1px solid var(--color-border-line);
  --cds-shadow-popover: 0 8px 24px rgba(0,0,0,.35), 0 2px 4px rgba(0,0,0,.2);
  --cds-surface-popover: #1b2234;
  --cds-text-secondary: #99a1b3;

  /* Dark theme palette */
  --color-bg: #0e1220;
  --color-panel: #171c2e;
  --color-fg: #e9ecf3;
  --color-fg-muted: #99a1b3;
  --color-border-line: #242a40;
  --color-ok: #4ade80;
  --color-bad: #f87171;
  --color-warn: #fbbf24;

  /* Accent */
  --hub-accent: #7c8dff;
  --hub-accent-soft: rgba(124,141,255,.15);
  --hub-raise: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 20px rgba(0,0,0,.25);

  --dot: #7c8dff;
  --sw: var(--hub-accent);
}

@media (prefers-color-scheme: light) {
  :root {
    --color-bg: #f7f8fb;
    --color-panel: #ffffff;
    --color-fg: #1a1d29;
    --color-fg-muted: #656b7d;
    --color-border-line: #e5e7ee;
    --cds-surface-popover: #ffffff;
    --cds-text-secondary: #656b7d;
    --cds-shadow-popover: 0 8px 24px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.04);
    --hub-raise: 0 1px 0 rgba(255,255,255,.6) inset, 0 4px 12px rgba(15,23,42,.06);
  }
}

/* Base — give the body + panels proper colors */
html, body {
  background: var(--color-bg);
  color: var(--color-fg);
  margin: 0;
  padding: 0;
  font-family: var(--font-anthropic-sans);
  font-size: var(--cds-font-size-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.hub {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 40px 64px;
}

.hub-title {
  font-size: var(--cds-font-size-title);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.hub-h2 {
  font-size: var(--cds-font-size-heading);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

.hub-lede {
  font-size: 15px;
  color: var(--color-fg);
  margin: 0 0 4px;
}
.hub-lede b { color: var(--hub-accent); font-weight: 600; }

.hub-note {
  font-size: var(--cds-font-size-caption);
  color: var(--color-fg-muted);
  line-height: 1.55;
  margin: 0;
}

/* Cards — the main surface */
.hub-card {
  background: var(--color-panel);
  border: 1px solid var(--color-border-line);
  border-radius: var(--cds-radius);
  padding: var(--cds-pad-lg);
  box-shadow: var(--hub-raise);
}

/* Tabs — clean pill row */
.hub-tabs {
  gap: 2px !important;
  padding: 4px;
  background: var(--color-panel);
  border: 1px solid var(--color-border-line);
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
}
.hub-tabs::-webkit-scrollbar { display: none; }

.hub-tab {
  border: 0;
  background: transparent;
  color: var(--color-fg-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.hub-tab:hover { color: var(--color-fg); background: rgba(255,255,255,.03); }
.hub-tab[aria-selected="true"] {
  color: var(--color-bg);
  background: var(--hub-accent);
}

/* Tables */
.hub-table { width: 100%; border-collapse: collapse; font-size: var(--cds-font-size-body); }
.hub-table th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-fg-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border-line);
}
.hub-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border-line);
}
.hub-table tbody tr:last-child td { border-bottom: 0; }
.hub-table tbody tr:hover td { background: rgba(124,141,255,.05); }
.hub-table th.num, .hub-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.hub-scroll { overflow-x: auto; }

/* Pills / chips */
.hub-pill {
  background: var(--hub-accent-soft);
  color: var(--hub-accent);
  border: 0 !important;
  font-weight: 500;
}

/* Form controls */
.hub-form input, .hub-form select, .hub-form textarea, input[type="text"], input[type="search"], select, textarea {
  background: var(--color-bg);
  color: var(--color-fg);
  border: 1px solid var(--color-border-line);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--hub-accent);
  box-shadow: 0 0 0 3px var(--hub-accent-soft);
}

button {
  background: var(--color-panel);
  color: var(--color-fg);
  border: 1px solid var(--color-border-line);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
button:hover { background: rgba(255,255,255,.04); }

/* "Watch in Parker" button (sits in the ad thumbnail card) */
.hub-btn,
a.hub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--hub-accent);
  color: var(--color-bg) !important;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none !important;
  border: 0;
  cursor: pointer;
  transition: transform .1s ease, filter .15s ease;
  white-space: nowrap;
}
.hub-btn:hover,
a.hub-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* External links row ("Open in Parker ↗") */
.hub-extlinks {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 12px 0 20px;
}
.hub-extlinks a {
  color: var(--hub-accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease;
}
.hub-extlinks a:hover { border-bottom-color: var(--hub-accent); }

/* Ad-detail links generally */
a { color: var(--hub-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Thumbnail card — make it less tall and position the Parker button at the bottom */
.hub-thumb {
  position: relative;
  aspect-ratio: 9/16;
  max-height: 480px;
  border-radius: var(--cds-radius);
  overflow: hidden;
  background: linear-gradient(135deg, #1f2d3d, #2d1f3d);
}

/* Snapshot banner */
#hub-snapshot-banner {
  background: var(--color-panel) !important;
  color: var(--color-fg-muted) !important;
  border: 1px solid var(--color-border-line) !important;
  border-right: 0 !important;
  border-top: 0 !important;
}

/* Hide empty-state noise — if a table's tbody has no rows after load,
   render its wrapper card slightly less loud */
.hub-table tbody:empty::before {
  content: "No data yet — will populate on next snapshot refresh.";
  display: block;
  padding: 24px 14px;
  color: var(--color-fg-muted);
  font-size: 13px;
  font-style: italic;
}
