/* =========================================================
   Music button + overlay bar wrapper
   File: assets/css/musicplayer.css
   ========================================================= */

/* WRAPPER: positions everything at bottom and centers horizontally */
.overlay__bar-wrap {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  height: 50px;
  z-index: 6;
}

/* ---------------------------------------------------------
   MUSIC BUTTON
   --------------------------------------------------------- */

/* Circle button (positioned relative to the screen, aligned to bar) */
.mute-btn {
  position: absolute;
  top: 50%;

  /* stick to the left of the centered .overlay__bar
     .overlay__bar has width: min(600px, 90vw) */
  left: calc(50% - (min(600px, 90vw) / 2) - 8px);
  /* 24px = small gap from bar; tweak if you want it closer/farther */

  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  overflow: visible;
}

/* White base circle */
.mute-btn__bg {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #ffffff;
}

/* Dark fill that appears when muted */
.mute-btn__inner {
  position: absolute;
  inset: 0;
}

.mute-btn__fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #000000;
  transform: scale(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

/* Center the EQ bars inside the circle */
.mute-btn__icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 22px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}

/* Bars */
.mute-btn__icon-line {
  stroke: #000000;
  transform-origin: center bottom;
  /* no fixed transform here -> allows SVG base + animations to work */
  transition: stroke 0.3s ease, transform 0.3s ease;
}

/* ---------------------------------------------------------
   PLAYING STATE  (button NOT muted)
   --------------------------------------------------------- */

/* Equalizer animation when NOT muted */
.mute-btn:not(.is-muted) .js-sound-line {
  animation: eqBar 0.9s infinite ease-in-out;
}

/* Slightly different timing per bar */
.mute-btn:not(.is-muted) .js-sound-line:nth-child(1) { animation-duration: 0.7s; }
.mute-btn:not(.is-muted) .js-sound-line:nth-child(2) { animation-duration: 0.9s; }
.mute-btn:not(.is-muted) .js-sound-line:nth-child(3) { animation-duration: 0.6s; }
.mute-btn:not(.is-muted) .js-sound-line:nth-child(4) { animation-duration: 0.8s; }
.mute-btn:not(.is-muted) .js-sound-line:nth-child(5) { animation-duration: 1s; }

@keyframes eqBar {
  0%, 100% { transform: scaleY(0.2); }
  50%      { transform: scaleY(1);   }
}

/* ---------------------------------------------------------
   MUTED STATE
   --------------------------------------------------------- */

.mute-btn.is-muted .mute-btn__bg {
  background: #000000;
}

.mute-btn.is-muted .mute-btn__fill {
  transform: scale(1.05);
}

/* Lines become white and move VERY slightly (soft idle animation) */
.mute-btn.is-muted .js-sound-line {
  stroke: #ffffff;
  animation: eqBarSoft 1.4s infinite ease-in-out;
}

.mute-btn.is-muted .js-sound-line:nth-child(1) { animation-duration: 1.1s; }
.mute-btn.is-muted .js-sound-line:nth-child(2) { animation-duration: 1.3s; }
.mute-btn.is-muted .js-sound-line:nth-child(3) { animation-duration: 1.2s; }
.mute-btn.is-muted .js-sound-line:nth-child(4) { animation-duration: 1.5s; }
.mute-btn.is-muted .js-sound-line:nth-child(5) { animation-duration: 1.7s; }

@keyframes eqBarSoft {
  0%, 100% { transform: scaleY(0.18); }
  50%      { transform: scaleY(0.30); } /* tiny movement */
}

/* ---------------------------------------------------------
   Screen-reader only text
   --------------------------------------------------------- */

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
