/* Styles for /youtube-transcript/ — the paste-a-link transcript tool.
   Sits on top of styles.css and only adds what the shared system has no
   component for: the URL form, the player/transcript split, and the progress
   and download strip. Everything else (topbar, buttons, login modal, footer)
   is the shared markup and needs no styling here. */

.yt-hero {
  padding-bottom: 56px;
}

.yt-hero h1 {
  margin: 0 auto;
  max-width: 16ch;
}

.yt-sub {
  max-width: 62ch;
  margin: 22px auto 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(1rem, 2.4vw, 1.16rem);
  line-height: 1.6;
}

/* ── The entry form ─────────────────────────────────────────────────────── */

.yt-form {
  position: relative;
  z-index: 2;
  width: min(100%, 880px);
  margin: 34px auto 0;
}

.yt-form__row {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 50px rgba(24, 10, 55, 0.22);
}

.yt-input,
.yt-select {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0 14px;
}

.yt-input {
  flex: 1 1 auto;
  min-width: 0;
}

.yt-input:focus,
.yt-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.yt-select {
  flex: 0 0 auto;
  max-width: 210px;
  cursor: pointer;
}

.yt-go {
  flex: 0 0 auto;
  background: var(--text);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.yt-go[disabled] {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.yt-form__hint {
  margin: 12px auto 0;
  max-width: 60ch;
  /* The hint sits at the pale end of the hero gradient, not the purple one,
     so it takes the page's own ink rather than the hero's white. */
  color: rgba(17, 17, 22, 0.66);
  font-size: 0.88rem;
  line-height: 1.5;
}

.yt-form__hint.is-error {
  color: #8a1f1f;
  font-weight: 600;
}

/* Below ~760px the three controls stack; the button goes full width so it
   stays the obvious next step rather than a stub next to the select. */
@media (max-width: 760px) {
  .yt-form__row { flex-wrap: wrap; }
  .yt-input { flex: 1 1 100%; }
  .yt-select { flex: 1 1 auto; max-width: none; }
  /* .button-hero caps itself at 240px, which left the stacked button two
     thirds as wide as the fields above it. */
  .yt-go { flex: 1 1 100%; width: 100%; max-width: none; }
}

/* ── Workspace ──────────────────────────────────────────────────────────── */

.yt-workspace {
  padding: 8px clamp(20px, 4vw, 56px) 64px;
}

/* The player IS the page now. The transcript list that used to take the other
   half is gone: subtitles belong inside the picture, not beside it. */
.yt-stage {
  width: min(100%, 900px);
  margin: 0 auto;
}

.yt-player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #0d0b16;
  box-shadow: 0 12px 40px rgba(24, 10, 55, 0.14);
}

.yt-player-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.yt-meter {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.yt-meter strong { color: var(--text); }

.yt-meter a {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
}

/* ── Transcript panel ───────────────────────────────────────────────────── */

.yt-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.yt-panel__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 17, 22, 0.02);
}

/* `display: flex` on a class beats the UA's `[hidden] { display: none }`, so
   these two need the attribute spelled out — the same patch styles.css already
   applies to .cookie-consent, .cookie-settings and .login-modal. Without it the
   download chips and the progress bar show over an empty panel. */
.yt-progress[hidden],
.yt-actions[hidden] { display: none; }

.yt-progress {
  display: flex;
  margin-top: 14px;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.yt-progress__track {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background: rgba(17, 17, 22, 0.08);
  overflow: hidden;
}

.yt-progress__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 240ms ease;
}

.yt-progress__label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.yt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.yt-chip {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.yt-chip:hover {
  background: var(--accent-light);
  border-color: transparent;
}

.yt-note {
  margin: 14px 0 0;
  padding: 12px 16px;
  border: 1px solid rgba(107, 75, 4, .18);
  border-radius: 12px;
  background: #fdf6e6;
  color: #6b4b04;
  font-size: 0.85rem;
  line-height: 1.5;
}

.yt-note a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.yt-note.is-error {
  background: #fdecec;
  color: #8a1f1f;
}

.yt-transcript {
  max-height: 560px;
  overflow-y: auto;
  padding: 6px 0;
}

.yt-line {
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 9px 16px;
  border: 0;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.yt-line:hover { background: rgba(207, 157, 255, 0.12); }

.yt-line__time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.yt-line__text {
  flex: 1 1 auto;
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.6;
}

/* Right-to-left target languages: the line text flips, the timestamp column
   stays where the eye expects it. */
.yt-transcript[dir="rtl"] .yt-line { text-align: right; }
.yt-transcript[dir="rtl"] .yt-line__text { direction: rtl; }

.yt-empty {
  padding: 40px 16px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ── Upgrade card ───────────────────────────────────────────────────────── */

.yt-upsell {
  padding: 0 clamp(20px, 4vw, 56px) 64px;
}

.yt-upsell__card {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 32px;
  border-radius: 18px;
  background: linear-gradient(140deg, #2a1550 0%, #6040c7 100%);
  color: #fff;
  text-align: center;
}

/* styles.css gives every h2 the page's dark ink, which on this purple card
   rendered the headline nearly black on nearly black. */
.yt-upsell__card h2 { margin: 0 0 12px; font-size: 1.5rem; color: #fff; }

.yt-upsell__card p {
  margin: 0 auto 22px;
  max-width: 58ch;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.65;
}

.yt-upsell__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.yt-upsell__actions .button-hero {
  background: #fff;
  color: var(--text);
}

.yt-link {
  border: 0;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.yt-link:hover { color: #fff; }

.yt-center { text-align: center; }
.yt-center .button-hero { background: var(--text); color: #fff; }

/* The step-number badge is borrowed from the use-case pages, which define it
   in their own page <style>; this page has no such block. */
.feature-icon .step-num { color: #fff; font-weight: 800; font-size: 1rem; line-height: 1; }

/* ── Captions over the player ───────────────────────────────────────────
   Ported from the extension's vod-engine.js so the two surfaces look the
   same. The only change is the anchor: the extension appends this inside
   YouTube's own player element, and here it sits on top of the embed. */

.anydub-captions {
  position: absolute; left: 0; right: 0; bottom: 8%;
  z-index: 38; text-align: center; pointer-events: none;
}

.anydub-cap-line {
  display: inline-block; max-width: 82%;
  background: rgba(8, 8, 8, .75); color: #fff;
  padding: .18em .5em; border-radius: 4px;
  font-family: "YouTube Noto", Roboto, "Arial Unicode MS", Arial, sans-serif;
  font-weight: 500; line-height: 1.35; white-space: pre-wrap;
  unicode-bidi: isolate;
}

.anydub-captions[data-bg="off"] .anydub-cap-line {
  background: transparent;
  text-shadow: 0 0 4px #000, 0 0 4px #000, 1px 1px 2px #000, -1px -1px 2px #000;
}

/* ── Mode row: the extension's two toggles ──────────────────────────────── */

.yt-modes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.yt-modes[hidden] { display: none; }
.yt-modes__spacer { flex: 1 1 auto; }

.yt-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text);
  cursor: pointer;
}

.yt-switch input {
  width: 38px;
  height: 22px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  background: rgba(17, 17, 22, 0.16);
  position: relative;
  cursor: pointer;
  transition: background 160ms ease;
}

.yt-switch input::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
}

.yt-switch input:checked { background: var(--accent); }
.yt-switch input:checked::after { transform: translateX(16px); }

.yt-field[hidden] { display: none; }

.yt-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.yt-mini-select {
  min-height: 34px;
  max-width: 150px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.yt-range { width: 78px; accent-color: var(--accent); cursor: pointer; }

/* The line being spoken right now. The dub is audio-only, so without this the
   viewer has no way to tell whether it is tracking the picture. */
.yt-line.is-speaking {
  background: rgba(207, 157, 255, 0.22);
  box-shadow: inset 3px 0 0 var(--accent);
}

.yt-line.is-speaking .yt-line__text { font-weight: 600; }
