/* ============================================
   MUSIC PLAYER — Floating Toggle Button
   ============================================ */

.music-toggle {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 10000;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 0;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity 0.3s ease;
}

.music-toggle:hover {
  opacity: 0.7;
}

/* ── Animated bars (equalizer) ── */
.music-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.music-bars .bar {
  width: 2px;
  background: #999;
  border-radius: 1px;
  transform-origin: bottom;
  height: 3px;
}

/* Playing state — bars bounce */
.music-toggle.playing .bar {
  background: #666;
}

.music-toggle.playing .bar:nth-child(1) {
  animation: musicBar 0.6s ease-in-out infinite alternate;
  animation-delay: 0s;
}
.music-toggle.playing .bar:nth-child(2) {
  animation: musicBar 0.6s ease-in-out infinite alternate;
  animation-delay: 0.15s;
}
.music-toggle.playing .bar:nth-child(3) {
  animation: musicBar 0.6s ease-in-out infinite alternate;
  animation-delay: 0.3s;
}
.music-toggle.playing .bar:nth-child(4) {
  animation: musicBar 0.6s ease-in-out infinite alternate;
  animation-delay: 0.45s;
}

@keyframes musicBar {
  0%   { height: 3px; }
  100% { height: 14px; }
}

/* Muted / paused state — bars static and dim */
.music-toggle.muted .bar {
  animation: none;
  height: 3px;
}

.music-toggle.muted {
  opacity: 0.35;
}

/* ── Slash overlay when muted ── */
.music-slash {
  position: absolute;
  width: 20px;
  height: 1.5px;
  background: #999;
  border-radius: 1px;
  transform: rotate(-45deg);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.music-toggle.muted .music-slash {
  opacity: 1;
}

/* ── Dark sections: lighter bars ── */
[data-bg="dark"] ~ .music-toggle .bar,
.fp-section.active[data-bg="dark"] ~ .music-toggle .bar {
  background: rgba(255, 255, 255, 0.5);
}

[data-bg="dark"] ~ .music-toggle .music-slash {
  background: rgba(255, 255, 255, 0.5);
}

/* ── Mobile adjustments ── */
@media (max-width: 768px) {
  .music-toggle {
    bottom: 16px;
    left: 16px;
    width: 28px;
    height: 28px;
  }

  .music-bars {
    height: 12px;
  }

  .music-bars .bar {
    width: 1.5px;
  }

  @keyframes musicBar {
    0%   { height: 3px; }
    100% { height: 12px; }
  }
}
