/* —— Light Show NudeFrance —— */

/* Calque lumineux : ne masque pas la vidéo */
.lights-page-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  mix-blend-mode: screen;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lights-page-canvas.is-on,
body.lights-active .lights-page-canvas {
  opacity: 1;
  visibility: visible;
}

body.lights-idle .lights-page-canvas,
body.lights-idle .lights-stage {
  opacity: 0 !important;
  visibility: hidden !important;
}

.lights-stage {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  mix-blend-mode: screen;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.lights-stage.is-on,
body.lights-live .lights-stage {
  opacity: 1;
  visibility: visible;
}

/* Faisceaux bass — rouge/orange puissant */
.lights-beam {
  position: absolute;
  left: 50%;
  bottom: -5%;
  width: 120px;
  height: 92vh;
  margin-left: -60px;
  transform-origin: bottom center;
  opacity: 0;
  background: linear-gradient(
    to top,
    rgba(255, 25, 70, 0.95) 0%,
    rgba(220, 20, 60, 0.7) 22%,
    rgba(180, 0, 100, 0.28) 50%,
    transparent 75%
  );
  clip-path: polygon(44% 100%, 50% 0%, 56% 100%);
  will-change: transform, opacity;
}

.lights-beam:nth-child(odd) {
  background: linear-gradient(
    to top,
    rgba(255, 90, 30, 0.92) 0%,
    rgba(255, 40, 80, 0.6) 28%,
    rgba(200, 0, 90, 0.22) 55%,
    transparent 78%
  );
}

.lights-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
}

/* Flash bass (kick) */
.lights-flash-bass {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle at 50% 48%,
    rgba(255, 40, 80, 0.75) 0%,
    rgba(220, 20, 60, 0.3) 38%,
    transparent 68%
  );
  mix-blend-mode: screen;
  transition: opacity 0.05s ease-out;
}

/* Flash treble (hi-hats) — blanc/bleu court */
.lights-flash-treble {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle at 30% 25%,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(180, 120, 255, 0.15) 25%,
    transparent 50%
  ),
  radial-gradient(
    circle at 72% 35%,
    rgba(255, 255, 255, 0.28) 0%,
    transparent 45%
  );
  mix-blend-mode: screen;
  transition: opacity 0.04s ease-out;
}

body.lights-beat .lights-flash-bass {
  opacity: var(--nf-beat-flash, 0.5);
}

/* Vidéo visible : overlay allégé quand le show tourne */
body.lights-active.has-bg-video .bg-overlay {
  background:
    linear-gradient(180deg, rgba(10,10,10,0.12) 0%, rgba(10,10,10,0.28) 50%, rgba(10,10,10,0.45) 100%),
    radial-gradient(circle at 50% 30%, rgba(220,20,60,0.12) 0%, transparent 55%);
}

body.lights-active.has-bg-video .bg-glow {
  opacity: calc(0.15 + var(--lights-show-level, 0) * 0.35);
}

body.lights-active:not(.has-bg-video) .bg-overlay {
  background:
    linear-gradient(180deg, rgba(10,10,10,0.4) 0%, rgba(10,10,10,0.6) 50%, rgba(10,10,10,0.8) 100%),
    radial-gradient(circle at 50% 30%, rgba(220,20,60,0.25) 0%, transparent 60%);
}

body.lights-active .bg-glow {
  opacity: calc(0.5 + var(--lights-show-level, 0) * 0.45);
  filter: hue-rotate(calc(var(--nf-light-hue, 340) * 1deg));
  transform: translateX(-50%) scale(calc(1.05 + var(--lights-show-level, 0) * 0.4));
  width: min(900px, 120vw);
  height: min(900px, 120vw);
  transition: opacity 0.08s, filter 0.08s, transform 0.08s;
}

body.lights-active .header,
body.lights-active .player-container,
body.lights-active .footer {
  position: relative;
  z-index: 5;
}

body.lights-live .cover.playing {
  box-shadow:
    0 0 25px rgba(255, 40, 90, calc(var(--light-bass, 0) * 0.7)),
    0 0 60px rgba(220, 20, 60, calc(var(--light-mid, 0) * 0.5));
}

body.lights-live .btn-play.is-playing {
  filter: drop-shadow(0 0 18px rgba(255, 50, 90, calc(var(--light-bass, 0) * 0.65)));
}

body.lights-live .btn-play.is-playing .btn-play-glow {
  opacity: calc(0.6 + var(--lights-show-level, 0) * 0.4);
}

body.light-show-on .player-container {
  animation: none;
}

.lights-section-compact {
  margin: 1.5rem 0;
  padding: 0;
  border: none;
  background: transparent;
}

.light-show-toggle {
  display: block;
  cursor: pointer;
}

.light-show-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.light-show-toggle-ui {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(20, 20, 20, 0.85);
  transition: border-color 0.2s, box-shadow 0.25s;
}

.light-show-toggle input:checked + .light-show-toggle-ui {
  border-color: #ff3d6a;
  box-shadow: 0 0 40px rgba(255, 50, 100, 0.35);
}

.light-show-icon { font-size: 1.75rem; }

.light-show-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.light-show-text small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.light-show-switch {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

.light-show-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.light-show-toggle input:checked + .light-show-toggle-ui .light-show-switch {
  background: linear-gradient(135deg, #ff3d6a, #dc143c);
}

.light-show-toggle input:checked + .light-show-toggle-ui .light-show-switch::after {
  transform: translateX(20px);
}
