/* VibePDF Video Studio — uses the shared design tokens from style.css */

.vs-body-root {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: "Fira Code", monospace;
  overflow: hidden;
}

.vs-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background:
    var(--mesh-a), var(--mesh-b), var(--mesh-c), var(--mesh-d), var(--mesh-e), var(--mesh-f),
    var(--bg-base);
}

/* ---------- top bar ---------- */

.vs-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
}

.vs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vs-logo {
  width: 26px;
  height: 26px;
}

.vs-title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.vs-back {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  margin-left: 6px;
}

.vs-back:hover {
  color: var(--text-primary);
}

.vs-jobbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.vs-job-select {
  max-width: 260px;
}

.vs-pill {
  font-size: 11px;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 3px 10px;
  background: var(--bg-input);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.vs-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vs-status {
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 3px 10px;
}

.vs-status[data-state="running"] {
  color: var(--accent-cyan);
  border-color: var(--border-accent);
  animation: vs-pulse 1.4s ease-in-out infinite;
}

.vs-status[data-state="failed"] {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.4);
}

@keyframes vs-pulse {
  50% { opacity: 0.55; }
}

/* ---------- layout ---------- */

.vs-columns {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) minmax(380px, 42%);
  gap: var(--app-shell-gap);
  padding: var(--app-shell-gap);
  flex: 1;
  min-height: 0;
}

.vs-left,
.vs-right,
.vs-center {
  min-height: 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--app-panel-radius);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- tabs ---------- */

.vs-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--glass-border);
}

.vs-tab {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.vs-tab:hover {
  color: var(--text-primary);
}

.vs-tab.active {
  color: var(--text-primary);
  background: var(--gradient-active);
  border-color: var(--glass-border-soft);
}

.vs-panel {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.vs-panel.active {
  display: flex;
}

.vs-panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}

.vs-panel-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

/* ---------- shared controls ---------- */

.vs-section {
  margin-bottom: 18px;
}

.vs-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.vs-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.vs-field {
  margin-bottom: 8px;
}

.vs-field-inline {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.vs-field-label {
  display: block;
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.vs-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  padding: 7px 9px;
  outline: none;
}

.vs-input:focus {
  border-color: var(--border-accent);
}

textarea.vs-input {
  resize: vertical;
}

.vs-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 8px;
}

.vs-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  flex: 1;
}

.vs-btn {
  font: inherit;
  font-size: 12px;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  background: var(--bg-input);
  color: var(--text-primary);
  transition: filter 0.15s ease, transform 0.05s ease;
}

.vs-btn:active {
  transform: translateY(1px);
}

.vs-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.vs-btn-primary {
  background: var(--gradient-btn);
  border: none;
  color: #0b0d1f;
  font-weight: 600;
}

.vs-btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
}

.vs-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.vs-btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.vs-btn-block {
  width: 100%;
  margin-top: 6px;
}

.vs-btn-sm {
  padding: 3px 8px;
  font-size: 11px;
}

.vs-hidden {
  display: none !important;
}

/* ---------- chat ---------- */

.vs-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vs-chat-welcome {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vs-chat-welcome-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.vs-chat-bubble {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
}

.vs-chat-bubble-role {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.vs-chat-bubble-text {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.vs-chat-bubble-text code {
  font-family: "Fira Code", monospace;
  font-size: 11px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 0 4px;
}

.vs-chat-bubble.user .vs-chat-bubble-text {
  background: var(--gradient-active);
  border: 1px solid var(--glass-border-soft);
  border-radius: 10px;
  padding: 8px 10px;
}

.vs-chat-starters {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vs-chat-starter {
  text-align: left;
  font: inherit;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.vs-chat-starter:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.vs-chat-composer {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vs-chat-input {
  resize: none;
  min-height: 64px;
  max-height: 140px;
  line-height: 1.45;
}

.vs-chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vs-chat-live {
  font-size: 11px;
  color: var(--accent-cyan);
  line-height: 1.4;
}

.vs-chat-thoughts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vs-chat-messages .thought-block {
  font-size: 11px;
}

.vs-chat-messages .thought-body {
  font-size: 11px;
}

/* ---------- script editor ---------- */

.vs-scene {
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.vs-scene-head {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.vs-scene-id {
  font-weight: 600;
}

.vs-cue {
  border-left: 2px solid var(--accent-indigo);
  padding: 6px 8px;
  margin: 8px 0;
  background: rgba(129, 140, 248, 0.05);
  border-radius: 0 8px 8px 0;
}

.vs-cue-head {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.vs-cue-id {
  flex: 1.2;
}

.vs-cue-tag {
  flex: 1;
  color: var(--accent-teal);
}

.vs-cue-text {
  margin-bottom: 6px;
}

/* ---------- timeline viz ---------- */

.vs-timeline-viz {
  margin-top: 10px;
}

.vs-tl-ruler {
  position: relative;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-input);
  overflow: hidden;
  margin-bottom: 4px;
}

.vs-tl-scene {
  position: absolute;
  top: 0;
  bottom: 0;
  border-right: 1px solid var(--glass-border);
  background: var(--gradient-active);
  font-size: 9px;
  color: var(--text-secondary);
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vs-tl-cues {
  position: relative;
  height: 18px;
  border-radius: 6px;
  background: var(--bg-input);
}

.vs-tl-cue {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border: none;
  border-radius: 4px;
  background: var(--accent-indigo);
  opacity: 0.75;
  cursor: pointer;
  padding: 0;
}

.vs-tl-cue:hover {
  opacity: 1;
  background: var(--accent-cyan);
}

.vs-cue-detail {
  margin-top: 8px;
  font-size: 11px;
}

.vs-cue-detail-head {
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.vs-cue-detail-text {
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.vs-words {
  line-height: 2;
}

.vs-word {
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-primary);
  font: inherit;
  font-size: 10px;
  padding: 2px 6px;
  margin: 1px;
  cursor: pointer;
}

.vs-word:hover {
  border-color: var(--border-accent);
  color: var(--accent-cyan);
}

/* ---------- sfx + mix ---------- */

.vs-sfx-row,
.vs-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.vs-sfx-name,
.vs-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-primary);
  background: none;
  border: none;
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.vs-file-name:hover {
  color: var(--accent-cyan);
}

.vs-file-size {
  font-size: 10px;
  color: var(--text-faint);
}

/* ---------- user assets ---------- */

.vs-assets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.vs-asset-card {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.vs-asset-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.vs-asset-title {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vs-asset-kind {
  flex-shrink: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-cyan);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 4px;
  padding: 1px 6px;
}

.vs-asset-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-bottom: 4px;
}

.vs-asset-meta {
  font-size: 10px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
}

.vs-asset-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.vs-mix-row {
  display: grid;
  grid-template-columns: 1fr 64px 1.2fr 60px 28px;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}

.vs-audio {
  width: 100%;
  margin-top: 8px;
  height: 32px;
}

/* ---------- center stage ---------- */

.vs-center {
  position: relative;
}

.vs-stage-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(129, 140, 248, 0.08), transparent 70%),
    #05060f;
}

.vs-stage-scaler {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  overflow: hidden;
}

.vs-preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #000;
}

.vs-stage-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
}

.vs-stage-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.vs-transport {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--glass-border);
}

.vs-transport-play {
  width: 36px;
  height: 32px;
  padding: 0;
  text-align: center;
}

.vs-time {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 92px;
  text-align: center;
}

.vs-scrubber {
  flex: 1;
  accent-color: var(--accent-indigo);
}

/* ---------- code editor ---------- */

.vs-code-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 8px 0;
  flex-wrap: wrap;
}

.vs-code-tab {
  font: inherit;
  font-size: 11px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: var(--text-muted);
  padding: 5px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vs-code-tab.active {
  color: var(--text-primary);
  background: var(--gradient-active);
}

.vs-code-tab-close {
  color: var(--text-faint);
  font-size: 9px;
}

.vs-code-tab-close:hover {
  color: #f87171;
}

.vs-editor-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.vs-editor-wrap .CodeMirror {
  height: 100%;
  font-family: "Fira Code", monospace;
  font-size: 12px;
  background: rgba(7, 8, 24, 0.6);
}

/* ---------- render panel ---------- */

.vs-balance-row {
  align-items: center;
  justify-content: space-between;
}

.vs-tiers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.vs-tier {
  cursor: pointer;
}

.vs-tier input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vs-tier-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  box-sizing: border-box;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px;
  background: var(--bg-input);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.vs-tier:hover .vs-tier-card {
  border-color: var(--border-strong);
}

.vs-tier input:checked + .vs-tier-card {
  border-color: var(--border-accent);
  background: var(--gradient-active);
  box-shadow: var(--glass-highlight);
}

.vs-tier-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.vs-tier-price {
  font-size: 11px;
  color: var(--accent-cyan);
}

.vs-tier-desc {
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-muted);
}

.vs-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-input);
  overflow: hidden;
  margin: 12px 0 6px;
}

.vs-progress-bar {
  height: 100%;
  background: var(--gradient-btn);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.vs-render-log {
  font-family: "Fira Code", monospace;
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(7, 8, 24, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px;
  height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin: 10px 0;
}

.vs-render-preview {
  width: 100%;
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

/* ---------- responsive ---------- */

@media (max-width: 1200px) {
  .vs-columns {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .vs-right {
    display: none;
  }
}
