/* Standalone Edit product (website/edit/index.html + js/vmcr-edit-studio.js) — small additions
 * on top of vmcr.css's already-proven .vmcr-edit-* rules (shared with the Director's inline
 * editor), just for the pieces this page has that Director's doesn't. */

.vmcr-edit-warn {
  border-radius: 12px;
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 0.85rem;
  font-weight: 650;
  background: rgba(220, 140, 20, 0.14);
  color: #7a4a00;
  border: 1px solid rgba(220, 140, 20, 0.35);
}

.vmcr-edit-warn.is-critical {
  background: rgba(200, 40, 40, 0.14);
  color: #7a1010;
  border-color: rgba(200, 40, 40, 0.35);
}

.vmcr-edit-preview {
  width: 100%;
  max-height: 420px;
  background: #000;
  border-radius: 10px;
  display: block;
}

.vmcr-edit-format-help {
  margin-top: 10px;
  font-size: 0.8rem;
}

.vmcr-edit-format-help pre {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  padding: 10px 12px;
  overflow: auto;
  font-size: 0.75rem;
}

.vmcr-edit-pl-item__io {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.vmcr-edit-pl-item__io input {
  width: 58px;
  font-size: 0.72rem;
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid var(--vmcr-line);
}

.vmcr-edit-vol-row {
  flex-direction: column;
  align-items: stretch;
  background: rgba(196, 95, 18, 0.05);
}

/* Video (crop) and audio (volume) for one clip, as one panel — both boxes share the same
 * max-width so they read as a matched pair instead of two differently-sized widgets. */
.vmcr-edit-media-row {
  gap: 6px;
}

.vmcr-edit-vol-canvas {
  width: 100%;
  max-width: 640px;
  height: 90px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  cursor: crosshair;
  touch-action: none;
}

.vmcr-edit-crop-canvas {
  width: 100%;
  max-width: 640px;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  cursor: crosshair;
  touch-action: none;
  margin: 8px 0;
}

/* Real drag timeline (replaces the old up/down reorder list) — a ruler + a track of
 * absolutely-positioned clip blocks, sized/placed by time, like Premiere/CapCut/Vegas. */
.vmcr-edit-tl-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.vmcr-edit-tl-hint {
  flex: 1;
  min-width: 180px;
  font-size: 0.72rem;
  color: var(--vmcr-muted);
}

.vmcr-edit-tl-zoom {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.vmcr-edit-tl-tools {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.vmcr-edit-tl-scroll {
  position: relative;
  overflow-x: auto;
  padding-bottom: 6px;
}

.vmcr-edit-tl-ruler {
  position: relative;
  height: 20px;
  min-width: 100%;
  border-bottom: 1px solid var(--vmcr-line);
  margin-bottom: 4px;
  cursor: pointer;
}

.vmcr-edit-tl-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.14);
  padding-left: 4px;
  font-size: 0.62rem;
  color: var(--vmcr-muted);
  white-space: nowrap;
}

.vmcr-edit-tl-track {
  position: relative;
  height: 84px;
  min-width: 100%;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
}

.vmcr-edit-tl-clip {
  position: absolute;
  top: 6px;
  bottom: 6px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 0.72rem;
  cursor: grab;
  overflow: hidden;
  user-select: none;
}

.vmcr-edit-tl-clip--video {
  background: linear-gradient(180deg, #3d6fc4 0%, #2a4f96 100%);
}

.vmcr-edit-tl-clip--audio {
  background: linear-gradient(180deg, #7858be 0%, #5a3f9a 100%);
}

.vmcr-edit-tl-clip--image {
  background: linear-gradient(180deg, #c88828 0%, #a5680f 100%);
}

.vmcr-edit-tl-clip.is-selected {
  outline: 2px solid #ffcf4b;
  box-shadow: 0 0 0 2px rgba(255, 207, 75, 0.4);
}

.vmcr-edit-tl-clip.is-dragging {
  cursor: grabbing;
  opacity: 0.75;
}

.vmcr-edit-tl-clip.is-pending {
  opacity: 0.55;
  border-style: dashed;
}

/* Two bands per clip block — a filmstrip-style thumbnail (video/image) above a mini
 * waveform (anything carrying audio) — so the timeline reads like a real NLE's stacked
 * video/audio tracks without actually being separate, independently-timed tracks. */
.vmcr-edit-tl-clip__bar {
  flex: 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 6px;
  background: rgba(0, 0, 0, 0.22);
}

.vmcr-edit-tl-clip__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
}

.vmcr-edit-tl-clip__dur {
  flex-shrink: 0;
  opacity: 0.85;
  font-size: 0.62rem;
}

.vmcr-edit-tl-clip__media {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.vmcr-edit-tl-clip__thumb {
  background-repeat: repeat-x;
  background-position: left center;
  background-size: auto 100%;
  background-color: rgba(0, 0, 0, 0.12);
}

.vmcr-edit-tl-clip--video .vmcr-edit-tl-clip__thumb {
  flex: 1 1 auto;
}

.vmcr-edit-tl-clip--image .vmcr-edit-tl-clip__thumb {
  flex: 1 1 auto;
}

.vmcr-edit-tl-clip__wave {
  display: block;
  width: 100%;
}

.vmcr-edit-tl-clip--video .vmcr-edit-tl-clip__wave {
  flex: 0 0 16px;
}

.vmcr-edit-tl-clip--audio .vmcr-edit-tl-clip__wave {
  flex: 1 1 auto;
}

.vmcr-edit-tl-clip__dur {
  font-size: 0.62rem;
  opacity: 0.9;
}

.vmcr-edit-tl-clip__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 9px;
  cursor: ew-resize;
}

.vmcr-edit-tl-clip__handle--l {
  left: 0;
}

.vmcr-edit-tl-clip__handle--r {
  right: 0;
}

.vmcr-edit-tl-clip__x {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  padding: 0;
  line-height: 15px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 0.58rem;
  cursor: pointer;
}

.vmcr-edit-tl-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e0356b;
  pointer-events: none;
  z-index: 5;
}

.vmcr-edit-insp {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--vmcr-line);
}

.vmcr-edit-insp__head {
  margin-bottom: 8px;
  flex-wrap: wrap;
}

/* Two monitors (Preview / Edit monitor) side by side, each Full/PIP/Two like Director's
 * layoutAssignTarget pattern — click a pane's ⤓ to arm it, then click a Footage card to
 * load that clip into it. Only cosmetic/for comparison — the export always comes from the
 * timeline, untouched by what's loaded into these panes. */
.vmcr-edit-monitors {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 16px;
  align-items: start;
}

@media (max-width: 860px) {
  .vmcr-edit-monitors {
    grid-template-columns: 1fr;
  }
}

.vmcr-edit-mon-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}

/* Preview monitor: a single reviewer (no Full/PIP/Two, no arm/load pane system — that's
 * only meaningful on the Edit/Program monitor) + mark in/out + send-somewhere actions. */
.vmcr-edit-mark-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.vmcr-edit-mark-io {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--vmcr-muted);
}

.vmcr-edit-mon-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 4px;
}

.vmcr-edit-mon-pane {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #111;
}

.vmcr-edit-mon-video,
.vmcr-edit-mon-pane--sequence canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.vmcr-edit-mon-pane--sequence video {
  display: none;
}

.vmcr-edit-mon-pane__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.vmcr-edit-mon-pane.has-media .vmcr-edit-mon-pane__empty {
  display: none;
}

.vmcr-edit-mon-pane.is-armed {
  outline: 2px solid #ffcf4b;
  outline-offset: -2px;
}

.vmcr-edit-mon-pane__arm {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

.vmcr-edit-mon-pane__arm:hover {
  background: rgba(0, 0, 0, 0.78);
}

/* PIP's pane B, and EVERY pane while in Split, is a floating box positioned/sized by JS
 * (draggable/resizable — see makePaneMovable). Pane A stays pinned full-size everywhere else. */
.vmcr-edit-mon-stage[data-layout="pip"] .vmcr-edit-mon-pane[data-pane="b"],
.vmcr-edit-mon-stage[data-layout="split"] .vmcr-edit-mon-pane {
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  z-index: 2;
  touch-action: none;
  cursor: grab;
}

.vmcr-edit-mon-stage[data-layout="pip"] .vmcr-edit-mon-pane[data-pane="b"].is-dragging,
.vmcr-edit-mon-stage[data-layout="split"] .vmcr-edit-mon-pane.is-dragging {
  cursor: grabbing;
  z-index: 5;
}

.vmcr-edit-mon-pane__resize {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  z-index: 3;
  cursor: nwse-resize;
  touch-action: none;
  display: none;
}

.vmcr-edit-mon-stage[data-layout="pip"] .vmcr-edit-mon-pane[data-pane="b"] .vmcr-edit-mon-pane__resize,
.vmcr-edit-mon-stage[data-layout="split"] .vmcr-edit-mon-pane .vmcr-edit-mon-pane__resize,
.vmcr-edit-mon-blur .vmcr-edit-mon-pane__resize {
  display: block;
}

/* Blur: a floating box like PIP's, but it defocuses whatever's behind it instead of showing
 * a loaded clip — no video/arm button, always draggable/resizable regardless of layout. */
.vmcr-edit-mon-blur {
  backdrop-filter: blur(14px); /* overridden inline once a strength is set via the slider */
  -webkit-backdrop-filter: blur(14px);
  border: 2px dashed rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  z-index: 4;
  touch-action: none;
  cursor: grab;
}

.vmcr-edit-mon-blur.is-dragging {
  cursor: grabbing;
}

.vmcr-edit-mon-blur-menu input[type="range"] {
  width: 110px;
  accent-color: #ffcf4b;
  cursor: pointer;
}

.vmcr-edit-mon-pane__resize::before {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 9px;
  height: 9px;
  border-right: 2px solid rgba(255, 255, 255, 0.9);
  border-bottom: 2px solid rgba(255, 255, 255, 0.9);
}

.vmcr-edit-mon-split-menu {
  position: absolute;
  top: -46px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(20, 20, 20, 0.92);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.vmcr-edit-mon-split-menu button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.vmcr-edit-mon-split-menu button:hover {
  background: rgba(255, 255, 255, 0.25);
}

.vmcr-edit-mon-bg-menu {
  top: -52px;
}

.vmcr-edit-mon-bg-menu input[type="color"] {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

.vmcr-edit-mon-bg-menu .vmcr-btn {
  white-space: nowrap;
}

/* Background layer: always the bottom-most thing in the stage — a solid color or an
 * uploaded image/gif/video — visible through any pane that's empty or doesn't cover it. */
.vmcr-edit-mon-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #000;
}

.vmcr-edit-mon-bg img,
.vmcr-edit-mon-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vmcr-edit-mon-pane {
  z-index: 1;
}

.vmcr-edit-mon-pane:not(.has-media):not(.vmcr-edit-mon-pane--sequence) {
  background: transparent;
}

.vmcr-edit-mon-pane:not(.has-media) .vmcr-edit-mon-video {
  /* An empty <video> paints its own opaque black surface regardless of CSS background —
   * hiding it (rather than just recoloring it) is what actually lets the background layer
   * show through until a clip is loaded. */
  visibility: hidden;
}

.vmcr-edit-mon-pane--sequence {
  background: transparent;
}

.vmcr-edit-mon-pane--sequence canvas {
  background: transparent;
}

/* Footage bin as clickable cards (label + tinted backing), matching Director's
 * .vmcr-slot-btn card look, instead of a plain file list. */
.vmcr-edit-footage-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px;
  margin: 10px 0;
}

.vmcr-edit-footage-card-wrap {
  position: relative;
}

.vmcr-edit-footage-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--vmcr-line);
  border-left-width: 4px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.7rem;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

/* Shown right after a file is added — pick where it should go. */
.vmcr-edit-footage-offer {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 8px;
  background: rgba(20, 20, 20, 0.92);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.vmcr-edit-footage-offer button {
  flex: 1;
  padding: 5px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.vmcr-edit-footage-offer button:hover {
  background: rgba(255, 255, 255, 0.25);
}

.vmcr-edit-footage-card:hover {
  background: rgba(255, 255, 255, 0.96);
}

.vmcr-edit-footage-card.is-selected {
  outline: 2px solid #ffcf4b;
}

.vmcr-edit-footage-card strong {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
}

.vmcr-edit-footage-card span {
  color: var(--vmcr-muted);
  font-size: 0.64rem;
}

.vmcr-edit-footage-card--video {
  border-left-color: #2a4f96;
}

.vmcr-edit-footage-card--audio {
  border-left-color: #5a3f9a;
}

.vmcr-edit-footage-card--image {
  border-left-color: #a5680f;
}

/* Footage / Export / Redeem key / This project — one row instead of four stacked cards. */
.vmcr-edit-bottom-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 0.8fr;
  gap: 14px;
  align-items: start;
  margin-top: 16px;
}

@media (max-width: 980px) {
  .vmcr-edit-bottom-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .vmcr-edit-bottom-row {
    grid-template-columns: 1fr;
  }
}

.vmcr-edit-bottom-card {
  margin: 0;
}
