/*
 * theme.css — SmartStream. A broadcast control room: opens dark like a
 * production switcher, one signal-orange accent for actions, a separate
 * on-air red (--x-onair) used only for the LIVE tally.
 */

:root {
  color-scheme: dark;
  --canvas: #0d1015;
  --surface: #151a21;
  --surface-2: #1c222b;
  --border: #262d38;
  --border-strong: #3a4352;
  --ink: #e8ecf2;
  --muted: #9aa4b2;
  --accent: #ff6a3d;
  --accent-hover: #ff8259;
  --accent-ink: #160a05;
  --accent-text: #ff8a65;
  --accent-strong: #ffa285;
  --accent-soft: #2a1912;
  --accent-border: #5a2e1f;
  --success: #2fbf71;
  --success-ink: #04140b;
  --success-soft: #0f2a1c;
  --success-strong: #5fd896;
  --warning: #f0a92e;
  --warning-ink: #1a1203;
  --warning-soft: #2e2410;
  --warning-strong: #f5c062;
  --danger: #f04b55;
  --danger-ink: #1a0506;
  --danger-soft: #2e1316;
  --danger-strong: #ff8a90;
  --chart-1: #ff6a3d;
  --chart-2: #5fb3ff;
  --chart-3: #2fbf71;
  --chart-4: #f0a92e;
  --chart-5: #b48cff;
  --chart-6: #ff6fa8;

  --font-display: "Space Grotesk Variable", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter Variable", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Inter Variable", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display-weight: 600;
  --display-tracking: -0.025em;
  --eyebrow-tracking: 0.08em;

  --radius-btn: 0.5rem;
  --radius-card: 0.875rem;
  --radius-input: 0.5rem;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-raised: 0 16px 48px rgba(0, 0, 0, 0.45);
  --btn-weight: 600;
  --card-pad: 1.5rem;

  --x-onair: #ff3b47;
  --x-onair-soft: #3a1216;
  --x-grid: rgba(255, 255, 255, 0.025);
}

html[data-theme="light"] {
  color-scheme: light;
  --canvas: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --border: #dce0e6;
  --border-strong: #b4bcc8;
  --ink: #10141a;
  --muted: #5a6472;
  --accent: #c2401b;
  --accent-hover: #a83616;
  --accent-ink: #ffffff;
  --accent-text: #b23a17;
  --accent-strong: #9a3214;
  --accent-soft: #fde9e2;
  --accent-border: #f4b8a5;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #ddf3e6;
  --success-strong: #116a32;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #fbebd9;
  --warning-strong: #924306;
  --danger: #c42330;
  --danger-ink: #ffffff;
  --danger-soft: #fbe3e5;
  --danger-strong: #a81d29;
  --chart-1: #c2401b;
  --chart-2: #1f6fd1;
  --chart-3: #15803d;
  --chart-4: #b45309;
  --chart-5: #7a4fd6;
  --chart-6: #c2306f;

  --shadow-card: 0 1px 2px rgba(16, 20, 26, 0.06), 0 4px 16px rgba(16, 20, 26, 0.05);
  --shadow-raised: 0 16px 48px rgba(16, 20, 26, 0.18);

  --x-onair: #e0202e;
  --x-onair-soft: #fde2e4;
  --x-grid: rgba(0, 0, 0, 0.03);
}

/* app.css — SmartStream's own pieces: the control-room ground, the bar,
   the on-air tally, the monitor, the queue and the timeline. Tokens only. */

.studio-ground {
  background-color: var(--canvas);
  background-image:
    linear-gradient(var(--x-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--x-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  font-family: var(--font-body);
}

.font-display { font-family: var(--font-display); }

/* ---- Bar ---- */
.studio-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: var(--accent);
  color: var(--accent-ink);
}
.brand-mark-lg { width: 2.75rem; height: 2.75rem; border-radius: 0.75rem; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.is-active { background: var(--surface-2); color: var(--ink); }

/* ---- Tally (the one moving thing: the ON AIR light breathes) ---- */
.tally {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 1.5rem;
  padding: 0 0.625rem;
  border-radius: 999px;
  background: var(--x-onair-soft);
  color: var(--x-onair);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: var(--eyebrow-tracking);
  text-transform: uppercase;
}
.tally-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--x-onair);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--x-onair) 60%, transparent);
  animation: onair-pulse 1.6s ease-out infinite;
}
@keyframes onair-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--x-onair) 55%, transparent); }
  70% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--x-onair) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--x-onair) 0%, transparent); }
}
html.reduced-motion .tally-dot { animation: none; }

.status-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--border-strong);
}
.status-dot.is-on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }

/* ---- Monitor (16:9 poster) ---- */
.monitor {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--radius-card);
}
.monitor > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.monitor::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.35));
  pointer-events: none;
}
.monitor-slate { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); }

.onair-card.is-live {
  border-color: color-mix(in srgb, var(--x-onair) 55%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--x-onair) 30%, transparent), var(--shadow-card);
}
.onair-bar { background: var(--x-onair); }

/* ---- Queue ---- */
.queue {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.queue > li + li { border-top: 1px solid var(--border); }
.queue-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  color: var(--ink);
  text-decoration: none;
}
.queue-row:hover { background: var(--surface-2); text-decoration: none; }
.queue-time { width: 5.5rem; flex-shrink: 0; }

/* ---- Setup lights ---- */
.setup-step {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  background: var(--surface-2);
}
.setup-light {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning-strong);
}
.setup-step.is-done .setup-light { background: var(--success-soft); color: var(--success-strong); }

/* ---- Video chip in the form ---- */
.video-chip {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface-2);
}
.video-chip-thumb {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 6rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--muted);
}
.video-chip-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Timeline ---- */
.timeline { position: relative; display: grid; gap: 1rem; }
.timeline-item { position: relative; display: flex; gap: 0.75rem; }
.timeline-dot {
  flex-shrink: 0;
  width: 0.625rem;
  height: 0.625rem;
  margin-top: 0.375rem;
  border-radius: 999px;
  background: var(--border-strong);
}
.tone-success .timeline-dot { background: var(--success); }
.tone-warning .timeline-dot { background: var(--warning); }
.tone-danger .timeline-dot { background: var(--danger); }

/* ---- Facts list ---- */
.facts { display: grid; gap: 0.75rem; font-size: 0.875rem; }
.facts > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 0.75rem; }
.facts dt { color: var(--muted); }
.facts dd { min-width: 0; }
