.custom-audio-player {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: #222;
  user-select: none;
}

.custom-audio-player>button {

}
.player-btn {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  color: #eee;
  padding: 0 8px;
  transition: color 0.1s;

  height: 40px;
  min-width: 40px;
  border-radius: 0;

  background: #555;
  user-select: none;
}
.player-btn:hover {
  color: #333;
}
.player-btn.playpause {
  width:60px;
}
.seek-container {
  position: relative;
  flex-grow: 10;
  height: 40px;
}
.seek-container canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;

  padding: 4px 2px 4px 4px;
  box-sizing: border-box;
}
.seek-container .waveform {
  width: 100%;
  height: 100%;
  position: relative;
}

.seek-container .waveform::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff0;
  pointer-events: none;
  display: none;
  z-index: 2;
}
body.loading .seek-container .waveform::after {
  display: block;
  animation: waveform-loading 1s ease-in-out infinite;
}
@keyframes waveform-loading {
  0%, 100% { background: #fff0; }
  50% { background: #fff3; }
}


.seek-container .player-slider.seek {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 100%;
  background: none;
  z-index: 3;
  flex-grow: 1;
}
.player-slider.seek {
  flex-grow: 10;
}
.player-slider.volume {
  width: 60px;
}
.player-time, .player-duration {
  min-width: 3em;
  text-align: right;
  color: #aaa;
  font-size: 0.95em;
}
.player-duration {
  text-align: left;
}
.player-btn svg {
  vertical-align: middle;
  width: 1.25em;
  height: 1.25em;
  stroke: currentColor;
}
.custom-audio-player>button:hover {
  background: #eee;
  color: #222;
}


input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #444 0%, #888 50%, #444 100%);
  outline: none;
  margin: 0;
}

input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  border-radius: 3px;
  width:6px;
  height:20px;
  background:#bbb;
  position:relative;
  z-index:3;
  box-shadow:0 0 5px 0 rgba(0,0,0,0.3);
}

/* waveform slider */
/*.seek-container input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  border-radius: 6px;
  border: 2px solid #bbbbbb;
  border-width: 10px 2px 10px 2px;
  width: 6px;
  height: 65px;
  background: #222;
  position: relative;
  z-index: 3;
}*/
/*.seek-container input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  border-radius: 6px;
  border: 2px solid #bbbbbb;
  border-width: 10px 2px 10px 2px;
  width: 6px;
  height: 65px;
  background: #222;
  position: relative;
  z-index: 3;
}*/
/*.seek-container input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  border-radius: 0px;
  border: 2px solid #fff;
  border-width: 6px 2px 6px 2px;
  width: 6px;
  height: 42px;
  background: #000;
  position: relative;
  z-index: 3;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
}*/
/*.seek-container input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  border-radius: 0px;
  border: 2px solid #222;
  border-width: 0 2px 0 2px;
  width: 6px;
  height: 40px;
  background: #fff;
  position: relative;
  z-index: 3;
}*/
.seek-container input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  border: 2px solid #222;
  border-width: 0 0 0 2px;
  height: 40px;
  width: 4px;
  background: #fff;
  position: relative;
  z-index: 3;
  box-shadow: none;
}



.player-btn.mute {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  margin-left: -0.4em;
}
.player-btn.mute.unmuted svg {
  display: block;
}
.player-btn.mute.muted svg {
  display: block;
}

/* Optionally, color the SVG using currentColor */
.player-btn.mute svg {
  width: 1.5em;
  height: 1.5em;
  stroke: currentColor;
}

/* Hide the SVG for the opposite state (if both present) */
.player-btn.mute.muted .unmuted-icon { display: none; }
.player-btn.mute.unmuted .muted-icon { display: none; }


.player-btn svg {
  vertical-align: middle;
  stroke: currentColor;
}
.player-btn.playpause .pause-icon { display: none; }
.player-btn.playpause.playing .pause-icon { display: inline-block; }
.player-btn.playpause.playing .play-icon { display: none; }
.player-btn.playpause.paused .play-icon { display: inline-block; }
.player-btn.playpause.paused .pause-icon { display: none; }
.player-btn.mute.muted .unmuted-icon { display: none; }
.player-btn.mute.unmuted .muted-icon { display: none; }
.player-btn.mute.unmuted .unmuted-icon { display: inline-block; }
.player-btn.mute.muted .muted-icon { display: inline-block; }

.player-title {
  position: absolute;
  color: #1c1c1c;
  color: #6a6a6a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  top: -25px;
  padding: 1px;
  font-weight: bold;
}

.player-btn.loop {
  background: none;
  border: none;
  color: #eee;
  transition: color .2s;
}
.player-btn.mute:hover ,
.player-btn.loop:hover {
  background:#555;
  color: #eee;
}
.player-btn.loop.active {
  color: #000;
  background: #eee;
}
.player-slider.rate {
  width: 60px;
  margin: 0;

}
.rate-display {
  min-width: 45px;
  text-align: left;
  font-size: 0.95em;
  color: #aaa;
  font-variant-numeric: tabular-nums;
}
.rate-display[contenteditable='true'] {
  background: #555;
  color: #fff;
  outline: none;
  border-radius: 2px;
  padding: 2px 4px;
}

.volume-display {
  min-width: 45px;
  text-align: left;
  font-size: 0.95em;
  color: #aaa;
  font-variant-numeric: tabular-nums;
}
.volume-display[contenteditable='true'] {
  background: #555;
  color: #fff;
  outline: none;
  border-radius: 2px;
  padding: 2px 4px;
}


.player-slider.volume {
    width: 67px; /* becomes height */
    height: 6px;
    -webkit-appearance: slider-vertical;
    appearance: none;
    transform: rotate(-90deg);
    margin: 0 -22px;
  }

