/* Director control panel */

:root {
  --bg: #0a0a0a;
  --panel: #141414;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f5f5;
  --muted: rgba(255, 255, 255, 0.5);
  --accent: #fe2c55;
  --cyan: #25f4ee;
  --ok: #3ddc84;
  --warn: #ffb020;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.director-app {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
}

/* ── Header ── */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  gap: 12px;
}

.app-header h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #444;
}

.status-pill .dot.ok { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.status-pill .dot.warn { background: var(--warn); }
.status-pill .dot.live { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* ── Main grid ── */

.app-main {
  display: grid;
  grid-template-columns: 1fr 380px;
  min-height: 0;
}

.vdo-pane {
  position: relative;
  background: #000;
  min-height: 0;
}

.vdo-pane iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.side-pane {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--panel);
  min-height: 0;
}

/* ── Tabs ── */

.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tab-panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
}

.tab-body {
  padding: 14px;
  flex: 1;
  overflow-y: auto;
}

/* ── Links tab ── */

.link-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.link-card h3 {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.link-card p {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.link-url {
  display: block;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--cyan);
  word-break: break-all;
  margin-bottom: 8px;
  line-height: 1.45;
}

.demo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.demo-grid .btn {
  font-size: 11px;
  padding: 6px 10px;
}

.btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover { background: rgba(255, 255, 255, 0.1); }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.1); }

/* ── Settings form ── */

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 13px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.35;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 10px;
}

.checkbox-row input { width: auto; }

.save-bar {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.save-msg {
  font-size: 11px;
  color: var(--ok);
  opacity: 0;
  transition: opacity 0.3s;
}

.save-msg.show { opacity: 1; }

/* ── Chat tab ── */

.chat-tab-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-tab-wrap .panel-header {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chat-tab-wrap .chat-feed {
  flex: 1;
  overflow: hidden;
}

.chat-tab-wrap .status-bar {
  flex-shrink: 0;
}

/* ── Status tab ── */

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.status-item span:last-child {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.firewall-warn {
  background: rgba(255, 176, 32, 0.12);
  border: 1px solid rgba(255, 176, 32, 0.35);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 12px;
  color: #ffd080;
}

/* ── Simple SSN setup ── */

.setup-intro {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.setup-form {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.setup-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setup-step {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  align-items: flex-start;
}

.setup-step.done {
  border-color: rgba(61, 220, 132, 0.35);
  background: rgba(61, 220, 132, 0.06);
}

.setup-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.setup-step.done .setup-step-num {
  background: var(--ok);
}

.setup-step-body {
  flex: 1;
  min-width: 0;
}

.setup-step-body h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.setup-step-body p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 8px;
}

details.advanced {
  margin-top: 12px;
  font-size: 12px;
}

details.advanced summary {
  cursor: pointer;
  color: var(--muted);
  padding: 8px 0;
  user-select: none;
}

details.advanced .tab-body {
  padding: 12px 0 0;
}

.hidden { display: none !important; }

@media (max-width: 960px) {
  .app-main {
    grid-template-columns: 1fr;
    grid-template-rows: 55vh 1fr;
  }
  .side-pane { border-left: 0; border-top: 1px solid var(--border); }
}
