/* ============================================================
   SINTONÍA EN EL AULA – Beautiful Radio Player
   ============================================================ */

/* ── Floating Player Container ── */
.player-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  width: 360px;
  background: rgba(8, 8, 20, 0.94);
  backdrop-filter: blur(28px) saturate(1.5);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow:
    0 28px 60px rgba(0,0,0,.55),
    0 0 0 1px rgba(255,255,255,0.04),
    inset 0 1px 0 rgba(255,255,255,0.08);
  overflow: hidden;
  transition: all 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Rainbow gradient top line */
.player-float::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    #7C3AED 0%,
    #EC4899 22%,
    #F59E0B 44%,
    #10B981 66%,
    #3B82F6 88%,
    #7C3AED 100%
  );
  background-size: 200% 100%;
  animation: rainbow-slide 3s linear infinite;
  z-index: 2;
}

@keyframes rainbow-slide {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* Hidden state */
.player-float.hidden {
  transform: translateY(130%) scale(0.88);
  opacity: 0;
  pointer-events: none;
}

/* ── Inner Layout ── */
.player-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem 1.15rem 1rem;
  position: relative;
}

/* ── Spinning Logo ── */
.player-logo-wrap {
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
}

.player-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  border: 2px solid rgba(255,255,255,0.12);
  display: block;
}

/* Spinning ring around logo */
.player-logo-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: #10B981;
  border-right-color: #7C3AED;
  border-bottom-color: #EC4899;
  animation: spin-ring 2.4s linear infinite;
  z-index: 0;
}

.player-logo-ring.paused { animation-play-state: paused; }

@keyframes spin-ring {
  to { transform: rotate(360deg); }
}

/* ── Station Info ── */
.player-info {
  min-width: 0;
}

.player-name {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: #F1F5F9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.player-live-row {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin-top: 0.18rem;
}

.live-dot-anim {
  width: 7px;
  height: 7px;
  background: #EF4444;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse-dot 1.4s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(239,68,68,0.8);
}

@keyframes pulse-dot {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.45; transform:scale(.6); }
}

#playerStatus {
  font-size: 0.68rem;
  color: #64748B;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Visualizer ── */
.player-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 20px;
  margin-top: 0.35rem;
}

.player-visualizer span {
  width: 3px;
  border-radius: 3px 3px 0 0;
  animation: vis-bar 0.75s ease-in-out infinite;
  flex-shrink: 0;
}

.player-visualizer span:nth-child(1){ height:8px;  background:#7C3AED; animation-delay:0s; }
.player-visualizer span:nth-child(2){ height:15px; background:#EC4899; animation-delay:.1s; }
.player-visualizer span:nth-child(3){ height:10px; background:#F59E0B; animation-delay:.2s; }
.player-visualizer span:nth-child(4){ height:18px; background:#10B981; animation-delay:.3s; }
.player-visualizer span:nth-child(5){ height:7px;  background:#3B82F6; animation-delay:.4s; }
.player-visualizer span:nth-child(6){ height:13px; background:#F97316; animation-delay:.5s; }

@keyframes vis-bar {
  0%,100% { transform: scaleY(1); }
  50%     { transform: scaleY(0.2); }
}

.player-visualizer.paused span { animation-play-state: paused; }

/* ── Controls ── */
.player-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.player-btn-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16,185,129,.45), 0 0 0 0 rgba(16,185,129,.3);
  transition: all 0.22s ease;
  position: relative;
}

.player-btn-play:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(16,185,129,.55);
}

.player-btn-play.playing {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  box-shadow: 0 4px 16px rgba(239,68,68,.4);
  animation: play-pulse 2s ease-in-out infinite;
}

@keyframes play-pulse {
  0%,100% { box-shadow: 0 4px 16px rgba(239,68,68,.4), 0 0 0 0 rgba(239,68,68,.3); }
  50%     { box-shadow: 0 4px 16px rgba(239,68,68,.5), 0 0 0 8px rgba(239,68,68,0); }
}

.player-volume {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.player-volume i {
  color: #475569;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.vol-slider {
  width: 58px;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  transition: transform 0.15s;
}

.vol-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.player-btn-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
  transition: all 0.18s;
  background: none;
  border: none;
  cursor: pointer;
}

.player-btn-close:hover {
  color: white;
  background: rgba(255,255,255,0.1);
}

/* ── ON AIR badge overlay ── */
.player-on-air-badge {
  position: absolute;
  top: -1px;
  right: 14px;
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: white;
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 0.18rem 0.55rem;
  border-radius: 0 0 6px 6px;
  display: flex;
  align-items: center;
  gap: 0.28rem;
  animation: pulse-dot 1.4s ease-in-out infinite;
  z-index: 3;
}

/* ── Mobile player ── */
@media (max-width: 480px) {
  .player-float {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    bottom: 1rem;
    border-radius: 18px;
  }

  .vol-slider { display: none; }
  .player-volume i:first-child { display: none; }
}
