/**
 * AlabanzaPeruana Music Player Widget - Estilos
 * Diseño profesional y responsive
 */

.ap-player {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  max-width: 900px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin: 0 auto;
}

/* Main player section */
.ap-main {
  display: flex;
  gap: 24px;
  padding: 24px;
  background: linear-gradient(135deg, #110eff 0%, #0f0f0f 100%);
  color: white;
}

@media (max-width: 768px) {
  .ap-main {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }
}

/* Cover section */
.ap-cover-section {
  position: relative;
  flex-shrink: 0;
}

.ap-cover {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s;
}

@media (max-width: 768px) {
  .ap-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }
}

.ap-cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: 8px;
}

.ap-cover-section:hover .ap-cover-overlay {
  opacity: 1;
}

.ap-cover-section:hover .ap-cover {
  transform: scale(1.05);
}

.ap-cover-play {
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.ap-cover-play:hover {
  transform: scale(1.1);
}

.ap-cover-play svg {
  fill: #667eea;
}

/* Info section */
.ap-info-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.ap-track-info {
  margin-bottom: 16px;
}

.ap-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-artist {
  font-size: 16px;
  opacity: 0.9;
}

/* Progress */
.ap-progress-container {
  margin-bottom: 16px;
}

.ap-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 8px;
  overflow: hidden;
}

.ap-progress-bar {
  height: 100%;
  background: white;
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.ap-time {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.9;
}

/* Controls */
.ap-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ap-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.ap-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.ap-btn:active {
  transform: scale(0.95);
}

.ap-btn svg {
  fill: white;
}

.ap-btn-play {
  width: 56px;
  height: 56px;
  background: white;
}

.ap-btn-play svg {
  fill: #667eea;
}

.ap-btn-prev,
.ap-btn-next,
.ap-btn-repeat,
.ap-btn-volume {
  width: 40px;
  height: 40px;
}

/* Volume control container */
.ap-volume-control {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 180px;
}

.ap-btn-volume {
  position: relative;
  flex-shrink: 0;
}

/* Horizontal volume slider */
.ap-volume-slider-horizontal {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

.ap-volume-slider-horizontal:hover {
  background: rgba(255, 255, 255, 0.4);
}

.ap-volume-slider-horizontal::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.ap-volume-slider-horizontal::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.ap-volume-slider-horizontal::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.ap-volume-slider-horizontal::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.ap-volume-slider-horizontal::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
}

.ap-volume-slider-horizontal::-moz-range-track {
  height: 4px;
  border-radius: 2px;
}

/* Error message */
.ap-error {
  margin-top: 8px;
  font-size: 13px;
  color: #fca5a5;
  min-height: 18px;
}

/* Playlist */
.ap-playlist {
  max-height: 400px;
  overflow-y: auto;
  background: #fafafa;
}

.ap-playlist::-webkit-scrollbar {
  width: 8px;
}

.ap-playlist::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.ap-playlist::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.ap-playlist::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.ap-playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid #e5e5e5;
}

.ap-playlist-item:hover {
  background: #f0f0f0;
}

.ap-playlist-item.active {
  background: #f3e8ff;
  border-left: 4px solid #667eea;
}

.ap-playlist-number {
  width: 24px;
  text-align: center;
  font-weight: 600;
  color: #666;
  font-size: 14px;
}

.ap-playlist-cover {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
}

.ap-playlist-info {
  flex: 1;
  min-width: 0;
}

.ap-playlist-title {
  font-weight: 600;
  font-size: 14px;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-playlist-artist {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-playlist-plays {
  font-size: 11px;
  color: #667eea;
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 12px;
  white-space: nowrap;
  margin-right: 8px;
}

.ap-playlist-duration {
  font-size: 12px;
  color: #999;
  font-variant-numeric: tabular-nums;
}

/* Dark theme */
.ap-player.dark {
  background: #1a1a1a;
  color: #ffffff;
}

.ap-player.dark .ap-playlist {
  background: #2a2a2a;
}

.ap-player.dark .ap-playlist-item {
  border-bottom-color: #3a3a3a;
}

.ap-player.dark .ap-playlist-item:hover {
  background: #3a3a3a;
}

.ap-player.dark .ap-playlist-item.active {
  background: #4a2a5a;
}

.ap-player.dark .ap-playlist-title {
  color: #ffffff;
}

/* ========== NEW CONTROLS ========== */

/* Shuffle button */
.ap-btn-shuffle {
  width: 40px;
  height: 40px;
  transition: color 0.2s;
}

.ap-btn-shuffle.active {
  color: #667eea;
}

/* Favorite button */
.ap-playlist-fav {
  background: transparent;
  border: none;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s;
  padding: 0 8px;
  margin: 0 8px;
}

.ap-playlist-fav:hover {
  color: #ffd700;
  transform: scale(1.2);
}

.ap-playlist-fav.favorited {
  color: #ffd700;
}

/* Responsive */
@media (max-width: 480px) {
  .ap-title {
    font-size: 18px;
  }
  
  .ap-artist {
    font-size: 14px;
  }
  
  .ap-btn-play {
    width: 48px;
    height: 48px;
  }
  
  .ap-btn-prev,
  .ap-btn-next,
  .ap-btn-shuffle,
  .ap-btn-volume {
    width: 36px;
    height: 36px;
  }
  
  .ap-playlist-item {
    padding: 10px 16px;
  }
  
  .ap-volume-control {
    max-width: 120px;
  }
}


