/* =====================================
   3. LAYOUT & NAVIGATION
===================================== */
/* Navigation Selector */
#channel-selector {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 30;
  color: var(--theme-color, white);
  font-size: 18px;
}

#current-channel {
  background: var(--bg-color, black);
  padding: 12px 16px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
  min-width: 250px;
  letter-spacing: 1px;
}

.dropdown-arrow {
  float: right;
  font-size: 12px;
  margin-top: 2px;
}

#channel-dropdown {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--bg-color, black);
}

#channel-selector.is-open #channel-dropdown {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.channel-option {
  padding: 12px 16px;
  cursor: pointer;
  color: var(--opt-color, var(--theme-color));
  background: var(--opt-bg, transparent);
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  letter-spacing: 1px;
}

.channel-option:hover {
  background: var(--opt-color);
  color: var(--opt-bg);
  border-left: 3px solid #fff;
}

/* Set from JS on mouse pointerenter/leave rather than via
   `@media (hover: hover)`, which Chrome reports as `none` on touchscreen
   laptops even when a mouse is being used. */
#channel-selector.is-hovered #channel-dropdown {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* Tooltip */
#tutorial-tooltip {
  position: absolute;
  top: 8px;
  left: 100%;
  background-color: var(--theme-color, white);
  color: var(--bg-color);
  padding: 6px 12px;
  border: 1px solid var(--theme-color, white);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.3s ease;
  animation: bounceTooltip 1s infinite alternate;
}
@keyframes bounceTooltip {
  0% { transform: translateX(0); }
  100% { transform: translateX(10px); }
}
#tutorial-tooltip.hidden { opacity: 0; }

#trackbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  padding: 8px 12px;
  background: var(--bg-color, black);
  font-size: 13px;
  color: var(--theme-color, white);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Progress of the current track: 1px along the very bottom of the trackbar.
   Its width is a scaleX set every frame by js/track-progress.js. Hidden
   (faded out) when the duration is unknown (live shows). */
#track-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--theme-color, white);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
  transition: opacity 0.5s, background-color 0.5s;
}
#track-progress.hidden { opacity: 0; }

.track-scroller {
  flex-grow: 1;
  overflow: hidden;
  white-space: nowrap;
  max-width: calc(100% - 100px); 
  position: relative;
  mask-image: linear-gradient(to right, black 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 95%, transparent 100%);
}

.trackbar-actions {
  display: flex;
  gap: 8px;
  justify-self: end;
  z-index: 2;
}

#copy-track-btn,
#chat-heart,
#report-track-btn {
  background: var(--bg-color, black);
  color: var(--theme-color, white);
  border: 1px solid var(--theme-color, white);
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: monospace;
  font-weight: bold;
  outline: none;
}

#copy-track-btn svg,
#report-track-btn svg {
  width: 14px;
  height: 14px;
}

#copy-track-btn:hover,
#copy-track-btn:focus,
#chat-heart:hover,
#chat-heart:focus,
#report-track-btn:hover,
#report-track-btn:focus {
  background: var(--theme-color, white);
  color: var(--bg-color, black);
}

#track-info {
  display: inline-block;
  white-space: nowrap;
}

#track-info.is-scrolling {
  animation: scrollPingPong 10s ease-in-out infinite alternate;
}

@keyframes scrollPingPong {
  0%, 15% { transform: translateX(0); }
  85%, 100% { transform: translateX(var(--overflow-dist)); } 
}

#volume-control {
  position: absolute;
  bottom: 14px; 
  left: 50%;
  transform: translateX(-50%);
  user-select: none;
  font-family: monospace;
  font-weight: bold;
  color: var(--theme-color, white);
  display: flex;
  gap: 8px;
  
  transition: bottom 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s, padding 0.2s, border 0.2s;
}

#volume-control.is-elevated {
  bottom: 38px; 
  background: var(--bg-color, black);
  padding: 4px 8px;
}

#vol-bar {
  cursor: pointer;
  white-space: pre;
}

#vol-text {
  width: 35px;
  text-align: right;
}

#copy-track-btn,
#report-track-btn {
  background: var(--bg-color, black);
  color: var(--theme-color, white);
  border: 1px solid var(--theme-color, white);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
}

#copy-track-btn svg, #report-track-btn svg { width: 14px; height: 14px; }
#copy-track-btn:hover, #report-track-btn:hover { background: var(--theme-color, white); color: var(--bg-color, black); }
#report-track-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#report-track-btn:disabled:hover { background: var(--bg-color, black); color: var(--theme-color, white); }

/* Report button + "doesn't belong here" tooltip */
#report-track-btn { position: relative; }

#report-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--theme-color, white);
  color: var(--bg-color, black);
  padding: 6px 12px;
  border: 1px solid var(--theme-color, white);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
#report-track-btn:hover #report-tooltip { opacity: 1; visibility: visible; }


/* Listeners Stats */
#bottom-status-bar {
  position: fixed;
  bottom: 50px;
  left: 16px;
  z-index: 20;
  display: flex;
  /* next-up badge stacked above the listener count */
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
}

#listeners-container {
  font-size: 12px;
  color: var(--theme-color, white);
  background: rgba(0, 0, 0, 0.8);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.listeners-text { display: flex; flex-direction: column; gap: 2px; }
.local-listeners { font-size: 10px; opacity: 0.8; }
.pulse-dot {
  width: 8px; height: 8px; background-color: var(--theme-color, white);
  border-radius: 50%; animation: pulse 2s infinite;
}

body[data-station="club_braquage"] #listeners-container { background-color: var(--theme-color); color: var(--bg-color); }
body[data-station="club_braquage"] .pulse-dot { background-color: var(--bg-color); }

/* Next-up / live badge, on every station. Clicking it opens the schedule,
   or switches to the main station while a show is live. */
.home-next-up {
  pointer-events: auto;
  cursor: pointer;
  font-size: 10px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--theme-color, white);
  font-variant-numeric: tabular-nums;
  max-width: calc(100vw - 32px);
  transition: opacity 0.2s ease;
}
.home-next-up[hidden] { display: none; }
/* Club's theme is inverted (--theme-color black, --bg-color lime): use the
   lime for the text, like the listener count below it, instead of black on
   black. */
body[data-station="club_braquage"] .home-next-up { color: var(--bg-color); }
.home-next-up:hover { opacity: 0.7; }
.home-next-up-dot { display: inline-block; animation: blink 1s steps(1) infinite; }
.home-next-up-short { display: none; }
@media (max-width: 768px) {
  .home-next-up-full { display: none; }
  .home-next-up-short { display: inline; }
}

/* Cover Art */
#cover-container {
  position: fixed;
  bottom: 45px;
  right: 12px;
  z-index: 15;
  width: 120px;
  height: 120px;
  background: var(--bg-color, black);
  display: none;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
  transform-origin: bottom right;
}
#cover-container.expanded {
  bottom: calc(50vh - 30vmin);
  right: calc(50vw - 30vmin);
  transform: none !important;
  width: 60vmin;
  height: 60vmin;
  /* Pas de z-index ici : elle garde celui de base (15), toujours sous
     #panels-wrapper (25) même agrandie. */
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.9);
}
#cover-art { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
@media (hover: hover) { #cover-container:not(.expanded):hover { transform: scale(2.5); } }

