body.has-wyxr-player {
  --wyxr-player-height: clamp(3.5rem, 2.75rem + 2vw, 4.5rem);
  padding-bottom: calc(var(--wyxr-player-height) + env(safe-area-inset-bottom, 0px));
}

.wyxr-player {
  --glow-size: calc(var(--wyxr-player-height) * 0.5);
  position: fixed;
  inset-inline: 0;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: #131313;
  color: #f8f8f8; 
  z-index: 999;
  transition: box-shadow 0.3s ease;
}

.wyxr-player.is-playing {
  animation: wyxr-player-glow 8s ease-in-out infinite;
}

@keyframes wyxr-player-glow {
  0% {
    box-shadow: inset 0 calc(var(--glow-size) * -0.5) var(--glow-size) rgba(0, 255, 255, 0.5);
  }
  14% {
    box-shadow: inset 0 calc(var(--glow-size) * -0.5) var(--glow-size) rgba(255, 255, 0, 0.5);
  }
  28% {
    box-shadow: inset 0 calc(var(--glow-size) * -0.5) var(--glow-size) rgba(255, 0, 0, 0.5);
  }
  42% {
    box-shadow: inset 0 calc(var(--glow-size) * -0.5) var(--glow-size) rgba(240, 248, 255, 0.5);
  }
  57% {
    box-shadow: inset 0 calc(var(--glow-size) * -0.5) var(--glow-size) rgba(255, 127, 80, 0.5);
  }
  71% {
    box-shadow: inset 0 calc(var(--glow-size) * -0.5) var(--glow-size) rgba(255, 20, 147, 0.5);
  }
  85% {
    box-shadow: inset 0 calc(var(--glow-size) * -0.5) var(--glow-size) rgba(147, 51, 234, 0.5);
  }
  100% {
    box-shadow: inset 0 calc(var(--glow-size) * -0.5) var(--glow-size) rgba(0, 255, 255, 0.5);
  }
}

/* if admin bar is visible, add padding-top to the player */
@media screen and (min-width: 782px) {
  .admin-bar .wyxr-player {
    top: var(--wp-admin--admin-bar--height);
  }
}

.wyxr-player__primary {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.wyxr-player__toggle {
  width: 120px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem; 
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--wp--preset--color--foreground);
  background: var(--wp--preset--color--yellow);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.wyxr-player__toggle:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.wyxr-player__toggle:hover { 
  background: #ff7a2e;
}

.wyxr-player__toggle[aria-pressed="true"] .wyxr-player__icon {
  transform: scale(0.9);
}

.wyxr-player__icon {
  font-size: 1.25rem;
  line-height: 1;
}

.wyxr-player__meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.875rem;
}

.wyxr-player__station {
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.wyxr-player__status {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.85);
}

.wyxr-player__secondary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}
.wyxr-player__secondary {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
.wyxr-player.is-playing .wyxr-player__secondary {
  opacity: 1;
}

.wyxr-player__indicator {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wyxr-player.is-playing .wyxr-player__indicator {
  color: #6ee7b7;
}

.wyxr-player__indicator .speaker-icon-on {
  display: none;
}

.wyxr-player.is-playing .wyxr-player__indicator .speaker-icon-off {
  display: none;
}

.wyxr-player.is-playing .wyxr-player__indicator .speaker-icon-on {
  display: block;
}

.wyxr-player__volume input[type="range"] {
  width: clamp(120px, 20vw, 200px);
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

/* Chrome/Safari thumb */
.wyxr-player__volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: -5px; /* Center the thumb on the track (half of thumb - half of track) */
}

.wyxr-player__volume input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}

/* Firefox thumb */
.wyxr-player__volume input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #ffffff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  /* Firefox automatically centers, no margin needed */
}

.wyxr-player__volume input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}

/* Chrome/Safari track */
.wyxr-player__volume input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

/* Firefox track */
.wyxr-player__volume input[type="range"]::-moz-range-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

/* Focus state */
.wyxr-player__volume input[type="range"]:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  body.has-wyxr-player {
      padding-bottom: calc(var(--wyxr-player-height) + 0.5rem + env(safe-area-inset-bottom, 0px));
  }

  .wyxr-player {
      flex-direction: column;
      align-items: stretch;
      text-align: center;
      gap: 0.5rem;
      .is-playing .speaker-icon-off {
        display: none;
      }
      .is-playing .speaker-icon-on {
        display: block;
      }
      .is-not-playing .speaker-icon-off {
        display: block;
      }
      .is-not-playing .speaker-icon-on {
        display: none;
      }
  }

  .wyxr-player__primary {
      justify-content: center;
  }

  .wyxr-player__secondary {
      justify-content: center;
  }
  
  .wyxr-player__volume input[type="range"] {
      width: min(220px, 70vw);
  }
}







.now-playing-module-wrapper {
  position: fixed;  
  bottom: auto;
  top: -1px;
  width: 100%; 
  z-index: 100;
  height: 1px; 
  overflow: visible;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  .now-playing-module {
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    display: inline-flex;
    align-items: flex-start;
    justify-content: flex-start;   
    gap: calc(var(--spacing) * 2);
    font-size: var(--text-sm);
    line-height: var(--tw-leading, var(--text-sm--line-height));
    font-weight: 400;
    font-style: normal;
    font-family: var(--ff);
    text-decoration: none; 
    color: var(--white);
    background-color: var(--color-base-900);
    padding: 0 calc(var(--spacing) * 6) 0 0; 
    width: auto;
    min-width: 360px;
    max-width: 600px;
    &:hover { 
      color: var(--white);
      text-decoration: none;
    } 
    #now-playing-module-container {
      display: flex; 
      flex-direction: row;
      align-items: center;
      justify-content: center;
      gap: calc(var(--spacing) * 2);
      text-align: left;
      text-wrap: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap; 
      max-width: 100%;
      .module-image-container {
        width: var(--wyxr-player-height);
        height: var(--wyxr-player-height); 
        overflow: hidden;
        margin: 0;
        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          object-position: center; 
        }
      }
      .module-content-container {
        display: flex;
        flex-direction: column; 
        .module-now-playing {
          display: flex;
          flex-direction: row;
          align-items: center;
          justify-content: flex-start;
          gap: calc(var(--spacing) * 2); 
          padding: calc(var(--spacing) * 1);
          border-radius: var(--radius-sm);
          font-size: var(--text-sm);
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          max-width: 100%; 
          svg {
            width: calc(var(--spacing) * 4);
            height: calc(var(--spacing) * 4);
            color: var(--primary);
          }
        }
        i { 
          border-radius: var(--radius-lg);
          font-style: normal;
          font-weight: 800;
          font-size: var(--text-xs);
          line-height: var(--tw-leading, var(--text-sm--line-height));
          color: var(--color-red-300); 
        }
        * {
          color: var(--white);
        }
      }
    }
  }
}
@media screen and (min-width: 782px) {
  .admin-bar .now-playing-module-wrapper {
    /* top: calc(var(--wyxr-player-height) + var(--wp-admin--admin-bar--height) + 2px); */
    top: var(--wp-admin--admin-bar--height);
  }
}