/* lib/music-video-maker.css — page-specific styles for /make-video.
 *
 * Most panel layout is inlined in make-video.html because it's tightly
 * coupled to the grid structure. This file is for the timeline rows,
 * clip cards, and the canvas preview overlay.
 */

.mvm-clip-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line, #330022);
  border-radius: 3px;
  font-size: 10px;
}

.mvm-clip-card:hover {
  background: rgba(0, 240, 255, 0.06);
  border-color: var(--accent-2, #00ccff);
}

.mvm-clip-thumb {
  flex: 0 0 auto;
  width: 40px;
  height: 30px;
  background: var(--panel-2, #1f0010);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #ff44aa);
}

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

.mvm-clip-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mvm-clip-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink, #fff);
}

.mvm-clip-sub {
  color: var(--muted, #ff44aa);
  opacity: 0.75;
  font-size: 9px;
}

.mvm-clip-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 3px;
}

.mvm-clip-actions button {
  background: transparent;
  border: 1px solid var(--line, #330022);
  color: var(--muted, #ff44aa);
  font: 9px ui-monospace, monospace;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 3px 6px;
  cursor: pointer;
}

.mvm-clip-actions button:hover {
  border-color: var(--accent, #ff0066);
  color: var(--accent, #ff0066);
}

.mvm-clip-actions button.tl-add {
  border-color: var(--accent-2, #00ccff);
  color: var(--accent-2, #00ccff);
}

.mvm-clip-actions button.tl-remove {
  border-color: var(--accent, #ff0066);
  color: var(--accent, #ff0066);
}

.mvm-timeline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 3px;
  background: rgba(0, 240, 255, 0.04);
  border-left: 3px solid var(--accent-2, #00ccff);
  border-radius: 2px;
  font-size: 10px;
}

.mvm-timeline-row .tl-time {
  flex: 0 0 auto;
  color: var(--accent-2, #00ccff);
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.04em;
  min-width: 70px;
}

.mvm-timeline-row .tl-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mvm-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 10px;
  color: var(--muted, #ff44aa);
  opacity: 0.7;
  font-style: italic;
}

.mvm-drop-target {
  border: 2px dashed var(--line, #330022);
  border-radius: 4px;
  padding: 24px;
  text-align: center;
  color: var(--muted, #ff44aa);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin: 8px 0;
}

.mvm-drop-target.dragover {
  border-color: var(--accent-2, #00ccff);
  color: var(--accent-2, #00ccff);
  background: rgba(0, 240, 255, 0.04);
}

/* Per-clip controls: blend / opacity / transition */
.mvm-clip-controls {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: stretch;
  min-width: 90px;
}
.mvm-clip-controls select,
.mvm-clip-controls input[type="range"] {
  font: 9px ui-monospace, monospace;
  letter-spacing: 0.06em;
  background: var(--bg-2, #0a0008);
  color: var(--ink, #fff);
  border: 1px solid var(--line, #330022);
  padding: 2px 3px;
  width: 100%;
  box-sizing: border-box;
}
.mvm-clip-controls input[type="range"] {
  padding: 0;
  height: 14px;
  accent-color: var(--accent, #ff0066);
}
.mvm-clip-controls select:focus,
.mvm-clip-controls input[type="range"]:focus { outline: 1px solid var(--accent-2, #00ccff); }

/* RECORDING indicator */
.mvm-recording {
  color: var(--accent, #ff0066) !important;
  animation: mvm-rec-pulse 1s ease-in-out infinite;
}
@keyframes mvm-rec-pulse {
  0%, 100% { opacity: 1.0; }
  50% { opacity: 0.4; }
}
.mvm-rec-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent, #ff0066);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* Phase 3: drag reorder + edge resize */
.mvm-timeline-row {
  position: relative;
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 18px 4px 4px; /* extra right padding for the grip */
  user-select: none;
  -webkit-user-select: none;
}
.mvm-timeline-row:active { cursor: grabbing; }
.mvm-timeline-row[draggable="true"]:hover {
  background: rgba(255, 255, 255, 0.04);
}
.mvm-tl-dragging {
  opacity: 0.4 !important;
  transform: scale(0.99);
  transition: opacity .12s ease, transform .12s ease;
}
.mvm-tl-drop-before {
  box-shadow: inset 0 2px 0 var(--accent, #ff0066);
}
.mvm-tl-drop-after {
  box-shadow: inset 0 -2px 0 var(--accent, #ff0066);
}
.mvm-tl-grip {
  position: absolute;
  top: 0;
  right: 28px;  /* sit just left of the ✕ button */
  bottom: 0;
  width: 6px;
  cursor: ew-resize;
  background: transparent;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  transition: border-color .12s ease, background .12s ease;
}
.mvm-tl-grip:hover {
  border-left-color: var(--accent-2, #00ccff);
  border-right-color: var(--accent-2, #00ccff);
  background: rgba(0, 204, 255, 0.05);
}
.mvm-tl-grip-active {
  border-left-color: var(--accent-2, #00ccff) !important;
  border-right-color: var(--accent-2, #00ccff) !important;
  background: rgba(0, 204, 255, 0.12) !important;
}

/* Phase 4: viz toggle in the header */
.mvm-viz-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 6px;
  font: 9px ui-monospace, monospace;
  letter-spacing: 0.06em;
  color: var(--muted, #999);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: border-color .12s ease, color .12s ease;
}
.mvm-viz-toggle:hover { border-color: var(--line, #330022); color: var(--ink, #fff); }
.mvm-viz-toggle input[type="checkbox"] {
  margin: 0;
  width: 12px;
  height: 12px;
  accent-color: var(--accent-2, #00ccff);
  cursor: pointer;
}

/* Phase 6: timeline row thumbnail */
.tl-thumb {
  flex: 0 0 60px;
  width: 60px;
  height: 40px;
  background: var(--bg-2, #0a0008);
  border: 1px solid var(--line, #330022);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tl-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tl-thumb-icon {
  font-size: 16px;
  color: var(--muted, #999);
  pointer-events: none;
  z-index: 0;
}
.tl-thumb-loading { opacity: 0.6; }
.tl-thumb-loading .tl-thumb-icon { color: var(--accent-2, #00ccff); }

/* Phase 7: drag-from-clips-panel */
.mvm-clip-card {
  cursor: grab;
}
.mvm-clip-card:active { cursor: grabbing; }
.mvm-clip-dragging {
  opacity: 0.4 !important;
  transform: scale(0.98);
  transition: opacity .12s ease, transform .12s ease;
}

/* Phase 8: two-click STOP REC safety */
.mvm-pending-stop {
  /* A second class on the same REC button — outlines to confirm
     "click again to stop" without losing the recording red. */
  outline: 2px solid var(--accent, #ff0066);
  outline-offset: 2px;
  animation: mvm-pending-pulse 0.4s ease-in-out infinite alternate;
}
@keyframes mvm-pending-pulse {
  0%   { transform: scale(1.0); }
  100% { transform: scale(1.04); }
}

.current-song.has-song {
  color: var(--green, #00ff66);
  font-weight: 600;
}