/* StageSync app chrome theme — futuristic glass UI. Shared by every screen.
   Tokens only + base components. Screen-specific styles go in their own CSS file. */
@font-face { font-family: 'Orbitron'; src: url('/assets/fonts/Orbitron.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/Inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --accent: #00e5ff;
  --accent-rgb: 0, 229, 255;
  --accent-2: #7c4dff;
  --danger: #ff3d71;
  --warn: #ffb300;
  --ok: #00e676;
  --live: #ff1744;
  --preview: #00e676;
  --radius: 12px;
  --radius-sm: 8px;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Orbitron', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --shadow: 0 10px 40px rgba(0, 0, 0, .35);
  --glow: 0 0 0 1px rgba(var(--accent-rgb), .35), 0 0 18px rgba(var(--accent-rgb), .25);
  --t: 160ms cubic-bezier(.2, .8, .2, 1);
}

:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070a12;
  --bg-2: #0c1120;
  --panel: rgba(18, 25, 44, .72);
  --panel-solid: #111829;
  --panel-2: rgba(28, 38, 64, .65);
  --border: rgba(140, 170, 255, .14);
  --text: #e6ecff;
  --muted: #8a96b8;
  --grid: rgba(var(--accent-rgb), .06);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2fb;
  --bg-2: #e3e9f7;
  --panel: rgba(255, 255, 255, .78);
  --panel-solid: #ffffff;
  --panel-2: rgba(240, 244, 252, .9);
  --border: rgba(30, 50, 110, .14);
  --text: #121a33;
  --muted: #5a6788;
  --grid: rgba(var(--accent-rgb), .10);
  --shadow: 0 10px 30px rgba(20, 30, 70, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    radial-gradient(1200px 600px at 80% -10%, rgba(var(--accent-rgb), .10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(124, 77, 255, .10), transparent 60%);
  background-size: 40px 40px, 40px 40px, auto, auto;
  color: var(--text);
  font: 14px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: .04em; }
::selection { background: rgba(var(--accent-rgb), .35); }

/* Panels */
.glass { background: var(--panel); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-title { font: 600 11px/1 var(--font-display); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); padding: 10px 12px; display: flex; align-items: center; gap: 8px; }

/* Buttons */
.btn { appearance: none; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); padding: 8px 14px; border-radius: var(--radius-sm); font: 500 13px var(--font-ui); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: var(--t); white-space: nowrap; }
.btn:hover { border-color: rgba(var(--accent-rgb), .6); box-shadow: var(--glow); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #050811; border: 0; font-weight: 700; }
.btn.danger { background: var(--danger); color: #fff; border: 0; }
.btn.live { background: var(--live); color: #fff; border: 0; font-family: var(--font-display); letter-spacing: .08em; }
.btn.ghost { background: transparent; }
.btn.icon { padding: 7px 9px; }
.btn.on { border-color: var(--accent); color: var(--accent); box-shadow: var(--glow); }
.btn.big { padding: 14px 22px; font-size: 16px; }

/* Inputs */
input, select, textarea { background: var(--bg-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 10px; font: inherit; outline: none; transition: var(--t); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--glow); }
input[type=color] { padding: 2px; width: 34px; height: 30px; }
input[type=range] { accent-color: var(--accent); padding: 0; }
label.field { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }

/* Badges / tally lights */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; font: 700 10px/1.2 var(--font-display); letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--border); }
.badge.live { background: var(--live); color: #fff; border-color: transparent; box-shadow: 0 0 14px rgba(255, 23, 68, .6); }
.badge.preview { background: var(--preview); color: #021; border-color: transparent; }
.badge.temp { background: var(--warn); color: #221500; border-color: transparent; animation: pulse 1.4s infinite; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.bad { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
@keyframes pulse { 50% { opacity: .55; } }

/* Theme switcher */
.theme-switcher { display: flex; align-items: center; gap: 8px; }
.accent-pick { position: relative; }
.accent-btn { padding: 6px 9px; gap: 6px; }
.accent-btn .accent-name { font-size: 12px; }
.accent-caret { font-size: 10px; color: var(--muted); }
.accent-sw { width: 14px; height: 14px; border-radius: 50%; background: var(--c, var(--accent)); box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 0 8px var(--c, var(--accent)); flex: none; }
.accent-sw-custom { background: conic-gradient(#ff3d00, #ffb300, #39ff14, #00e5ff, #2979ff, #ff2bd6, #ff3d00); box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.accent-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 2500; min-width: 150px; padding: 4px; display: flex; flex-direction: column; background: var(--panel-solid); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.accent-opt { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--text); padding: 6px 8px; border-radius: 6px; cursor: pointer; font: 13px var(--font-ui); text-align: left; }
.accent-opt:hover, .accent-opt:focus-visible { background: rgba(var(--accent-rgb), .14); outline: none; }
.accent-opt[aria-selected="true"] { color: var(--accent); font-weight: 600; }
.accent-color { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; right: 0; bottom: 0; padding: 0; border: 0; }
@media (max-width: 640px) { .accent-btn .accent-name { display: none; } }

/* Toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 9999; }
.toast { background: var(--panel-solid); border: 1px solid var(--border); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow); max-width: 360px; transition: var(--t); }
.toast-error { border-left-color: var(--danger); }
.toast-ok { border-left-color: var(--ok); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(3, 6, 14, .6); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 1000; padding: 16px; }
.modal { width: min(720px, 100%); max-height: 90vh; overflow: auto; padding: 20px; }
.modal h2 { margin: 0 0 12px; font-size: 18px; }

/* Utility */
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.scroll { overflow: auto; }
.scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), .25); border-radius: 8px; }
kbd { font: 11px var(--font-mono); padding: 2px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--bg-2); }
