/* ═══════════════════════════════════════════════════
   RocklandUSA Classic Radio — Persistent Player Bar
   ═══════════════════════════════════════════════════ */

#rusa-radio {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: #0d0d0d;
  border-top: 1px solid rgba(160, 194, 19, 0.25);
  display: flex;
  align-items: center;
  gap: 0;
  z-index: 9999;
  font-family: system-ui, -apple-system, sans-serif;
  user-select: none;
}

/* Animated top glow line — only when playing */
#rusa-radio::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #A0C213 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s;
}
#rusa-radio.rp-playing::before {
  opacity: 1;
  animation: rp-scanline 3s linear infinite;
}
@keyframes rp-scanline {
  0%   { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

/* ── LEFT: LIVE BADGE + SHOW TITLE ── */
.rp-left {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 0 18px;
  min-width: 0;
  flex: 1;
  max-width: 380px;
}

.rp-live-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(204, 41, 54, 0.15);
  border: 1px solid rgba(204, 41, 54, 0.5);
  border-radius: 4px;
  padding: 3px 7px;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #ff4455;
  text-transform: uppercase;
}
.rp-live-badge .rp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff4455;
  animation: rp-pulse 1.4s ease-in-out infinite;
}
#rusa-radio.rp-offline .rp-live-badge {
  background: rgba(80,80,80,0.15);
  border-color: rgba(80,80,80,0.4);
  color: #666;
}
#rusa-radio.rp-offline .rp-dot {
  background: #555;
  animation: none;
}
@keyframes rp-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

.rp-meta {
  min-width: 0;
  overflow: hidden;
}
.rp-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #555;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.rp-show {
  font-size: 13px;
  font-weight: 600;
  color: #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color 0.2s;
}
.rp-show:hover { color: #A0C213; }
.rp-show-scroll {
  display: inline-block;
  animation: rp-marquee 18s linear infinite;
}
@keyframes rp-marquee {
  0%   { transform: translateX(0); }
  40%  { transform: translateX(0); }
  90%  { transform: translateX(-60%); }
  100% { transform: translateX(0); }
}

/* ── CENTER: WAVEFORM + CONTROLS ── */
.rp-center {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  padding: 0 24px;
}

.rp-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
}
.rp-bar {
  width: 3px;
  background: #A0C213;
  border-radius: 2px;
  opacity: 0.85;
  transform-origin: bottom;
}
#rusa-radio.rp-playing .rp-bar { animation: rp-bounce var(--d, 0.8s) ease-in-out infinite alternate; }
#rusa-radio.rp-playing .rp-bar:nth-child(1) { --d: 0.65s; height: 8px;  }
#rusa-radio.rp-playing .rp-bar:nth-child(2) { --d: 0.90s; height: 14px; }
#rusa-radio.rp-playing .rp-bar:nth-child(3) { --d: 0.55s; height: 22px; }
#rusa-radio.rp-playing .rp-bar:nth-child(4) { --d: 0.75s; height: 18px; }
#rusa-radio.rp-playing .rp-bar:nth-child(5) { --d: 1.00s; height: 12px; }
#rusa-radio.rp-playing .rp-bar:nth-child(6) { --d: 0.70s; height: 20px; }
#rusa-radio.rp-playing .rp-bar:nth-child(7) { --d: 0.85s; height: 9px;  }
/* Frozen state */
.rp-bar:nth-child(1) { height: 6px; }
.rp-bar:nth-child(2) { height: 10px; }
.rp-bar:nth-child(3) { height: 16px; }
.rp-bar:nth-child(4) { height: 13px; }
.rp-bar:nth-child(5) { height: 9px; }
.rp-bar:nth-child(6) { height: 15px; }
.rp-bar:nth-child(7) { height: 7px; }
#rusa-radio.rp-offline .rp-bar { background: #333; opacity: 0.4; }
@keyframes rp-bounce {
  from { transform: scaleY(0.3); }
  to   { transform: scaleY(1); }
}

.rp-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #A0C213;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 0 0 rgba(160,194,19,0);
  flex-shrink: 0;
}
.rp-play-btn:hover:not(:disabled) {
  background: #b8dd17;
  transform: scale(1.06);
  box-shadow: 0 0 16px rgba(160,194,19,0.4);
}
.rp-play-btn:active:not(:disabled) { transform: scale(0.96); }
.rp-play-btn:disabled { background: #333; cursor: not-allowed; }
.rp-play-btn svg { display: block; }
#rusa-radio.rp-playing .rp-play-btn {
  box-shadow: 0 0 20px rgba(160,194,19,0.25);
}

/* ── RIGHT: VOLUME + LISTENERS ── */
.rp-right {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px 0 0;
  flex-shrink: 0;
}

.rp-volume {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rp-vol-icon {
  font-size: 14px;
  color: #555;
  flex-shrink: 0;
}
.rp-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 3px;
  background: linear-gradient(to right, #A0C213 var(--vol, 80%), #333 var(--vol, 80%));
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.rp-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #A0C213;
  cursor: pointer;
  transition: transform 0.15s;
}
.rp-vol-slider::-webkit-slider-thumb:hover { transform: scale(1.3); }
.rp-vol-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: #A0C213;
  cursor: pointer;
}

.rp-listeners {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #555;
  flex-shrink: 0;
  min-width: 60px;
}
.rp-listener-count { color: #888; font-weight: 500; }

/* Dividers */
.rp-div {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}

/* Body padding so content isn't hidden under bar */
body { padding-bottom: 68px !important; }

/* Mobile adjustments */
@media (max-width: 600px) {
  #rusa-radio { height: 60px; }
  .rp-left { max-width: 160px; padding: 0 10px 0 12px; gap: 8px; }
  .rp-label { display: none; }
  .rp-show { font-size: 12px; }
  .rp-center { gap: 12px; padding: 0 14px; }
  .rp-wave { gap: 2px; }
  .rp-play-btn { width: 38px; height: 38px; }
  .rp-right { padding: 0 12px 0 0; gap: 8px; }
  .rp-vol-slider { width: 60px; }
  .rp-listeners span:first-child { display: none; }
  body { padding-bottom: 60px !important; }
}
@media (max-width: 400px) {
  .rp-volume { display: none; }
}
