/* ==========================================================================
   MUSIC STUDIO PRO - ULTRA PREMIUM MEDIA STUDIO DESIGN SYSTEM
   (Inspired by CapCut, Figma & Canva Studio Interfaces)
   ========================================================================== */

:root {
  /* Surface Color Palette */
  --bg-dark: #070b14;
  --bg-surface-1: #0f172a;
  --bg-surface-2: #162032;
  --bg-card: rgba(22, 32, 50, 0.75);
  --bg-element: #1e293b;
  --bg-hover: #334155;
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-focus: #06b6d4;
  --border-active: #7c5cfc;
  
  /* Curated Vibrant Accents */
  --accent-cyan: #06b6d4;
  --accent-purple: #7c5cfc;
  --accent-blue: #3b82f6;
  --accent-gradient: linear-gradient(135deg, #7c5cfc 0%, #06b6d4 100%);
  --accent-glow: 0 0 20px rgba(6, 182, 212, 0.35);
  
  /* Text Color Hierarchy */
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Status Colors */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  /* Geometry & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  
  --font-heading: 'Manrope', 'Outfit', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(124, 92, 252, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* ==========================================================================
   HEADER NAVIGATION BAR
   ========================================================================== */

.app-header {
  height: 56px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  flex-shrink: 0;
}

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

.btn-sidebar-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-sidebar-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

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

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  box-shadow: 0 0 12px rgba(124, 92, 252, 0.4);
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.brand-text h1 span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Header Workflow Step Indicators */
.header-steps-flow {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

.step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.step-item.step-done {
  color: var(--success);
}

.step-item.step-active {
  color: var(--accent-cyan);
  font-weight: 600;
}

.step-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.step-item.step-done .step-icon {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.step-item.step-active .step-icon {
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
}

.step-sub {
  font-size: 11px;
  opacity: 0.7;
}

.step-divider {
  font-size: 10px;
  color: var(--text-dim);
}

/* Render Header Button & Validation Tooltip */
.render-btn-tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.btn-render-header {
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 700;
}

.tooltip-box {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  background: #0f172a;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f8fafc;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.render-btn-tooltip-wrapper:hover .tooltip-box {
  visibility: visible;
  opacity: 1;
}

.btn-render-header:not(:disabled) + .tooltip-box {
  display: none !important;
}

/* ==========================================================================
   MAIN STUDIO WORKSPACE & COLLAPSIBLE SIDEBARS
   ========================================================================== */

.studio-workspace-container {
  flex: 1;
  display: flex;
  width: 100%;
  height: calc(100vh - 56px);
  overflow: hidden;
}

.studio-sidebar {
  width: 320px;
  background: var(--bg-surface-1);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 20;
}

.sidebar-right {
  border-right: none;
  border-left: 1px solid var(--border-subtle);
  width: 350px;
}

/* Collapsed Sidebar States */
.studio-sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0;
  overflow: hidden;
  border-left: none;
  border-right: none;
}

.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header h2 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
}

.sidebar-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   MEDIA PANEL (LEFT SIDEBAR)
   ========================================================================== */

.media-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.total-duration {
  font-size: 11.5px;
  color: var(--text-muted);
}

.upload-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-box:hover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.06);
}

.upload-box-small {
  padding: 10px;
}

.icon-upload {
  font-size: 22px;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.upload-box p {
  color: var(--text-main);
  font-size: 13px;
}

.upload-box .hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* Tracklist */
.tracklist-wrapper {
  margin-top: 10px;
}

.track-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}

.track-item {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.track-item:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--bg-element);
}

.track-title-input {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text-main);
  font-size: 12.5px;
  padding: 2px 6px;
  width: 160px;
}

.track-title-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

/* Background Image Thumbnail Preview */
.bg-preview-card {
  position: relative;
  margin-top: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  aspect-ratio: 16 / 9;
  background: #000;
}

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

.bg-preview-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(6px);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.btn-icon-xs {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
}

.btn-icon-xs:hover {
  color: var(--danger);
}

/* ==========================================================================
   CENTER CANVAS WORKSPACE & TOOLBAR
   ========================================================================== */

.canvas-workspace {
  flex: 1;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 20px;
  overflow: hidden;
}

/* Canvas Floating Toolbar */
.canvas-toolbar {
  position: absolute;
  top: 16px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 30px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.toolbar-divider {
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
}

.btn-tool-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-tool-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-tool-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-tool-pill:hover, .btn-tool-pill.active {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

/* Canvas Viewport Surface */
.canvas-viewport {
  position: relative;
  width: 100%;
  max-width: 1100px;
  aspect-ratio: 16 / 9;
  background: #030712;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-md);
}

#studio-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Canvas Empty State Overlay */
.canvas-empty-state {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 20, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 20px;
  z-index: 10;
  pointer-events: none;
}

.canvas-empty-state button {
  pointer-events: auto;
}

.empty-illustration {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--accent-cyan);
}

.canvas-empty-state h3 {
  font-size: 16px;
  color: var(--text-main);
  font-weight: 700;
}

.canvas-empty-state p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Audio Player Bar */
.audio-player-bar {
  margin-top: 14px;
  width: 100%;
  max-width: 1100px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-play-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.btn-play-circle:hover {
  transform: scale(1.06);
}

.seek-bar-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
}

.time-display {
  font-family: monospace;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ==========================================================================
   TABBED INSPECTOR (RIGHT SIDEBAR)
   ========================================================================== */

.inspector-tabs-nav {
  display: flex;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--border-subtle);
}

.tab-nav-btn {
  flex: 1;
  padding: 12px 8px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.tab-nav-btn:hover {
  color: var(--text-secondary);
}

.tab-nav-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.04);
}

.inspector-section {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.inspector-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.text-cyan { color: var(--accent-cyan); }
.text-purple { color: var(--accent-purple); }
.text-danger { color: var(--danger); }

.label-with-value {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.range-val {
  font-size: 12px;
  color: var(--accent-cyan);
  font-weight: 600;
}

.range-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.form-group {
  margin-bottom: 10px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
}

.form-select, .form-input, .form-textarea {
  width: 100%;
  background: #090e1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px 12px;
  font-size: 13.5px;
  font-family: var(--font-body);
}

.form-select:focus, .form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #090e1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

.color-picker {
  border: none;
  background: none;
  width: 26px;
  height: 26px;
  cursor: pointer;
}

.color-hex-badge {
  font-family: monospace;
  font-size: 12px;
  color: var(--accent-cyan);
}

.slider {
  width: 100%;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

/* Effect Chips & Subpanels */
.fx-chips-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-toggle:hover, .chip-toggle.active {
  background: rgba(124, 92, 252, 0.15);
  color: var(--accent-purple);
  border-color: var(--accent-purple);
}

.fx-subpanel {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.fx-subpanel-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Tag Chips Component */
.tags-chips-wrapper {
  background: #090e1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 42px;
}

.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  padding: 3px 8px;
  border-radius: 14px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tag-chip-remove {
  cursor: pointer;
  font-size: 10px;
  opacity: 0.7;
}

.tag-chip-remove:hover {
  opacity: 1;
}

.tag-input-field {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 12.5px;
  outline: none;
  flex: 1;
  min-width: 80px;
}

.char-count {
  font-size: 11.5px;
  color: var(--text-dim);
}

/* Checkbox Cards */
.checkbox-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Buttons System */
.btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

.btn-outline:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-yt-sm {
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.08);
  font-size: 12px;
  padding: 5px 10px;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 11.5px;
  cursor: pointer;
}

.btn-text-action:hover {
  text-decoration: underline;
}

/* Status Cards & Render Progress */
.hidden {
  display: none !important;
}

.status-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
}

.status-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 12.5px;
  margin-bottom: 6px;
}

.status-pct {
  color: var(--accent-cyan);
}

.progress-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  transition: width 0.3s ease;
}

/* Gallery Items */
.gallery-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-card {
  background: #090e1a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.empty-state {
  color: var(--text-dim);
  text-align: center;
  padding: 20px 0;
  font-size: 13px;
  font-style: italic;
}

