/* ============================================================
   Transcript Tool — styles
   ============================================================ */

:root {
  --bg: #f5f6fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e4e8f1;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: #eef0ff;
  --accent-ink: #4338ca;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn-ink: #92400e;
  --warn-soft: #fffbeb;
  --warn-line: #fde68a;
  --err: #dc2626;
  --err-soft: #fef2f2;
  --err-line: #fecaca;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px rgba(15, 23, 42, .07);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --header-bg: rgba(255, 255, 255, .82);
  --radius: 16px;
  --font-en: 'Inter', 'Hind Siliguri', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-bn: 'Hind Siliguri', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html[data-theme="dark"] {
  --bg: #0b1020;
  --card: #121936;
  --ink: #e8ebf8;
  --muted: #8f97b8;
  --line: #232c52;
  --accent: #818cf8;
  --accent-2: #a78bfa;
  --accent-soft: #1c2350;
  --accent-ink: #b3bafc;
  --ok: #34d399;
  --ok-soft: #0c2b22;
  --warn-ink: #fcd34d;
  --warn-soft: #2a2210;
  --warn-line: #4d3d13;
  --err: #f87171;
  --err-soft: #2d1416;
  --err-line: #5b2528;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 40px rgba(0, 0, 0, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --header-bg: rgba(11, 16, 32, .82);
}

* { box-sizing: border-box; }

/* the hidden attribute must always win over display rules */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-en);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
html[data-lang="bn"] body { font-family: var(--font-bn); }

/* decorative background */
.bg-decor {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 340px at 12% -4%, rgba(99, 102, 241, .13), transparent 62%),
    radial-gradient(520px 300px at 92% 4%, rgba(168, 85, 247, .10), transparent 60%);
}
html[data-theme="dark"] .bg-decor {
  background:
    radial-gradient(600px 340px at 12% -4%, rgba(99, 102, 241, .16), transparent 62%),
    radial-gradient(520px 300px at 92% 4%, rgba(168, 85, 247, .12), transparent 60%);
}

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

/* ---------------- header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-weight: 800; font-size: 1.06rem; letter-spacing: -.01em; }
.header-actions { display: flex; align-items: center; gap: 8px; }

.pill-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: .82rem;
  cursor: pointer; font-family: inherit; transition: border-color .15s, background .15s;
}
.pill-btn:hover { border-color: var(--accent); color: var(--accent-ink); }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); display: grid; place-items: center; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.icon-btn svg { width: 18px; height: 18px; }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: none; }

/* ---------------- hero ---------------- */
.hero { text-align: center; padding: 52px 0 30px; }
.hero h1 {
  font-size: clamp(1.8rem, 4.6vw, 2.9rem);
  font-weight: 800; letter-spacing: -.025em; line-height: 1.22; margin: 0 0 14px;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { max-width: 640px; margin: 0 auto; color: var(--muted); font-size: 1.04rem; }

/* ---------------- banners / alerts ---------------- */
.banner {
  margin: 18px 0 0; padding: 12px 16px; border-radius: 12px; font-size: .9rem; line-height: 1.55;
}
.banner.warn { background: var(--warn-soft); color: var(--warn-ink); border: 1px solid var(--warn-line); }

.alert { padding: 13px 16px; border-radius: 12px; font-size: .92rem; margin-top: 16px; line-height: 1.55; }
.alert.error { background: var(--err-soft); border: 1px solid var(--err-line); color: var(--err); }
.alert.notice { background: var(--accent-soft); border: 1px solid var(--line); color: var(--ink); }
.alert.notice p { margin: 6px 0 10px; color: var(--muted); font-size: .88rem; }

/* ---------------- tool card ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.tool { max-width: 860px; margin: 8px auto 0; padding: 22px 24px 26px; }

.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--accent-soft); border-radius: 12px; padding: 4px; margin-bottom: 20px;
}
.tab {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; background: transparent; color: var(--muted);
  padding: 11px 10px; border-radius: 9px; font-weight: 700; font-size: .95rem;
  cursor: pointer; font-family: inherit; transition: background .18s, color .18s, box-shadow .18s;
}
.tab svg { width: 17px; height: 17px; }
.tab.active { background: var(--card); color: var(--accent-ink); box-shadow: var(--shadow-sm); }

.panel { display: none; }
.panel.active { display: block; animation: fadeIn .22s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------- forms ---------------- */
.row-form { display: flex; gap: 10px; }
.row-form input[type="url"], .row-form input[type="text"] {
  flex: 1; min-width: 0; padding: 12px 15px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink);
  font-size: .95rem; font-family: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
.row-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, .18); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px 22px;
  font-weight: 700; font-size: .95rem; font-family: inherit; cursor: pointer;
  transition: transform .12s, box-shadow .15s, opacity .15s;
  white-space: nowrap;
}
.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 6px 18px rgba(99, 102, 241, .35);
}
.btn.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(99, 102, 241, .42); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.sm { padding: 9px 16px; font-size: .88rem; border-radius: 10px; }
.btn.block { width: 100%; margin-top: 14px; }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 9px; padding: 7px 13px; font-size: .82rem; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.ghost-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.ghost-btn svg { width: 14px; height: 14px; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite; flex: none;
}
.spinner.dark { border-color: rgba(100, 116, 139, .3); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- video card ---------------- */
.video-card {
  display: flex; gap: 14px; align-items: center; margin-top: 18px;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--bg);
}
.video-card img {
  width: 128px; aspect-ratio: 16/9; object-fit: cover; border-radius: 9px; flex: none;
  background: #000;
}
.video-card .vc-meta { min-width: 0; }
.video-card .vc-title {
  font-weight: 700; font-size: .95rem; line-height: 1.4; margin: 0 0 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.video-card .vc-sub { color: var(--muted); font-size: .82rem; margin: 0; }

/* ---------------- controls ---------------- */
.controls { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.controls label { display: flex; flex-direction: column; gap: 5px; font-size: .8rem; font-weight: 600; color: var(--muted); flex: 1; min-width: 180px; }
.controls select {
  padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); font-family: inherit; font-size: .9rem; outline: none;
  cursor: pointer; transition: border-color .15s;
}
.controls select:focus { border-color: var(--accent); }
.controls select:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- dropzone ---------------- */
.dropzone {
  border: 2px dashed var(--line); border-radius: 14px; padding: 38px 20px;
  text-align: center; cursor: pointer; transition: border-color .18s, background .18s;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.drag {
  border-color: var(--accent); background: var(--accent-soft);
}
.dropzone .dz-icon {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 12px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}
.dropzone .dz-icon svg { width: 22px; height: 22px; }
.dz-title { font-weight: 700; margin: 0 0 4px; font-size: .98rem; }
.dz-sub { color: var(--muted); font-size: .84rem; margin: 0 0 4px; }
.dz-max { color: var(--muted); font-size: .78rem; margin: 0; opacity: .85; }

.file-chip {
  display: flex; align-items: center; gap: 12px; margin-top: 14px;
  border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px 14px;
}
.file-chip .fc-icon { color: var(--accent-ink); flex: none; display: grid; place-items: center; }
.file-chip .fc-icon svg { width: 20px; height: 20px; }
.file-chip .fc-meta { min-width: 0; flex: 1; }
.file-chip .fc-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.file-chip .fc-size { color: var(--muted); font-size: .78rem; margin: 0; }
.file-chip .fc-remove {
  border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.05rem;
  padding: 4px 8px; border-radius: 8px; flex: none;
}
.file-chip .fc-remove:hover { color: var(--err); background: var(--err-soft); }

.check { display: flex; align-items: center; gap: 9px; margin-top: 14px; font-size: .88rem; color: var(--muted); cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

/* ---------------- job status ---------------- */
.job-status { margin-top: 16px; }
.progress {
  height: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden;
}
.progress .bar {
  height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s ease;
}
.progress.indeterminate .bar {
  width: 38%; animation: slide 1.3s ease-in-out infinite;
}
@keyframes slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(300%); }
}
.job-status .st-text { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; margin: 10px 0 0; }

/* ---------------- result ---------------- */
.result { margin-top: 20px; }
.result-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.result-head .spacer { flex: 1; }
.switch { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.stats { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .8rem; padding: 10px 2px 4px; }
.stats b { color: var(--ink); font-weight: 700; }

.viewer {
  max-height: 480px; overflow-y: auto; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg); padding: 6px 4px; margin-top: 8px;
}
.seg {
  display: flex; gap: 12px; align-items: flex-start; padding: 7px 12px; border-radius: 9px;
}
.seg:hover { background: var(--accent-soft); }
.seg .ts {
  flex: none; font-variant-numeric: tabular-nums; font-size: .74rem; font-weight: 700;
  color: var(--accent-ink); background: var(--accent-soft); border: 1px solid var(--line);
  border-radius: 7px; padding: 2px 8px; margin-top: 2px; text-decoration: none; letter-spacing: .02em;
}
a.ts:hover { border-color: var(--accent); }
.seg .seg-text { font-size: .93rem; line-height: 1.65; min-width: 0; }
.seg .spk {
  display: inline-block; font-size: .7rem; font-weight: 800; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 6px; padding: 1px 7px; margin-right: 7px;
  vertical-align: 2px; letter-spacing: .03em;
}
.viewer.no-ts .seg .ts { display: none; }

/* ---------------- features ---------------- */
.features { padding: 56px 0 8px; }
.features .grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  box-shadow: var(--shadow-sm);
}
.feature .f-icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); margin-bottom: 13px;
  box-shadow: 0 5px 14px rgba(99, 102, 241, .3);
}
.feature .f-icon svg { width: 19px; height: 19px; }
.feature h3 { margin: 0 0 6px; font-size: .95rem; font-weight: 700; }
.feature p { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.6; }

/* ---------------- FAQ ---------------- */
.faq { max-width: 760px; margin: 0 auto; padding: 40px 0 30px; }
.faq h2 { text-align: center; font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 20px; }
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 18px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.faq summary {
  cursor: pointer; font-weight: 700; font-size: .93rem; padding: 15px 0;
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.15rem; color: var(--accent-ink); font-weight: 600; transition: transform .18s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 15px; color: var(--muted); font-size: .88rem; line-height: 1.7; }

/* ---------------- footer ---------------- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 30px;
  color: var(--muted); font-size: .82rem; text-align: center;
}

/* ---------------- toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(8px);
  background: #101426; color: #f1f3fd; border: 1px solid #2a3157;
  padding: 10px 20px; border-radius: 99px; font-size: .86rem; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- responsive ---------------- */
@media (max-width: 860px) {
  .features .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .hero { padding: 38px 0 22px; }
  .tool { padding: 16px 14px 20px; }
  .row-form { flex-direction: column; }
  .row-form .btn { width: 100%; }
  .features .grid { grid-template-columns: 1fr; }
  .video-card img { width: 104px; }
  .seg { gap: 9px; padding: 7px 8px; }
  .brand-name { font-size: .98rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
