:root {
  --primary:   #2563eb;
  --primary-h: #1d4ed8;
  --success:   #16a34a;
  --danger:    #dc2626;
  --bg:        #0f172a;
  --surface:   #1e293b;
  --border:    #334155;
  --text:      #f1f5f9;
  --muted:     #94a3b8;
  --radius:    12px;
}

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

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Navbar ── */
.navbar { background: #0d1f3c; border-bottom: 1px solid var(--border); padding: 14px 0; }
.navbar-brand { font-weight: 800; font-size: 1.2rem; color: #fff !important; letter-spacing: -0.5px; }
.navbar-brand i { color: var(--primary); }
.nav-link { color: var(--muted) !important; font-size: .88rem; transition: color .2s; }
.nav-link:hover, .nav-link.active { color: #fff !important; }
.btn-nav { background: var(--primary); color: #fff; border-radius: 8px; padding: 6px 16px; font-size: .85rem; font-weight: 600; border: none; cursor: pointer; transition: background .2s; text-decoration: none; }
.btn-nav:hover { background: var(--primary-h); color: #fff; }

/* ── Hero / Input ── */
.hero { padding: 64px 0 40px; text-align: center; }
.hero h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 12px; }
.hero h1 span { color: var(--primary); }
.hero p { color: var(--muted); font-size: 1.05rem; margin-bottom: 40px; }

.input-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  max-width: 740px;
  margin: 0 auto;
}
.url-wrap { display: flex; gap: 10px; }
.url-input {
  flex: 1; padding: 14px 18px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: .95rem;
  transition: border-color .2s;
}
.url-input:focus { outline: none; border-color: var(--primary); }
.url-input::placeholder { color: var(--muted); }
.btn-transcribe {
  padding: 14px 28px; background: var(--primary);
  color: #fff; border: none; border-radius: 10px;
  font-size: .95rem; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: background .2s;
}
.btn-transcribe:hover { background: var(--primary-h); }
.btn-transcribe:disabled { background: #334155; cursor: not-allowed; }

/* ── Progress ── */
.progress-card {
  max-width: 740px; margin: 24px auto 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px; display: none;
}
.progress-track {
  height: 8px; background: var(--border);
  border-radius: 99px; overflow: hidden; margin-bottom: 14px;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: 99px; transition: width .6s ease;
}
.progress-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.step-badge {
  padding: 4px 12px; border-radius: 99px; font-size: .78rem; font-weight: 600;
  background: var(--border); color: var(--muted);
}
.step-badge.active { background: var(--primary); color: #fff; }
.step-badge.done   { background: #14532d; color: #86efac; }

/* ── Result ── */
.result-card {
  max-width: 920px; margin: 32px auto 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; display: none;
}
.result-header { display: flex; gap: 16px; align-items: flex-start; padding: 24px; border-bottom: 1px solid var(--border); }
.result-thumb { width: 100px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--border); flex-shrink: 0; }
.result-meta h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.result-meta .badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge-info { background: #1e3a5f; color: #7dd3fc; padding: 3px 10px; border-radius: 6px; font-size: .78rem; font-weight: 600; }

.result-tabs { display: flex; border-bottom: 1px solid var(--border); }
.tab-btn { padding: 14px 20px; background: none; border: none; color: var(--muted); font-size: .88rem; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; transition: all .2s; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-pane { display: none; padding: 24px; }
.tab-pane.active { display: block; }

.transcription-text {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px; font-size: .9rem;
  line-height: 1.8; color: #cbd5e1; max-height: 400px;
  overflow-y: auto; white-space: pre-wrap;
}
.summary-box {
  background: #172035; border: 1px solid #1e3a5f;
  border-radius: 10px; padding: 18px;
  font-size: .92rem; line-height: 1.75; color: #e2e8f0;
  margin-bottom: 16px;
}
.topics-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.topics-list li { background: #1a2a1a; color: #86efac; padding: 5px 14px; border-radius: 99px; font-size: .82rem; font-weight: 600; }
.keywords-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.keywords-list li { background: #1a1a2e; color: #a5b4fc; padding: 5px 14px; border-radius: 99px; font-size: .82rem; }

.download-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn-dl {
  padding: 10px 20px; border-radius: 8px; font-size: .85rem;
  font-weight: 700; border: 1.5px solid var(--border);
  color: var(--text); background: var(--bg); cursor: pointer;
  text-decoration: none; transition: all .2s;
}
.btn-dl:hover { border-color: var(--primary); color: var(--primary); }
.btn-dl.copy { border-color: var(--success); color: #86efac; }

/* ── History ── */
.section-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 20px; color: var(--text); }
.hist-filters { display: flex; gap: 8px; margin-bottom: 20px; }
.filter-btn { padding: 7px 18px; border-radius: 99px; border: 1.5px solid var(--border); background: none; color: var(--muted); font-size: .83rem; font-weight: 600; cursor: pointer; transition: all .2s; }
.filter-btn.active, .filter-btn:hover { border-color: var(--primary); color: var(--text); }

.hist-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; margin-bottom: 10px;
  transition: border-color .2s; cursor: pointer;
}
.hist-item:hover { border-color: var(--primary); }
.hist-thumb { width: 72px; height: 46px; border-radius: 6px; object-fit: cover; background: var(--border); flex-shrink: 0; }
.hist-info { flex: 1; min-width: 0; }
.hist-title { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-meta { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.completed { background: var(--success); }
.status-dot.processing { background: #f59e0b; }
.status-dot.failed { background: var(--danger); }

/* ── Auth modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 1000; display: none; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 36px; width: 100%; max-width: 420px; }
.modal-box h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.modal-box p { color: var(--muted); font-size: .88rem; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .83rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.form-group input { width: 100%; padding: 12px 14px; background: var(--bg); border: 1.5px solid var(--border); border-radius: 8px; color: var(--text); font-size: .93rem; }
.form-group input:focus { outline: none; border-color: var(--primary); }
.btn-auth { width: 100%; padding: 13px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: background .2s; margin-top: 4px; }
.btn-auth:hover { background: var(--primary-h); }
.auth-switch { text-align: center; margin-top: 18px; font-size: .85rem; color: var(--muted); }
.auth-switch a { color: var(--primary); font-weight: 600; cursor: pointer; }
.modal-close { position: absolute; top: 16px; right: 20px; background: none; border: none; color: var(--muted); font-size: 1.4rem; cursor: pointer; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.8rem; }
  .url-wrap { flex-direction: column; }
  .result-header { flex-direction: column; }
}
