/* ================================================================
   RadioWeb — Player de Áudio: Estilos Multiplataforma
   ================================================================ */

/* ── Barra do Player ─────────────────────────────────────────────── */
.player-bar {
  background: var(--cor-primaria);
  color: #fff;
  position: sticky;
  top: 71px;          /* logo abaixo do header fixo */
  z-index: 999;
  box-shadow: 0 3px 12px rgba(0,0,0,.25);
  transition: top .3s ease;
}

.player-inner {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: nowrap;
  min-height: 56px;
}

/* ── Botão Play/Pause ────────────────────────────────────────────── */
.player-btn {
  background: rgba(255,255,255,.2);
  border: 2px solid rgba(255,255,255,.4);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;  /* remove flash azul no iOS */
  touch-action: manipulation;               /* sem delay de toque no mobile */
  position: relative;
}
.player-btn:hover,
.player-btn:focus-visible { background: rgba(255,255,255,.35); outline: none; }
.player-btn:active        { transform: scale(.92); }
.player-btn.tocando       { background: rgba(255,255,255,.3); border-color: rgba(255,255,255,.7); }

/* ícones dentro do botão */
.player-btn .play-icon  { display: block;  font-size: 1rem; margin-left: 2px; }
.player-btn .pause-icon { display: none;   font-size: 1rem; }
.player-btn.tocando .play-icon  { display: none; }
.player-btn.tocando .pause-icon { display: block; }

/* spinner de carregando */
.player-btn .spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Label (OUVIR / AO VIVO) ────────────────────────────────────── */
#player-btn-label {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,.9);
  display: block;
  text-align: center;
  margin-top: 2px;
  line-height: 1;
}

/* ── Info do Programa ────────────────────────────────────────────── */
.player-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.player-info .programa {
  font-weight: 700;
  font-size: .875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.player-info .apresentador {
  font-size: .7rem;
  opacity: .8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ── Status (conectando / erro / aviso) ──────────────────────────── */
.player-status {
  font-size: .72rem;
  padding: .2rem .6rem;
  border-radius: 20px;
  display: none;
  flex-shrink: 0;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-status--carregando {
  background: rgba(255,255,255,.15);
  animation: pulsar-status 1.2s ease infinite;
}
.player-status--aviso  { background: rgba(255,200,0,.3); }
.player-status--erro   { background: rgba(220,53,69,.4); max-width: 320px; white-space: normal; }
.player-status--info   { background: rgba(255,255,255,.1); }
@keyframes pulsar-status { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ── Volume ──────────────────────────────────────────────────────── */
.player-volume {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
}
#player-vol-icon {
  cursor: pointer;
  font-size: .95rem;
  opacity: .85;
  transition: opacity .2s;
  padding: .2rem;
  -webkit-tap-highlight-color: transparent;
}
#player-vol-icon:hover { opacity: 1; }

#player-volume {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: rgba(255,255,255,.3);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  accent-color: #fff;
  transition: width .2s;
}
#player-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  cursor: pointer;
}
#player-volume::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}

/* ── Badge AO VIVO ───────────────────────────────────────────────── */
.player-ao-vivo {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.4);
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .4s;
}
.player-ao-vivo.visivel {
  opacity: 1;
  animation: piscar 2.5s ease infinite;
}
@keyframes piscar { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ── Player HTML personalizado ───────────────────────────────────── */
#player-html-wrap {
  display: none;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
#player-html-wrap iframe,
#player-html-wrap > * {
  display: block;
  max-width: 100%;
  border: none;
}

/* ── Responsivo ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .player-inner { gap: .5rem; padding: .5rem .75rem; }
  #player-volume { width: 60px; }
  .player-status { max-width: 140px; font-size: .65rem; }
  .player-ao-vivo { display: none; }  /* espaço no mobile */
}
@media (max-width: 420px) {
  .player-volume { display: none; }   /* esconde volume em telas muito pequenas */
  .player-info .programa { font-size: .8rem; }
}
