/* ==========================================================================
   Audio Player Styles
   ========================================================================== */

/**
 * Container styles
 */
.product__audio {
  width: 100%;
  margin-top: var(--text-spc-500);
  border: 0.1rem solid #eee;
  padding: 1rem;
}

/**
 * Title styles
 */
.product__audio__title {
  text-transform: uppercase;
  font-size: var(--font-size-400);
  font-weight: 600;
  text-align: center;
}

/**
 * Time display styles
 */
#currentTime, 
#duration {
  font-size: var(--font-size-400);
  color: #666;
  font-weight: 500;
}

/**
 * Native audio element (hidden but accessible)
 */
audio {
  width: 100%;
}

/**
 * Custom audio player container
 */
.custom-audio {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 0.8rem 0;
}

/**
 * Play/Pause button base styles
 */
#playPause {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: #000;
  color: white;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/**
 * Play/Pause button hover state
 */
#playPause:hover {
  transform: scale(1.1);
}

/**
 * Play/Pause button active state
 */
#playPause:active {
  transform: scale(0.95);
}

/**
 * Progress bar container
 */
.progress-container {
  position: relative;
  flex-grow: 1;
  height: 0.5rem;
  margin: 0 0.8rem;
  border-radius: 0.2rem;
  background-color: #e0e0e0;
  cursor: pointer;
}

/**
 * Progress bar fill
 */
.progress-bar {
  position: relative;
  width: 0%;
  height: 100%;
  border-radius: 0.2rem;
  background-color: #000;
  transition: width 0.1s linear;
}

/**
 * Time display
 * Uses tabular numbers for consistent width when changing
 */
.time {
  min-width: 4rem;
  color: #666;
  font-size: 1.2rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/**
 * Play/Pause button icon states
 */
#playPause {
  width: 2.4rem;
  height: 2.4rem;
  background: #000
    url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIyIj48cGF0aCBkPSJNMTIgN0wwIDE0VjBsMTIgN3oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)
    no-repeat center center;
  background-size: 1.2rem 1.4rem;
}

/**
 * Paused state icon
 */
#playPause[data-paused] {
  background: #000
    url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSIxNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLW1pdGVybGltaXQ9IjIiPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0wIDBoM3YxNEgwek01IDBoM3YxNEg1eiIvPjwvc3ZnPg==)
    no-repeat center center;
  background-size: 0.9rem 1.4rem;
}

/**
 * Loading state styles
 */
.audio-loading #playPause {
  position: relative;
  opacity: 0.6;
  cursor: not-allowed;
}

/**
 * Loading spinner animation
 */
.audio-loading #playPause::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/**
 * Error message styles
 */
.audio-error {
  display: none;
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: 1px solid #fcc;
  border-radius: 0.25rem;
  background: #fee;
  color: #c33;
  font-size: var(--font-size-400);
}

/**
 * Accessibility improvements
 */
#playPause:focus,
.progress-container:focus {
  outline: 2px solid #007acc;
  outline-offset: 2px;
}

/**
 * Progress container interaction states
 */
.progress-container:hover {
  opacity: 0.8;
}
