/* transkript.informacija.hr — editorial UI, reuses ArchiveExplorer aesthetic */

:root {
  --bg: oklch(0.965 0.012 85);
  --bg-elev: oklch(0.985 0.008 85);
  --bg-sunken: oklch(0.93 0.014 85);
  --rule: oklch(0.82 0.014 85);
  --rule-soft: oklch(0.88 0.012 85);
  --ink: oklch(0.18 0.015 250);
  --ink-soft: oklch(0.42 0.012 250);
  --ink-muted: oklch(0.58 0.010 250);
  --accent: oklch(0.35 0.09 255);
  --accent-soft: oklch(0.55 0.08 255);
  --accent-bg: oklch(0.92 0.025 255);
  --highlight: oklch(0.92 0.16 95);

  --speaker-blue:     oklch(0.45 0.09 250);
  --speaker-blue-bg:  oklch(0.94 0.025 250);
  --speaker-green:    oklch(0.42 0.07 155);
  --speaker-green-bg: oklch(0.94 0.025 155);
  --speaker-burgundy: oklch(0.42 0.10 20);
  --speaker-burgundy-bg: oklch(0.94 0.028 20);
  --speaker-ochre:    oklch(0.50 0.10 75);
  --speaker-ochre-bg: oklch(0.94 0.028 75);
  --speaker-neutral:  oklch(0.45 0.005 250);
  --speaker-neutral-bg: oklch(0.92 0.005 250);

  --ok:   oklch(0.55 0.13 145);
  --warn: oklch(0.65 0.13 75);
  --err:  oklch(0.55 0.18 25);

  --serif: 'Crimson Pro', 'Crimson Text', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== MASTHEAD ===== */

.masthead {
  border-bottom: 1px solid var(--ink);
  background: var(--bg);
}
.masthead-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 32px 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 24px;
}
.masthead-meta-l, .masthead-meta-r {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.masthead-meta-r { text-align: right; }
.masthead-wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: center;
}
.masthead-wordmark .dot { color: var(--accent); }
.masthead-tagline {
  text-align: center;
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.masthead-meta-r .user {
  display: inline-flex; align-items: center; gap: 8px;
}
.masthead-meta-r .user-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: white;
  font-size: 10px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}

.subnav {
  border-bottom: 1px solid var(--rule);
  background: var(--bg-elev);
}
.subnav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 32px;
  display: flex;
  gap: 22px;
  font-size: 13px;
}
.subnav a {
  color: var(--ink-soft);
  text-decoration: none;
}
.subnav a.active { color: var(--ink); font-weight: 500; }
.subnav a:hover { color: var(--ink); }

/* ===== PAGE LAYOUT ===== */

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px 120px;
}

.hero {
  text-align: center;
  padding: 60px 0 50px;
  border-bottom: 1px solid var(--rule);
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.hero p.lede {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto 32px;
  font-style: italic;
}

/* ===== EMAIL FORM ===== */

.email-form {
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  border: 1px solid var(--ink);
  background: white;
}
.email-form input[type="email"] {
  flex: 1;
  border: none;
  padding: 14px 16px;
  font-size: 15px;
  background: transparent;
  outline: none;
  color: var(--ink);
}
.email-form input[type="email"]::placeholder { color: var(--ink-muted); }
.email-form button {
  border: none;
  background: var(--ink);
  color: var(--bg);
  padding: 14px 22px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-left: 1px solid var(--ink);
}
.email-form button:hover { background: var(--accent); }
.email-hint {
  text-align: center;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 14px;
}

/* ===== HOW IT WORKS ===== */

.howto {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding: 60px 0;
  border-bottom: 1px solid var(--rule);
}
.howto-step {
  text-align: center;
}
.howto-num {
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 16px;
}
.howto-step h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 10px;
}
.howto-step p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.55;
}

/* ===== LIMITS BAR ===== */

.limits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 50px 0 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.limit-cell {
  text-align: center;
  padding: 22px 16px;
  border-right: 1px solid var(--rule-soft);
}
.limit-cell:last-child { border-right: none; }
.limit-value {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}
.limit-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-top: 8px;
}

/* ===== UPLOAD ZONE ===== */

.upload-card {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  padding: 30px;
  margin-top: 28px;
}
.upload-card h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 26px;
  margin: 0 0 6px;
}
.upload-card .sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 22px;
}
.drop-zone {
  display: block;
  border: 2px dashed var(--rule);
  background: var(--bg);
  padding: 50px 30px;
  text-align: center;
  transition: border-color 120ms, background 120ms;
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.drop-zone-icon {
  font-size: 38px;
  margin-bottom: 12px;
  color: var(--ink-muted);
}
.drop-zone-text {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink-soft);
}
.drop-zone-text strong { color: var(--ink); font-weight: 600; }
.drop-zone-hint {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 8px;
}

/* ===== JOB LIST (dashboard) ===== */

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 50px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}
.section-title h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  margin: 0;
}
.section-title .meta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.job-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.job-table th {
  text-align: left;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  color: var(--ink-muted);
  padding: 12px 10px;
  border-bottom: 1px solid var(--rule);
}
.job-table td {
  padding: 16px 10px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: middle;
}
.job-table tr:hover td { background: var(--bg-elev); }
.job-table .filename {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}
.job-table .ts {
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid;
}
.badge.queued { color: var(--warn); border-color: var(--warn); background: oklch(0.96 0.04 75); }
.badge.processing { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.badge.done { color: var(--ok); border-color: var(--ok); background: oklch(0.96 0.04 145); }
.badge.failed { color: var(--err); border-color: var(--err); background: oklch(0.96 0.04 25); }

.action-link {
  font-size: 13px;
  color: var(--ink-soft);
  margin-right: 14px;
}
.action-link:hover { color: var(--accent); }
.action-link.danger:hover { color: var(--err); }

.job-table tr.row-link { cursor: pointer; }
.row-actions { white-space: nowrap; }

.icon-btn {
  background: none;
  border: 1px solid transparent;
  width: 30px; height: 30px;
  border-radius: 4px;
  color: var(--ink-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 6px;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover {
  background: var(--bg-sunken);
  color: var(--ink);
}
.icon-btn.danger:hover {
  background: oklch(0.97 0.04 25);
  color: var(--err);
  border-color: var(--err);
}

/* ===== MODAL ===== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.18 0.015 250 / 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: var(--bg-elev);
  border: 1px solid var(--ink);
  max-width: 460px;
  width: 100%;
  padding: 28px 30px 24px;
  box-shadow: 0 20px 60px oklch(0.18 0.015 250 / 0.25);
}
.modal-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  margin: 0 0 12px;
  line-height: 1.2;
}
.modal-body {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 22px;
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.modal-actions .action-btn {
  min-width: 110px;
  justify-content: center;
}

/* ===== JOB DETAIL — waiting state ===== */

.status-hero {
  text-align: center;
  padding: 80px 20px 60px;
  border-bottom: 1px solid var(--rule);
}
.status-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--accent-bg);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.status-icon.spinner::before {
  content: '';
  position: absolute;
  inset: -3px;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status-icon svg { width: 32px; height: 32px; color: var(--accent); }

.status-hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 36px;
  margin: 0 0 12px;
  line-height: 1.15;
}
.status-hero p.lede {
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  color: var(--ink-soft);
  max-width: 540px;
  margin: 0 auto;
}
.status-detail {
  display: inline-flex;
  gap: 24px;
  margin-top: 28px;
  padding: 14px 22px;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  font-size: 13px;
}
.status-detail .k {
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  margin-right: 6px;
}
.status-detail .v {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ===== JOB DETAIL — done state ===== */

.detail-back {
  border-bottom: 1px solid var(--rule-soft);
  background: var(--bg-elev);
}
.detail-back-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
}
.back-link svg { width: 14px; height: 14px; }
.breadcrumb {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 56px;
  padding-top: 36px;
}
.detail-main { min-width: 0; }
.detail-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 12px;
}
.detail-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 38px;
  line-height: 1.1;
  margin: 0 0 14px;
}
.detail-subtitle {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 26px;
}
.detail-divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 26px 0 22px;
}

.speakers-legend {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  margin-bottom: 26px;
}
.speaker-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.speaker-chip .swatch {
  width: 10px; height: 10px; border-radius: 50%;
}

.transcript-line {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  padding: 14px 0;
  cursor: pointer;
  border-radius: 4px;
}
.transcript-line:hover { background: var(--bg-elev); }
.transcript-line .timestamp {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
  padding-top: 6px;
  font-variant-numeric: tabular-nums;
}
.transcript-line.current .timestamp { color: var(--accent); font-weight: 500; }
.transcript-line .speaker-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.transcript-line .speaker-label::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
}
.transcript-line .text {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
}
.transcript-line .text p.para {
  margin: 0 0 22px;
}
.transcript-line .text p.para + p.para::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--rule);
  margin: -10px 0 12px;
}
.transcript-line .text p.para:last-child {
  margin-bottom: 0;
}
.transcript-line .word {
  display: inline;
  transition: color 80ms;
}
.transcript-line .word.spoken { color: var(--ink-soft); }
.transcript-line .word.current {
  background: var(--highlight);
  color: var(--ink);
  padding: 0 2px;
  border-radius: 2px;
}

.speaker-blue .speaker-label { color: var(--speaker-blue); }
.speaker-blue .speaker-label::before { background: var(--speaker-blue); }
.speaker-green .speaker-label { color: var(--speaker-green); }
.speaker-green .speaker-label::before { background: var(--speaker-green); }
.speaker-burgundy .speaker-label { color: var(--speaker-burgundy); }
.speaker-burgundy .speaker-label::before { background: var(--speaker-burgundy); }
.speaker-ochre .speaker-label { color: var(--speaker-ochre); }
.speaker-ochre .speaker-label::before { background: var(--speaker-ochre); }
.speaker-neutral .speaker-label { color: var(--speaker-neutral); }
.speaker-neutral .speaker-label::before { background: var(--speaker-neutral); }

.transcript-line.current.speaker-blue     { box-shadow: inset 3px 0 0 var(--speaker-blue);     background: var(--speaker-blue-bg); }
.transcript-line.current.speaker-green    { box-shadow: inset 3px 0 0 var(--speaker-green);    background: var(--speaker-green-bg); }
.transcript-line.current.speaker-burgundy { box-shadow: inset 3px 0 0 var(--speaker-burgundy); background: var(--speaker-burgundy-bg); }
.transcript-line.current.speaker-ochre    { box-shadow: inset 3px 0 0 var(--speaker-ochre);    background: var(--speaker-ochre-bg); }
.transcript-line.current.speaker-neutral  { box-shadow: inset 3px 0 0 var(--speaker-neutral);  background: var(--speaker-neutral-bg); }

/* ===== DETAIL SIDEBAR ===== */

.detail-meta {
  font-size: 13px;
}
.meta-block {
  padding: 18px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.meta-block:first-child { padding-top: 0; }
.meta-block h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin: 0 0 6px;
  font-weight: 500;
}
.meta-block .value {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
}
.meta-block .value.small {
  font-family: var(--sans);
  font-size: 13px;
}

.detail-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  background: var(--bg-elev);
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  transition: background 120ms;
}
.action-btn:hover { background: var(--accent-bg); border-color: var(--accent); text-decoration: none; }
.action-btn svg { width: 14px; height: 14px; opacity: 0.7; }
.action-btn.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.action-btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.action-btn.danger:hover { color: var(--err); border-color: var(--err); background: oklch(0.97 0.04 25); }

/* ===== STICKY TOP PLAYER ===== */

.sticky-player {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  color: var(--bg);
  border-bottom: 1px solid oklch(0.28 0.015 250);
}
.sticky-player-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.player-controls {
  display: flex; gap: 6px;
  flex-shrink: 0;
}
.player-btn {
  width: 32px; height: 32px;
  border: none;
  background: oklch(0.25 0.015 250);
  color: var(--bg);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.player-btn:hover { background: oklch(0.32 0.015 250); }
.player-btn svg { width: 14px; height: 14px; }
.player-btn.main {
  width: 42px; height: 42px;
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
}
.player-btn.main:hover { background: oklch(0.92 0.02 85); }
.player-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.player-time-start, .player-time-end {
  font-family: var(--mono);
  font-size: 11px;
  color: oklch(0.75 0.012 250);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 38px;
}
.player-time-end { text-align: right; }
.player-track {
  flex: 1;
  height: 4px;
  background: oklch(0.28 0.015 250);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}
.player-track-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--bg);
  width: 0%;
  border-radius: 2px;
}
.speed-toggle {
  border: 1px solid oklch(0.3 0.015 250);
  background: transparent;
  color: var(--bg);
  padding: 6px 12px;
  font-size: 12px;
  font-family: var(--mono);
  border-radius: 14px;
  flex-shrink: 0;
}
.speed-toggle:hover { background: oklch(0.25 0.015 250); }

/* ===== FOOTER ===== */

footer.colophon {
  border-top: 1px solid var(--ink);
  margin-top: 50px;
  padding: 30px 32px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-muted);
}
footer.colophon a { color: var(--ink-soft); }

/* ===== TOAST ===== */

.toast-flash {
  margin-left: 8px;
  font-size: 11px;
  color: var(--ok);
  opacity: 0;
  transition: opacity 200ms;
}
.action-btn.flashed .toast-flash { opacity: 1; }

/* ===== FLASH MESSAGES ===== */

.flash {
  padding: 12px 16px;
  border: 1px solid;
  font-size: 14px;
  margin-bottom: 0;
  font-family: var(--sans);
}
.flash-error {
  color: var(--err);
  border-color: var(--err);
  background: oklch(0.97 0.04 25);
}
.flash-info {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-bg);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 880px) {
  .masthead-inner { grid-template-columns: 1fr; text-align: center; gap: 8px; }
  .masthead-meta-r { text-align: center; }
  .howto { grid-template-columns: 1fr; gap: 36px; }
  .limits { grid-template-columns: repeat(2, 1fr); }
  .limit-cell:nth-child(2) { border-right: none; }
  .detail-grid { grid-template-columns: 1fr; gap: 28px; }
  .sticky-player-inner { padding: 10px 16px; gap: 10px; }
  .player-time-start, .player-time-end { display: none; }
  .speed-toggle { display: none; }
  .hero h1 { font-size: 36px; }
  .hero p.lede { font-size: 18px; }
}
