:root {
  --bg-primary: #0a0b12;
  --bg-secondary: #11131f;
  --bg-tertiary: #171b2d;
  --bg-surface: rgba(23, 27, 45, 0.7);
  --bg-glass: rgba(18, 22, 38, 0.65);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.6);
  --border-active: #6366f1;
  
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-glow: rgba(99, 102, 241, 0.35);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-glow: 0 0 35px rgba(99, 102, 241, 0.25);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Dynamic Animated Background */
.app-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  animation: floatOrb 20s infinite alternate ease-in-out;
}

.orb-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #7928ca 0%, #4338ca 70%);
  top: -120px;
  left: -80px;
}

.orb-2 {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, #06b6d4 0%, #2563eb 60%);
  bottom: -150px;
  right: -100px;
  animation-duration: 25s;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.8) 0%, transparent 80%);
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.08); }
  100% { transform: translate(-30px, 80px) scale(0.95); }
}

/* Header */
.app-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 11, 18, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-pink));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
  color: #fff;
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  fill: #fff;
  stroke: none;
}

.brand-info h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.version-badge {
  font-size: 0.72rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-primary));
  color: #fff;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.model-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-indicator-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}

.status-indicator-pill.online .status-dot {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.status-indicator-pill.demo .status-dot {
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Layout */
.main-content {
  position: relative;
  z-index: 10;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px 48px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Model Selector Tabs */
.model-tabs-container {
  width: 100%;
}

.model-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: rgba(14, 17, 30, 0.6);
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

@media (max-width: 1100px) {
  .model-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .model-tabs {
    grid-template-columns: 1fr;
  }
}

.model-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 4px;
  padding: 14px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  transition: all var(--transition-fast);
}

.model-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.08);
}

.model-tab.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.08));
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
}

.model-tab-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.model-tab-badge.wan-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.model-tab-badge.kling-badge {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  border-color: rgba(236, 72, 153, 0.4);
}

.model-tab-badge.soul-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

/* Multi-Shot Storyboard Styles */
.storyboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.storyboard-card {
  background: rgba(15, 18, 32, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--transition-fast);
}

.storyboard-card:hover {
  border-color: rgba(236, 72, 153, 0.4);
}

.storyboard-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shot-label-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: #f472b6;
  background: rgba(236, 72, 153, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.shot-duration-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-dim);
}

.shot-duration-input {
  width: 50px;
  background: #0f1220;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 2px 6px;
  text-align: center;
}

.btn-remove-shot {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px;
  transition: color var(--transition-fast);
}

.btn-remove-shot:hover {
  color: var(--danger);
}

.storyboard-card textarea {
  width: 100%;
  font-size: 0.84rem;
  padding: 8px 10px;
  min-height: 52px;
}

.model-tab-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.model-tab-desc {
  font-size: 0.76rem;
  color: var(--text-dim);
}

.model-tab.active .model-tab-desc {
  color: var(--text-muted);
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.active-model-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

.input-hint-inline {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.model-indicator-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.studio-layout {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 28px;
  align-items: start;
}

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

/* Panels */
.panel {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.panel-header {
  margin-bottom: 20px;
}

.panel-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Form Styles */
.control-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.required {
  color: var(--accent-pink);
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.btn-text-action:hover {
  color: #fff;
}

textarea {
  width: 100%;
  background: rgba(14, 17, 30, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  line-height: 1.45;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Prompt Chips */
.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.chip-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 500;
}

.prompt-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.74rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.prompt-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
  color: #fff;
  transform: translateY(-1px);
}

/* Duration Slider */
.value-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.slider-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: #1f243b;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-primary));
  box-shadow: 0 0 10px var(--accent-primary);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-marks {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Radio Card Groups */
.radio-card-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.radio-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(15, 18, 32, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.radio-card input {
  position: absolute;
  opacity: 0;
}

.radio-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(20, 24, 42, 0.8);
}

.radio-card.active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}

.radio-card-content {
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 0.88rem;
  font-weight: 600;
}

.card-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.pill-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  text-transform: uppercase;
}

.pill-badge.recommended {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Aspect Ratio Selector */
.ratio-preview-tag {
  font-size: 0.78rem;
  color: var(--accent-cyan);
  font-weight: 500;
}

.ratio-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.ratio-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 4px;
  background: rgba(15, 18, 32, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ratio-item input {
  position: absolute;
  opacity: 0;
}

.ratio-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.ratio-item.active {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
}

.ratio-box {
  border: 1.5px solid var(--text-dim);
  border-radius: 2px;
  transition: border-color var(--transition-fast);
}

.ratio-item.active .ratio-box {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.ratio-16-9 { width: 26px; height: 15px; }
.ratio-9-16 { width: 15px; height: 26px; }
.ratio-1-1  { width: 20px; height: 20px; }
.ratio-4-3  { width: 24px; height: 18px; }
.ratio-3-4  { width: 18px; height: 24px; }
.ratio-2-3  { width: 16px; height: 24px; }
.ratio-3-2  { width: 24px; height: 16px; }
.ratio-21-9 { width: 28px; height: 12px; }

.ratio-name {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Accordion */
.accordion {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(14, 17, 30, 0.5);
  overflow: hidden;
}

.accordion-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.accordion-summary svg {
  transition: transform var(--transition-fast);
}

.accordion[open] .accordion-summary svg {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-select {
  background: #0f1220;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
}

.form-select:focus {
  border-color: var(--border-focus);
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle-info {
  display: flex;
  flex-direction: column;
}

.toggle-label {
  font-size: 0.84rem;
  font-weight: 600;
}

.toggle-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider.round {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #1e243d;
  transition: .3s;
  border-radius: 34px;
}

.slider.round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider.round {
  background-color: var(--accent-primary);
}

input:checked + .slider.round:before {
  transform: translateX(20px);
}

/* Estimate Bar */
.estimate-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: rgba(14, 17, 30, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.estimate-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.est-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-weight: 600;
}

.est-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 500;
}

.est-val.highlight {
  color: var(--accent-cyan);
}

.est-val.cost-badge {
  color: #34d399;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.icon-btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
}

.btn-generate {
  position: relative;
  overflow: hidden;
  padding: 15px 24px;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.btn-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-100%);
  animation: sweepGlow 3s infinite;
}

@keyframes sweepGlow {
  0% { transform: translateX(-100%); }
  50%, 100% { transform: translateX(100%); }
}

/* Monitor Viewport Panel */
.monitor-panel {
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.viewport-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.viewport-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.viewport-tags {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.badge.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.3);
  color: #38bdf8;
}

.badge-dim {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Player Stage */
.player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #080911;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
  transition: aspect-ratio var(--transition-smooth);
}

/* Idle State */
.idle-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  max-width: 440px;
  gap: 12px;
}

.pulse-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.08);
  border: 1px dashed rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
  animation: pulseGlow 4s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.06); opacity: 1; border-color: var(--accent-cyan); }
}

.idle-state h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.idle-state p {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Generating State */
.generating-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  gap: 20px;
}

.generator-orb {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-core {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--accent-cyan) 80%);
  box-shadow: 0 0 25px var(--accent-cyan);
}

.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}

.ring-1 {
  width: 60px;
  height: 60px;
  border-top-color: var(--accent-primary);
  border-right-color: var(--accent-pink);
  animation: spinRing 2s linear infinite;
}

.ring-2 {
  width: 80px;
  height: 80px;
  border-bottom-color: var(--accent-cyan);
  border-left-color: var(--accent-secondary);
  animation: spinRing 3s linear infinite reverse;
}

@keyframes spinRing {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.gen-info {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 12px;
}

.gen-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.gen-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-primary), var(--accent-pink));
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
  box-shadow: 0 0 12px var(--accent-primary);
}

.gen-meta-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.btn-cancel {
  align-self: center;
  background: none;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-family: inherit;
  font-size: 0.76rem;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-cancel:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
  color: #fff;
}

/* Video Wrapper & Controls */
.video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
  padding: 14px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.video-wrapper:hover .video-controls {
  opacity: 1;
}

.scrub-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  cursor: pointer;
  position: relative;
}

.scrub-bar-fill {
  height: 100%;
  background: var(--accent-cyan);
  width: 0%;
  border-radius: var(--radius-pill);
  position: relative;
}

.controls-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: all var(--transition-fast);
}

.ctrl-btn:hover {
  opacity: 1;
  transform: scale(1.1);
  color: var(--accent-cyan);
}

.ctrl-btn.active {
  color: var(--accent-cyan);
}

.video-timecode {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Clip Metadata Card */
.clip-metadata {
  background: rgba(14, 17, 30, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meta-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.meta-prompt-text {
  font-size: 0.84rem;
  color: var(--text-main);
  line-height: 1.4;
  font-style: italic;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.meta-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-title {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.meta-data {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Gallery Section */
.gallery-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gallery-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gallery-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.gallery-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.gallery-empty {
  grid-column: 1 / -1;
  background: rgba(18, 22, 38, 0.4);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 36px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.gallery-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.gallery-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  box-shadow: 0 10px 24px -8px rgba(99, 102, 241, 0.3);
}

.gallery-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.gallery-thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity var(--transition-fast);
  color: #fff;
}

.gallery-card:hover .gallery-thumb-play {
  opacity: 1;
}

.gallery-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gallery-card-prompt {
  font-size: 0.8rem;
  color: var(--text-main);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-card-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  background: #111424;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-cyan);
  font-size: 0.8rem;
}

.form-input {
  width: 100%;
  background: rgba(14, 17, 30, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.input-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.mode-selector-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(14, 17, 30, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.mode-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 12px;
}

.mode-title {
  font-size: 0.86rem;
  font-weight: 600;
}

.mode-desc {
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.35;
}

.model-doc-box {
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.model-doc-box h4 {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.model-doc-box ul {
  list-style: none;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 12, 22, 0.5);
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 11, 18, 0.9);
  padding: 18px 28px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: #fff;
}

/* Image Wrapper & Lookbook Grid */
.image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080911;
  overflow: hidden;
}

.image-stage-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.single-image-view {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.single-image-view img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform var(--transition-smooth);
}

.single-image-view img:hover {
  transform: scale(1.02);
}

.image-grid-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 12px;
}

.grid-image-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #000;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
}

.grid-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.grid-image-item:hover img {
  transform: scale(1.06);
}

.grid-image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity var(--transition-fast);
  color: #fff;
}

.grid-image-item:hover .grid-image-overlay {
  opacity: 1;
}

/* Lightbox Modal */
.lightbox-card {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #111424;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-media-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05060a;
  padding: 16px;
  overflow: hidden;
}

.lightbox-media-wrap img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 10;
  font-size: 1.8rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.lightbox-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(14, 17, 30, 0.9);
}

.lightbox-prompt {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

