/* Music popover — anchored to the music-note button at the bottom of
   the vertical dock. Mirrors the dock pill aesthetic: translucent dark
   well, backdrop blur, faint border, soft red halo. GSAP drives the
   pop-out open/close animation; this file just describes the resting
   state. */

.music-popover {
  position: absolute;
  left: calc(100% + 14px);
  bottom: 0;
  width: 260px;
  background: rgba(15, 12, 14, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.75rem 0.85rem 0.7rem;
  color: #e8e8e8;
  font-family: var(--font-mono);
  box-shadow:
    0 0 18px rgba(139, 0, 0, 0.14),
    0 8px 26px rgba(0, 0, 0, 0.45);
  /* GSAP animates this; the [hidden] attribute is also toggled
     defensively so the initial state isn't clickable until opened. */
  transform-origin: left center;
  z-index: 110;
  overflow: hidden;
}
.music-popover[hidden] { display: none; }

.mp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mp-title {
  flex: 1;
  min-width: 0;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #d4c4c4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-artist {
  color: var(--color-red-bright);
}
.mp-track-num {
  font-size: 0.5rem;
  color: #777;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* Visualizer — sits between header and controls. Bars stretch to fill
   the row width (flex:1 each) and only animate while .is-playing. */
.mp-viz {
  display: flex;
  align-items: center;
  gap: 1px;
  height: 24px;
  margin-bottom: 0.7rem;
}
.mp-viz-bar {
  flex: 1;
  display: block;
  min-width: 0;
  height: 4px;
  background: var(--color-red);
  border-radius: 1px;
  animation: mpVizPulse 0.85s ease-in-out infinite alternate;
  animation-play-state: paused;
  opacity: 0.55;
}
.mp-viz.is-playing .mp-viz-bar { animation-play-state: running; }
@keyframes mpVizPulse {
  0%   { height: 4px;  opacity: 0.55; }
  100% { height: 24px; opacity: 1; }
}

/* Controls row: play / next / volume slider. */
.mp-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mp-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #2a2020;
  background: rgba(139, 0, 0, 0.18);
  color: #cc4444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 180ms ease;
  flex-shrink: 0;
}
.mp-btn:hover {
  border-color: #8b0000;
  background: rgba(139, 0, 0, 0.32);
  box-shadow: 0 0 8px rgba(139, 0, 0, 0.3);
}
.mp-btn--ghost {
  width: 20px;
  height: 20px;
  background: transparent;
  border: none;
  color: #777;
}
.mp-btn--ghost:hover {
  color: #a89090;
  background: transparent;
  box-shadow: none;
}

.mp-vol {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mp-vol-label {
  font-size: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #777;
  flex-shrink: 0;
}
.mp-vol-slider {
  flex: 1;
  min-width: 0;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 3px;
  background: #2a1818;
  border-radius: 2px;
  outline: none;
  margin: 0;
  padding: 0;
}
.mp-vol-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cc4444;
  border: none;
  cursor: pointer;
}
.mp-vol-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cc4444;
  border: none;
  cursor: pointer;
}

/* On mobile the dock is horizontal at the bottom, so the popover
   opens UPWARD from the music button (the rightmost button) instead
   of sliding out to the right. Right-aligning to the dock keeps the
   popover roughly above the button it's anchored to. The matching
   open/close GSAP tween in js/music-player.js also flips its slide
   axis (y instead of x) on mobile so the entrance reads correctly. */
@media (max-width: 768px) {
  .music-popover {
    left: auto;
    right: 0;
    bottom: calc(100% + 14px);
    transform-origin: right bottom;
    max-width: calc(100vw - 1.5rem);
  }
}
