/* ==========================================================================
   VMC STUDIO PRO - PROFESSIONAL NON-LINEAR VIDEO EDITOR
   Design Philosophy: Sleek, high-precision dark studio aesthetic (DaVinci/Premiere inspired).
   No cheesy AI glows, no purple holographic nonsense. Pure broadcast toolcraft.
   ========================================================================== */

:root {
  /* Surfaces */
  --bg-deep: #090b0e;
  --bg-app: #0e1117;
  --bg-panel: #151922;
  --bg-panel-header: #1a202c;
  --bg-elevated: #1e2432;
  --bg-hover: #262e40;
  --bg-active: #2f384d;
  --bg-input: #12151d;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-default: rgba(255, 255, 255, 0.12);
  --border-focus: #f59e0b;
  --border-highlight: rgba(245, 158, 11, 0.4);

  /* Accents */
  --accent-amber: #f59e0b;
  --accent-amber-hover: #fbbf24;
  --accent-amber-dark: #b45309;
  --accent-blue: #3b82f6;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  --accent-cyan: #06b6d4;

  /* Clip Track Color Tags */
  --clip-video: #2563eb;
  --clip-video-border: #60a5fa;
  --clip-video-dark: #1e3a8a;
  --clip-audio: #059669;
  --clip-audio-border: #34d399;
  --clip-audio-dark: #064e3b;
  --clip-text: #d97706;
  --clip-text-border: #fbbf24;
  --clip-text-dark: #78350f;
  --clip-image: #7c3aed;
  --clip-image-border: #a78bfa;
  --clip-image-dark: #4c1d95;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Text Colors */
  --text-main: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-dim: #4b5563;
  --text-inverse: #090b0e;

  /* Dimensions */
  --header-height: 52px;
  --timeline-toolbar-height: 42px;
  --timeline-header-width: 240px;
  --ruler-height: 28px;
  --track-height: 58px;

  /* Radii */
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.7);
  --shadow-timeline-clip: 0 2px 6px rgba(0, 0, 0, 0.45);
}

/* Reset & Basics */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-panel);
}
::-webkit-scrollbar-thumb {
  background: #2a3345;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3b475e;
}

input, button, select, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent-amber);
  outline-offset: 1px;
}

/* App Master Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: var(--bg-app);
}

/* Top Navigation / Studio Bar */
.studio-header {
  height: var(--header-height);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 50;
  flex-shrink: 0;
}

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

.brand-logo-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 229, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #000;
  flex-shrink: 0;
}

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

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-version {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-elevated);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.project-name-input {
  font-size: 11px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  transition: all 0.15s ease;
  max-width: 160px;
}
.project-name-input:hover {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}
.project-name-input:focus {
  background: var(--bg-input);
  border-color: var(--accent-amber);
  color: var(--text-main);
  outline: none;
}

/* Header Center Controls */
.header-center-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}

.aspect-ratio-selector {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.aspect-select-dropdown {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.aspect-select-dropdown option {
  background: var(--bg-panel);
  color: var(--text-main);
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.header-tool-btn {
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
}
.header-tool-btn:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-main);
}
.header-tool-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Header Right Actions */
.header-right-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-default);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
}

.btn-primary {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  color: #0b0e14;
  border: 1px solid #fbbf24;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.4);
}

/* Main Workspace Grid (Upper Workspace + Lower Timeline) */
.studio-workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.upper-workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  border-bottom: 2px solid var(--border-default);
}

/* Left Panel: Asset Library */
.asset-panel {
  width: 350px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.panel-tabs-header {
  display: flex;
  background: var(--bg-panel-header);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  gap: 6px;
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}
.tab-btn.active {
  color: var(--accent-amber);
  border-bottom-color: var(--accent-amber);
  background: var(--bg-panel);
}

.asset-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Upload Dropzone */
.upload-dropzone {
  border: 1.5px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: 20px 14px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.05);
}
.upload-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-amber);
}
.upload-text-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}
.upload-text-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Media Filter Pills */
.media-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0 6px;
  overflow-x: auto;
}

.media-filter-chip {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.media-filter-chip:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-default);
}

.media-filter-chip.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  font-weight: 700;
}

/* Return to Media Button inside Inspector */
.btn-return-media {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  padding: 3px 8px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-return-media:hover {
  background: var(--bg-hover);
  color: var(--accent-amber);
  border-color: var(--accent-amber);
}

/* Asset Cards Grid */
.asset-items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.asset-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: grab;
  transition: all 0.15s ease;
  position: relative;
}
.asset-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.asset-thumbnail-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.asset-thumb-img, .asset-thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-badge-type {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  letter-spacing: 0.4px;
}

.asset-duration-tag {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.85);
  color: #f3f4f6;
}

.asset-info {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.asset-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.asset-add-btn {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  background: var(--bg-panel);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.asset-add-btn:hover {
  background: var(--accent-amber);
  color: #000;
}

.asset-delete-btn {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  background: var(--bg-panel);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.asset-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.uploaded-media-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-subtle);
}

.clear-uploaded-btn {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}
.clear-uploaded-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.tab-counter-badge {
  background: var(--accent-amber);
  color: #000;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 4px;
}

.upload-dropzone.processing {
  border-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.08);
  pointer-events: none;
}

.spin-loader {
  animation: spin 1s linear infinite;
}

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

.audio-thumb-fallback, .video-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f131a;
}

.badge-video {
  background: rgba(59, 130, 246, 0.85) !important;
}
.badge-audio {
  background: rgba(16, 185, 129, 0.85) !important;
}
.badge-image {
  background: rgba(139, 92, 246, 0.85) !important;
}

.uploaded-audio {
  border-left: 2px solid #10b981;
}

/* Audio Asset Card */
.audio-card {
  grid-column: span 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 8px 10px;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: grab;
}
.audio-card:hover {
  border-color: var(--accent-green);
}
.audio-card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Text Templates Grid */
.text-template-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: grab;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.text-template-card:hover {
  border-color: var(--accent-amber);
  background: var(--bg-hover);
}
.text-template-preview {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  padding: 6px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  text-align: center;
}

/* Color Mattes */
.color-matte-card {
  height: 60px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-end;
  padding: 6px;
  cursor: grab;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.15s ease;
}
.color-matte-card:hover {
  transform: scale(1.02);
  border-color: #fff;
}
.color-matte-name {
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.65);
  padding: 2px 5px;
  border-radius: 3px;
  color: #fff;
}

/* Center Preview Monitor Area */
.preview-stage {
  flex: 1;
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

.preview-top-toolbar {
  height: 36px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}

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

.preview-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 2px 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.preview-viewport-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  background-image: 
    linear-gradient(45deg, #0d0f14 25%, transparent 25%), 
    linear-gradient(-45deg, #0d0f14 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #0d0f14 75%), 
    linear-gradient(-45deg, transparent 75%, #0d0f14 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  background-color: #08090d;
}

.monitor-frame {
  position: relative;
  background: #ffffff;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.2);
  outline: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.15);
  overflow: hidden;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.video-render-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #ffffff;
}

/* Safe guides overlay */
.safe-guides-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}
.guide-action-safe {
  position: absolute;
  top: 5%;
  left: 5%;
  right: 5%;
  bottom: 5%;
  border: 1px dashed rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.guide-title-safe {
  position: absolute;
  top: 10%;
  left: 10%;
  right: 10%;
  bottom: 10%;
  border: 1px dashed rgba(217, 119, 6, 0.85);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.guide-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
}
.guide-crosshair::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.guide-crosshair::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.5);
}

/* Audio VU Meter Strip (Right edge of preview monitor) */
.vu-meter-bar-container {
  display: flex;
  gap: 3px;
  padding: 6px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  align-items: flex-end;
  height: 100%;
  width: 32px;
  flex-shrink: 0;
}

.vu-channel {
  flex: 1;
  height: 100%;
  background: var(--bg-input);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
}

.vu-channel-fill {
  width: 100%;
  background: linear-gradient(to top, #10b981 0%, #10b981 65%, #f59e0b 85%, #ef4444 100%);
  transition: height 0.08s ease-out;
}

.vu-clip-peak {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #ef4444;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.vu-clip-peak.active {
  opacity: 1;
}

/* Transport Controls Bar */
.transport-controls-bar {
  height: 48px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.timecode-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
}

.timecode-current {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent-amber);
}

.timecode-divider {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 13px;
}

.timecode-total {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.playback-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.transport-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}
.transport-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-default);
}

.play-pause-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-amber);
  color: #0b0e14;
  border: none;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}
.play-pause-btn:hover {
  background: var(--accent-amber-hover);
  transform: scale(1.05);
}

/* Right Panel: Inspector / Properties */
.inspector-panel {
  width: 300px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.inspector-header {
  height: 36px;
  background: var(--bg-panel-header);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inspector-empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 30px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

/* Property Groups */
.property-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.control-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.control-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
}

/* Studio Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: #2a3345;
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-amber);
  cursor: ew-resize;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  border: 1px solid #fff;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-val-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-input);
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--text-main);
  min-width: 38px;
  text-align: right;
  border: 1px solid var(--border-subtle);
}

/* Preset Pill Buttons */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.preset-pill-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 6px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}
.preset-pill-btn:hover {
  border-color: var(--accent-amber);
  color: var(--text-main);
}
.preset-pill-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

/* ==========================================================================
   TIMELINE SECTION (BOTTOM DOCK)
   ========================================================================== */
.timeline-dock {
  height: 290px;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  border-top: 1px solid var(--border-default);
}

/* Timeline Toolbar */
.timeline-toolbar {
  height: var(--timeline-toolbar-height);
  background: var(--bg-panel-header);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}

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

.t-tool-btn {
  padding: 5px 9px;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  gap: 5px;
}
.t-tool-btn:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-main);
}
.t-tool-btn.active {
  background: var(--accent-amber);
  color: #0b0e14;
}
.t-tool-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.tool-separator {
  width: 1px;
  height: 18px;
  background: var(--border-default);
  margin: 0 4px;
}

.timeline-zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.zoom-slider-wrap {
  width: 110px;
}

/* Multi-track Timeline Viewport */
.timeline-body-wrap {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* Left: Track Header Columns */
.track-headers-column {
  width: var(--timeline-header-width);
  background: var(--bg-panel);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
}

.track-header-ruler-spacer {
  height: var(--ruler-height);
  background: var(--bg-panel-header);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.track-headers-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: hidden; /* Synced with tracks scroll */
}

/* 2-Tiered Track Header Card */
.track-header-card {
  height: var(--track-height);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 10px;
  box-sizing: border-box;
  transition: background 0.15s ease;
}
.track-header-card:hover {
  background: #191f2c;
}

.track-header-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.track-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.track-layer-num {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
  flex-shrink: 0;
}

.track-name-text {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  letter-spacing: 0.2px;
}
.track-name-text:hover {
  color: var(--accent-amber);
}

.track-inline-rename-input {
  background: var(--bg-input);
  border: 1px solid var(--accent-amber);
  border-radius: 3px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  width: 100%;
  outline: none;
}

.track-actions-group {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}

.track-header-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.track-clips-badge {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 500;
}

.track-toggles-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.t-icon-btn {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  color: var(--text-dim);
}
.t-icon-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}
.t-icon-btn.active {
  color: var(--accent-amber);
}
.t-icon-btn.muted {
  color: var(--accent-red);
}

/* Right: Scrollable Tracks & Ruler Area */
.timeline-tracks-scroll-area {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  position: relative;
  background: #090b0e;
  cursor: default;
}

.timeline-content-inner {
  position: relative;
  min-width: 100%;
}

/* Time Ruler */
.time-ruler-canvas-wrap {
  height: var(--ruler-height);
  background: #12161f;
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  z-index: 15;
  cursor: pointer;
}

.ruler-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Tracks Container */
.tracks-lanes-container {
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 100%;
}

.track-lane {
  height: var(--track-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 50px 100%;
}
.track-lane.audio {
  background-color: rgba(16, 185, 129, 0.02);
}

/* Individual Clip Component */
.timeline-clip {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: var(--radius-xs);
  cursor: grab;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-timeline-clip);
  overflow: hidden;
  transition: box-shadow 0.1s ease, border-color 0.1s ease;
  border: 1px solid transparent;
}
.timeline-clip:active {
  cursor: grabbing;
}

.timeline-clip.video {
  background: linear-gradient(180deg, #2563eb 0%, #1e40af 100%);
  border-color: #3b82f6;
}
.timeline-clip.text {
  background: linear-gradient(180deg, #d97706 0%, #92400e 100%);
  border-color: #f59e0b;
}
.timeline-clip.audio {
  background: linear-gradient(180deg, #059669 0%, #065f46 100%);
  border-color: #10b981;
}

.timeline-clip.selected {
  outline: 2px solid #ffffff;
  outline-offset: 1px;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.clip-drag-surface {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
  overflow: hidden;
}

.clip-title-label {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.clip-duration-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

/* Audio Waveform Simulator in Clip */
.clip-waveform-svg {
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  height: 60%;
  opacity: 0.35;
  pointer-events: none;
}

/* Trim Handles */
.clip-trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  background: rgba(0, 0, 0, 0.35);
  cursor: ew-resize;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.clip-trim-handle:hover {
  background: #ffffff;
}
.clip-trim-handle.start {
  left: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.4);
}
.clip-trim-handle.end {
  right: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.4);
}

.trim-grip-bar {
  width: 2px;
  height: 14px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 1px;
}

/* Master Playhead Indicator */
.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #f59e0b;
  z-index: 30;
  pointer-events: none;
  transform: translateX(-50%);
}

.playhead-head {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 18px;
  background: #f59e0b;
  clip-path: polygon(0 0, 100% 0, 100% 65%, 50% 100%, 0 65%);
  cursor: grab;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}
.playhead-head:active {
  cursor: grabbing;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-dialog {
  background: var(--bg-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.modal-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}
.modal-close-btn:hover {
  background: var(--bg-elevated);
  color: #fff;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: 80vh;
}

.modal-footer {
  padding: 14px 20px;
  background: var(--bg-panel-header);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Progress bar inside export modal */
.render-progress-track {
  width: 100%;
  height: 10px;
  background: var(--bg-input);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.render-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%);
  transition: width 0.15s ease;
}

/* ==========================================================================
   EXPORT MODAL / RENDER STUDIO STYLES
   ========================================================================== */

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

.export-format-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.export-format-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-align: left;
}

.export-format-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-default);
  transform: translateY(-1px);
}

.export-format-card.active {
  background: rgba(245, 158, 11, 0.08);
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 1px var(--accent-amber), 0 4px 14px rgba(245, 158, 11, 0.15);
}

.format-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.export-format-card:hover .format-card-icon {
  color: var(--text-main);
  border-color: var(--border-default);
}

.export-format-card.active .format-card-icon {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--accent-amber);
}

.format-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.format-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.export-format-card.active .format-card-title {
  color: #ffffff;
}

.format-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.export-format-card.active .format-card-desc {
  color: var(--text-secondary);
}

.export-settings-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resolution-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pill-btn {
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-default);
  background: var(--bg-panel);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.pill-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-focus);
}

.pill-btn.active {
  background: var(--accent-amber);
  color: #090b0e;
  font-weight: 700;
  border-color: var(--accent-amber);
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

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

/* Shortcuts grid */
.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
}
.shortcuts-table tr {
  border-bottom: 1px solid var(--border-subtle);
}
.shortcuts-table td {
  padding: 8px 6px;
  font-size: 12px;
}
.shortcut-key-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--accent-amber);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Floating Timeline Zoom HUD (Triggered by Ctrl + Wheel) */
.timeline-zoom-hud {
  position: absolute;
  bottom: 24px;
  right: 24px;
  background: rgba(18, 22, 31, 0.92);
  border: 1px solid var(--accent-amber);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7), 0 0 12px rgba(245, 158, 11, 0.35);
  pointer-events: none;
  z-index: 50;
  animation: hudFadeIn 0.15s ease-out;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 6px;
}

@keyframes hudFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

