/* ================================================================= */
/*              AUDIO PLAYER ULTIMATE THEME INTEGRATION            */
/* ================================================================= */

/* =============== PLAYER CONTAINER =============== */
.music-player {
  background: var(--player-bg);
  border: 2px solid var(--border-accent);
  border-radius: var(--border-radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: all var(--transition-md);
}

.music-player::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-glass);
  pointer-events: none;
  z-index: 1;
}

.music-player * {
  position: relative;
  z-index: 2;
}

.music-player:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2xl), var(--shadow-glow-strong);
}

/* =============== ALBUM ARTWORK =============== */
.album-art {
  width: 200px;
  height: 200px;
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-md);
  margin: 0 auto var(--space-6) auto;
}

.album-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-md);
}

.album-art:hover img {
  transform: scale(1.05);
}

.album-art::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-overlay);
  opacity: 0;
  transition: opacity var(--transition-md);
}

.album-art:hover::after {
  opacity: 0.3;
}

/* Rotating album effect when playing */
.album-art.playing {
  animation: rotate 20s linear infinite;
}

.album-art.playing::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: var(--bg-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* =============== TRACK INFORMATION =============== */
.track-info {
  text-align: center;
  margin-bottom: var(--space-6);
}

.track-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

.track-artist {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.track-album {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  font-style: italic;
}

/* =============== PROGRESS BAR =============== */
.progress-container {
  margin-bottom: var(--space-6);
  position: relative;
}

.progress-time {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.progress-bar-container {
  position: relative;
  height: 8px;
  background: var(--player-progress-bg);
  border-radius: var(--border-radius-pill);
  overflow: hidden;
  cursor: pointer;
  transition: height var(--transition-md);
}

.progress-bar-container:hover {
  height: 12px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--border-radius-pill);
  position: relative;
  transition: width var(--transition-sm);
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-thumb {
  position: absolute;
  top: 50%;
  right: -8px;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border: 3px solid var(--text-primary);
  border-radius: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-md);
  box-shadow: var(--shadow-md);
}

.progress-bar-container:hover .progress-thumb {
  opacity: 1;
}

/* =============== PLAYER CONTROLS =============== */
.player-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.control-btn {
  background: var(--bg-glass);
  border: 2px solid var(--border-primary);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--player-control);
  cursor: pointer;
  transition: all var(--transition-md);
  position: relative;
  backdrop-filter: blur(5px);
}

.control-btn:hover {
  background: var(--player-control-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.control-btn:active {
  transform: translateY(0);
  background: var(--player-control-active);
}

.control-btn.play-pause {
  width: 70px;
  height: 70px;
  background: var(--gradient-primary);
  border-color: var(--primary);
  color: var(--text-primary);
  font-size: 1.5rem;
}

.control-btn.play-pause:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
}

.control-btn.active {
  background: var(--primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-glow);
}

/* Control button icons */
.control-btn i {
  font-size: 1.2rem;
  transition: transform var(--transition-md);
}

.control-btn:hover i {
  transform: scale(1.1);
}

/* =============== VOLUME CONTROL =============== */
.volume-container {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.volume-icon {
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: color var(--transition-md);
}

.volume-icon:hover {
  color: var(--primary);
}

.volume-slider {
  flex: 1;
  height: 6px;
  background: var(--player-volume-bg);
  border-radius: var(--border-radius-pill);
  position: relative;
  cursor: pointer;
}

.volume-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--border-radius-pill);
  position: relative;
  transition: width var(--transition-sm);
}

.volume-thumb {
  position: absolute;
  top: 50%;
  right: -6px;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border: 2px solid var(--text-primary);
  border-radius: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  transition: all var(--transition-md);
  box-shadow: var(--shadow-sm);
}

.volume-slider:hover .volume-thumb {
  transform: translateY(-50%) scale(1.2);
  box-shadow: var(--shadow-md);
}

/* =============== EQUALIZER VISUALIZATION =============== */
.equalizer {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 3px;
  height: 60px;
  margin-bottom: var(--space-6);
  padding: var(--space-3);
  background: var(--bg-glass);
  border-radius: var(--border-radius-md);
  backdrop-filter: blur(5px);
}

.eq-bar {
  width: 4px;
  min-height: 4px;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-sm);
  position: relative;
  overflow: hidden;
}

.eq-bar:nth-child(odd) {
  background: var(--equalizer-bar-1);
}

.eq-bar:nth-child(even) {
  background: var(--equalizer-bar-2);
}

.eq-bar:nth-child(3n) {
  background: var(--equalizer-bar-3);
}

.eq-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, transparent, rgba(255, 255, 255, 0.3));
}

/* Equalizer animation when playing */
.equalizer.playing .eq-bar {
  animation: equalizerDance 0.5s ease-in-out infinite alternate;
}

.equalizer.playing .eq-bar:nth-child(1) { animation-delay: 0s; }
.equalizer.playing .eq-bar:nth-child(2) { animation-delay: 0.1s; }
.equalizer.playing .eq-bar:nth-child(3) { animation-delay: 0.2s; }
.equalizer.playing .eq-bar:nth-child(4) { animation-delay: 0.3s; }
.equalizer.playing .eq-bar:nth-child(5) { animation-delay: 0.4s; }
.equalizer.playing .eq-bar:nth-child(6) { animation-delay: 0.2s; }
.equalizer.playing .eq-bar:nth-child(7) { animation-delay: 0.1s; }
.equalizer.playing .eq-bar:nth-child(8) { animation-delay: 0.05s; }

@keyframes equalizerDance {
  0% { height: 10%; }
  100% { height: 100%; }
}

/* =============== SPECTRUM ANALYZER =============== */
.spectrum-analyzer {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1px;
  height: 80px;
  margin-bottom: var(--space-6);
  padding: var(--space-3);
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-accent);
  overflow: hidden;
  position: relative;
}

.spectrum-analyzer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-bg);
  opacity: 0.5;
}

.spectrum-bar {
  width: 3px;
  min-height: 2px;
  background: var(--spectrum-color);
  border-radius: 1px 1px 0 0;
  position: relative;
  transition: height var(--transition-xs);
}

.spectrum-analyzer.playing .spectrum-bar {
  animation: spectrumWave 1s ease-in-out infinite;
}

@keyframes spectrumWave {
  0%, 100% { height: 10%; opacity: 0.7; }
  50% { height: 90%; opacity: 1; }
}

/* =============== PLAYLIST =============== */
.playlist {
  background: var(--bg-glass);
  border-radius: var(--border-radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-primary);
  max-height: 300px;
  overflow-y: auto;
}

.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-primary);
}

.playlist-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.playlist-count {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.playlist-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-md);
  position: relative;
  overflow: hidden;
}

.playlist-item:hover {
  background: var(--bg-glass);
  transform: translateX(8px);
}

.playlist-item.active {
  background: var(--gradient-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-glow);
}

.playlist-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}

.track-number {
  min-width: 24px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.playlist-item.active .track-number {
  color: var(--text-primary);
}

.track-details {
  flex: 1;
  min-width: 0;
}

.track-name {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.track-meta {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-duration {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  min-width: 40px;
  text-align: right;
}

/* =============== WAVEFORM DISPLAY =============== */
.waveform {
  height: 100px;
  margin-bottom: var(--space-6);
  background: var(--bg-primary);
  border-radius: var(--border-radius-lg);
  padding: var(--space-3);
  border: 1px solid var(--border-accent);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.waveform-canvas {
  width: 100%;
  height: 100%;
  background: transparent;
}

.waveform-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--gradient-primary);
  opacity: 0.7;
  pointer-events: none;
  transition: width var(--transition-sm);
}

/* =============== THEME-SPECIFIC PLAYER STYLING =============== */

/* ============ FRÜHLING PLAYER ============ */
body.theme-spring .music-player {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border-image: linear-gradient(45deg, var(--leaf-color-1), var(--leaf-color-2)) 1;
}

body.theme-spring .album-art.playing {
  box-shadow: 0 0 30px var(--nature-ambient);
}

body.theme-spring .control-btn:hover {
  background: var(--gradient-primary);
  animation: leafSway 0.6s ease-in-out;
}

body.theme-spring .eq-bar {
  background: linear-gradient(to top, var(--leaf-color-1), var(--flower-color));
}

/* ============ SOMMER PLAYER ============ */
body.theme-summer .music-player {
  background: radial-gradient(ellipse at center, var(--bg-secondary), var(--bg-primary));
  box-shadow: var(--shadow-xl), 0 0 50px var(--summer-ambient);
}

body.theme-summer .album-art.playing {
  animation: rotate 15s linear infinite, sunGlow 3s ease-in-out infinite;
}

body.theme-summer .control-btn:hover {
  animation: sunBeam 0.8s ease-out;
}

body.theme-summer .eq-bar {
  background: linear-gradient(to top, var(--sun-color), var(--fire-color));
  animation: heatShimmer 2s ease-in-out infinite;
}

body.theme-summer .progress-bar-fill {
  background: linear-gradient(90deg, var(--fire-color), var(--sun-color));
}

/* ============ HERBST PLAYER ============ */
body.theme-autumn .music-player {
  background: linear-gradient(145deg, var(--bg-secondary), var(--bg-quaternary));
  border-image: linear-gradient(45deg, var(--leaf-fall-1), var(--leaf-fall-2), var(--leaf-fall-3)) 1;
}

body.theme-autumn .album-art.playing {
  animation: rotate 25s linear infinite, autumnGlow 4s ease-in-out infinite;
}

body.theme-autumn .control-btn:hover {
  animation: windBlow 1s ease-in-out;
}

body.theme-autumn .eq-bar {
  background: linear-gradient(to top, var(--leaf-fall-1), var(--leaf-fall-2));
}

body.theme-autumn .playlist-item:hover {
  animation: rustleLeaves 0.8s ease-in-out;
}

/* ============ WINTER PLAYER ============ */
body.theme-winter .music-player {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border: 2px solid var(--ice-color);
  box-shadow: var(--shadow-xl), 0 0 40px var(--winter-ambient);
}

body.theme-winter .album-art.playing {
  animation: rotate 30s linear infinite, iceShimmer 2s ease-in-out infinite;
}

body.theme-winter .control-btn {
  background: var(--frost-color);
  backdrop-filter: blur(10px);
}

body.theme-winter .control-btn:hover {
  animation: crystalGrow 0.6s ease-out;
}

body.theme-winter .eq-bar {
  background: linear-gradient(to top, var(--ice-color), var(--crystal-color));
}

body.theme-winter .progress-bar-fill {
  background: linear-gradient(90deg, var(--ice-color), var(--snow-color));
}

/* ============ HALLOWEEN PLAYER ============ */
body.theme-halloween .music-player {
  background: radial-gradient(ellipse at center, var(--bg-secondary), var(--bg-primary));
  border: 2px solid var(--flame-color);
  box-shadow: var(--shadow-2xl), 0 0 60px var(--spooky-ambient), inset 0 0 20px var(--shadow-creep);
}

body.theme-halloween .album-art.playing {
  animation: rotate 18s linear infinite, spookyGlow 3s ease-in-out infinite;
}

body.theme-halloween .control-btn:hover {
  animation: flameFlicker 1s ease-in-out infinite;
}

body.theme-halloween .eq-bar {
  background: linear-gradient(to top, var(--flame-color), var(--pumpkin-color));
  animation: flameFlicker 2s ease-in-out infinite;
}

body.theme-halloween .progress-bar-fill {
  background: linear-gradient(90deg, var(--flame-color), var(--pumpkin-color));
  animation: flameFlicker 3s ease-in-out infinite;
}

body.theme-halloween .playlist-item:hover {
  animation: creepyShadow 2s ease-in-out;
}

/* ============ OSTERN PLAYER ============ */
body.theme-easter .music-player {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border-image: linear-gradient(45deg, var(--egg-color-1), var(--egg-color-2), var(--egg-color-3)) 1;
  box-shadow: var(--shadow-xl), 0 0 40px var(--easter-ambient);
}

body.theme-easter .album-art.playing {
  animation: rotate 22s linear infinite, colorShift 6s ease-in-out infinite;
}

body.theme-easter .control-btn:hover {
  animation: bunnyHop 1s ease-in-out, colorShift 2s ease-in-out infinite;
}

body.theme-easter .eq-bar {
  background: linear-gradient(to top, var(--egg-color-1), var(--egg-color-2));
  animation: colorShift 4s ease-in-out infinite;
}

body.theme-easter .progress-bar-fill {
  background: linear-gradient(90deg, var(--egg-color-1), var(--egg-color-2), var(--egg-color-3));
  animation: colorShift 5s ease-in-out infinite;
}

body.theme-easter .playlist-item:hover {
  animation: eggWobble 0.8s ease-in-out;
}

/* =============== RESPONSIVE PLAYER =============== */
@media (max-width: 768px) {
  .music-player {
    padding: var(--space-4);
  }
  
  .album-art {
    width: 150px;
    height: 150px;
  }
  
  .player-controls {
    gap: var(--space-3);
  }
  
  .control-btn {
    width: 40px;
    height: 40px;
  }
  
  .control-btn.play-pause {
    width: 60px;
    height: 60px;
  }
  
  .equalizer {
    height: 40px;
  }
  
  .spectrum-analyzer {
    height: 60px;
  }
  
  .playlist {
    max-height: 200px;
  }
}

@media (max-width: 480px) {
  .album-art {
    width: 120px;
    height: 120px;
  }
  
  .track-title {
    font-size: 1.2rem;
  }
  
  .track-artist {
    font-size: 1rem;
  }
  
  .control-btn {
    width: 36px;
    height: 36px;
  }
  
  .control-btn.play-pause {
    width: 50px;
    height: 50px;
  }
}