/* ==========================================================================
   VIDEO MERGER & AUDIO STUDIO PRO - LIGHT VIBRANT DESIGN SYSTEM
   ========================================================================== */

/* Design Tokens & Custom Properties */
:root {
  /* Light & Clean Palette */
  --bg-base: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f8fafc;

  /* Borders & Dividers */
  --border-subtle: #e2e8f0;
  --border-card: #e2e8f0;
  --border-focus: rgba(99, 102, 241, 0.6);
  --border-accent: rgba(99, 102, 241, 0.35);

  /* Color System */
  --primary-indigo: #6366f1;
  --primary-indigo-dark: #4f46e5;
  --primary-indigo-light: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.18);

  --accent-cyan: #0284c7;
  --accent-cyan-glow: rgba(2, 132, 199, 0.15);

  --emerald-success: #10b981;
  --emerald-dark: #059669;
  
  --amber-warn: #d97706;
  --rose-danger: #e11d48;

  /* Text & Typography */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* Geometry & Spacing */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Shadows & Depth */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 4px 16px rgba(99, 102, 241, 0.25);
  
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-base);
  background-image: 
    radial-gradient(ellipse at 15% 0%, rgba(99, 102, 241, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse at 85% 100%, rgba(2, 132, 199, 0.07) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  padding: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Application Layout Container */
.app-container {
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   STUDIO NAVBAR & WORKFLOW STEPPER
   ========================================================================== */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 14px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-indigo), #8b5cf6);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.logo-icon i {
  width: 22px;
  height: 22px;
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Header Workflow Stepper Indicator */
.header-workflow {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-base);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.workflow-step.active {
  opacity: 1;
}

.wf-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #cbd5e1;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.workflow-step.active .wf-num {
  background: var(--primary-indigo);
  color: #fff;
}

.wf-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.wf-connector {
  width: 16px;
  height: 2px;
  background: #cbd5e1;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--emerald-dark);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-success);
  box-shadow: 0 0 8px var(--emerald-success);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ==========================================================================
   WORKSPACE GRID & PANELS
   ========================================================================== */

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  min-height: calc(100vh - 120px);
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-md);
}

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

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

.step-title-wrap h2 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.step-number {
  background: var(--primary-indigo);
  color: #fff;
  font-weight: 800;
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Step Card Container */
.step-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.25s ease;
  position: relative;
}

.step-card.active-step {
  border-color: var(--primary-indigo);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.12);
}

.step-card.locked-step {
  opacity: 0.55;
  pointer-events: none;
  filter: grayscale(0.15);
}

.step-card.completed-step {
  border-color: var(--emerald-success);
}

.step-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ==========================================================================
   FORM CONTROLS & DROPZONE
   ========================================================================== */

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

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

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sub-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-select, .form-input, .form-select-sm {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-select:focus, .form-input:focus, .form-select-sm:focus {
  border-color: var(--primary-indigo);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Upload Dropzone Box */
.upload-box {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-sm);
  padding: 24px 16px;
  text-align: center;
  background: rgba(99, 102, 241, 0.03);
  cursor: pointer;
  transition: all 0.25s ease;
}

.upload-box:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--primary-indigo);
  transform: translateY(-1px);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.upload-icon-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary-glow);
  color: var(--primary-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.upload-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.upload-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Video Items Timeline List */
.video-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 52px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.empty-state {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.8rem;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-xs);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card-hover);
}

.video-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  transition: all 0.2s ease;
  cursor: grab;
}

.video-item:hover {
  border-color: #cbd5e1;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.video-item.dragging {
  opacity: 0.5;
  border-color: var(--primary-indigo);
}

.video-item.drag-over {
  border-color: var(--accent-cyan);
  background: rgba(2, 132, 199, 0.08);
}

.video-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.drag-handle {
  color: var(--text-muted);
  cursor: grab;
  display: flex;
  align-items: center;
}

.video-item-badge {
  background: #e2e8f0;
  color: #334155;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.video-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.video-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.video-item-duration {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 4px;
}

.btn-move, .btn-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-move:hover:not(:disabled) {
  background: #e2e8f0;
  color: var(--text-primary);
}

.btn-remove:hover {
  background: rgba(225, 29, 72, 0.1);
  color: var(--rose-danger);
}

.btn-move:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ==========================================================================
   GEMINI WATERMARK REMOVAL TOOLKIT CARD
   ========================================================================== */

.video-audio-card {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

/* Custom Checkbox Design */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background: #ffffff;
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkbox {
  background: var(--primary-indigo);
  border-color: var(--primary-indigo);
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkbox::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.checkbox-text {
  font-size: 0.84rem;
  color: var(--text-primary);
}

.icon-sparkle {
  color: var(--primary-indigo);
  vertical-align: middle;
  margin-right: 2px;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-accent {
  background: #e2e8f0;
  color: #475569;
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-dark);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.logo-options-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.logo-options-wrap.hidden, .hidden {
  display: none !important;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-label-sm {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Pill Group Selector */
.pill-group {
  display: flex;
  background: #e2e8f0;
  padding: 3px;
  border-radius: var(--radius-xs);
  gap: 2px;
}

.pill-btn {
  background: transparent;
  border: none;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-btn.active {
  background: #ffffff;
  color: var(--primary-indigo);
  box-shadow: var(--shadow-sm);
}

.pill-btn:hover:not(.active) {
  color: var(--text-primary);
}

/* Sliders Grid */
.control-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.slider-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.slider-title {
  color: var(--text-muted);
}

.slider-meta strong {
  color: var(--primary-indigo);
}

/* Custom Range Input Styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-indigo);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
  transition: transform 0.15s ease;
}

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

/* Step Success Banner */
.step-success-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--emerald-dark);
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  font-weight: 700;
}

/* ==========================================================================
   AUDIO MIXING ENGINE & WAVEFORM TRIMMER (STEP 2)
   ========================================================================== */

.audio-mix-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  transition: all 0.25s ease;
}

.audio-mix-badge.mix-dual {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: var(--primary-indigo-dark);
}

.audio-mix-badge.mix-bgm {
  background: rgba(147, 51, 234, 0.12);
  border: 1px solid rgba(147, 51, 234, 0.35);
  color: #7e22ce;
}

.audio-mix-badge.mix-video {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--emerald-dark);
}

.audio-mix-badge.mix-mute {
  background: rgba(225, 29, 72, 0.12);
  border: 1px solid rgba(225, 29, 72, 0.35);
  color: var(--rose-danger);
}

.audio-volume-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.vol-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.vol-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-indigo);
  min-width: 36px;
  text-align: right;
}

/* Audio Trimmer Container */
.audio-trimmer-container {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trimmer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.trimmer-header strong {
  color: var(--accent-cyan);
}

.waveform-wrapper {
  position: relative;
  height: 64px;
  background: #0f172a;
  border-radius: var(--radius-xs);
  overflow: hidden;
}

#waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Trimmer Selection Overlay Window */
.trim-window {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(99, 102, 241, 0.28);
  border: 2px solid var(--primary-indigo);
  border-radius: 4px;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trim-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  background: var(--primary-indigo);
  cursor: ew-resize;
}

.trim-left { left: 0; }
.trim-right { right: 0; }

.audio-scrubber-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ==========================================================================
   BUTTON SYSTEM
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-xs);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 13px 20px;
  font-size: 0.92rem;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-indigo), var(--primary-indigo-dark));
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #818cf8, var(--primary-indigo));
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
  background: #f1f5f9;
}

.btn-accent {
  background: linear-gradient(135deg, var(--emerald-success), var(--emerald-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-accent:hover:not(:disabled) {
  background: linear-gradient(135deg, #34d399, var(--emerald-success));
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-xs);
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid #cbd5e1;
}

.btn-icon:hover {
  background: #f1f5f9;
}

/* Aspect Ratio Selector */
.aspect-ratio-selector {
  display: flex;
  background: #e2e8f0;
  padding: 3px;
  border-radius: var(--radius-xs);
}

.btn-aspect {
  background: transparent;
  border: none;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-aspect.active {
  background: #ffffff;
  color: var(--primary-indigo);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   STUDIO VIDEO PLAYER & EXPORT (RIGHT PANEL)
   ========================================================================== */

.panel-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.player-container {
  position: relative;
  width: 100%;
  background: #090d16;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  margin: 0 auto;
}

.player-container.ratio-9-16 {
  max-width: 360px;
  height: 520px;
}

.player-container.ratio-16-9 {
  width: 100%;
  height: 380px;
}

#main-video-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  transition: opacity 0.3s ease;
}

.player-container.playing .player-overlay {
  opacity: 0;
  pointer-events: none;
}

.play-pulse-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
  transition: transform 0.2s ease;
}

.play-pulse-btn:hover {
  transform: scale(1.1);
}

.play-pulse-btn i {
  width: 28px;
  height: 28px;
  margin-left: 3px;
}

.live-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--emerald-success);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(4px);
}

.live-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-success);
}

/* Timeline Scrubber Bar */
.video-progress-bar-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.video-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-indigo);
  transition: width 0.1s linear;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 10px 16px;
}

.time-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: monospace;
}

.icon-clock {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.control-actions {
  display: flex;
  gap: 8px;
}

/* Export Card */
.export-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.export-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.export-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   MODALS & DIALOGS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.modal-spinner {
  margin-bottom: 4px;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary-indigo);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-indigo), #0284c7);
  transition: width 0.2s ease;
}

.progress-percent {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.success-icon-badge {
  font-size: 2.8rem;
}

.download-instruction-box {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  color: var(--emerald-dark);
  text-align: left;
  line-height: 1.5;
  width: 100%;
}

/* Studio Module Switcher Navbar */
.module-navbar {
  display: flex;
  background: var(--bg-base);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.module-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s ease;
}

.module-tab-btn.active {
  background: #ffffff;
  color: var(--primary-indigo);
  box-shadow: var(--shadow-sm);
}

.module-tab-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.module-content-view {
  display: block;
}

.module-content-view.hidden {
  display: none !important;
}

/* Product Thumbnails Grid */
.product-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 2px;
}

.product-thumb-grid .empty-state {
  grid-column: 1 / -1;
  width: 100%;
}

.thumb-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
}

.thumb-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-card .btn-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(225, 29, 72, 0.85);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.thumb-card .btn-thumb-remove:hover {
  transform: scale(1.15);
}

.thumb-card .thumb-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

/* Preset Prompt Tags */
.preset-tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.preset-tag {
  background: #e2e8f0;
  border: none;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-tag:hover {
  background: var(--primary-glow);
  color: var(--primary-indigo-dark);
}

/* AI Progress Box */
.ai-progress-box {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.ai-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Results Gallery Grid */
.ai-results-gallery-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.result-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xs);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.result-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #090d16;
}

.result-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-card-footer {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-hover);
  border-top: 1px solid var(--border-subtle);
}

.result-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.result-actions {
  display: flex;
  gap: 4px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */

@media (max-width: 1024px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .header-workflow {
    display: none;
  }
}

@media (max-width: 640px) {
  body {
    padding: 10px;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
  }

  .header-badge {
    align-self: flex-start;
  }

  .panel {
    padding: 14px;
  }

  .control-row-grid {
    grid-template-columns: 1fr;
  }

  .player-container.ratio-9-16 {
    max-width: 100%;
    height: 440px;
  }
}
