/* ── Navigation ─────────────────────────────────────────────────────────────── */

.nav {
  background: #0000aa;
  border-bottom: 4px solid #ffffff;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 54px;
}

.nav-logo {
  color: #ffff00;
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
}

.nav-spacer { flex: 1; }

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 9px;
  padding: 5px 10px;
  border: 2px solid transparent;
  background: transparent;
  display: inline-block;
  line-height: 1.6;
}

.nav-link.active {
  color: #ffff00;
  border-color: #ffff00;
  background: #000066;
}

/* ── Page shell ─────────────────────────────────────────────────────────────── */

.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  color: #ffffff;
}

.editor-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  color: #ffffff;
  font-size: 10px;
  line-height: 2.2;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ff0000;
  padding: 12px 16px;
  margin-bottom: 1.5rem;
  border: 4px solid #ffffff;
}

.page-title {
  font-size: 14px;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.btn-red {
  background: #ff0000;
  color: #ffffff;
  border: 2px solid #ffffff;
  padding: 8px 14px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.6;
}

.btn-primary {
  background: #ff0000;
  color: #ffffff;
  border: 2px solid #ffffff;
  padding: 7px 14px;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.6;
}

.btn-primary:disabled { opacity: 0.4; cursor: default; }

.btn-add {
  background: transparent;
  color: #00ffff;
  border: 2px solid #00ffff;
  padding: 5px 10px;
  font-size: 8px;
  cursor: pointer;
  line-height: 1.6;
}

.btn-ghost {
  background: transparent;
  color: #888888;
  border: 2px solid #555555;
  padding: 8px 12px;
  font-size: 9px;
  cursor: pointer;
  line-height: 1.6;
}

.btn-ghost-sm {
  background: transparent;
  border: none;
  color: #888888;
  font-size: 8px;
  cursor: pointer;
  padding: 4px 6px;
}

.btn-pick {
  background: #000000;
  color: #ffffff;
  border: 2px solid #444444;
  padding: 5px 10px;
  font-size: 8px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.6;
}

.btn-icon {
  background: transparent;
  border: none;
  color: #888888;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
}

.btn-delete {
  background: transparent;
  border: none;
  color: #666666;
  cursor: pointer;
  font-size: 10px;
  padding: 2px 6px;
  line-height: 1;
}

.btn-arrow {
  background: #000000;
  border: 2px solid #444444;
  color: #888888;
  cursor: pointer;
  font-size: 8px;
  padding: 3px 6px;
  line-height: 1.4;
}

.btn-change-type {
  flex: 1;
  background: #000000;
  border: 2px solid #333333;
  color: #aaaaaa;
  cursor: pointer;
  font-size: 8px;
  padding: 4px 10px;
  text-align: left;
  line-height: 1.4;
}

.btn-change-type:hover { border-color: #00ffff; color: #ffffff; }

.btn-arrow:disabled { opacity: 0.3; cursor: default; }

.btn-confirm-yes {
  background: #ff0000;
  color: #ffffff;
  border: none;
  padding: 3px 8px;
  font-size: 8px;
  cursor: pointer;
}

.btn-confirm-no {
  background: #000000;
  color: #888888;
  border: 2px solid #444444;
  padding: 3px 8px;
  font-size: 8px;
  cursor: pointer;
}

.export-link {
  color: #888888;
  font-size: 8px;
  text-decoration: none;
  white-space: nowrap;
}

/* ── Form controls ──────────────────────────────────────────────────────────── */

.field-input {
  background: #000000;
  border: 2px solid #444444;
  color: #ffffff;
  padding: 8px 10px;
  font-size: 8px;
  outline: none;
  box-sizing: border-box;
  line-height: 2;
}

.field-input.full { width: 100%; }
.field-input.resize-v { resize: vertical; line-height: 1.6; }
.field-input.mono { font-family: 'Courier New', monospace; font-size: 13px; }

.field-select {
  background: #000000;
  border: 2px solid #444444;
  color: #ffffff;
  padding: 6px 8px;
  font-size: 8px;
  line-height: 1.6;
}

.modal-input {
  width: 100%;
  background: #000000;
  border: 2px solid #ffffff;
  color: #ffffff;
  padding: 10px 12px;
  font-size: 10px;
  outline: none;
  box-sizing: border-box;
  line-height: 2;
}

.title-input {
  flex: 1;
  min-width: 180px;
  background: transparent;
  border: none;
  border-bottom: 3px solid #ffffff;
  color: #ffff00;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 0;
  outline: none;
  line-height: 1.6;
}

/* ── Overlay / Modal ────────────────────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #000000;
  border: 4px solid #ffff00;
  padding: 1.5rem;
  width: 660px;
  max-width: 95vw;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-sm {
  background: #000000;
  border: 4px solid #ffff00;
  padding: 1.75rem;
  width: 460px;
  max-width: 95vw;
}

.modal-wide { width: 740px; }
.modal-xl   { width: 960px; }

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-title {
  color: #ffff00;
  font-size: 10px;
  font-weight: 700;
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

/* ── Videos table ───────────────────────────────────────────────────────────── */

.data-table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid #555555;
}

.data-table thead tr { background: #0000aa; }

.data-table tr.tr-odd  { background: #0a0a12; }
.data-table tr.tr-even { background: #000000; }

.th {
  text-align: left;
  padding: 10px 12px;
  font-size: 9px;
  color: #ffffff;
  letter-spacing: 0.1em;
  border-bottom: 2px solid #ffffff;
  font-weight: 700;
}

.td {
  padding: 10px 12px;
  border-bottom: 1px solid #222222;
  font-size: 9px;
  vertical-align: middle;
  line-height: 2;
}

.td-id    { color: #888888; font-size: 9px; }
.td-count { color: #ffff00; }

.td a             { color: #ffffff; text-decoration: none; }
.td a.action      { color: #00ffff; font-size: 8px; }
.td a.action-muted { color: #888888; font-size: 8px; }

.td-course {
  margin-left: 10px;
  font-size: 8px;
  color: #888888;
}

.status-badge {
  font-size: 8px;
  font-weight: 700;
  padding: 2px 6px;
}

.status-complete { color: #000000; background: #00ff00; }
.status-scripted { color: #000000; background: #ffff00; }
.status-draft    { color: #888888; }

/* ── Editor header ──────────────────────────────────────────────────────────── */

.editor-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 2px solid #444444;
  padding-bottom: 1rem;
}

.back-link {
  color: #00ffff;
  text-decoration: none;
  font-size: 8px;
  white-space: nowrap;
}

/* ── Sections ───────────────────────────────────────────────────────────────── */

.section {
  background: #000000;
  border: 2px solid #444444;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  margin: 0;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffff00;
}

.sub-label {
  font-size: 8px;
  font-weight: 700;
  color: #00ffff;
  text-transform: uppercase;
}

.muted {
  color: #777777;
  font-size: 8px;
  margin: 0;
  line-height: 2;
}

.error-text { color: #ff0000; font-size: 8px; }

.divider {
  border: none;
  border-top: 2px solid #444444;
  margin: 12px 0;
}

/* ── Slides two-pane layout ──────────────────────────────────────────────────── */

.slides-pane {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

/* Filmstrip: sticky vertical timeline of slide thumbnails */
.slides-filmstrip {
  width: 214px;
  min-width: 214px;
  flex-shrink: 0;
  position: sticky;
  top: 58px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  border-right: 2px solid #333333;
}

.strip-item {
  cursor: pointer;
  border: 2px solid transparent;
  border-bottom: 2px solid #1a1a1a;
  padding: 4px;
  background: #000000;
  user-select: none;
}

.strip-item:hover { background: #0a0a10; }

.strip-item--selected {
  background: #08080f;
  border-color: #ffff00;
}

.strip-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 2px 1px;
  line-height: 1.4;
}

.strip-num {
  font-size: 8px;
  color: #666666;
  min-width: 16px;
  text-align: right;
  flex-shrink: 0;
}

.strip-id {
  font-size: 8px;
  color: #ffff00;
  font-weight: 700;
  flex-shrink: 0;
}

.strip-type {
  font-size: 8px;
  color: #666666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* Delete button — hidden until the strip item is hovered */
.strip-delete {
  display: none;
  background: transparent;
  border: none;
  color: #555555;
  font-size: 8px;
  padding: 0 2px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}
.strip-item:hover .strip-delete { display: block; }
.strip-delete:hover { color: #ff0000; }

.strip-confirm {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.strip-confirm-yes {
  font-size: 8px; padding: 1px 4px;
  background: #ff0000; color: #000; border: none; cursor: pointer;
}
.strip-confirm-no {
  font-size: 8px; padding: 1px 4px;
  background: transparent; color: #888; border: 1px solid #555; cursor: pointer;
}

.strip-add {
  padding: 8px 4px;
  display: flex;
  justify-content: center;
  border-top: 2px solid #333333;
}

/* Editor panel: shows fields for the selected slide */
.slides-editor {
  flex: 1;
  min-width: 0;
  padding: 0 0 0 14px;
}

.slide-editor-panel {
  padding-top: 4px;
}

.slide-editor-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 2px solid #333333;
}

.slide-editor-empty {
  padding: 24px 0;
  color: #666666;
  font-size: 9px;
  line-height: 2;
}

/* Player embedded at top of editor panel */
.slide-editor-player-host {
  margin-bottom: 14px;
  border: 2px solid #222222;
  background: #0a0a0a;
}

.slide-editor-player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-bottom: 2px solid #1a1a1a;
}

/* Player fills the full editor column width */
.slide-editor-player-host .player-preview-host--landscape {
  width: 100%;
  margin: 0;
}

.slide-editor-player-host .player-preview-host--portrait {
  width: 45%;
  margin: 0 auto;
}

/* ── Slide labels shared across old and new ──────────────────────────────────── */

.slide-num {
  font-size: 8px;
  color: #666666;
  min-width: 20px;
  text-align: right;
  font-weight: 700;
}

.slide-badge {
  font-size: 8px;
  background: #0000cc;
  color: #ffffff;
  padding: 3px 7px;
  white-space: nowrap;
}

.saving-dot { font-size: 8px; color: #ffff00; white-space: nowrap; }
.saved-dot  { font-size: 8px; color: #00ff00; white-space: nowrap; }
.save-error-btn {
  font-size: 8px; color: #000; background: #ff0000;
  border: none; padding: 2px 8px; cursor: pointer; white-space: nowrap;
}
.save-error-btn:hover { background: #ff4444; }

.confirm-row  { display: flex; align-items: center; gap: 6px; }
.confirm-text { font-size: 8px; color: #ff0000; }

/* ── Field rows ──────────────────────────────────────────────────────────────── */

.field-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.field-label {
  color: #00ffff;
  font-size: 8px;
  font-weight: 700;
  min-width: 90px;
  padding-top: 10px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.field-label.inline { padding-top: 0; width: auto; }

/* ── Narration segments ──────────────────────────────────────────────────────── */

.segment-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0a0a0a;
  border: 2px solid #444444;
  padding: 8px 10px;
  margin-bottom: 4px;
}

.segment-thumb {
  width: 88px;
  height: 54px;
  object-fit: cover;
  flex-shrink: 0;
}

.segment-name {
  font-size: 8px;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 2;
}

/* ── Template picker ─────────────────────────────────────────────────────────── */

.template-group {
  margin-bottom: 18px;
}

.template-group:last-child { margin-bottom: 0; }

.template-group-label {
  font-size: 8px;
  font-weight: 700;
  color: #00ffff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 0 8px 2px;
  border-bottom: 2px solid #333333;
  margin-bottom: 8px;
}

/* ── Template picker preview bar ─────────────────────────────────────────── */

.tmpl-preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 12px;
  border-bottom: 2px solid #222222;
  margin-bottom: 12px;
}

.tmpl-preview-label {
  font-size: 8px;
  font-weight: 700;
  color: #00ffff;
  text-transform: uppercase;
  letter-spacing: .1em;
  white-space: nowrap;
}

.tmpl-preview-input {
  flex: 1;
  font-size: 11px;
}

.modal-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

/* ── Template grid ───────────────────────────────────────────────────────── */

.template-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 4px;
  align-items: start;
}

.template-grid--square {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.template-grid--fullscreen {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.template-card {
  background: #000000;
  border: 2px solid #444444;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.template-card:hover { border-color: #00ffff; }

/* Thumbnail wrapper — hides the vendor's external header label so only slide surface shows */
.tmpl-thumbnail {
  width: 100%;
  display: block;
}

.tmpl-thumbnail .glitch-slide-thumbnail__header { display: none; }

/* Force correct aspect ratios on the slide surface within the picker */
.tmpl-thumbnail--square .glitch-slide-thumbnail__surface     { aspect-ratio: 1 / 1; }
.tmpl-thumbnail--fullscreen .glitch-slide-thumbnail__surface { aspect-ratio: 16 / 9; }

.tmpl-label  { font-size: 8px; font-weight: 700; color: #ffffff; padding: 5px 8px 2px; line-height: 1.8; }
.tmpl-desc   { font-size: 8px; color: #aaaaaa;   padding: 0 8px 6px; line-height: 1.8; }

/* ── Asset picker ────────────────────────────────────────────────────────────── */

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
  overflow-y: auto;
  margin-top: 4px;
  flex: 1;
}

.asset-card {
  background: #0a0a0a;
  border: 2px solid #444444;
  padding: 4px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.asset-card.selected { outline: 3px solid #00ff00; }

.asset-thumb {
  width: 100%;
  height: 66px;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
}

.asset-name { font-size: 8px; color: #aaaaaa; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-meta { font-size: 8px; color: #777777; margin-top: 2px; }

.check-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #00ff00;
  color: #000000;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
}

/* ── Player host ─────────────────────────────────────────────────────────────── */

.player-shell {
  background: #111111;
  border: 2px solid #444444;
  overflow: hidden;
}

/* ── Auth indicator ──────────────────────────────────────────────────────────── */

.auth-indicator {
  position: relative;
  cursor: pointer;
  padding: 4px 8px;
  border: 2px solid #333333;
  background: #000000;
  font-size: 8px;
  white-space: nowrap;
  user-select: none;
}

.auth-indicator:hover { border-color: #555555; }

.auth-indicator__name { color: #00ffff; }
.auth-indicator__guest { color: #888888; }

.auth-token-popup {
  position: absolute;
  top: 54px;
  right: 1rem;
  background: #111111;
  border: 2px solid #444444;
  padding: 10px;
  display: flex;
  gap: 6px;
  align-items: center;
  z-index: 200;
}

/* ── Proposals ───────────────────────────────────────────────────────────────── */

.proposals-section {
  padding-bottom: 8px;
}

.proposals-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.proposals-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.proposal-card {
  width: 160px;
  background: #0a0a0a;
  border: 2px solid #333333;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.proposal-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000000;
  border: 1px solid #222222;
}

.proposal-card__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.proposal-card__by {
  font-size: 8px;
  color: #aaaaaa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proposal-card__actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.proposal-form {
  background: #0a0a0a;
  border: 2px solid #333333;
  padding: 10px;
  margin-top: 8px;
}

.proposal-form__title {
  font-size: 8px;
  color: #aaaaaa;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
