/* ==========================================================================
   Chroma Key Tuner — page-specific styles
   ==========================================================================

   Loaded AFTER product-theme.css. Everything here is a component the theme
   doesn't already provide (monitor overlays, source-row chips, key-color
   swatches, range sliders, toggle switches, a segmented control, the EQ
   grid) — built entirely on product-theme.css's tokens, never hardcoded
   hex, so a future token change here still tracks the canonical file.

   Layout comes from product-theme.css's "AV workbench" section
   (.workbench / .workbench-layout / .monitor / .control-rail /
   .control-section / .status-strip) — this file only adds what that
   pattern doesn't cover.
   ========================================================================== */

.visually-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
}

/* ── Stage column (monitor + sources) ── */

.stage-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

#demoCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
}
#demoCanvas.picking { cursor: crosshair; }

.stage-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px;
}

.stage-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.62);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 999px;
}

.fps {
  position: absolute;
  bottom: 8px;
  right: 10px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
}

/* ── Sources panel ── */

.sources-panel {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.src-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.src-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.src-label {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  width: 28px;
  flex-shrink: 0;
}

.src-name {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.upload-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
}
.upload-note strong { color: var(--accent-orange); font-weight: 700; }

.cta-signup {
  margin-left: auto;
  flex-shrink: 0;
  text-decoration: none;
  text-align: center;
  max-width: 220px;
}

/* ── Small chip buttons (source select, swatches, autotune) ──
   A compact variant of .btn for dense rows of choices — same pill shape
   and font as the theme's buttons, smaller footprint. Neutral by default;
   .active marks the current selection with the theme's accent-blue, the
   same "structure/selection" role blue carries in the AV workbench rail. */

.btn-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 6px 13px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  transition: border-color 0.14s, color 0.14s;
}
.btn-chip:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.btn-chip.active {
  border-color: var(--accent-blue);
  color: var(--text-primary);
  background: rgba(64, 139, 195, 0.22);
}
.btn-chip input[type="file"] { display: none; }

/* ── Control rail header ── */

.rail-title {
  margin: 0 0 4px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.rail-title .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-orange);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 11px;
}

/* ── Key color swatches ── */

.swatches {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

.swatch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
}

.swatch-btn .sw {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.sw-green { background: #00b140; }
.sw-blue { background: #1c3fd6; }
.sw-init { background: #00ff00; } /* matches the default key color, #00FF00, before any change */

.swatch-btn input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.key-readout {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ── Sliders ── */

.ctrl { display: flex; flex-direction: column; gap: 4px; }

.ctrl-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.ctrl-head label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.ctrl-head .val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.help {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

input[type="range"] {
  width: 100%;
  margin: 2px 0;
  height: 20px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: var(--panel-inset);
  border: 1px solid var(--border);
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--accent-orange);
  border: 2px solid var(--text-on-accent);
  box-shadow: var(--shadow-sm);
}
input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--panel-inset);
  border: 1px solid var(--border);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-orange);
  border: 2px solid var(--text-on-accent);
  box-shadow: var(--shadow-sm);
}

/* ── Toggle switch (despill / EQ enable) ──
   The theme's .checkbox-item checkbox is a plain accent-colored tickbox;
   this control needs a compact pill toggle instead, so it's scoped under
   .switch rather than overriding the shared checkbox style. */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  cursor: pointer;
  margin: 0;
  background: var(--panel-inset);
  border: 1px solid var(--border);
  transition: background 0.16s, border-color 0.16s;
}
.switch input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-on-accent);
  transition: left 0.16s;
}
.switch input[type="checkbox"]:checked {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
}
.switch input[type="checkbox"]:checked::before { left: calc(100% - 14px); }

/* ── Segmented control (despill type) ── */

.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
}
.seg button.active {
  background: var(--accent-orange);
  color: var(--text-on-accent);
}

/* ── EQ grid ── */

.eq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

/* Disabled-look sub-section (despill mix / EQ sliders) until its toggle
   is on — dimmed and non-interactive rather than hidden, so the layout
   doesn't jump when it's enabled. */
.sub { opacity: 0.45; pointer-events: none; transition: opacity 0.15s; }
.sub.on { opacity: 1; pointer-events: auto; }

.tuner-status {
  font-size: 11px;
  color: var(--accent-blue-hover);
  min-height: 1.2em;
}

@media (max-width: 640px) {
  .sources-panel { flex-direction: column; align-items: stretch; }
  .cta-signup { margin-left: 0; align-self: stretch; max-width: none; }
}
