/* =====================================================
   PlanetRadio – Sticky Global Player (FINAL)
   Desktop focus: Volume + Timer BIG & CLEAR
===================================================== */

/* ===== PLAYER ROOT ===== */
#prPlayer {
  position: sticky;
  bottom: 0;
  z-index: 50;

  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 18px;

  padding: 16px 20px;
  min-height: 88px;

  background: linear-gradient(180deg, #0b1220, #0a0f1a);
  border-top: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    0 -12px 30px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

/* accent line */
#prPlayer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #e11d48, #fb7185);
}

/* ===== META ===== */
.pr-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.pr-station {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pr-country {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
}

/* ===== CONTROLS ===== */
.pr-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.pr-controls button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: all .15s ease;
}

.pr-controls button:hover {
  background: rgba(255,255,255,0.14);
  transform: scale(1.08);
}

/* PLAY HERO */
#btnPlay {
  width: 58px;
  height: 58px;
  background: #e11d48;
  box-shadow: 0 10px 30px rgba(225,29,72,0.6);
}

#btnPlay:hover {
  transform: scale(1.12);
}

/* playing pulse */
#prPlayer.is-playing #btnPlay {
  animation: pr-play-pulse 1.8s infinite;
}

@keyframes pr-play-pulse {
  0% { box-shadow: 0 0 0 0 rgba(225,29,72,.6); }
  70% { box-shadow: 0 0 0 16px rgba(225,29,72,0); }
  100% { box-shadow: 0 0 0 0 rgba(225,29,72,0); }
}

/* ===== EXTRAS ===== */
.pr-extras {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

/* === TIMER – PILL STYLE + DARK DROPDOWN FIX === */
#stopTimer {
  appearance: none;
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;

  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;

  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: .02em;

  cursor: pointer;
  transition: all .15s ease;

  /* 🔥 CRITICAL */
  color-scheme: dark;
}

#stopTimer:hover {
  background: rgba(225,29,72,0.15);
  border-color: rgba(225,29,72,0.5);
}

#stopTimer:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(225,29,72,0.4);
}

/* OPTIONS – prevents white dropdown */
#stopTimer option {
  background-color: #0f172a;
  color: #ffffff;
}

#stopTimer option:checked {
  background-color: #e11d48;
  color: #ffffff;
}

/* === VOLUME – BIG SLIDER === */
#volumeRange {
  width: 150px;
  height: 6px;
  accent-color: #e11d48;
  cursor: pointer;
}

#volumeRange::-webkit-slider-runnable-track {
  height: 6px;
  background: rgba(255,255,255,0.18);
  border-radius: 6px;
}

#volumeRange::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: #e11d48;
  border-radius: 50%;
  margin-top: -5px;
  box-shadow: 0 0 10px rgba(225,29,72,0.6);
}

#volumeRange::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #e11d48;
  border-radius: 50%;
}

/* ===== EXPAND/COLLAPSE TOGGLE (mobile only) ===== */
.pr-expand-toggle {
  display: none;
}

/* =====================================================
   MOBILE — collapsible bottom-sheet player
   Collapsed by default: station meta + play/pause only.
   Tap the chevron to reveal prev/next, timer, volume, clock.
===================================================== */
@media (max-width: 720px) {

  #prPlayer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    z-index: 500;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;

    padding: 10px 14px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    min-height: 64px;
  }

  .pr-meta {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 10px;
  }

  .pr-controls {
    order: 2;
    flex-shrink: 0;
    gap: 8px;
  }

  #btnPrev,
  #btnNext {
    display: none;
  }

  #btnPlay {
    width: 44px;
    height: 44px;
  }

  .pr-expand-toggle {
    order: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    margin-left: 8px;
    background: rgba(255,255,255,0.06);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
  }

  .pr-expand-toggle::before {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform .2s ease;
  }

  .pr-extras {
    order: 4;
    display: none;
    width: 100%;
  }

  /* ===== EXPANDED STATE ===== */
  #prPlayer.pr-expanded {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  #prPlayer.pr-expanded .pr-expand-toggle::before {
    transform: rotate(135deg);
  }

  #prPlayer.pr-expanded #btnPrev,
  #prPlayer.pr-expanded #btnNext {
    display: flex;
  }

  #prPlayer.pr-expanded .pr-controls {
    width: 100%;
    justify-content: center;
    gap: 24px;
    margin-top: 14px;
    order: 5;
  }

  #prPlayer.pr-expanded .pr-extras {
    display: flex;
    justify-content: center;
    margin-top: 14px;
    order: 6;
  }

  #prPlayer.pr-expanded .pr-extras-stack {
    width: 100%;
    align-items: center;
  }

  #prPlayer.pr-expanded .pr-extras-row {
    justify-content: center;
    gap: 16px;
  }

  #prPlayer.pr-expanded #volumeRange {
    flex: 1;
    max-width: 200px;
  }

  #stopTimer {
    padding: 6px 10px;
    font-size: 0.7rem;
  }

  /* dropdown safety */
  #prPlayer.pr-expanded { overflow: visible; }
  .pr-extras { position: relative; z-index: 200; }
}
