/* ─── File title in nav (editor mode) ───────────────────────────── */
.file-title {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text-primary);
}

/* ─── Content wrapper (body + timeline, vertically split) ───────── */
.editor-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
  gap: 12px;
  padding: 12px;
}

/* ─── Editor Body (left/right split) ────────────────────────────── */
.editor-body {
  display: flex;
  overflow: hidden;
  height: 781px; /* give room for natural video player height + controls */
  min-height: 520px;
  flex-shrink: 0;
  gap: 12px;
}

/* ─── Left Panel: Video / Audio ─────────────────────────────────── */
.editor-left {
  min-width: 340px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #101722, #0b1018);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.workspace-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.workspace-title-wrap {
  display: grid;
  gap: 2px;
}

.workspace-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

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

.player-tab-bar {
  display: flex;
  gap: 8px;
  width: min(360px, 58%);
}
.player-tab {
  flex: 1;
  padding: 7px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  transition: 0.16s ease;
}

.player-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.player-tab.active {
  color: #eaf4ff;
  border-color: rgba(76, 156, 255, 0.58);
  background: rgba(76, 156, 255, 0.24);
}

.player-panel {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.player-panel.active {
  display: flex;
}

.video-wrap {
  flex: 1;
  min-height: 430px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

.video-wrap .plyr {
  --plyr-color-main: var(--accent);
  --plyr-font-family: var(--font);
  --plyr-video-controls-background: linear-gradient(transparent, rgba(0, 0, 0, 0.84));
  width: 100%;
  height: 100%;
}

.video-wrap .plyr video {
  object-fit: contain;
}

.waveform-wrap {
  flex: 1;
  position: relative;
  padding: 10px 0;
  background: linear-gradient(180deg, #111926, #0d131e);
}

#waveform {
  width: 100%; height: 100%;
}

/* WaveSurfer override to match dark theme */
wave { background: transparent !important; }

.waveform-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-muted);
  pointer-events: none;
}

/* ─── Right Panel: Editor tabs ───────────────────────────────────── */
.editor-right {
  width: 360px;
  display: flex;
  flex-direction: column;
  background: rgba(11, 16, 24, 0.85);
  border: 1px solid var(--border);
  border-radius: 16px;
  min-width: 300px;
  box-shadow: var(--shadow);
}

.editor-tabs {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  background: rgba(44, 54, 71, 0.85);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  flex-shrink: 0;
  overflow: hidden;
}

.workspace-inspector {
  display: grid;
  gap: 10px;
  padding: 12px;
  flex-shrink: 0;
}

.workspace-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.workspace-card-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.quickmix-row {
  display: grid;
  gap: 8px;
}

.quickmix-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editor-tabs .tab-bar {
  padding: 10px 12px 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
  overflow-x: auto;
  white-space: nowrap;
}
.editor-tabs .tab-panel {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.editor-tabs .tab-panel.active {
  display: flex;
  flex-direction: column;
}

/* ─── Transcript Section ─────────────────────────────────────────── */
.editor-transcript {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(11, 16, 24, 0.72);
  padding: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
  overflow: hidden;
  flex-shrink: 0;
}

.editor-transcript-header {
  padding: 2px 2px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.editor-transcript .transcript-words {
  /* no max-height — grows to fit content by default; constrained when user resizes */
}

/* ─── Bottom: Timeline ───────────────────────────────────────────── */
.editor-timeline {
  min-height: 96px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #111926, #0c131d);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
  flex-shrink: 0;
}

/* ─── Editor-body resize handle ─────────────────────────────────── */
.editor-body-handle {
  height: 6px;
  flex-shrink: 0;
  cursor: row-resize;
  background: rgba(255, 255, 255, 0.04);
  background-repeat: no-repeat;
  background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='6'%3E%3Ccircle cx='10' cy='3' r='1.5' fill='%23555'/%3E%3Ccircle cx='15' cy='3' r='1.5' fill='%23555'/%3E%3Ccircle cx='20' cy='3' r='1.5' fill='%23555'/%3E%3C/svg%3E");
  position: relative;
  z-index: 10;
}
.editor-body-handle:hover { background-color: rgba(76, 156, 255, 0.28); }

/* ─── Split.js gutters ───────────────────────────────────────────── */
.gutter {
  background: rgba(255, 255, 255, 0.04);
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.gutter:hover { background-color: rgba(76, 156, 255, 0.28); }
.gutter.gutter-horizontal {
  cursor: col-resize;
  width: 6px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='30'%3E%3Ccircle cx='3' cy='10' r='1.5' fill='%23555'/%3E%3Ccircle cx='3' cy='15' r='1.5' fill='%23555'/%3E%3Ccircle cx='3' cy='20' r='1.5' fill='%23555'/%3E%3C/svg%3E");
}
.gutter.gutter-vertical {
  cursor: row-resize;
  height: 6px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='6'%3E%3Ccircle cx='10' cy='3' r='1.5' fill='%23555'/%3E%3Ccircle cx='15' cy='3' r='1.5' fill='%23555'/%3E%3Ccircle cx='20' cy='3' r='1.5' fill='%23555'/%3E%3C/svg%3E");
}

/* ─── Play controls (shared) ─────────────────────────────────────── */
.audio-controls {
  display: flex;
  justify-content: center;
  padding: 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid var(--border);
}
.audio-play-btn {
  background: linear-gradient(135deg, var(--accent), #67b6ff);
  color: #071322;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.audio-play-btn:disabled { background: var(--surface-2, #333); color: var(--text-muted, #666); cursor: not-allowed; }

/* Hide play button when video panel is active (video has its own controls) */
#player-panel-video.active ~ .audio-controls { display: none; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 860px) {

  .editor-body {
    flex-direction: column;
    overflow: visible;
    height: auto;
  }

  .editor-content {
    overflow: visible;
    padding: 10px;
  }

  .editor-left {
    width: 100% !important;
    max-width: none;
    min-width: 0;
    overflow: visible;
    height: auto;
    max-height: none;
  }

  .workspace-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .player-tab-bar {
    width: 100%;
  }

  .video-wrap {
    min-height: 260px;
    height: 260px;
    max-height: 260px;
  }

  .video-wrap video { max-height: 100%; }

  .waveform-wrap { width: 120px; max-height: none; }

  .editor-right {
    width: 100% !important;
    overflow: visible;
    min-width: 0;
  }

  .editor-tabs {
    height: auto;
  }

  .editor-tabs .tab-panel {
    overflow-y: visible;
    min-height: 200px;
  }

  .editor-transcript .transcript-words {
    max-height: none;
  }

  .editor-timeline {
    overflow: visible;
    padding-bottom: calc(env(safe-area-inset-bottom) + 16px);
  }

  .gutter { display: none; }
}

@media (max-width: 560px) {
  .editor-left { flex-direction: column; }
  .video-wrap { height: 180px; max-height: 180px; }
  .waveform-wrap { width: 100%; height: 74px; max-height: 74px; }
  .editor-tabs .tab-bar { padding: 0 8px; }
  .tab-btn { padding: 10px 10px; font-size: 12px; }
}
