/* ══════════════════════════════════════════════════════
   node-viewer.css — DCVisuals v5
   Nouveautés : drag sur image, curseur grab/grabbing,
   handle visible sur la ligne de wipe, hint discret
   ══════════════════════════════════════════════════════ */

:root {
  --nv-amber  : #c8912a;
  --nv-ab     : rgba(200,145,42,.28);
  --nv-ad     : rgba(200,145,42,.10);
  --nv-br     : var(--br,  rgba(255,255,255,.08));
  --nv-bg     : var(--raised, #131a22);
  --nv-t1     : var(--t1,  #e4e0d8);
  --nv-t3     : var(--t3,  #5e5e58);
  --nv-ffm    : var(--ffm, 'DM Mono', monospace);

  --nv-thumb  : 20px;
  --nv-dot    : 12px;
  --nv-trk-h  :  4px;
  --nv-tip-h  : 26px;
  --nv-tip-gap:  6px;
}

/* ── Wrapper ── */
.nv {
  border: 1px solid var(--nv-br);
  border-radius: 14px;
  overflow: hidden;
  background: var(--nv-bg);
  margin-top: 28px;
  user-select: none;
}

/* ── Header ── */
.nv-hd {
  padding: 10px 18px;
  border-bottom: 1px solid var(--nv-br);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nv-ttl {
  font-family: var(--nv-ffm);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--nv-amber);
}

/* Hint "glisser" — discret, disparaît après le 1er drag */
.nv-drag-hint {
  font-family: var(--nv-ffm);
  font-size: .52rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--nv-t3);
  opacity: .7;
  transition: opacity .4s ease;
  pointer-events: none;
}
.nv--grabbed .nv-drag-hint {
  opacity: 0;
}

/* ══════════════════════
   ZONE IMAGE
══════════════════════ */
.nv-img {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #060808;
  overflow: hidden;
}

/* Curseur : grab si draggable */
.nv--draggable .nv-img { cursor: grab; }
.nv--grabbing  .nv-img,
.nv--grabbing  { cursor: grabbing !important; }

.nv-img-base,
.nv-img-over {
  position: absolute;
  inset: 0;
}

.nv-img-base img,
.nv-img-over img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  /* Empêche la sélection de l'image pendant le drag */
  -webkit-user-drag: none;
  user-select: none;
}

.nv-img-over {
  clip-path: inset(0 100% 0 0);
}

/* ── Ligne de wipe + handle ── */
.nv-wipe {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 2px;
  transform: translateX(-50%);
  /* Dégradé vertical pour la ligne */
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255,168,58,.8) 20%,
    rgba(255,168,58,.8) 80%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 5;
  /* Transition douce pendant le drag libre, désactivée pendant le drag actif */
  transition: left .05s linear;
}

/* Handle (poignée ronde sur la ligne de wipe) */
.nv-wipe-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,.65);
  border: 2px solid var(--nv-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
}

/* Flèches gauche/droite dans le handle */
.nv-wipe-handle::before,
.nv-wipe-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.nv-wipe-handle::before {
  right: 11px;
  border-right: 6px solid var(--nv-amber);
}
.nv-wipe-handle::after {
  left: 11px;
  border-left: 6px solid var(--nv-amber);
}

/* Badge état */
.nv-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 4px 11px;
  background: rgba(0,0,0,.78);
  border: 1px solid var(--nv-ab);
  border-radius: 100px;
  font-family: var(--nv-ffm);
  font-size: .58rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--nv-amber);
  pointer-events: none;
  z-index: 6;
}

/* ══════════════════════
   BARRE DE NAVIGATION
══════════════════════ */
.nv-bar {
  padding: 8px 20px 20px;
  border-top: 1px solid var(--nv-br);
}

.nv-sw {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding-top: calc(var(--nv-tip-h) + var(--nv-tip-gap));
  padding-bottom: calc(var(--nv-thumb) / 2 + 2px);
}

/* Track */
.nv-trk {
  position: relative;
  width: 100%;
  height: var(--nv-trk-h);
  background: rgba(255,255,255,.1);
  border-radius: 999px;
  overflow: visible;
  cursor: pointer;
}

/* Fill amber */
.nv-fill {
  position: absolute;
  inset: 0;
  right: auto;
  width: 0%;
  background: var(--nv-amber);
  border-radius: 999px;
  pointer-events: none;
}

/* Points fixes (magnets) */
.nv-pts {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.nv-pt {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: var(--nv-dot);
  height: var(--nv-dot);
  border-radius: 50%;
  background: var(--nv-bg);
  border: 2px solid rgba(255,255,255,.18);
  z-index: 2;
  transition: border-color .18s, background .18s, box-shadow .18s;
}

.nv-pt.on {
  border-color: var(--nv-amber);
  background: var(--nv-amber);
  box-shadow: 0 0 0 3px rgba(200,145,42,.2);
}

/* Thumb mobile */
.nv-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: var(--nv-thumb);
  height: var(--nv-thumb);
  border-radius: 50%;
  background: var(--nv-amber);
  border: 2px solid rgba(0,0,0,.55);
  box-shadow: 0 0 0 3px rgba(200,145,42,.22);
  z-index: 4;
  pointer-events: none;
}

/* Tooltip */
.nv-tip {
  position: absolute;
  top: 0;
  left: 0%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(0,0,0,.9);
  border: 1px solid var(--nv-ab);
  font-family: var(--nv-ffm);
  font-size: .55rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--nv-amber);
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Focus visible */
.nv:focus-visible {
  outline: 2px solid rgba(200,145,42,.5);
  outline-offset: 3px;
}

/* ══════════════════════
   RESPONSIVE
══════════════════════ */
@media (max-width: 600px) {
  .nv-hd  { padding: 10px 14px; }
  .nv-bar { padding: 6px 14px 14px; }
  .nv-badge { bottom: 8px; left: 8px; }
  .nv-wipe-handle { width: 26px; height: 26px; }
}