/* ══════════════════════════════════════════════
   Music Player — Spotify embed style, fixed top-right
══════════════════════════════════════════════ */

#music-player {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 340px;
  padding: 12px 14px 12px 12px;

  /* Glassmorphic Spotify-dark card */
  background: rgba(20, 15, 28, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(155, 127, 196, 0.18);
  border-radius: 14px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 0 0.5px rgba(255,255,255,0.05) inset,
    0 0 24px rgba(155, 127, 196, 0.08);

  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}


#music-player.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

/* ── Album art ── */
.player-album-art {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--purple-deep), var(--pink-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.player-album-placeholder {
  font-size: 20px;
  opacity: 0.7;
  color: white;
}

/* ── Track info ── */
.player-info {
  flex: 1;
  min-width: 0;
}

.player-track {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  margin-bottom: 1px;
}

.player-artist {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
}

/* ── Progress bar ── */
.player-progress-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.12);
  border-radius: 99px;
  overflow: hidden;
  cursor: pointer;
}

.player-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  border-radius: 99px;
  transition: width 0.5s linear;
}

.player-time {
  font-family: var(--font-body);
  font-size: 0.62rem;
  color: rgba(255,255,255,0.4);
  min-width: 26px;
  text-align: right;
}

/* ── Controls ── */
.player-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.player-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  padding: 5px 4px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.player-btn-play {
  font-size: 16px;
  color: #fff;
  background: rgba(155, 127, 196, 0.25);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  padding: 0;
}

.player-btn-play:hover {
  background: rgba(155, 127, 196, 0.5);
}

/* ── Close button ── */
.player-close {
  position: absolute;
  top: 5px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.25);
  font-size: 9px;
  padding: 2px 3px;
  transition: color 0.2s;
}

.player-close:hover {
  color: rgba(255,255,255,0.7);
}

/* ── Spinning album art when playing ── */
@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

.player-album-art.playing {
  animation: spin-slow 8s linear infinite;
}
