﻿:root {
  --bg: #071620;
  --panel: #0d2431;
  --panel-soft: #122f40;
  --text: #e8f1f4;
  --muted: #9db4be;
  --accent: #ff7b36;
  --accent-2: #2fb7a5;
  --border: #285061;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: radial-gradient(1200px 500px at 10% -10%, #19455f 0%, transparent 45%),
              radial-gradient(1000px 500px at 90% 0%, #1b513f 0%, transparent 40%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.bg-shape {
  position: fixed;
  filter: blur(80px);
  opacity: 0.2;
  z-index: 0;
}
.bg-1 { width: 300px; height: 300px; background: #ff7b36; top: 10%; left: -80px; }
.bg-2 { width: 280px; height: 280px; background: #2fb7a5; bottom: -60px; right: -70px; }

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.hero h1 {
  margin: 6px 0;
  font-size: clamp(2rem, 4vw, 3rem);
}
.eyebrow {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
}
.subtitle { margin: 0; color: var(--muted); }

.grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: linear-gradient(160deg, var(--panel), var(--panel-soft));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}
.card h2 { margin-top: 0; }
.wide { grid-column: 1 / -1; }

.field-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.field-label {
  display: block;
  margin: 8px 0 6px;
  color: var(--muted);
}

input, select {
  width: 100%;
  background: #0a1d27;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}

input:focus, select:focus { border-color: var(--accent-2); }

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  margin-top: 10px;
}
.btn.primary { background: var(--accent); color: #122; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.params-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.params-grid label {
  font-size: 0.9rem;
  color: var(--muted);
}
.params-grid input,
.params-grid select { margin-top: 6px; }

.progress-wrap {
  width: 100%;
  background: #061017;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  height: 14px;
}
.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ffd35f);
  transition: width .25s ease;
}

.table-wrap { overflow: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}
th, td {
  padding: 8px;
  border-bottom: 1px solid #23485b;
  text-align: left;
  font-size: 0.9rem;
}
th { color: #b6ced8; }

.mono {
  font-family: "Consolas", "Courier New", monospace;
  background: #07141d;
  border: 1px solid #214255;
  border-radius: 10px;
  padding: 10px;
  white-space: pre-wrap;
}
.log {
  min-height: 80px;
  max-height: 220px;
  overflow: auto;
}

.download-wrap a {
  color: #8ef5d4;
  font-weight: 700;
}

.transcript-hint {
  margin: 0 0 10px 0;
}

.transcript-info {
  margin-top: 10px;
  display: none;
}

.transcript-list {
  margin-top: 10px;
  display: none;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #07141d;
}

.transcript-list .ts-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #23485b;
  font-size: 0.9rem;
  align-items: start;
}

.transcript-list .ts-row:last-child {
  border-bottom: none;
}

.transcript-list .ts-time {
  color: #8ef5d4;
  font-family: "Consolas", "Courier New", monospace;
  white-space: nowrap;
}

.transcript-list .ts-text {
  color: var(--text);
  line-height: 1.4;
}

.transcript-list .ts-empty {
  padding: 16px;
  color: var(--muted);
  font-style: italic;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  align-self: end;
  padding-bottom: 10px;
}

.checkbox-label input {
  width: auto;
  margin: 0;
}

.cue-editor {
  margin-top: 10px;
  max-height: 360px;
  overflow: auto;
}

.cue-row {
  display: grid;
  grid-template-columns: 90px 90px 1fr 36px;
  gap: 8px;
  align-items: start;
  margin-bottom: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #07141d;
}

.cue-time {
  font-family: "Consolas", monospace;
  font-size: 0.85rem;
  padding: 6px;
  background: #0a1d27;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 100%;
}

.cue-text {
  font-size: 0.9rem;
  padding: 6px;
  background: #0a1d27;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 100%;
  min-height: 36px;
  resize: vertical;
  font-family: inherit;
}

.cue-delete {
  background: #7a1f1f;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.cue-delete:hover {
  background: #a02525;
}

.search-box {
  flex: 1;
  margin-right: 8px;
}

.search-results {
  display: none;
  margin-bottom: 10px;
  max-height: 200px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #07141d;
}

.search-result-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px solid #23485b;
  font-size: 0.85rem;
  align-items: start;
}

.search-result-row:last-child {
  border-bottom: none;
}

.search-result-row .ts-time {
  font-family: "Consolas", monospace;
  color: #8ef5d4;
}

.search-result-row .ts-snippet {
  color: var(--text);
  line-height: 1.4;
}

.tag-pill {
  display: inline-block;
  background: #1a4a55;
  color: #8ef5d4;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  margin: 1px;
  white-space: nowrap;
}

.scene-label {
  font-weight: 700;
  color: var(--text);
}

.scene-search-row {
  margin-bottom: 10px;
}

.quick-file-hidden {
  display: none;
}

.quick-progress {
  margin-top: 12px;
  display: none;
}

.form-select-inline {
  background: #0a1d27;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  margin-left: 4px;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  background: rgba(255, 255, 255, 0.02);
}

.drop-zone.active {
  border-color: var(--accent);
  background: rgba(255, 123, 54, 0.08);
  transform: scale(1.01);
}

.drop-zone-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.drop-zone-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.drop-zone-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 6px;
}

.preset-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.preset-row label {
  font-size: 0.9rem;
  color: var(--muted);
}

#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #1a3a4a;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  font-size: 0.9rem;
  pointer-events: auto;
  animation: toastIn 0.2s ease;
  max-width: 360px;
}

.toast.success {
  background: #1a4a2a;
  border-color: #2a7a3a;
}

.toast.error {
  background: #5a1a1a;
  border-color: #a02a2a;
  color: #fff;
}

.toast.warn {
  background: #5a4a1a;
  border-color: #a08a2a;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.scene-summary {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .params-grid { grid-template-columns: 1fr; }
}
