/* ═══════════════════════════════════════
   Transcriber — Clean, modern UI
   ═══════════════════════════════════════ */

:root {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --bg3: #1a1a26;
  --card: #16161f;
  --border: rgba(255,255,255,.08);
  --border-hover: rgba(255,255,255,.15);
  --text: #e8e8ef;
  --text2: rgba(255,255,255,.55);
  --accent: #6c5ce7;
  --accent2: #a29bfe;
  --accent-bg: rgba(108,92,231,.12);
  --green: #00b894;
  --red: #ff6b6b;
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 800px; margin: 0 auto; padding: 0 20px; }

/* ─── Header ─── */
.header {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.header .container { display: flex; align-items: center; gap: 16px; }
.logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text);
}
.logo-icon { font-size: 1.5rem; }
.logo-text { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.5px; }
.header-sub {
  font-size: .85rem; color: var(--text2);
  margin-left: auto;
}

/* ─── Hero ─── */
.hero {
  text-align: center;
  padding: 56px 0 32px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #fff 30%, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.hero-desc {
  font-size: 1.05rem;
  color: var(--text2);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─── Tabs ─── */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 4px;
  border: 1px solid var(--border);
}
.tab {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: calc(var(--radius) - 3px);
  background: transparent;
  color: var(--text2);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  font-family: var(--font);
}
.tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.tab.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 16px rgba(108,92,231,.3);
}
.tab svg { flex-shrink: 0; }

/* ─── Input panels ─── */
.input-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.url-input-wrap {
  display: flex; gap: 10px;
}
.url-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  transition: border-color .25s;
}
.url-input:focus { border-color: var(--accent); }
.url-input::placeholder { color: rgba(255,255,255,.25); }

.platforms {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 14px;
}
.platform {
  font-size: .75rem;
  color: var(--text2);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg3);
  color: var(--text);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  font-family: var(--font);
  white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,.08); border-color: var(--border-hover); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: #7c6ff0;
  box-shadow: 0 4px 20px rgba(108,92,231,.3);
}
.btn-sm { padding: 8px 16px; font-size: .85rem; border-radius: 8px; }
.btn-loader {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn {
  background: none; border: none;
  color: var(--accent2); cursor: pointer;
  font-size: inherit; font-family: var(--font);
  text-decoration: underline;
}
.link-btn:hover { color: #fff; }

/* ─── Dropzone ─── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .25s, background .25s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.dropzone-text {
  font-size: 1.05rem; color: var(--text);
  margin: 16px 0 8px; font-weight: 600;
}
.dropzone-hint { font-size: .9rem; color: var(--text2); }
.dropzone-limit { font-size: .8rem; color: rgba(255,255,255,.3); margin-top: 12px; }

.file-info {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px;
}
.file-name {
  flex: 1;
  font-size: .95rem; color: var(--text);
  background: var(--bg);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Progress ─── */
.progress-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.progress-bar-wrap {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
  transition: width .5s ease;
}
.progress-info {
  display: flex; justify-content: space-between;
  font-size: .9rem;
}
.progress-status { color: var(--text2); }
.progress-pct { color: var(--accent2); font-weight: 700; }

/* ─── Result ─── */
.result-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  animation: fadeIn .4s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } }
.result-header {
  margin-bottom: 20px;
}
.result-header h2 {
  font-size: 1.3rem; font-weight: 700;
  margin-bottom: 6px;
}
.result-meta {
  font-size: .85rem; color: var(--text2);
  margin-bottom: 14px;
}
.result-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.result-text {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-size: .95rem;
  line-height: 1.8;
  color: var(--text);
  max-height: 500px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.result-text::-webkit-scrollbar { width: 6px; }
.result-text::-webkit-scrollbar-track { background: transparent; }
.result-text::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.result-segments {
  margin-top: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 500px;
  overflow-y: auto;
}
.segment {
  display: flex; gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
.segment:hover { background: rgba(255,255,255,.03); }
.segment:last-child { border-bottom: none; }
.segment-time {
  flex-shrink: 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent2);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
  min-width: 56px;
}
.segment-text { font-size: .92rem; color: var(--text); line-height: 1.6; }

/* ─── Error ─── */
.error-panel {
  background: var(--card);
  border: 1px solid rgba(255,107,107,.2);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  margin-bottom: 20px;
  animation: fadeIn .4s ease;
}
.error-icon { font-size: 2rem; margin-bottom: 12px; }
.error-text { color: var(--red); margin-bottom: 16px; font-size: .95rem; }

/* ─── Features ─── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  padding: 48px 0 32px;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}
.feature {
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  text-align: center;
}
.feature-icon { font-size: 2rem; margin-bottom: 10px; }
.feature h3 { font-size: .95rem; font-weight: 700; margin-bottom: 6px; }
.feature p { font-size: .82rem; color: var(--text2); line-height: 1.5; }

/* ─── Footer ─── */
.footer {
  padding: 24px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text2);
  font-size: .82rem;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .header .container { flex-direction: column; gap: 4px; }
  .header-sub { margin-left: 0; }
  .url-input-wrap { flex-direction: column; }
  .result-actions { gap: 6px; }
  .btn-sm { padding: 8px 12px; font-size: .8rem; }
}
