/* ==========================================================================
   editing-fixes.css — load AFTER css/editing.css
   1. Color-grading slider   2. Brief modal
   Uses the site's theme colors with safe fallbacks.
   ========================================================================== */

:root {
  --fx-gold: var(--gold, #f5b83d);
  --fx-orange: var(--orange, #ff8a3d);
  --fx-ember: #ff6a2b;
  --fx-text: var(--text, #f3ebe0);
  --fx-muted: var(--muted, #b9a998);
  --fx-bg: #0d0b0a;
  --fx-glass: rgba(28, 22, 18, 0.78);
  --fx-line: rgba(245, 184, 61, 0.22);
}

/* --------------------------------------------------------------------------
   1. BEFORE / AFTER COLOR GRADING
   -------------------------------------------------------------------------- */
.grade-v2 {
  --pos: 50;
  margin-top: 1.25rem;
}

.gv2-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 22px;
  overflow: hidden;
  background: #16110d;
  border: 1px solid var(--fx-line);
  box-shadow:
    0 30px 80px -30px rgba(255, 106, 43, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.gv2-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

/* BEFORE — flat, ungraded "log" look */
.gv2-before {
  filter: saturate(0.55) contrast(0.8) brightness(1.05);
}

/* AFTER — cinematic grade, revealed from the handle to the right edge */
.gv2-after-wrap {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 calc(var(--pos) * 1%));
  will-change: clip-path;
}
.gv2-after {
  filter: saturate(1.25) contrast(1.15) brightness(0.95) sepia(0.15) hue-rotate(-8deg);
}
.gv2-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 138, 61, 0.55) 0%, rgba(255, 170, 90, 0.15) 45%, rgba(0, 128, 140, 0.45) 100%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.gv2-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.6) 100%);
  pointer-events: none;
}

/* Skeleton shimmer while the first image loads */
.gv2-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #17110d 20%, #2a1d14 40%, #3a2716 50%, #2a1d14 60%, #17110d 80%);
  background-size: 300% 100%;
  animation: gv2-shimmer 1.6s linear infinite;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.gv2-stage.is-loading .gv2-skeleton {
  opacity: 1;
}
.gv2-stage.is-loading .gv2-img,
.gv2-stage.is-switching .gv2-img {
  opacity: 0;
}
@keyframes gv2-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -200% 0; }
}

/* Labels */
.gv2-label {
  position: absolute;
  top: 1rem;
  z-index: 3;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(8, 6, 5, 0.72);
  backdrop-filter: blur(6px);
  color: var(--fx-text);
  font: 700 0.78rem/1 'Inter', sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  pointer-events: none;
}
.gv2-label-before { left: 1rem; }
.gv2-label-after {
  right: 1rem;
  color: var(--fx-gold);
  border: 1px solid rgba(245, 184, 61, 0.35);
}

/* Divider + handle */
.gv2-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--pos) * 1%);
  width: 2px;
  transform: translateX(-1px);
  background: linear-gradient(to bottom, transparent, var(--fx-gold) 12%, var(--fx-gold) 88%, transparent);
  box-shadow: 0 0 18px rgba(245, 184, 61, 0.8);
  z-index: 2;
  pointer-events: none;
}
.gv2-handle {
  position: absolute;
  top: 50%;
  left: calc(var(--pos) * 1%);
  z-index: 4;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fx-gold), var(--fx-orange));
  color: #1a0f07;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  cursor: ew-resize;
  box-shadow: 0 0 0 6px rgba(245, 184, 61, 0.18), 0 10px 30px rgba(255, 106, 43, 0.45);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.gv2-stage:hover .gv2-handle,
.gv2-stage.is-dragging .gv2-handle {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 0 0 10px rgba(245, 184, 61, 0.14), 0 12px 36px rgba(255, 106, 43, 0.6);
}
.gv2-handle:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

/* Sample tabs */
.gv2-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}
.gv2-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 1rem 0.35rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--fx-line);
  background: rgba(20, 15, 12, 0.7);
  color: var(--fx-muted);
  font: 600 0.88rem/1 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.gv2-tab:hover { color: var(--fx-text); }
.gv2-tab[aria-selected='true'] {
  color: var(--fx-gold);
  border-color: var(--fx-gold);
  box-shadow: 0 0 20px rgba(245, 184, 61, 0.25);
}
.gv2-tab:focus-visible {
  outline: 2px solid var(--fx-gold);
  outline-offset: 3px;
}
.gv2-thumb {
  width: 44px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  background: #2a1d14;
}

@media (max-width: 600px) {
  .gv2-stage { aspect-ratio: 4 / 3; border-radius: 16px; }
  .gv2-handle { width: 46px; height: 46px; }
  .gv2-label { font-size: 0.68rem; top: 0.7rem; }
  .gv2-label-before { left: 0.7rem; }
  .gv2-label-after { right: 0.7rem; }
}

/* --------------------------------------------------------------------------
   2. "GET YOUR VIDEO EDITED" BRIEF MODAL
   -------------------------------------------------------------------------- */
html.brief-lock,
html.brief-lock body {
  overflow: hidden;
}

.brief-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: radial-gradient(ellipse at 30% 20%, rgba(255, 138, 61, 0.14), transparent 60%), rgba(5, 4, 3, 0.86);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.brief-overlay[hidden] { display: none; }
.brief-overlay.is-open { opacity: 1; }

.brief-dialog {
  position: relative;
  width: min(680px, 100%);
  max-height: min(calc(100vh - 2rem), calc(100dvh - 2rem), 720px);
  /* The dialog itself never scrolls: only .brief-body does, so the
     letterbox bars, step track and Back/Next buttons stay put. */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 2.8rem 2.2rem 1.6rem;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(38, 28, 20, 0.95), rgba(16, 12, 10, 0.97));
  border: 1px solid var(--fx-line);
  box-shadow:
    0 0 60px rgba(245, 184, 61, 0.12),
    0 0 120px rgba(255, 106, 43, 0.12),
    0 40px 80px rgba(0, 0, 0, 0.6);
  color: var(--fx-text);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.brief-overlay.is-open .brief-dialog { transform: none; }
.brief-dialog:focus { outline: none; }

/* Letterbox bars slide in */
.brief-letterbox {
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  background: #000;
  transform: scaleY(0);
  transition: transform 0.5s 0.1s ease;
}
.brief-letterbox.top { top: 0; transform-origin: top; border-radius: 24px 24px 0 0; }
.brief-letterbox.bottom { bottom: 0; transform-origin: bottom; border-radius: 0 0 24px 24px; }
.brief-overlay.is-open .brief-letterbox { transform: scaleY(1); }

.brief-close {
  position: absolute;
  top: 1.4rem;
  right: 1.2rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--fx-line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--fx-text);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.brief-close:hover { color: var(--fx-gold); border-color: var(--fx-gold); }

.brief-kicker {
  margin: 0 0 1.1rem;
  font: 700 0.75rem/1 'Inter', sans-serif;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fx-gold);
}

/* Progress styled as clips on an editing track */
.brief-progress {
  --brief-progress: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 1.8rem;
  padding: 6px;
  list-style: none;
  border-radius: 10px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 22px), #0b0908;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.brief-clip {
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--fx-muted);
  font: 600 0.8rem/1.1 'Inter', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.brief-clip span {
  margin-right: 0.35rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  opacity: 0.7;
}
.brief-clip.is-done {
  background: rgba(245, 184, 61, 0.16);
  border-color: rgba(245, 184, 61, 0.35);
  color: var(--fx-text);
}
.brief-clip.is-active {
  background: linear-gradient(135deg, var(--fx-gold), var(--fx-orange));
  border-color: transparent;
  color: #1a0f07;
  box-shadow: 0 0 18px rgba(245, 184, 61, 0.35);
}

.brief-panel h3 {
  margin: 0 0 1.1rem;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  line-height: 1.2;
}
.brief-panel h4 {
  margin: 1.6rem 0 0.9rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
}
.brief-panel.is-active {
  animation: brief-cut-in 0.45s ease both;
}
@keyframes brief-cut-in {
  from { opacity: 0; transform: translateX(18px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}

.brief-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.brief-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 184, 61, 0.25);
  background: rgba(255, 255, 255, 0.03);
  color: var(--fx-text);
  font: 500 0.95rem/1 'Inter', sans-serif;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.brief-chip:hover {
  transform: translateY(-2px);
  border-color: var(--fx-gold);
}
.brief-chip[aria-pressed='true'] {
  background: linear-gradient(135deg, rgba(245, 184, 61, 0.28), rgba(255, 106, 43, 0.22));
  border-color: var(--fx-gold);
  color: #fff;
  box-shadow: 0 0 22px rgba(245, 184, 61, 0.4), inset 0 0 12px rgba(245, 184, 61, 0.15);
}
.brief-chip:focus-visible,
.brief-text-btn:focus-visible,
.brief-close:focus-visible,
.brief-field input:focus-visible {
  outline: 2px solid var(--fx-gold);
  outline-offset: 3px;
}

.brief-field {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.5rem;
  font: 500 0.9rem/1.3 'Inter', sans-serif;
  color: var(--fx-muted);
}
.brief-field em { font-style: normal; opacity: 0.7; }
.brief-field input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(245, 184, 61, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: var(--fx-text);
  font: 400 0.95rem/1.2 'Inter', sans-serif;
}
.brief-field input::placeholder { color: rgba(185, 169, 152, 0.6); }

.brief-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.25rem;
  margin: -0.25rem;
}
.brief-progress,
.brief-kicker { flex-shrink: 0; }
.brief-nav {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.2rem;
  padding-bottom: 0.4rem;
}
.brief-nav[hidden] { display: none; }
.brief-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.4);
  box-shadow: none;
}

/* Final "script card" */
.brief-final { text-align: center; }
.brief-script {
  position: relative;
  margin: 0 auto 1.6rem;
  padding: 1.6rem 1.4rem;
  max-width: 480px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(245, 184, 61, 0.1), rgba(255, 106, 43, 0.06));
  border: 1px dashed rgba(245, 184, 61, 0.45);
  box-shadow: 0 0 40px rgba(245, 184, 61, 0.15);
}
.brief-script-label {
  margin: 0 0 0.7rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--fx-gold);
}
.brief-summary {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  line-height: 1.5;
}
.brief-idea {
  margin: 0.8rem 0 0;
  color: var(--fx-muted);
  font-style: italic;
}
.brief-final-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.2rem;
}
.brief-text-btn {
  border: 0;
  background: none;
  color: var(--fx-muted);
  font: 500 0.9rem/1 'Inter', sans-serif;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.brief-text-btn:hover { color: var(--fx-gold); }

/* Mobile: full-screen sheet */
@media (max-width: 600px) {
  .brief-overlay { padding: 0; align-items: end; }
  .brief-dialog {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    padding: 3.4rem 1.25rem 1.6rem;
    transform: translateY(40px);
  }
  .brief-letterbox.top,
  .brief-letterbox.bottom { border-radius: 0; }
  .brief-clip { font-size: 0.72rem; padding: 0.5rem; }
  .brief-clip span { display: none; }
  .brief-chip { font-size: 0.9rem; padding: 0.65rem 0.95rem; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .gv2-skeleton { animation: none; }
  .gv2-img,
  .brief-overlay,
  .brief-dialog,
  .brief-letterbox,
  .brief-chip { transition: none; }
  .brief-panel.is-active { animation: none; }
  .brief-dialog { transform: none; }
}