/* Modern Audio Player Dock */
.audio-player-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.audio-player-dock.hidden {
  transform: translateY(100%);
}

/* Backdrop blur effect */
.audio-player-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Dark mode backdrop */
@media (prefers-color-scheme: dark) {
  .audio-player-backdrop {
    background: rgba(17, 24, 39, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
}

.audio-player-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

/* Common styles */
.audio-player-title {
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-player-subtitle {
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.875rem;
  margin-top: 2px;
}

/* Animated waveform */
.audio-player-waveform,
.audio-player-waveform-desktop {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 40px;
  padding: 0 12px;
}

.audio-player-waveform-bar {
  width: 3px;
  height: 20px;
  background: #e5e7eb;
  border-radius: 2px;
  transition: all 0.2s ease;
}

/* Animate waveform when playing */
.audio-player-dock:not(.paused) .audio-player-waveform-bar {
  animation: wave 1.2s ease-in-out infinite;
  background: #f97316;
}

.audio-player-waveform-bar:nth-child(1) { animation-delay: 0s; }
.audio-player-waveform-bar:nth-child(2) { animation-delay: 0.1s; }
.audio-player-waveform-bar:nth-child(3) { animation-delay: 0.2s; }
.audio-player-waveform-bar:nth-child(4) { animation-delay: 0.3s; }
.audio-player-waveform-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
  0%, 100% { height: 20px; }
  50% { height: 35px; }
}

/* Progress bar */
.audio-player-progress-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: height 0.2s ease;
}

.audio-player-progress-bar:hover {
  height: 6px;
}

.audio-player-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #f97316 0%, #ea580c 100%);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s ease;
}

/* Add a loading animation */
.audio-player-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: -4px;
  width: 4px;
  height: 100%;
  background: white;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.audio-player-dock:not(.paused) .audio-player-progress-fill::after {
  opacity: 1;
}

/* Mobile Layout */
.audio-player-mobile {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.audio-player-mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.audio-player-mobile .audio-player-info {
  flex: 1;
  min-width: 0;
}

.audio-player-close-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.audio-player-close-btn:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.audio-player-close-btn:active {
  transform: scale(0.95);
}

.audio-player-progress {
  width: 100%;
}

.audio-player-time-info {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.75rem;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

.audio-player-controls-mobile {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
}

.audio-player-skip-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #374151;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  position: relative;
}

.audio-player-skip-btn:hover {
  background: #f3f4f6;
}

.audio-player-skip-btn:active {
  transform: scale(0.95);
}

.audio-player-play-btn {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
  transition: all 0.2s ease;
}

.audio-player-play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.audio-player-play-btn:active {
  transform: scale(0.98);
}

/* Desktop Layout */
.audio-player-desktop {
  padding: 12px 20px;
  align-items: center;
  gap: 20px;
}

.audio-player-desktop .audio-player-info {
  flex: 0 0 250px;
  min-width: 0;
}

.audio-player-controls-desktop {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-player-control-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #4b5563;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.audio-player-control-btn:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.audio-player-play-btn-desktop {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.audio-player-play-btn-desktop:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.audio-player-play-btn-desktop:active {
  transform: scale(0.98);
}

.audio-player-progress-desktop {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 500px;
  cursor: pointer;
}

.audio-player-progress-desktop .audio-player-progress-bar {
  flex: 1;
}

.audio-player-time {
  font-size: 0.875rem;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.audio-player-close-btn-desktop {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.audio-player-close-btn-desktop:hover {
  background: #f3f4f6;
  color: #1f2937;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .audio-player-title {
    color: #f9fafb;
  }
  
  .audio-player-subtitle {
    color: #9ca3af;
  }
  
  .audio-player-waveform-bar {
    background: #374151;
  }
  
  .audio-player-progress-bar {
    background: #374151;
  }
  
  .audio-player-close-btn,
  .audio-player-control-btn,
  .audio-player-close-btn-desktop {
    background: #1f2937;
    color: #9ca3af;
  }
  
  .audio-player-close-btn:hover,
  .audio-player-control-btn:hover,
  .audio-player-close-btn-desktop:hover {
    background: #374151;
    color: #f3f4f6;
  }
  
  .audio-player-skip-btn {
    color: #d1d5db;
  }
  
  .audio-player-skip-btn:hover {
    background: #374151;
  }
  
  .audio-player-time,
  .audio-player-time-info {
    color: #9ca3af;
  }
}

/* Responsive breakpoint for sm */
@media (min-width: 640px) {
  .audio-player-mobile {
    display: none !important;
  }
  
  .audio-player-desktop {
    display: flex !important;
  }
}