/* === VIDEO GENERATOR PAGE === */

.vg-main {
  min-height: calc(100vh - 64px);
  padding: 2rem 1.5rem 4rem;
  max-width: 1400px;
  margin: 0 auto;
}

.vg-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

/* === LAYOUT === */

.vg-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 960px) {
  .vg-layout { grid-template-columns: 1fr; }
}

/* === SETUP PANEL === */

.vg-setup-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.vg-step {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 215, 0, 0.12);
  border-radius: 16px;
  overflow: hidden;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  background: rgba(255, 215, 0, 0.06);
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold);
  color: #0d0d2b;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

.step-body {
  padding: 1rem 1.25rem;
}

/* Script Picker */
.script-picker {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
  position: relative;
}

/* Fade gradient when content is scrollable — signals more scripts below */
.script-picker::after {
  content: '';
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: linear-gradient(to bottom, transparent, rgba(13, 13, 43, 0.5));
  pointer-events: none;
  display: block;
}

.script-picker::-webkit-scrollbar { width: 4px; }
.script-picker::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 4px; }
.script-picker::-webkit-scrollbar-thumb { background: rgba(255,215,0,0.3); border-radius: 4px; }

.script-pick-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.1rem 0.5rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: left;
}

.script-pick-card:hover {
  border-color: rgba(255, 215, 0, 0.3);
  background: rgba(255, 215, 0, 0.04);
}

.script-pick-card.selected {
  border-color: var(--gold);
  background: rgba(255, 215, 0, 0.08);
}

.pick-pillar {
  grid-column: 1;
  grid-row: 1;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
  background: rgba(255, 215, 0, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  width: fit-content;
  align-self: center;
}

.pick-title {
  grid-column: 2;
  grid-row: 1;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  line-height: 1.3;
}

.pick-hook {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.4;
  margin-top: 0.15rem;
}

/* Template Grid */
.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.template-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
  color: inherit;
}

.template-btn:hover {
  border-color: rgba(255, 215, 0, 0.3);
  background: rgba(255, 215, 0, 0.04);
}

.template-btn.selected {
  border-color: var(--gold);
  background: rgba(255, 215, 0, 0.1);
}

.tmpl-emoji { font-size: 1.4rem; }
.tmpl-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}
.tmpl-desc {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.3;
}

/* Style Grid */
.style-grid,
.voice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.style-btn,
.voice-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.65rem 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
  color: inherit;
}

.style-btn:hover,
.voice-btn:hover {
  border-color: rgba(255, 215, 0, 0.3);
  background: rgba(255, 215, 0, 0.04);
}

.style-btn.selected,
.voice-btn.selected {
  border-color: var(--gold);
  background: rgba(255, 215, 0, 0.1);
}

.style-label,
.voice-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

.style-desc,
.voice-desc {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.3;
}

/* Generate Button */
.vg-generate-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--gold), #ffa500);
  color: #0d0d2b;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

.vg-generate-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(255, 215, 0, 0.4);
}

.vg-generate-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.vg-disclaimer {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  text-align: center;
  line-height: 1.5;
}

.no-scripts-notice {
  padding: 0.75rem 0;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
}

.no-scripts-notice a { color: var(--gold); }

/* === OUTPUT PANEL === */

.vg-output-panel {
  min-height: 500px;
}

/* Idle State */
.vg-output-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,215,0,0.2);
  border-radius: 20px;
  min-height: 400px;
}

.vg-idle-icon { font-size: 4rem; margin-bottom: 1rem; }
.vg-idle-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  margin-bottom: 0.5rem;
}
.vg-idle-text {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.45);
  max-width: 400px;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.vg-idle-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.5rem;
  text-align: left;
}

.idle-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}

.feature-icon { font-size: 1rem; }

/* Loading State */
.vg-output-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: 20px;
  padding: 3rem;
  gap: 2rem;
}

.vg-loading-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.loading-orb-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,215,0,0.8), rgba(255,140,0,0.3));
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(255,215,0,0.4);
}

.loading-stages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 280px;
}

.loading-stage {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.35);
  transition: color 0.4s;
}

.loading-stage.active {
  color: rgba(255,255,255,0.85);
}

.stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,215,0,0.3);
  flex-shrink: 0;
  transition: background 0.4s;
}

.loading-stage.active .stage-dot {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(255,215,0,0.8);
  animation: pulse 1s ease-in-out infinite;
}

.vg-loading-note {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
  text-align: center;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.95); }
}

/* Error State */
.vg-output-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: rgba(255,50,50,0.05);
  border: 1px solid rgba(255,50,50,0.2);
  border-radius: 20px;
  padding: 3rem;
  gap: 1rem;
  text-align: center;
}

/* Result State */
.vg-output-result {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.vg-result-header {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
}

.result-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.result-template-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0d0d2b;
  background: var(--gold);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.result-style-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.result-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.result-actions-top {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 10px;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.export-btn:hover { background: rgba(255,215,0,0.18); }

/* TTS launch button — sits next to export in result-actions-top */
.tts-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: rgba(100, 220, 130, 0.1);
  border: 1px solid rgba(100, 220, 130, 0.4);
  border-radius: 10px;
  color: #64dc82;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.tts-launch-btn:hover { background: rgba(100,220,130,0.18); }

/* Production Notes */
.production-notes {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,215,0,0.1);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
}

.notes-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  margin-bottom: 1rem;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.note-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.note-icon { font-size: 1rem; flex-shrink: 0; }
.note-label {
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  min-width: 60px;
}
.note-value {
  color: rgba(255,255,255,0.8);
}

/* Scene Timeline */
.scene-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
}

.scenes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Scene Card */
.scene-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.25rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.25rem;
  transition: border-color 0.2s;
}

.scene-card:hover {
  border-color: rgba(255,215,0,0.2);
}

.scene-card.scene-reveal {
  border-color: rgba(255,215,0,0.3);
  background: rgba(255,215,0,0.04);
}

@media (max-width: 640px) {
  .scene-card { grid-template-columns: 1fr; }
}

/* Scene Image */
.scene-img-wrap {
  position: relative;
  width: 120px;
  height: 213px; /* 9:16 ratio */
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.scene-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scene-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-size: 1.5rem;
  color: rgba(255,255,255,0.3);
}

/* Image failed state */
.scene-img-error {
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 80, 80, 0.3);
  gap: 0.15rem !important;
}

.img-error-icon {
  font-size: 1.5rem;
}

.img-error-msg {
  font-size: 0.6rem;
  color: rgba(255,120,120,0.7);
  text-align: center;
  max-width: 90px;
  line-height: 1.3;
  display: block;
}

.img-retry-btn {
  margin-top: 0.25rem;
  padding: 0.2rem 0.5rem;
  background: rgba(255,100,100,0.15);
  border: 1px solid rgba(255,100,100,0.4);
  border-radius: 6px;
  color: #ff9090;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.img-retry-btn:hover { background: rgba(255,100,100,0.25); }
.img-retry-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.placeholder-text {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.3);
}

.reveal-badge {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(255,215,0,0.9);
  color: #0d0d2b;
  padding: 0.2rem;
}

/* Scene Right Content */
.scene-right {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.scene-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.scene-num {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
}

.scene-timing {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.06);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

.scene-duration {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
}

.scene-transition {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  margin-left: auto;
  background: rgba(255,255,255,0.05);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

.scene-field-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.35);
  display: block;
  margin-bottom: 0.25rem;
}

.scene-voiceover-text {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.55;
  font-style: italic;
  margin: 0;
}

/* Text Overlay Preview */
.overlay-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.overlay-text {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: #FFE600;
  text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.overlay-timing-badge {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.06);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

.scene-prompt-text {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  margin: 0 0 0.5rem;
}

.copy-prompt-btn {
  font-size: 0.72rem;
  color: var(--gold);
  background: rgba(255,215,0,0.08);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  transition: background 0.2s;
}

.copy-prompt-btn:hover { background: rgba(255,215,0,0.15); }

/* Result Bottom Actions */
.result-actions-bottom {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}

.vg-generate-another-btn {
  padding: 0.7rem 1.4rem;
  background: rgba(255,215,0,0.1);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 12px;
  color: var(--gold);
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.vg-generate-another-btn:hover { background: rgba(255,215,0,0.18); }

.view-scripts-link {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 0.2s;
}

.view-scripts-link:hover { color: var(--gold); }

/* === PAST PROJECTS === */
.past-projects-section {
  padding: 3rem 1.5rem;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid rgba(255,215,0,0.08);
}

.past-projects-container {
  max-width: 1400px;
  margin: 0 auto;
}

.past-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  margin-bottom: 1.25rem;
}

.past-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.past-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.past-card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.past-mode-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: capitalize;
  color: rgba(255,215,0,0.8);
  background: rgba(255,215,0,0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

.past-status {
  font-size: 0.68rem;
  text-transform: capitalize;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  margin-left: auto;
}

.past-status.complete { color: #4ade80; background: rgba(74,222,128,0.1); }
.past-status.failed { color: #f87171; background: rgba(248,113,113,0.1); }
.past-status.generating { color: var(--gold); background: rgba(255,215,0,0.1); }

.past-title-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  line-height: 1.3;
}

.past-date {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
}

.past-load-btn {
  margin-top: 0.5rem;
  padding: 0.35rem 0.8rem;
  background: rgba(255,215,0,0.1);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  width: fit-content;
}

.past-load-btn:hover { background: rgba(255,215,0,0.18); }

/* ===================================
   TTS AUDIO PANEL
   =================================== */

.tts-panel {
  background: rgba(100, 220, 130, 0.04);
  border: 1px solid rgba(100, 220, 130, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.tts-panel-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #64dc82;
  margin: 0 0 0.4rem;
}

.tts-panel-desc {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

/* Voice grid */
.tts-voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.tts-voice-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.85rem 0.9rem 0.65rem;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.tts-voice-btn:hover {
  border-color: rgba(100,220,130,0.35);
  background: rgba(100,220,130,0.05);
}

.tts-voice-btn.selected {
  border-color: #64dc82;
  background: rgba(100,220,130,0.1);
}

.tts-voice-emoji {
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 0.15rem;
}

.tts-voice-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

.tts-voice-desc {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.3;
}

.tts-preview-btn {
  margin-top: 0.4rem;
  padding: 0.2rem 0.55rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: rgba(255,255,255,0.65);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  align-self: flex-start;
}

.tts-preview-btn:hover {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
}

.tts-preview-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Actions */
.tts-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.tts-generate-btn {
  padding: 0.7rem 1.4rem;
  background: linear-gradient(135deg, #2dbd50, #1a9e40);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 0.01em;
}

.tts-generate-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.tts-generate-btn:active { transform: translateY(0); }

.tts-time-estimate {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  margin: 0;
}

/* Progress */
.tts-progress {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.tts-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(100,220,130,0.25);
  border-top-color: #64dc82;
  border-radius: 50%;
  animation: tts-spin 0.8s linear infinite;
  flex-shrink: 0;
  margin-top: 2px;
}

@keyframes tts-spin {
  to { transform: rotate(360deg); }
}

.tts-progress-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: #64dc82;
  margin: 0 0 0.2rem;
}

.tts-progress-sub {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  margin: 0;
}

/* Error */
.tts-error {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tts-error-text {
  font-size: 0.85rem;
  color: #ff7070;
  margin: 0;
}

.tts-retry-btn {
  padding: 0.35rem 0.8rem;
  background: rgba(255,100,100,0.12);
  border: 1px solid rgba(255,100,100,0.35);
  border-radius: 8px;
  color: #ff9090;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.tts-retry-btn:hover { background: rgba(255,100,100,0.2); }

/* Success */
.tts-success-text {
  font-size: 0.85rem;
  color: #64dc82;
  margin: 0;
  font-weight: 600;
}

/* Audio player in scene card */
.scene-audio-player {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.audio-player-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.scene-audio {
  flex: 1;
  min-width: 200px;
  height: 36px;
  border-radius: 8px;
  accent-color: #64dc82;
}

.audio-voice-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64dc82;
  background: rgba(100,220,130,0.12);
  border: 1px solid rgba(100,220,130,0.25);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* === RENDER VIDEO PANEL === */

.render-panel {
  background: rgba(255, 215, 0, 0.04);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.render-panel-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffd700;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}

.render-panel-desc {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

/* Checklist */
.render-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.render-check {
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
}
.render-check.done {
  color: #64dc82;
  background: rgba(100,220,130,0.08);
}
.render-check.missing {
  color: #ff7b7b;
  background: rgba(255,100,100,0.08);
}
.render-check.optional {
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.04);
}

/* Render button */
.render-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #1a1208;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: opacity 0.2s, transform 0.15s;
}
.render-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}
.render-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.render-btn-icon { font-size: 1.3rem; }

.render-time-note {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  margin-top: 0.6rem;
}

/* Progress bar */
.render-progress-bar-wrap {
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  height: 16px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.render-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ffd700, #64dc82);
  border-radius: 12px;
  transition: width 0.5s ease;
  min-width: 3%;
}
.render-progress-msg {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  font-weight: 600;
  text-align: center;
  margin: 0 0 0.25rem;
}
.render-progress-pct {
  font-size: 0.8rem;
  color: #ffd700;
  text-align: center;
  font-weight: 700;
  margin: 0;
}

/* Error */
.render-error-text {
  color: #ff7b7b;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.75rem;
}
.render-retry-btn {
  display: block;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  background: rgba(255,120,120,0.15);
  border: 1px solid rgba(255,120,120,0.3);
  border-radius: 10px;
  color: #ff7b7b;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.render-retry-btn:hover { background: rgba(255,120,120,0.25); }

/* Complete / Download */
.render-complete {
  text-align: center;
}
.render-success-icon {
  font-size: 2.5rem;
  margin-bottom: 0.4rem;
}
.render-success-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #64dc82;
  margin: 0 0 1rem;
}
.render-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  background: linear-gradient(135deg, #64dc82, #3ecf6c);
  color: #0d1f14;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
  margin-bottom: 0.6rem;
}
.render-download-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.render-download-note {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  margin: 0 0 1rem;
  font-family: monospace;
}
.render-video-preview-wrap {
  margin-top: 1rem;
}
.render-video-preview {
  width: 100%;
  max-width: 320px;
  border-radius: 12px;
  background: #000;
}

/* Image failure warning banner */
.image-failure-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.3);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.banner-icon { font-size: 1.2rem; flex-shrink: 0; }

.banner-text {
  font-size: 0.82rem;
  color: rgba(255, 150, 150, 0.9);
  flex: 1;
  line-height: 1.4;
}

.banner-retry-btn {
  padding: 0.35rem 0.8rem;
  background: rgba(255, 100, 100, 0.15);
  border: 1px solid rgba(255, 100, 100, 0.4);
  border-radius: 8px;
  color: #ff9090;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.banner-retry-btn:hover { background: rgba(255,100,100,0.25); }

/* === MUSIC TOGGLE === */

.music-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 215, 0, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 12px;
  margin-bottom: 1rem;
}

.music-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  cursor: default;
}

.music-toggle-icon { font-size: 1.1rem; }

.music-toggle-mood {
  font-size: 0.75rem;
  color: rgba(255, 215, 0, 0.7);
  font-weight: 500;
}

/* iOS-style toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.25s;
  cursor: pointer;
}

.toggle-track::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.toggle-switch input:checked + .toggle-track {
  background: rgba(255, 215, 0, 0.7);
}

.toggle-switch input:checked + .toggle-track::before {
  transform: translateX(20px);
}

/* === VIDEO OVERLAYS SECTION === */

.overlays-section {
  margin-bottom: 1rem;
}

.overlays-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.18);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.overlays-toggle-btn:hover { background: rgba(255, 215, 0, 0.07); }

.overlays-toggle-icon {
  font-size: 0.7rem;
  color: rgba(255, 215, 0, 0.7);
}

.overlays-badge {
  margin-left: auto;
  font-size: 0.72rem;
  background: rgba(255, 215, 0, 0.18);
  color: rgba(255, 215, 0, 0.9);
  border-radius: 20px;
  padding: 0.15rem 0.55rem;
  font-weight: 700;
}

.overlays-panel {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 215, 0, 0.1);
  border-radius: 12px;
}

.overlay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.overlay-row-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}

.overlay-row-icon { font-size: 1rem; flex-shrink: 0; padding-top: 1px; }

.overlay-row-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.overlay-row-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.overlay-row-desc {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.3;
}

.overlay-toggle { flex-shrink: 0; }

/* CTA picker */
.cta-picker {
  padding-left: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cta-preset-select {
  width: 100%;
  padding: 0.45rem 0.7rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.8rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23FFD700' d='M7 7l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 16px;
  padding-right: 2rem;
}

.cta-preset-select option { background: #1a1a3a; color: white; }

.cta-custom-input {
  width: 100%;
  padding: 0.45rem 0.7rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  outline: none;
  box-sizing: border-box;
}

.cta-custom-input:focus { border-color: rgba(255, 215, 0, 0.6); }

/* === MODE TOGGLE === */

.vg-mode-toggle {
  display: flex;
  gap: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 14px;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.mode-toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.mode-toggle-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.04);
}

.mode-toggle-btn.active {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 180, 0, 0.15));
  color: var(--gold);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.15);
}

/* === SCRIPT DROPDOWN (Existing Script mode) === */

.script-dropdown {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,215,0,0.6)' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.script-dropdown:focus {
  border-color: var(--gold);
  background: rgba(255, 215, 0, 0.06);
}

.script-dropdown option {
  background: #1a1a4e;
  color: white;
  padding: 0.5rem;
}

/* Selected Script Info Panel */
.selected-script-info {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(46, 207, 108, 0.06);
  border: 1px solid rgba(46, 207, 108, 0.2);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.script-info-pillar {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
  background: rgba(255, 215, 0, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  width: fit-content;
}

.script-info-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.3;
}

.script-info-hook {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.4;
  font-style: italic;
}

/* Auto-fill badge in step headers when pre-populated */
.step-header.auto-filled {
  background: rgba(46, 207, 108, 0.08);
  border-bottom-color: rgba(46, 207, 108, 0.2);
}

.step-header .auto-fill-note {
  font-size: 0.65rem;
  color: #64dc82;
  font-weight: 600;
  margin-left: auto;
}
