/* ============================================================
   TranscribeVideo — modern glass dashboard
   ============================================================ */

:root {
  --bg: #0a0b12;
  --bg-2: #0f1220;
  --panel: rgba(23, 26, 38, 0.72);
  --panel-solid: #171a26;
  --panel-2: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e7e9f1;
  --muted: #8a90a6;
  --muted-strong: #a3a9bf;

  --accent: #7c5cff;
  --accent-2: #4f8bff;
  --accent-hover: #8b6dff;
  --accent-glow: rgba(124, 92, 255, 0.55);

  --success: #2dd47e;
  --success-bg: rgba(45, 212, 126, 0.12);
  --warning: #f4c64a;
  --warning-bg: rgba(244, 198, 74, 0.12);
  --error: #ff5d6a;
  --error-bg: rgba(255, 93, 106, 0.12);

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.45),
                  inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Background gradient + glow blobs */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(79, 139, 255, 0.10), transparent 60%),
    radial-gradient(ellipse 80% 60% at 100% 100%, rgba(124, 92, 255, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  z-index: -2;
}
.bg-glow {
  position: fixed;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  filter: blur(80px);
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
  top: -120px; left: -120px;
  animation: float 18s ease-in-out infinite;
}
.bg-glow-2 {
  background: radial-gradient(circle, rgba(79, 139, 255, 0.5), transparent 70%);
  top: auto; left: auto;
  bottom: -160px; right: -160px;
  animation-delay: -9s;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(60px, 40px); }
}

/* ---------- Glassmorphism card ---------- */
.glass {
  background: var(--panel);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glass);
}

.card {
  padding: 24px;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* ---------- Top nav ---------- */
.topnav {
  position: sticky;
  top: 16px;
  margin: 16px auto 0;
  max-width: 1240px;
  padding: 0;
  z-index: 50;
  border-radius: 14px;
}
.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand h1 { font-size: 18px; margin: 0; letter-spacing: -0.01em; }
.brand-sm strong { font-weight: 600; }
.brand .pipe { color: var(--muted); margin: 0 6px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.brand-sm .brand-mark { width: 30px; height: 30px; border-radius: 9px; }

.topnav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--muted-strong);
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
  margin-left: 4px;
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
}
.user-name {
  font-weight: 500;
  font-size: 13px;
}

/* ---------- App layout ---------- */
.app-shell {
  max-width: 1240px;
  margin: 28px auto 60px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}
.main-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.side-col { display: flex; flex-direction: column; gap: 20px; }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .topnav-right .chip { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding: 8px 4px 0; }
.hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  background: linear-gradient(180deg, #fff 0%, #b9bed3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { margin: 0; max-width: 640px; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  background: var(--panel-2);
  border-radius: 10px;
  width: fit-content;
}
.tab {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .18s, color .18s;
  font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: linear-gradient(135deg, rgba(124,92,255,0.18), rgba(79,139,255,0.18));
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}
.dropzone:hover {
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.06);
}
.dropzone.drag {
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.10);
  transform: scale(1.01);
}
.dz-icon {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 8px 24px var(--accent-glow);
}
.dz-inner p { margin: 4px 0; }
.dz-inner .hint { color: var(--muted); font-size: 12.5px; }

/* ---------- URL form ---------- */
.url-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.url-form label span {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}
.url-form input[type="url"] {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.url-form input[type="url"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}
.url-form .hint {
  color: var(--muted);
  font-size: 12px;
  margin: 2px 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.url-form .hint code {
  background: var(--panel-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  border: 1px solid var(--border);
}
.url-form button { align-self: flex-start; margin-top: 6px; }

.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
}
.dot-ok { background: var(--success); box-shadow: 0 0 8px var(--success); }
.dot-warn { background: var(--warning); box-shadow: 0 0 8px var(--warning); }

/* ---------- Status card ---------- */
.status-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.status-head h2 { font-size: 16px; margin: 0 0 4px; font-weight: 600; }
.message {
  margin: 0;
  font-size: 12.5px;
  word-break: break-word;
  max-width: 460px;
}

.bar {
  height: 8px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width .35s ease;
  position: relative;
}
.bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ---------- Metrics ---------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.metric {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
}
.metric-value {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.result-metrics { margin: 0 0 16px; }

.job-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}
.job-meta .sep { opacity: 0.5; margin: 0 2px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.badge.processing { background: rgba(124,92,255,0.14); color: #b9a8ff; }
.badge.processing::before { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
.badge.queued { background: var(--warning-bg); color: var(--warning); }
.badge.queued::before { background: var(--warning); animation: pulse 1.8s ease-in-out infinite; }
.badge.done { background: var(--success-bg); color: var(--success); }
.badge.done::before { background: var(--success); }
.badge.error { background: var(--error-bg); color: var(--error); }
.badge.error::before { background: var(--error); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.3); }
}

/* ---------- Result card ---------- */
.result-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.result-head h2 { margin: 0 0 2px; font-size: 18px; }
.result-head p { margin: 0; }
.result-head .check { color: var(--success); }

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { background: rgba(255,255,255,0.06); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: white;
  box-shadow: 0 6px 18px var(--accent-glow);
}
.btn.primary:hover { filter: brightness(1.08); border-color: transparent; }
.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted-strong);
}
.btn.ghost:hover { color: var(--text); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { padding: 12px 22px; font-size: 14px; }

/* ---------- Callouts ---------- */
.callout {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin: 10px 0 0;
  border: 1px solid transparent;
}
.callout.error { background: var(--error-bg); color: var(--error); border-color: rgba(255,93,106,0.25); }
.callout.warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(244,198,74,0.25); }
.callout code {
  background: rgba(0,0,0,0.25);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

/* ---------- Sidebar: job history ---------- */
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.side-head h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted-strong); }

.job-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
}
.job-list::-webkit-scrollbar { width: 6px; }
.job-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.job-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  transition: background .15s, border-color .15s;
}
.job-item:hover { background: rgba(255,255,255,0.05); border-color: var(--border-strong); }
.job-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.job-sub { margin-top: 6px; }
.job-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}
.link {
  color: var(--accent-2);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
}
.link:hover { color: var(--accent-hover); text-decoration: underline; }

.empty {
  text-align: center;
  padding: 24px 8px;
  font-size: 13px;
}

/* ============================================================
   Login page
   ============================================================ */
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-shell {
  width: 100%;
  max-width: 420px;
}
.auth-card { padding: 32px 30px 28px; }
.auth-card .brand { margin-bottom: 26px; }
.auth-card .brand h1 { font-size: 20px; }
.auth-title {
  font-size: 22px;
  margin: 0 0 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-form label span {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}
.auth-form input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}
.auth-form button { margin-top: 6px; justify-content: center; }

.auth-foot {
  text-align: center;
  font-size: 12px;
  margin: 18px 0 0;
}

/* ---------- Spark accent (tagline) ---------- */
.spark {
  display: inline-block;
  color: var(--warning);
  filter: drop-shadow(0 0 6px rgba(244, 198, 74, 0.55));
  animation: spark-pulse 2.2s ease-in-out infinite;
  margin-left: 2px;
}
@keyframes spark-pulse {
  0%, 100% { transform: rotate(0deg) scale(1); opacity: 1; }
  45% { transform: rotate(-8deg) scale(1.12); opacity: 0.85; }
  55% { transform: rotate(8deg) scale(1.12); opacity: 0.85; }
}

/* ---------- Footer credit ---------- */
.credit {
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  margin: 24px 0 16px;
  letter-spacing: 0.02em;
}
.credit .heart {
  display: inline-block;
  color: var(--accent);
  margin: 0 2px;
}
.credit strong { color: var(--muted-strong); font-weight: 600; }
.credit a { color: var(--muted-strong); text-decoration: none; }
.credit a:hover { color: var(--text); }
