/* ═══════════════════════════════════════════════════════════ */
/* Player Page — Premium Spotify/Apple Music style             */
/* ═══════════════════════════════════════════════════════════ */

.player-page {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 60px 24px 40px;
}

.player-loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh;
}

/* Blurred Background */
.player-bg {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden;
}
.player-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(0deg, var(--bg) 5%, rgba(10,10,10,.65) 50%, rgba(10,10,10,.85) 100%);
}
.player-bg-img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(80px) saturate(1.4) brightness(.35);
  transform: scale(1.3);
  opacity: 0;
  transition: opacity 1s ease;
}
.player-bg-img.loaded { opacity: 1; }

/* Visualizer */
.player-visualizer {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
}

/* Content */
.player-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center;
  max-width: 440px; width: 100%;
  gap: 4px;
}

/* Artwork */
.player-artwork {
  width: clamp(240px, 52vw, 360px);
  aspect-ratio: 1;
  margin-bottom: 24px;
  perspective: 800px;
}
.player-artwork-inner {
  width: 100%; height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-inset);
  box-shadow: 0 12px 50px rgba(0,0,0,.5);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
.player-artwork.playing .player-artwork-inner {
  animation: artBreath 3s ease-in-out infinite;
}
@keyframes artBreath {
  0%, 100% { transform: scale(1); box-shadow: 0 12px 50px rgba(0,0,0,.5); }
  50% { transform: scale(1.015); box-shadow: 0 16px 60px rgba(0,0,0,.55); }
}

.player-artwork-inner img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .4s ease;
}
.player-artwork-inner img.loaded { opacity: 1; }

.player-artwork-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  color: var(--text-tertiary);
}
.player-artwork-placeholder svg { width: 48px; height: 48px; position: relative; z-index: 1; }
.placeholder-rings {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.placeholder-rings > div {
  position: absolute;
  border: 1px solid var(--border);
  border-radius: 50%;
  animation: ringExpand 3s ease-in-out infinite;
}
.placeholder-rings > div:nth-child(1) { width: 60%; height: 60%; animation-delay: 0s; }
.placeholder-rings > div:nth-child(2) { width: 80%; height: 80%; animation-delay: 1s; }
.placeholder-rings > div:nth-child(3) { width: 95%; height: 95%; animation-delay: 2s; }
@keyframes ringExpand {
  0%, 100% { opacity: .15; transform: scale(1); }
  50% { opacity: .06; transform: scale(1.02); }
}

/* Track Info */
.player-info {
  text-align: center;
  margin-bottom: 12px;
  width: 100%;
}
.player-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-artist {
  font-size: .88rem;
  color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Waveform */
.player-waveform-container {
  width: 100%;
  height: 42px;
  margin: 4px 0;
}
.waveform-wrap {
  width: 100%; height: 100%;
  position: relative;
  cursor: pointer;
}
.waveform-hover-time {
  position: absolute; top: -26px;
  padding: 2px 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .72rem;
  font-family: var(--mono);
  color: var(--text-secondary);
  pointer-events: none;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity .15s;
}
.waveform-wrap:hover .waveform-hover-time { opacity: 1; }

/* Time */
.player-time {
  display: flex; justify-content: space-between;
  width: 100%;
  font-size: .75rem;
  font-family: var(--mono);
  color: var(--text-tertiary);
  padding: 0 2px;
  margin-bottom: 16px;
}

/* Controls */
.player-controls {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 20px;
}
.ctrl-skip {
  width: 42px; height: 42px;
  background: none; border: none;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: color .15s, background .15s, transform .1s;
}
.ctrl-skip svg { width: 20px; height: 20px; }
.ctrl-skip:hover { color: var(--text-primary); background: var(--bg-hover); }
.ctrl-skip:active { transform: scale(.9); }

.ctrl-play {
  width: 58px; height: 58px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(232,168,73,.3);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.ctrl-play svg { width: 24px; height: 24px; }
.ctrl-play:hover { transform: scale(1.06); box-shadow: 0 6px 28px rgba(232,168,73,.4); }
.ctrl-play:active { transform: scale(.95); }
.ctrl-play.is-playing { background: #f0b65d; }

/* Volume */
.player-volume {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  max-width: 300px;
  margin-bottom: 16px;
}
.vol-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: color .15s;
}
.vol-btn:hover { color: var(--text-primary); }
.vol-btn svg { width: 18px; height: 18px; }

.vol-slider-wrap {
  flex: 1; position: relative; height: 4px;
  background: var(--bg-inset);
  border-radius: 2px;
}
.vol-slider {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text-primary);
  border: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
  transition: transform .1s;
}
.vol-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.vol-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text-primary);
  border: none;
}

.vol-slider-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: var(--text-primary);
  border-radius: 2px;
  pointer-events: none;
}

/* Actions */
.player-actions {
  display: flex; gap: 12px;
}
.act-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.act-btn svg { width: 15px; height: 15px; }
.act-btn:hover { background: var(--bg-inset); color: var(--text-primary); }

/* Error State */
.player-error {
  text-align: center;
  padding: 40px 20px;
  position: relative; z-index: 2;
}
.player-error-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center;
}
.player-error-icon svg { width: 48px; height: 48px; }
.player-error h2 { font-size: 1.2rem; margin-bottom: 6px; }
.player-error p { color: var(--text-secondary); margin-bottom: 20px; }

/* Responsive */
@media (max-width: 480px) {
  .player-page { padding: 50px 16px 30px; }
  .player-artwork { width: clamp(200px, 65vw, 280px); }
  .ctrl-play { width: 52px; height: 52px; }
  .ctrl-skip { width: 36px; height: 36px; }
  .player-controls { gap: 16px; }
  .act-btn span { display: none; }
}

@media (min-width: 768px) {
  .player-artwork { width: 380px; }
}
