/* PRINTmov Speak — page styles (extracted from tts.html) */

/* ── Editor shell ─────────────────────────────────── */
.vs-editor {
  display: flex;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0,0,0,0.35);
  min-height: 480px;
}

/* ── Left: character sidebar ─────────────────────── */
.vs-sidebar {
  width: 180px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.4);
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px 16px;
  gap: 0;
}
.vs-portrait {
  width: 120px;
  height: 160px;
  object-fit: contain;
  object-position: bottom;
  border-radius: 10px;
  margin-bottom: 10px;
  transition: opacity 0.2s;
}
.vs-char-name {
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  line-height: 1.2;
  margin-bottom: 2px;
}
.vs-char-sub {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  text-align: center;
  margin-bottom: 14px;
}
.vs-char-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin-top: 8px;
}
.vs-char-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
}
.vs-char-btn:hover { background: rgba(255,255,255,0.07); color: #fff; }
.vs-char-btn.active {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}
.vs-char-btn img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}
.vs-char-btn-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Gender-tinted avatar placeholder for community voices (no artwork) */
.vs-char-ph {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #fff;
}
.vs-char-ph.is-female { background: linear-gradient(135deg, #d86a9e, #a85080); }
.vs-char-ph.is-male   { background: linear-gradient(135deg, #6a8ed8, #5070a8); }

/* Sidebar group headers (PRINTmov / Community) */
.vs-group-label {
  width: 100%;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.32);
  padding: 9px 8px 3px;
  margin-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.vs-char-list > .vs-group-label:first-child { border-top: none; margin-top: 0; padding-top: 2px; }

/* Large portrait placeholder for community voices */
.vs-portrait-ph {
  width: 120px;
  height: 160px;
  border-radius: 10px;
  margin-bottom: 10px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: rgba(255,255,255,0.85);
  border: 1px dashed rgba(255,255,255,0.22);
  transition: opacity 0.2s;
}
.vs-portrait-ph i { font-size: 3rem; }
.vs-portrait-ph.is-female { background: radial-gradient(circle at 50% 38%, rgba(216,106,158,0.38), rgba(216,106,158,0.06)); }
.vs-portrait-ph.is-male   { background: radial-gradient(circle at 50% 38%, rgba(106,142,216,0.38), rgba(106,142,216,0.06)); }

/* ── Main editor area ────────────────────────────── */
.vs-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.vs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  flex-shrink: 0;
}
.vs-toolbar-title {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.vs-style-badge {
  font-size: 0.75rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 2px 10px;
  color: rgba(255,255,255,0.6);
}
.vs-style-badge span { color: #fff; font-weight: 600; }

.vs-body {
  flex: 1;
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Textarea */
.vs-textarea {
  flex: 1;
  min-height: 130px;
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: #fff !important;
  border-radius: 8px !important;
  font-size: 1rem !important;
  line-height: 1.6 !important;
  resize: none;
  outline: none !important;
  box-shadow: none !important;
  font-family: inherit;
}
.vs-textarea:focus {
  border-color: rgba(255,255,255,0.3) !important;
  background: rgba(255,255,255,0.06) !important;
}
.vs-textarea::placeholder { color: rgba(255,255,255,0.2) !important; }
.vs-char-count {
  text-align: right;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
  margin-top: -8px;
}
.vs-char-count.warn { color: #ffc107; }
.vs-char-count.over { color: #dc3545; }

/* Style slider */
.vs-slider-wrap { transition: opacity 0.2s ease; }
.vs-slider-wrap.locked { opacity: 0.3; pointer-events: none; }
.vs-slider-heading {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 4px;
}
.vs-slider-heading strong { color: #fff; }
#styleSlider {
  width: 100%;
  accent-color: #fff;
  cursor: pointer;
}
.vs-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  margin-top: 3px;
}
.vs-slider-labels span { flex: 0 0 auto; }
.vs-slider-labels span.active { color: #fff; font-weight: 600; }

/* Generate row */
.vs-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.vs-generate-btn {
  border-radius: 8px;
  padding: 8px 22px;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
.vs-hint {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.25);
}
.vs-status {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Output / waveform ───────────────────────────── */
.vs-output {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  background: rgba(0,0,0,0.3);
  overflow: hidden;
  margin-top: 16px;
}
.vs-output-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
}
.vs-output-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.vs-output-meta {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
}
.vs-waveform-wrap {
  position: relative;
  background: rgba(0,0,0,0.2);
  padding: 12px 0 4px;
}
#waveformCanvas {
  width: 100%;
  height: 80px;
  display: block;
}
.vs-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 14px;
}
#audioPlayer {
  flex: 1;
  height: 32px;
  min-width: 0;
}
/* Style the native audio player to be minimal */
audio::-webkit-media-controls-panel { background: rgba(255,255,255,0.05); }

/* ── Lip-sync talking head ───────────────────────── */
.vs-output-body {
  display: flex;
  align-items: stretch;
}
.vs-lipsync {
  flex-shrink: 0;
  width: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 10px 8px;
  border-right: 1px solid rgba(255,255,255,0.07);
  background: radial-gradient(ellipse at 50% 90%, rgba(255,255,255,0.07), transparent 72%);
}
.vs-output-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.vs-lip-stage {
  position: relative;
  height: 210px;
  width: 100%;
}
.vs-lip-frame {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.vs-lip-frame.active { opacity: 1; }   /* instant hard-cut swap — no crossfade flicker */
@media (max-width: 700px) {
  .vs-output-body { flex-direction: column; }
  .vs-lipsync {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  .vs-lip-stage { height: 170px; }
}

/* ── Singer color theming on editor ─────────────── */
.vs-editor.singer-printto {
  border-color: #d86a8e;
  background: linear-gradient(135deg, #24151d 0%, #3a1d2b 45%, #4a2323 100%);
}
.vs-editor.singer-kaiz {
  border-color: #a8adc8;
  background: linear-gradient(135deg, #191922 0%, #2a2d3a 45%, #34384a 100%);
}
.vs-editor.singer-francefrank {
  border-color: #9bb7d8;
  background: linear-gradient(135deg, #171a20 0%, #24303c 45%, #1f2630 100%);
}
.vs-editor.singer-petchploy {
  border-color: #9f8a90;
  background: linear-gradient(135deg, #2b2b30 0%, #3a3238 45%, #4a3e3e 100%);
}
.vs-editor.singer-ada {
  border-color: #d86a9e;
  background: linear-gradient(135deg, #241520 0%, #3a1d2e 45%, #4a2338 100%);
}
.vs-editor.singer-aden {
  border-color: #6a8ed8;
  background: linear-gradient(135deg, #15191f 0%, #1d2740 45%, #22314c 100%);
}

/* ── Sidebar bio ─────────────────────────────────── */
.vs-char-bio {
  width: 100%;
  height: 30px;
  overflow-y: visible;
  margin-top: 10px;
  margin-bottom: 10px;
}
.vs-char-bio p {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  margin-bottom: 7px;
}
.vs-char-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.vs-char-langs .badge {
  font-size: 0.65rem;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 700px) {
  .vs-editor { flex-direction: column; }
  .vs-sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 12px 14px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    gap: 12px;
  }
  .vs-portrait,
  .vs-portrait-ph { width: 52px; height: 68px; margin-bottom: 0; border-radius: 8px; }
  .vs-portrait-ph i { font-size: 1.4rem; }
  .vs-char-name { font-size: 0.9rem; text-align: left; }
  .vs-char-sub  { text-align: left; margin-bottom: 0; }
  .vs-char-list {
    flex-direction: row;
    flex: 0 1 auto;
    min-height: 0;
    margin-top: 0;
    margin-left: auto;
    width: auto;
    gap: 4px;
    overflow-x: auto;
    overflow-y: visible;
  }
  .vs-group-label { display: none; }
  .vs-char-btn { padding: 4px 6px; }
  .vs-char-btn .vs-char-btn-name { display: none; }
  .vs-char-btn img,
  .vs-char-ph { width: 30px; height: 30px; }
  .vs-char-bio { display: none; }
}
