/* =========================================================
   JUKEBOX — Barra flotante minimalista (YouTube embed)
   ========================================================= */

.jukebox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--ink, #0c0c0c);
  color: var(--paper, #ffffff);
  font-family: var(--mono, "Space Mono", "Courier New", monospace);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  user-select: none;
  -webkit-user-select: none;
  height: 36px;
}

.jb-inner {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(0.5rem, 2vw, 1.5rem);
  height: 100%;
}

/* control buttons */
.jb-btn,
.jb-vol-btn {
  background: none;
  border: none;
  color: inherit;
  height: 100%;
  padding: 0 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 180ms ease, transform 180ms ease;
  flex-shrink: 0;
}
.jb-btn:hover,
.jb-vol-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}
.jb-btn:active,
.jb-vol-btn:active {
  transform: scale(0.95);
}
.jb-btn.is-active {
  opacity: 1;
}

/* track info container */
.jb-info {
  flex: 1;
  overflow: hidden;
  padding: 0 0.5rem;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

/* marquee scrolling text */
.jb-track {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.75;
}

/* active marquee animation when playing */
.jukebox.is-playing .jb-track {
  padding-left: 100%;
  animation: jbMarquee 22s linear infinite;
}

@keyframes jbMarquee {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* volume control */
.jb-vol {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 180ms ease;
  margin-left: 0.25rem;
}
.jb-vol:hover {
  opacity: 1;
}
.jb-vol-icon {
  flex-shrink: 0;
}
.jb-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 60px;
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: background 180ms ease;
}
.jb-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper, #ffffff);
  cursor: pointer;
}
.jb-vol-slider::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper, #ffffff);
  cursor: pointer;
  border: none;
}
.jb-vol-slider:hover {
  background: rgba(255,255,255,0.4);
}

/* hidden YouTube player container */
.jb-yt-wrap {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 200px;
  height: 200px;
  z-index: -1000;
  pointer-events: none;
  opacity: 0.001;
}

/* pulse animation for playing state */
@keyframes jb-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
.jukebox.is-playing .jb-track {
  animation: jbMarquee 22s linear infinite; /* marquee takes over animation */
}

/* ─── RESPONSIVE & LAYOUT INTEGRATION ─── */

body {
  padding-top: 36px;
}

.topbar {
  top: 36px !important;
}

@media (max-width: 480px) {
  .jb-inner {
    gap: 0.1rem;
    padding: 0 0.4rem;
  }
  .jb-btn,
  .jb-vol-btn {
    padding: 0 8px;
  }
  .jb-btn svg,
  .jb-vol-btn svg {
    width: 14px;
    height: 14px;
  }
  .jb-track {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
  }
  .jb-vol {
    gap: 0.2rem;
    margin-left: 0.1rem;
  }
  .jb-vol-slider {
    width: 45px;
  }
  /* increase touch targets for slider thumb on mobile */
  .jb-vol-slider::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
  }
  .jb-vol-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
  }
}
