/**
 * ============================================================================
 * STRESSTHERAPIST.NET — AUDIO PLAYER WIDGET
 * ============================================================================
 * Matches the blog design system: colors, typography, spacing
 * Sits below the article title, above the content
 * ============================================================================
 */

.st-audio-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #f0f4f8 100%);
  border: 1px solid var(--color-border-light, #DDDDDD);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin: 1rem 0 1.5rem 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease;
  max-width: 100%;
}

.st-audio-player:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Play/Pause Button */
.st-audio-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  border: none;
  background: var(--color-accent-blue, #3898EC);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  padding: 0;
}

.st-audio-btn:hover {
  background: var(--color-accent-blue-alt, #0082F3);
  transform: scale(1.05);
}

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

.st-audio-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Center section: label + progress */
.st-audio-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.st-audio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-secondary, #333);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.st-audio-label-icon {
  font-size: 0.875rem;
}

.st-audio-label-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progress Bar */
.st-audio-progress-wrap {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--color-bg-muted, #EEEEEE);
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
}

.st-audio-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--color-accent-blue, #3898EC);
  border-radius: 3px;
  width: 0%;
  transition: width 0.15s linear;
}

.st-audio-progress-wrap:hover .st-audio-progress-bar {
  background: var(--color-accent-blue-alt, #0082F3);
}

/* Time display */
.st-audio-time {
  font-size: 0.75rem;
  color: var(--color-text-tertiary, #999);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}

/* Speed control */
.st-audio-speed {
  font-size: 0.6875rem;
  color: var(--color-text-tertiary, #999);
  background: var(--color-bg-muted, #EEE);
  border: 1px solid var(--color-border-light, #DDD);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.st-audio-speed:hover {
  background: var(--color-bg-tertiary, #F3F3F3);
  color: var(--color-text-secondary, #333);
}

/* Loading state */
.st-audio-player.loading .st-audio-btn {
  opacity: 0.6;
  cursor: wait;
}

.st-audio-player.loading .st-audio-progress-bar {
  width: 100% !important;
  animation: st-audio-loading 1.5s ease-in-out infinite;
  opacity: 0.4;
}

@keyframes st-audio-loading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Error state */
.st-audio-player.error {
  border-color: var(--color-accent-red, #EA384C);
  background: #fef5f5;
}

.st-audio-player.error .st-audio-label-text {
  color: var(--color-accent-red, #EA384C);
}

/* Mobile responsive */
@media (max-width: 480px) {
  .st-audio-player {
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
  }

  .st-audio-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .st-audio-btn svg {
    width: 15px;
    height: 15px;
  }

  .st-audio-time {
    font-size: 0.6875rem;
    min-width: 60px;
  }

  .st-audio-speed {
    display: none;
  }
}
