/* ======================================================
  Nova Líder FM — Player CSS
  Tema baseado nas cores da logo:
  Azul profundo, amarelo, vermelho e branco
   ====================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --red:        #E31B23;
  --yellow:     #FFD400;
  --blue:       #082F87;
  --blue-deep:  #041A4D;
  --grad:       linear-gradient(135deg, #FFD400 0%, #E31B23 100%);
  --grad-soft:  linear-gradient(135deg, rgba(255,212,0,.16) 0%, rgba(227,27,35,.16) 100%);
  --gray:       #B8C4DF;
  --dark:       #03143D;
  --dark2:      #061F5A;
  --white:      #FFFFFF;
  --radius:     20px;
}

/* ── Fundo ─────────────────────────────────────────── */
body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark);
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(255,212,0,.13) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(227,27,35,.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Card principal ─────────────────────────────────── */
.player-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  background: var(--dark2);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius);
  padding: 40px 48px 36px;
  width: min(420px, 92vw);
  box-shadow:
    0 8px 40px rgba(0,0,0,.6),
    0 0 0 1px rgba(255,212,0,.14);
}

/* ── Logo ───────────────────────────────────────────── */
.logo-area { display: flex; justify-content: center; }

.logo {
  width: 130px;
  height: 130px;
  object-fit: contain;
  border-radius: 50%;
  box-shadow: 0 4px 30px rgba(255,212,0,.3);
  transition: transform .3s ease;
}

.logo:hover { transform: scale(1.04); }

/* ── Info do programa ───────────────────────────────── */
.program-info { text-align: center; }

.on-air-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--red);
  margin-bottom: 6px;
  animation: pulse-badge 1.6s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

.program-name {
  font-size: 1.55rem;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.program-subtitle {
  margin-top: 4px;
  font-size: .82rem;
  color: var(--gray);
  letter-spacing: .03em;
}

/* ── Visualizador de ondas ──────────────────────────── */
.wave-visualizer {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 36px;
}

.wave-visualizer span {
  display: block;
  width: 4px;
  border-radius: 4px;
  background: var(--grad);
  height: 6px;
  opacity: .3;
  transition: height .15s ease, opacity .3s ease;
}

/* Ativo: barras animam */
.wave-visualizer.active span { opacity: 1; }

.wave-visualizer.active span:nth-child(1)  { animation: wave 1.0s ease-in-out .0s  infinite alternate; }
.wave-visualizer.active span:nth-child(2)  { animation: wave 1.0s ease-in-out .1s  infinite alternate; }
.wave-visualizer.active span:nth-child(3)  { animation: wave 1.0s ease-in-out .2s  infinite alternate; }
.wave-visualizer.active span:nth-child(4)  { animation: wave 1.0s ease-in-out .05s infinite alternate; }
.wave-visualizer.active span:nth-child(5)  { animation: wave 1.0s ease-in-out .25s infinite alternate; }
.wave-visualizer.active span:nth-child(6)  { animation: wave 1.0s ease-in-out .15s infinite alternate; }
.wave-visualizer.active span:nth-child(7)  { animation: wave 1.0s ease-in-out .3s  infinite alternate; }
.wave-visualizer.active span:nth-child(8)  { animation: wave 1.0s ease-in-out .08s infinite alternate; }
.wave-visualizer.active span:nth-child(9)  { animation: wave 1.0s ease-in-out .2s  infinite alternate; }

/* Carregando: todas iguais pulsando */
.wave-visualizer.loading span {
  opacity: .6;
  animation: wave-load 0.8s ease-in-out infinite alternate !important;
}

@keyframes wave {
  0%   { height: 5px; }
  100% { height: 32px; }
}

@keyframes wave-load {
  0%   { height: 5px; }
  100% { height: 20px; }
}

/* ── Barra de status ────────────────────────────────── */
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: var(--gray);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray);
  transition: background .4s ease;
  flex-shrink: 0;
}

/* Estados do dot */
.status-dot.idle       { background: var(--gray); }
.status-dot.loading    { background: var(--yellow); animation: blink .6s ease infinite; }
.status-dot.connecting { background: var(--yellow); animation: blink .4s ease infinite; }
.status-dot.playing    { background: #00E676; animation: none; }
.status-dot.error      { background: var(--red); animation: none; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .2; }
}

/* ── Botão Play/Stop ────────────────────────────────── */
.play-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 20px rgba(227,27,35,.45),
    0 0 0 0 rgba(255,212,0,.4);
  transition: transform .15s ease, box-shadow .2s ease;
  outline: none;
}

.play-btn:hover {
  transform: scale(1.07);
  box-shadow:
    0 6px 28px rgba(227,27,35,.6),
    0 0 0 0 rgba(255,212,0,.4);
}

.play-btn:active { transform: scale(.96); }

.play-btn.playing {
  animation: ripple 2s ease infinite;
}

@keyframes ripple {
  0%   { box-shadow: 0 4px 20px rgba(227,27,35,.45), 0 0 0 0   rgba(255,212,0,.5); }
  70%  { box-shadow: 0 4px 20px rgba(227,27,35,.45), 0 0 0 18px rgba(255,212,0,0); }
  100% { box-shadow: 0 4px 20px rgba(227,27,35,.45), 0 0 0 0   rgba(255,212,0,0); }
}

.play-btn svg {
  width: 32px;
  height: 32px;
  fill: var(--white);
  stroke: none;
}

/* ícone de stop usa stroke */
.icon-stop {
  fill: var(--white) !important;
}

/* ── Controle de volume ─────────────────────────────── */
.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.vol-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--gray);
  stroke-width: 2;
  flex-shrink: 0;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(255,255,255,.12);
  outline: none;
  cursor: pointer;
  background-image: var(--grad);
  background-size: calc(var(--vol, 80) * 1%) 100%;
  background-repeat: no-repeat;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 6px rgba(255,212,0,.6);
  cursor: pointer;
}

/* ── Info de reconexão ──────────────────────────────── */
.reconnect-info {
  font-size: .72rem;
  color: var(--yellow);
  min-height: 16px;
  text-align: center;
  letter-spacing: .03em;
}

/* ── Responsivo ─────────────────────────────────────── */
@media (max-width: 480px) {
  .player-wrapper { padding: 32px 28px 28px; }
  .program-name   { font-size: 1.3rem; }
  .logo           { width: 110px; height: 110px; }
}
