/* ===========================================
   MUSIC PLAYER - MODERN DESIGN

   A full-featured music player with:
   - Now Playing card with album art
   - Progress bar with seeking
   - Volume controls
   - Responsive design
   =========================================== */

/* CSS Variables for theming - AMOLED Black */
:root {
  --player-bg: #000000;
  --player-accent: #7b2ff7;
  --player-accent-glow: rgba(123, 47, 247, 0.4);
  --player-text: #ffffff;
  --player-text-muted: rgba(255, 255, 255, 0.5);
  --player-border: rgba(255, 255, 255, 0.06);
}

/* ===========================================
   MAIN PLAYER CONTAINER
   =========================================== */
.music-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--player-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--player-border);
  z-index: 9999;
  padding: 12px 24px;
  transition: transform 0.3s ease;
}

.music-player.hidden {
  transform: translateY(100%);
}

/* ===========================================
   NOW PLAYING SECTION
   =========================================== */
.now-playing {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Album Art */
.now-playing-art {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #000000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  position: relative;
  background-size: cover;
  background-position: center;
}

.now-playing-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--player-text-muted);
}

/* Song Info */
.now-playing-info {
  min-width: 180px;
  max-width: 250px;
  flex-shrink: 0;
}

.song-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--player-text);
  margin-bottom: 4px;
  /* Uses text-ellipsis pattern from global.css */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-artist {
  font-size: 13px;
  color: var(--player-text-muted);
  /* Uses text-ellipsis pattern from global.css */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================================
   PROGRESS BAR SECTION
   =========================================== */
.progress-section {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}

.time-current,
.time-duration {
  font-size: 12px;
  color: var(--player-text-muted);
  min-width: 40px;
  font-variant-numeric: tabular-nums;
}

.time-current {
  text-align: right;
}

.progress-bar-container {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  transition: height 0.15s ease;
}

.progress-bar-container:hover {
  height: 8px;
}

.progress-bar-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 3px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--player-accent), #9d4edd);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
  position: relative;
}

.progress-bar-thumb {
  display: none;
}

/* ===========================================
   PLAYER CONTROLS
   Note: These follow similar patterns to global.css .btn-icon
   but are specialized for the music player interface
   =========================================== */
.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.control-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--player-text-muted);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.control-btn svg {
  width: 22px;
  height: 22px;
}

.control-btn:hover {
  color: var(--player-text);
  background: rgba(255, 255, 255, 0.1);
}

.control-btn.active {
  color: var(--player-accent);
}

/* Play/Pause Button - Larger */
.control-btn.play-btn {
  width: 48px;
  height: 48px;
  background: var(--player-accent);
  color: var(--player-text);
}

.control-btn.play-btn:hover {
  background: #8b3ff8;
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--player-accent-glow);
}

.control-btn.play-btn svg {
  width: 26px;
  height: 26px;
}

/* Play/Pause Icon Toggle */
.control-btn .pause-icon {
  display: none;
}

.control-btn.playing .play-icon {
  display: none;
}

.control-btn.playing .pause-icon {
  display: block;
}

/* Volume Icon Toggle */
#volumeBtn .volume-low,
#volumeBtn .volume-mute {
  display: none;
}

#volumeBtn.low .volume-high,
#volumeBtn.low .volume-mute {
  display: none;
}

#volumeBtn.low .volume-low {
  display: block;
}

#volumeBtn.muted .volume-high,
#volumeBtn.muted .volume-low {
  display: none;
}

#volumeBtn.muted .volume-mute {
  display: block;
}

/* Volume Control */
.volume-control {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.volume-slider-container {
  width: 0;
  overflow: hidden;
  transition: width 0.2s ease;
}

.volume-control:hover .volume-slider-container {
  width: 100px;
}

.volume-slider-track {
  position: relative;
  width: 100px;
  height: 20px;
  display: flex;
  align-items: center;
}

.volume-slider-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: var(--accent-color, #ffffff);
  border-radius: 2px;
  pointer-events: none;
  width: 50%;
}

.volume-slider-ticks {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  padding: 0 6px;
}

.volume-slider-ticks .tick {
  width: 2px;
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 1px;
}

.volume-slider-ticks .tick[data-value="0"],
.volume-slider-ticks .tick[data-value="100"] {
  height: 10px;
  background: rgba(255, 255, 255, 0.5);
}

.volume-slider {
  width: 100px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 0;
  height: 0;
  background: transparent;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 0;
  height: 0;
  background: transparent;
  cursor: pointer;
  border: none;
}

/* ===========================================
   ANIMATIONS
   =========================================== */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading .now-playing-art {
  animation: pulse 1.5s ease-in-out infinite;
}
