/* ====== AUDIO PLAYER ====== */
.audio-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

.audio-player-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  border: 2px solid var(--neon-cyan);
  color: var(--text-on-accent);
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 255, 255, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-player-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 255, 255, 0.5);
}

.audio-player-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 380px;
  max-height: 600px;
  background: var(--overlay-bg);
  border: 2px solid var(--neon-cyan);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 255, 255, 0.3);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.audio-player-panel.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header */
.audio-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.audio-player-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--neon-cyan);
  letter-spacing: 1px;
}

.audio-player-close {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  transition: color 0.2s ease;
}

.audio-player-close:hover {
  color: var(--neon-magenta);
}

/* Cover Art with Vinyl */
.audio-player-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(0, 255, 255, 0.3);
}

.audio-player-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.audio-player-vinyl {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, #1a1a1a 30%, #0a0a0a 70%);
  border-radius: 50%;
  border: 3px solid var(--neon-cyan);
  transition: transform 0.5s ease;
  pointer-events: none;
}

.audio-player-vinyl::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: var(--neon-magenta);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--neon-magenta);
}

.audio-player-vinyl.is-spinning {
  animation: vinylSpin 3s linear infinite;
}

@keyframes vinylSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Track Info */
.audio-player-info {
  text-align: center;
  margin-bottom: 20px;
}

.audio-track-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-track-artist {
  font-family: 'Oxanium', sans-serif;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Spotify Embed */
.spotify-embed-container {
  margin: 20px 0;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 255, 0.2);
}

.spotify-embed-container iframe {
  width: 100%;
  height: 152px;
  border-radius: 12px;
}

/* Progress Bar - Ocultar ya que Spotify tiene su propio control */
.audio-player-progress {
  display: none;
}

.audio-time {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--neon-cyan);
  min-width: 45px;
}

.audio-progress-bar {
  position: relative;
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.audio-progress-bar input[type="range"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.audio-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
  border-radius: 4px;
  transition: width 0.1s linear;
}

/* Controls */
.audio-player-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.audio-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.3);
  color: var(--text-white);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.audio-btn:hover {
  background: rgba(0, 255, 255, 0.2);
  border-color: var(--neon-cyan);
  transform: scale(1.05);
}

.audio-btn-play {
  width: 60px;
  height: 60px;
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  border: 2px solid var(--neon-cyan);
}

.audio-btn-play:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(0, 255, 255, 0.4);
}

.audio-btn.is-active {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  border-color: var(--neon-magenta);
}

/* Volume - Ocultar ya que Spotify tiene su propio control */
.audio-player-volume {
  display: none;
}

/* Playlist */
.audio-player-playlist {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 255, 255, 0.2);
}

.audio-playlist-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  color: var(--neon-cyan);
  margin-bottom: 15px;
  letter-spacing: 1px;
}

.audio-playlist {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 300px;
  overflow-y: auto;
}

.audio-playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.audio-playlist-item:hover {
  background: rgba(0, 255, 255, 0.1);
  border-color: var(--neon-cyan);
}

.audio-playlist-item.is-active {
  background: linear-gradient(90deg, rgba(0, 255, 255, 0.2), rgba(255, 0, 255, 0.2));
  border-color: var(--neon-cyan);
}

.audio-playlist-item-cover {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.audio-playlist-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.audio-playlist-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.audio-playlist-item-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-playlist-item-artist {
  font-family: 'Oxanium', sans-serif;
  font-size: 0.8rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-playlist-item-duration {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--text-light);
  flex-shrink: 0;
}

.audio-playlist-item-platform {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.8rem;
  color: var(--text-light);
  opacity: 0.5;
}

.audio-playlist-item.is-soundcloud .audio-playlist-item-platform {
  color: #ff8800;
  opacity: 1;
}

.audio-playlist-item.is-spotify .audio-playlist-item-platform {
  color: #1db954;
  opacity: 1;
}

/* Scrollbar para playlist */
.audio-playlist::-webkit-scrollbar {
  width: 6px;
}

.audio-playlist::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.audio-playlist::-webkit-scrollbar-thumb {
  background: var(--neon-cyan);
  border-radius: 3px;
}

.audio-playlist::-webkit-scrollbar-thumb:hover {
  background: var(--neon-magenta);
}

/* Responsive */
@media (max-width: 768px) {
  .audio-player {
    bottom: 10px;
    right: 10px;
  }

  .audio-player-toggle {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }

  .audio-player-panel {
    width: calc(100vw - 20px);
    max-width: 350px;
    max-height: 500px;
  }

  .audio-track-title {
    font-size: 1.1rem;
  }

  .audio-btn {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .audio-btn-play {
    width: 50px;
    height: 50px;
    font-size: 1.1rem;
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .audio-player-vinyl.is-spinning {
    animation: none;
  }

  .audio-player-toggle,
  .audio-btn {
    transition: none;
  }
}
