/* ============================================================
   VoiceWave Player – Frontend Styles v2
   ============================================================ */

.wpvw-container {
  max-width: 800px;
  margin: 0 auto;
  font-family: inherit;
}

/* ── Main Player Card ── */
.wpvw-player-main {
  padding: 28px 28px 28px;
  background-color: #fff;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

/* Progress fill — sweeps left to right as track plays */
.wpvw-player-main::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: var(--wpvw-pct, 0%);
  background: var(--wpvw-progress, #EE772F);
  opacity: 0.12;
  transition: width 0.25s linear;
  pointer-events: none;
  z-index: 0;
}

/* Playing state — slightly brighter */
.wpvw-container.wpvw-is-playing .wpvw-player-main::before { opacity: 0.18; }

/* All direct children sit above the fill */
.wpvw-player-main > * { position: relative; z-index: 1; }

.wpvw-player-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Title ── */
.wpvw-title {
  font-weight: var(--wpvw-font-weight, 700);
  line-height: 1.2;
  margin: 0;
}

/* ── Row 1: Play + Waveform ── */
.wpvw-play-wave-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}

/* Play / Pause button — hard reset against theme overrides */
.wpvw-container .wpvw-play,
.wpvw-container .wpvw-play:link,
.wpvw-container .wpvw-play:visited,
.wpvw-container .wpvw-play:hover,
.wpvw-container .wpvw-play:focus,
.wpvw-container .wpvw-play:active {
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
  margin: 0 !important;
  padding: 4px !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
  color: inherit !important;
  text-shadow: none !important;
  outline: none !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  font-size: inherit !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  vertical-align: middle !important;
}

/* ── Icon visibility
   Use opacity+size instead of display:none so themes can't override it ── */

/* Play icon: fully visible by default */
.wpvw-container .wpvw-play-icon {
  opacity: 1 !important;
  width: 48px !important;
  height: 48px !important;
  overflow: visible !important;
  transform: none !important;
  transition: none !important;
  flex-shrink: 0;
}
.wpvw-container button.wpvw-related-play .wpvw-play-icon {
  opacity: 1 !important;
  width: 22px !important;
  height: 22px !important;
  overflow: visible !important;
}

/* Pause icon: invisible + zero-size by default */
.wpvw-container .wpvw-pause-icon {
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  transform: none !important;
  transition: none !important;
  flex-shrink: 0;
}

/* When playing: swap which icon is visible */
.wpvw-container .wpvw-play.wpvw-is-playing .wpvw-play-icon,
.wpvw-container button.wpvw-related-play.wpvw-is-playing .wpvw-play-icon {
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

.wpvw-container .wpvw-play.wpvw-is-playing .wpvw-pause-icon {
  opacity: 1 !important;
  width: 48px !important;
  height: 48px !important;
  overflow: visible !important;
}
.wpvw-container button.wpvw-related-play.wpvw-is-playing .wpvw-pause-icon {
  opacity: 1 !important;
  width: 22px !important;
  height: 22px !important;
  overflow: visible !important;
}

/* Same scoped reset for all other plugin buttons */
.wpvw-container .wpvw-playlist-toggle,
.wpvw-container .wpvw-playlist-toggle:hover,
.wpvw-container .wpvw-playlist-toggle:focus,
.wpvw-container button.wpvw-related-play,
.wpvw-container button.wpvw-related-play:hover,
.wpvw-container button.wpvw-related-play:focus {
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
  margin: 0 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  outline: none !important;
  text-shadow: none !important;
}

.wpvw-wave {
  flex: 1 1 0;
  min-width: 0;
  height: 50px;
}

/* ── Row 2: Volume + Download ── */
.wpvw-controls-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: nowrap;
}

.wpvw-download {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  text-decoration: none;
  flex-shrink: 0;
}
.wpvw-download svg { width: 22px; height: 22px; }
.wpvw-download:focus { outline: none; }
.wpvw-download:hover svg { opacity: 0.7; }

/* ── Row 3: Playlist toggle ── */
.wpvw-playlist-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.wpvw-playlist-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  padding: 0;
  color: var(--wpvw-icon-color) !important;
}

.wpvw-playlist-toggle span,
.wpvw-playlist-toggle * {
  color: var(--wpvw-icon-color) !important;
}

.wpvw-playlist-toggle:focus { outline: none; }

.wpvw-playlist-icon {
  transition: transform 0.3s ease;
}

.wpvw-playlist-icon.rotated {
  transform: rotate(180deg);
}

.wpvw-volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.wpvw-volume-wrap svg { width: 18px; height: 18px; flex-shrink: 0; }

.wpvw-volume {
  -webkit-appearance: none;
  width: 90px;
  height: 4px;
  background: linear-gradient(to right, var(--wpvw-icon-color, #000) 50%, #ccc 50%);
  border-radius: 5px;
  outline: none;
  flex-shrink: 0;
}

.wpvw-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 14px;
  width: 14px;
  background: var(--wpvw-icon-color, #333);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  margin-top: -5px;
}

.wpvw-volume::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
  border-radius: 5px;
}

.wpvw-volume::-moz-range-track {
  height: 4px;
  background: #ccc;
  border-radius: 5px;
}

.wpvw-volume::-moz-range-progress {
  background: var(--wpvw-icon-color, #000);
  height: 4px;
  border-radius: 5px;
}

.wpvw-volume::-moz-range-thumb {
  height: 14px;
  width: 14px;
  background: var(--wpvw-icon-color, #333);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

input.wpvw-volume:focus { outline: none; }

/* ── Video Embed ── */
.wpvw-video-embed {
  display: none;
  line-height: 0;
}

.wpvw-video-embed iframe {
  display: block;
  width: 100%;
}

/* ── Track List (hidden by default, toggled open) ── */
.wpvw-track-list {
  display: none;
}

.wpvw-track-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wpvw-track-item {
  border-bottom: 1px solid rgba(0,0,0,.1);
  transition: background 0.15s ease;
}

.wpvw-track-item:last-child { border-bottom: none; }

.wpvw-track-item.wpvw-active-track {
  background: rgba(0,0,0,.06);
}

/* ── Track Row: [▶] [Title··········] [↓] ── */
.wpvw-track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  flex-wrap: nowrap;    /* ← no wrap */
}

button.wpvw-related-play {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

button.wpvw-related-play svg { width: 22px; height: 22px; }
button.wpvw-related-play:focus { outline: none; }
button.wpvw-related-play:hover svg { opacity: 0.7; }

.wpvw-related-title {
  flex: 1 1 0;
  min-width: 0;         /* allows text to shrink & ellipsis */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.3;
}

.wpvw-related-title:hover { text-decoration: underline; }

.wpvw-related-download {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 4px;
}

.wpvw-related-download svg { width: 20px; height: 20px; }
.wpvw-related-download:focus { outline: none; }
.wpvw-related-download:hover svg { opacity: 0.7; }

/* ── Responsive ── */
@media (max-width: 540px) {
  .wpvw-player-main { padding: 18px 16px 18px; }
  .wpvw-track-row   { padding: 12px 14px; gap: 10px; }
  .wpvw-volume      { width: 70px; }
  .wpvw-play svg    { width: 40px; height: 40px; }
}

/* Tighten bottom padding when playlist toggle row is present */
.wpvw-has-playlist .wpvw-player-main {
  padding-bottom: 16px;
}

/* ── Meta band: spot type + read styles ── */
.wpvw-meta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 12px;
  margin: -28px -28px 14px -28px; /* bleed to edges of player card padding */
  background: rgba(0,0,0,0.18);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-wrap: nowrap;
}

.wpvw-spot-type {
  font-size: 11px;
  font-weight: var(--wpvw-font-weight, 600);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--wpvw-meta-color, #ffffff);
  opacity: .9;
}

.wpvw-read-styles {
  font-size: 11px;
  color: var(--wpvw-meta-color, #ffffff);
  opacity: .7;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 540px) {
  .wpvw-meta-band {
    margin: -18px -16px 12px -16px;
  }
}

/* ═══════════════════════════════════════════════════
   Compact / pill player layout
   ═══════════════════════════════════════════════════ */

.wpvw-compact {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  gap: 6px;
  padding: var(--wpvw-compact-padding, 10px 12px 8px);
  border-radius: var(--wpvw-radius, 8px);
  overflow: visible;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Progress fill handled by ::before pseudo-element */

/* Actual fill pseudo-element */
.wpvw-compact::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: var(--wpvw-pct, 0%);
  background: var(--wpvw-progress, #EE772F);
  opacity: 0.18;
  transition: var(--wpvw-transition, width 0.25s linear);
  pointer-events: none;
  z-index: 0;
  border-radius: var(--wpvw-radius, 8px);
}



/* All compact children above fill div */
.wpvw-compact > *:not(.wpvw-compact-fill) { position: relative; z-index: 1; }

/* Top row inside compact */
.wpvw-compact-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  gap: var(--wpvw-compact-row-gap, 10px);
  width: 100%;
}

/* Playing state — slightly brighter fill */
.wpvw-compact.wpvw-compact-playing::before { opacity: 0.25; }

/* ── Play button ── */
.wpvw-compact .wpvw-compact-play,
.wpvw-compact .wpvw-compact-play:hover,
.wpvw-compact .wpvw-compact-play:focus,
.wpvw-compact .wpvw-compact-play:active,
.wpvw-compact .wpvw-compact-play:visited {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-shrink: 0;
  color: var(--wpvw-icon-color, #fff);
  outline: none;
}

.wpvw-compact .wpvw-compact-play svg {
  width: 28px !important;
  height: 28px !important;
  display: block !important;
}

/* Icon visibility — reuse same class approach */
.wpvw-compact .wpvw-pause-icon { opacity: 0 !important; }
.wpvw-compact .wpvw-play-icon  { opacity: 1 !important; }
.wpvw-compact .wpvw-compact-play.wpvw-is-playing .wpvw-play-icon  { opacity: 0 !important; }
.wpvw-compact .wpvw-compact-play.wpvw-is-playing .wpvw-pause-icon { opacity: 1 !important; }

.wpvw-compact-title {
  font-size: 14px;
  font-weight: var(--wpvw-font-weight, 600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  flex: 1 1 0;
  min-width: 0;
}

.wpvw-compact-meta {
  font-size: 11px;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  padding-left: 38px;
  line-height: 1;
}

/* ── Volume ── */
.wpvw-compact-row .wpvw-compact-vol-wrap { margin-left: auto; }
.wpvw-compact-vol-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: static;
}

.wpvw-compact-vol-btn,
.wpvw-compact-vol-btn:hover,
.wpvw-compact-vol-btn:focus {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
  margin: 0 !important;
  padding: 4px !important;
  cursor: pointer !important;
  color: var(--wpvw-icon-color, #fff);
  opacity: 0.7;
  outline: none;
}

.wpvw-compact-vol-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: var(--wpvw-icon-color, #fff);
}

.wpvw-compact-vol-slider {
  width: 0;
  overflow: hidden;
  transition: width 0.2s ease;
  display: flex;
  align-items: center;
}

.wpvw-compact-vol-slider.wpvw-vol-open {
  width: 80px;
}


.wpvw-compact-volume {
  -webkit-appearance: none;
  width: 90px;
  height: 4px;
  border-radius: 5px;
  outline: none;
  background: rgba(255,255,255,0.2);
}

.wpvw-compact-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 12px;
  width: 12px;
  background: var(--wpvw-icon-color, #fff);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.wpvw-compact-volume::-moz-range-thumb {
  height: 12px;
  width: 12px;
  background: var(--wpvw-icon-color, #fff);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* ── Download ── */
.wpvw-compact .wpvw-compact-download,
.wpvw-compact .wpvw-compact-download:hover {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  opacity: 0.7;
  color: var(--wpvw-icon-color, #fff);
}

.wpvw-compact .wpvw-compact-download svg {
  width: 18px;
  height: 18px;
  fill: var(--wpvw-icon-color, #fff);
}

.wpvw-compact .wpvw-compact-download:hover { opacity: 1; }

/* ── Stacked play/pause icon wrapper — fixed size, no layout shift ── */
.wpvw-icon-wrap {
  display: inline-flex;
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.wpvw-icon-wrap .wpvw-play-icon,
.wpvw-icon-wrap .wpvw-pause-icon {
  position: absolute !important;
  top: 0; left: 0;
  width: 48px !important;
  height: 48px !important;
  transition: opacity 0.15s ease !important;
}

/* Compact size override */
.wpvw-compact .wpvw-icon-wrap {
  width: 28px;
  height: 28px;
}

.wpvw-compact .wpvw-icon-wrap .wpvw-play-icon,
.wpvw-compact .wpvw-icon-wrap .wpvw-pause-icon {
  width: 28px !important;
  height: 28px !important;
}

/* ── Compact mute toggle ── */
.wpvw-compact-mute,
.wpvw-compact-mute:hover,
.wpvw-compact-mute:focus,
.wpvw-compact-mute:active {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  flex-shrink: 0;
  color: var(--wpvw-icon-color, #fff);
  outline: none;
}
.wpvw-compact-mute svg {
  width: 20px;
  height: 20px;
  fill: var(--wpvw-icon-color, #fff);
}
