/* Video, audio and subtitle tools: hero with the tool card, drop zone,
   options, progress, results, subtitle panes and the SRT editor.
   Loaded after main.css and tool-pages.css. */

.vt-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.75rem, 5vw, 3.5rem) 0 clamp(2rem, 5vw, 3.5rem);
  background: #05070a;
  isolation: isolate;
}
.vt-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.vt-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.38;
}
.vt-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 7, 10, 0.94) 0%, rgba(5, 7, 10, 0.72) 55%, rgba(5, 7, 10, 0.55) 100%),
    linear-gradient(0deg, #070b12 0%, transparent 35%);
}
.vt-hero__grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
@media (min-width: 960px) {
  .vt-hero__grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .vt-hero--wide .vt-hero__grid { grid-template-columns: 1fr; }
}
.vt-hero__title {
  margin: 0.4rem 0 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: #f8fafc;
}
.vt-hero__title span {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.48em;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #93c5fd;
  font-weight: 600;
}
.vt-hero__lead { margin: 0; max-width: 38rem; color: #cbd5e1; font-size: 1.0625rem; line-height: 1.65; }
.vt-hero--wide .vt-hero__lead { max-width: 52rem; }
.vt-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 1.1rem 0 0; padding: 0; list-style: none; }
.vt-tags li {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  color: #dbeafe;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.25);
}

/* Tool card */
.vt-tool {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  border-radius: 20px;
  background: rgba(12, 18, 32, 0.92);
  border: 1px solid rgba(96, 165, 250, 0.22);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  min-width: 0;
}
.vt-drop {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  padding: clamp(1.75rem, 5vw, 3rem) 1rem;
  border: 2px dashed rgba(96, 165, 250, 0.35);
  border-radius: 16px;
  background: rgba(15, 26, 51, 0.55);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.vt-drop:hover, .vt-drop:focus-visible, .vt-drop.is-over { border-color: #60a5fa; background: rgba(30, 58, 138, 0.35); outline: none; }
.vt-drop__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393c5fd' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4m0 0-4 4m4-4 4 4'/%3E%3Cpath d='M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2'/%3E%3C/svg%3E") center / 26px no-repeat;
}
.vt-drop__or { color: #94a3b8; font-size: 0.9375rem; }
.vt-drop__hint { color: #64748b; font-size: 0.8125rem; }

.vt-btn {
  font: 600 0.9375rem/1.2 var(--font-display);
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  color: #f8fafc;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}
.vt-btn:disabled { opacity: 0.5; cursor: default; }
.vt-btn--primary { background: linear-gradient(180deg, #3b82f6, #2563eb); box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35); }
.vt-btn--primary:hover:not(:disabled) { background: linear-gradient(180deg, #60a5fa, #3b82f6); }
.vt-btn--ghost { background: rgba(17, 26, 46, 0.7); border-color: rgba(147, 197, 253, 0.25); }
.vt-btn--ghost:hover:not(:disabled) { border-color: #60a5fa; }
.vt-btn--small { padding: 0.45rem 0.8rem; font-size: 0.8125rem; }
.vt-go { justify-self: start; }

.vt-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(15, 26, 51, 0.7);
  border: 1px solid rgba(96, 165, 250, 0.16);
}
.vt-file__meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; align-items: baseline; min-width: 0; }
.vt-file__name { color: #f1f5f9; overflow-wrap: anywhere; }
.vt-file__size { color: #94a3b8; font-size: 0.875rem; }

.vt-options { display: grid; gap: 0.9rem; }
.vt-field { display: grid; gap: 0.4rem; }
.vt-field--inline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.vt-field__label { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em; color: #94a3b8; }
.vt-seg { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; }
.vt-seg__btn {
  font: 600 0.875rem/1.2 var(--font-body);
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(147, 197, 253, 0.22);
  background: rgba(17, 26, 46, 0.7);
  color: #cbd5e1;
  cursor: pointer;
}
.vt-seg__btn[aria-checked="true"] { background: rgba(59, 130, 246, 0.25); border-color: #60a5fa; color: #f8fafc; }
.vt-num {
  width: 6.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(147, 197, 253, 0.25);
  background: #0a1020;
  color: #f1f5f9;
  font: 500 0.9375rem var(--font-body);
}
.vt-num--time { width: 8.5rem; font-variant-numeric: tabular-nums; }
.vt-num--wide { width: 10rem; }
.vt-num.is-bad { border-color: #f87171; }

.vt-progress { display: grid; gap: 0.6rem; }
.vt-progress__track { display: block; height: 8px; border-radius: 99px; background: rgba(148, 163, 184, 0.18); overflow: hidden; }
.vt-progress__bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3b82f6, #60a5fa); transition: width 0.3s; }
.vt-progress__row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: #cbd5e1; font-size: 0.9375rem; }

.vt-result { display: grid; gap: 0.8rem; }
.vt-result__title { margin: 0; color: #86efac; font-weight: 600; overflow-wrap: anywhere; }
.vt-result__media { width: 100%; }
.vt-result__media--video { max-height: 420px; border-radius: 12px; background: #000; }
.vt-result__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.vt-error { margin: 0; padding: 0.75rem 1rem; border-radius: 12px; background: rgba(127, 29, 29, 0.35); border: 1px solid rgba(248, 113, 113, 0.4); color: #fecaca; }
.vt-summary { margin: 0; color: #cbd5e1; }

/* Subtitle tracks (MKV extractor) */
.vt-tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.vt-track { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; align-items: center; padding: 0.8rem 1rem; border-radius: 12px; background: rgba(15, 26, 51, 0.7); border: 1px solid rgba(96, 165, 250, 0.16); }
.vt-track__meta { display: grid; gap: 0.15rem; }
.vt-track__meta span { color: #94a3b8; font-size: 0.8125rem; }
.vt-track__actions { display: flex; gap: 0.4rem; }

/* Silence remover */
.vt-silence { display: grid; gap: 0.9rem; }
.vt-wave { width: 100%; height: 120px; border-radius: 12px; background: #050a14; border: 1px solid rgba(96, 165, 250, 0.16); }
.vt-sliders { display: grid; gap: 0.9rem; }
@media (min-width: 700px) { .vt-sliders { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vt-slider { display: grid; gap: 0.35rem; }
.vt-slider output { color: #f1f5f9; font-variant-numeric: tabular-nums; }
.vt-slider input { width: 100%; accent-color: #3b82f6; }

/* Frame extractor */
.vt-frames__panel { display: grid; gap: 0.9rem; }
.vt-frames__controls { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; }
.vt-frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; max-height: 420px; overflow: auto; }
.vt-frame { margin: 0; display: grid; gap: 0.3rem; }
.vt-frame img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: #000; }
.vt-frame figcaption { display: flex; justify-content: space-between; align-items: center; color: #94a3b8; font-size: 0.8125rem; }

/* Subtitle converters */
.vt-sub { display: grid; gap: 1rem; }
@media (min-width: 860px) { .vt-sub { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.vt-sub__pane { display: grid; gap: 0.55rem; align-content: start; min-width: 0; }
.vt-sub__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; color: #e2e8f0; }
.vt-sub__btns { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.vt-text {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(147, 197, 253, 0.22);
  background: #0a1020;
  color: #f1f5f9;
  font: 0.9rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.vt-text--out { background: #070d1a; }
.vt-text--short { min-height: 140px; }
.vt-count { color: #94a3b8; font-size: 0.8125rem; }
.vt-tool--wide .vt-options { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: end; }

/* SRT editor */
.vt-editor { display: grid; gap: 0.8rem; }
.vt-editor__bar { display: flex; flex-wrap: wrap; gap: 0.6rem 1.25rem; align-items: center; }
.vt-cues { display: grid; gap: 0.45rem; max-height: 560px; overflow: auto; padding-right: 0.25rem; }
.vt-cue { display: grid; grid-template-columns: 2.2rem auto 1fr auto; gap: 0.6rem; align-items: start; padding: 0.55rem 0.7rem; border-radius: 10px; background: rgba(15, 26, 51, 0.6); border: 1px solid rgba(96, 165, 250, 0.12); }
.vt-cue__n { color: #64748b; font-variant-numeric: tabular-nums; padding-top: 0.45rem; }
.vt-cue__times { display: grid; gap: 0.3rem; grid-template-columns: auto auto; }
.vt-cue__times .vt-num--time { width: 8.2rem; padding: 0.35rem 0.5rem; font-size: 0.85rem; }
.vt-cue__seek { grid-column: span 2; justify-self: start; background: none; border: 0; color: #60a5fa; cursor: pointer; font-size: 0.8rem; padding: 0; }
.vt-cue__text { width: 100%; resize: vertical; padding: 0.4rem 0.6rem; border-radius: 8px; border: 1px solid rgba(147, 197, 253, 0.2); background: #0a1020; color: #f1f5f9; font: 0.9375rem/1.45 var(--font-body); }
.vt-cue__actions { display: flex; gap: 0.3rem; }
@media (max-width: 760px) {
  .vt-cue { grid-template-columns: 2rem 1fr; }
  .vt-cue__times, .vt-cue__text, .vt-cue__actions { grid-column: 2; }
}


/* Explainer diagrams built from page elements */
.vt-diagram {
  margin: 0;
  padding: 1.1rem 1.2rem;
  border-radius: 16px;
  background: #0a1020;
  border: 1px solid rgba(96, 165, 250, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  color: #cbd5e1;
  overflow-x: auto;
}
.vt-diagram pre { margin: 0; font: 0.875rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; color: #e2e8f0; }
.vt-diagram figcaption { margin-top: 0.75rem; font-size: 0.8125rem; color: #94a3b8; }
.vt-diagram .hl { color: #fbbf24; }
.vt-diagram .dim { color: #64748b; }
.vt-diagram .ok { color: #86efac; }
.vt-specs { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.vt-specs th, .vt-specs td { padding: 0.55rem 0.7rem; text-align: left; border-bottom: 1px solid rgba(148, 163, 184, 0.15); vertical-align: top; }
.vt-specs th { color: #f1f5f9; font-weight: 600; }
.vt-specs td { color: #cbd5e1; }

/* Prose sections under the explainers */
.vt-prose { max-width: 46rem; margin: clamp(2.5rem, 6vw, 4rem) auto 0; }
.vt-prose h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 2.8vw, 2rem); letter-spacing: -0.02em; color: #f1f5f9; margin: 2.2rem 0 0.8rem; }
.vt-prose h3 { font-family: var(--font-display); font-size: 1.2rem; color: #f1f5f9; margin: 1.6rem 0 0.5rem; }
.vt-prose p, .vt-prose li { color: #cbd5e1; line-height: 1.75; }
.vt-prose p + p { margin-top: 0.85rem; }
.vt-prose .vt-answer { padding: 1rem 1.2rem; border-left: 3px solid #3b82f6; background: rgba(30, 58, 138, 0.18); border-radius: 0 12px 12px 0; color: #e2e8f0; }

/* Hub and sibling cards */
.vt-cards { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 1.25rem; }
.vt-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(15, 26, 51, 0.6);
  border: 1px solid rgba(96, 165, 250, 0.16);
  color: inherit;
  text-decoration: none !important;
  transition: border-color 0.2s, transform 0.2s;
}
.vt-card:hover { border-color: #60a5fa; transform: translateY(-2px); }
.vt-card strong { color: #f1f5f9; font-family: var(--font-display); }
.vt-card span { color: #94a3b8; font-size: 0.875rem; line-height: 1.5; }
.vt-group-title { font-family: var(--font-display); color: #f1f5f9; font-size: 1.25rem; margin: 2.2rem 0 0; }

/* [hidden] must win over the display rules above */
.vt-tool [hidden], .vt-hero [hidden] { display: none !important; }
.tool-row .tool-steps + p { margin-top: 0.9rem; }
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* Reserve the subtitle tools' height until the script has built them */
@media (min-width: 860px) { .vt-tool--wide:not(.is-ready):not(.vt-tool--editor) { min-height: 440px; } }
@media (max-width: 859px) { .vt-tool--wide:not(.is-ready):not(.vt-tool--editor) { min-height: 850px; } }

/* Chosen file: name and size, with a small × to remove it and pick another */
.vt-file { position: relative; padding-right: 3rem; }
.vt-file__close {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.vt-file__close:hover, .vt-file__close:focus-visible { background: rgba(248, 113, 113, 0.22); color: #fff; outline: none; }

/* Full-width tools (subtitle converters, SRT editor): the tool sits below the
   copy, so the heading and description are centred and wider. */
.vt-hero--wide .vt-hero__copy { text-align: center; max-width: 60rem; margin-inline: auto; }
.vt-hero--wide .vt-hero__copy .vt-hero__lead { max-width: 52rem; margin-inline: auto; }

/* Subtitle converters: equal panes, one settings row, centred actions */
.vt-tool--wide .vt-sub__head { min-height: 2.3rem; }
.vt-tool--wide .vt-text { height: 320px; min-height: 0; }
.vt-tool--wide .vt-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  grid-template-columns: none;
}
.vt-field--compact { gap: 0.3rem; }
.vt-select {
  padding: 0.5rem 2rem 0.5rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(147, 197, 253, 0.25);
  background: #0a1020 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2394a3b8' stroke-width='1.6'/%3E%3C/svg%3E") right 0.7rem center / 10px no-repeat;
  color: #f1f5f9;
  font: 500 0.9rem var(--font-body);
  appearance: none;
  cursor: pointer;
}
.vt-num--compact { width: 5.5rem; padding: 0.5rem 0.65rem; font-size: 0.9rem; }
.vt-num--compact.vt-num--time { width: 7rem; }
.vt-sub__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.6rem; }

/* Japanese and Korean headings: break at the spaces between terms, not mid-word */
:lang(ja) .vt-hero__title, :lang(ko) .vt-hero__title,
:lang(ja) .tool-row h3, :lang(ja) .section__title { word-break: keep-all; overflow-wrap: anywhere; }

/* SRT viewer */
.vt-viewer__start { display: grid; gap: 0.8rem; }
.vt-viewer { display: grid; gap: 0.8rem; }
.vt-viewer__search { width: min(18rem, 100%); }
.vt-count[data-search]::after { content: " · " attr(data-search); color: #fbbf24; }
.vt-viewer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; max-height: 620px; overflow: auto; }
.vt-viewer__cue { display: grid; grid-template-columns: 13.5rem 1fr; gap: 0.9rem; align-items: baseline; padding: 0.6rem 0.8rem; border-radius: 10px; background: rgba(15, 26, 51, 0.55); border: 1px solid rgba(96, 165, 250, 0.1); }
.vt-viewer__cue.is-now { border-color: #60a5fa; background: rgba(30, 58, 138, 0.4); }
.vt-viewer__time { justify-self: start; background: none; border: 0; padding: 0; color: #94a3b8; font: 0.8125rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; cursor: pointer; text-align: left; }
.vt-viewer__time:hover { color: #60a5fa; }
.vt-viewer__text { margin: 0; color: #f1f5f9; line-height: 1.55; }
.vt-viewer__text mark { background: rgba(251, 191, 36, 0.35); color: inherit; border-radius: 3px; padding: 0 1px; }
@media (max-width: 640px) { .vt-viewer__cue { grid-template-columns: 1fr; gap: 0.2rem; } }
