/* =========================================
   RÁDIO POSTO DA PONTE — Design System
   ========================================= */

/* --- Variáveis --- */
:root {
  --azul-escuro: #001F3F;
  --azul-medio: #0052A5;
  --azul-claro: #4FC3F7;
  --laranja: #FF6B00;
  --amarelo: #FFD700;
  --branco: #FFFFFF;
  --branco-70: rgba(255,255,255,0.7);
  --branco-20: rgba(255,255,255,0.12);
  --branco-10: rgba(255,255,255,0.07);
  --sombra: rgba(0,0,0,0.5);

  --glass-bg: rgba(0, 31, 63, 0.55);
  --glass-border: rgba(79, 195, 247, 0.25);
  --glass-blur: blur(20px);

  --grad-laranja: linear-gradient(135deg, #FF6B00, #FFD700);
  --grad-azul: linear-gradient(135deg, #001F3F, #0052A5);
  --grad-glow: 0 0 30px rgba(255, 107, 0, 0.35);

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-full: 999px;

  --font-main: 'Outfit', 'Inter', sans-serif;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--azul-escuro);
  color: var(--branco);
  min-height: 100dvh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: var(--font-main); }

/* --- Background --- */
.bg-overlay {
  position: fixed;
  inset: 0;
  background: url('assets/bg.jpg') center center / cover no-repeat;
  z-index: -2;
}
.bg-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,15,40,0.82) 0%,
    rgba(0,31,63,0.75) 40%,
    rgba(0,15,40,0.90) 100%
  );
}

/* --- Partículas decorativas --- */
.particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  animation: floatParticle linear infinite;
}
@keyframes floatParticle {
  0% { transform: translateY(110vh) scale(0.5); opacity: 0; }
  10% { opacity: 0.2; }
  90% { opacity: 0.15; }
  100% { transform: translateY(-10vh) scale(1.2); opacity: 0; }
}

/* --- Layout Principal --- */
.app-container {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 32px;
  max-width: 480px;
  margin: 0 auto;
  gap: 18px;
}

/* --- Glassmorphism --- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  width: 100%;
}

/* --- Cabeçalho --- */
.header { width: 100%; }
.header-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
}
.header-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(255,107,0,0.5));
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%,100% { filter: drop-shadow(0 0 12px rgba(255,107,0,0.5)); }
  50% { filter: drop-shadow(0 0 22px rgba(255,215,0,0.7)); }
}
.header-text { display: flex; flex-direction: column; gap: 4px; }
.radio-name {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--branco), var(--azul-claro));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.radio-tagline {
  font-size: 0.7rem;
  font-weight: 600;
  color: #FF4444;
  letter-spacing: 2px;
  animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- Main --- */
.main { display: flex; flex-direction: column; gap: 18px; width: 100%; }

/* --- Player Card --- */
.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 24px 22px;
  gap: 18px;
  position: relative;
  overflow: hidden;
}
.player-card::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,107,0,0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* Album art */
.album-art-wrapper { position: relative; }
.album-art {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 3px solid transparent;
  background: linear-gradient(var(--glass-bg), var(--glass-bg)) padding-box,
              var(--grad-laranja) border-box;
  box-shadow: 0 0 0 6px rgba(255,107,0,0.1), 0 8px 30px rgba(0,0,0,0.5);
  transition: box-shadow 0.4s;
}
.album-art.playing {
  animation: spinAlbum 12s linear infinite;
  box-shadow: 0 0 0 6px rgba(255,107,0,0.25), 0 0 40px rgba(255,107,0,0.35), 0 8px 30px rgba(0,0,0,0.5);
}
@keyframes spinAlbum {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.album-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.album-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255,107,0,0.5);
  animation: pulseRing 2s ease-out infinite;
  opacity: 0;
}
.album-art.playing .album-pulse { opacity: 1; }
@keyframes pulseRing {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* Track info */
.track-info { text-align: center; width: 100%; }
.track-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--branco);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 10px;
}
.track-artist {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--azul-claro);
  margin-top: 4px;
}

/* Waveform */
.waveform-container {
  width: 100%;
  height: 50px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
#waveformCanvas { display: none; }
.waveform-bars {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 40px;
}
.waveform-bars span {
  display: block;
  width: 4px;
  border-radius: 99px;
  background: var(--grad-laranja);
  height: 6px;
  transition: height 0.1s;
}
.waveform-bars.active span {
  animation: waveAnim 0.8s ease-in-out infinite alternate;
}
.waveform-bars.active span:nth-child(1)  { animation-delay: 0.00s; }
.waveform-bars.active span:nth-child(2)  { animation-delay: 0.05s; }
.waveform-bars.active span:nth-child(3)  { animation-delay: 0.10s; }
.waveform-bars.active span:nth-child(4)  { animation-delay: 0.15s; }
.waveform-bars.active span:nth-child(5)  { animation-delay: 0.20s; }
.waveform-bars.active span:nth-child(6)  { animation-delay: 0.25s; }
.waveform-bars.active span:nth-child(7)  { animation-delay: 0.30s; }
.waveform-bars.active span:nth-child(8)  { animation-delay: 0.35s; }
.waveform-bars.active span:nth-child(9)  { animation-delay: 0.40s; }
.waveform-bars.active span:nth-child(10) { animation-delay: 0.45s; }
.waveform-bars.active span:nth-child(11) { animation-delay: 0.40s; }
.waveform-bars.active span:nth-child(12) { animation-delay: 0.35s; }
.waveform-bars.active span:nth-child(13) { animation-delay: 0.30s; }
.waveform-bars.active span:nth-child(14) { animation-delay: 0.25s; }
.waveform-bars.active span:nth-child(15) { animation-delay: 0.20s; }
.waveform-bars.active span:nth-child(16) { animation-delay: 0.15s; }
.waveform-bars.active span:nth-child(17) { animation-delay: 0.10s; }
.waveform-bars.active span:nth-child(18) { animation-delay: 0.05s; }
.waveform-bars.active span:nth-child(19) { animation-delay: 0.00s; }
.waveform-bars.active span:nth-child(20) { animation-delay: 0.05s; }

@keyframes waveAnim {
  0%  { height: 4px; }
  100% { height: 36px; }
}

/* Botão Play */
.controls { display: flex; justify-content: center; }
.btn-play {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--grad-laranja);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(255,107,0,0.5), var(--grad-glow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-play:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(255,107,0,0.7); }
.btn-play:active { transform: scale(0.96); }
.btn-play svg { width: 30px; height: 30px; color: white; z-index: 1; }
.btn-play-ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transform: scale(0);
  transition: transform 0.4s, opacity 0.4s;
  opacity: 0;
}
.btn-play:active .btn-play-ripple { transform: scale(2); opacity: 0; }

/* Volume */
.volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.vol-icon { width: 18px; height: 18px; color: var(--azul-claro); flex-shrink: 0; }
.vol-label { font-size: 0.72rem; color: var(--branco-70); min-width: 32px; text-align: right; }
.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(to right, var(--laranja) 0%, var(--laranja) var(--val, 80%), rgba(255,255,255,0.2) var(--val, 80%));
  outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--grad-laranja);
  box-shadow: 0 0 8px rgba(255,107,0,0.5);
  cursor: pointer;
  transition: transform 0.2s;
}
.volume-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* Status */
.stream-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--branco-70);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #888;
  transition: background 0.4s;
}
.status-dot.connected { background: #00D26A; animation: blink 1.5s infinite; }
.status-dot.error { background: #FF4444; }

/* --- Card de Identidade do Posto --- */
.info-card {
  padding: 22px 22px 18px;
  border: 1px solid rgba(255,107,0,0.3);
  position: relative;
  overflow: hidden;
}
.info-card::before {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(255,107,0,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.info-card-header {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.info-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--amarelo);
  background: rgba(255,215,0,0.1);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,215,0,0.25);
}
.info-items { display: flex; flex-direction: column; gap: 12px; }
.info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.info-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.info-text { font-size: 0.9rem; color: var(--branco-70); font-weight: 400; line-height: 1.4; }
.info-slogan {
  font-style: italic;
  color: var(--azul-claro);
  font-weight: 500;
}
.info-link {
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity 0.2s;
}
.info-link:hover { opacity: 0.8; }
.info-link .info-text { color: var(--laranja); font-weight: 600; }

.info-exclusive {
  margin-top: 16px;
  text-align: center;
}
.exclusive-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 3px;
  background: var(--grad-laranja);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Rodapé --- */
.footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 4px;
}

/* Redes Sociais */
.social-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.social-btn {
  width: 50px; height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(10px);
}
.social-btn svg { width: 22px; height: 22px; }
.social-btn:hover { transform: translateY(-3px) scale(1.1); }

.social-instagram {
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  color: white;
  box-shadow: 0 4px 15px rgba(253,29,29,0.35);
}
.social-whatsapp {
  background: #25D366;
  color: white;
  box-shadow: 0 4px 15px rgba(37,211,102,0.35);
}
.social-facebook {
  background: #1877F2;
  color: white;
  box-shadow: 0 4px 15px rgba(24,119,242,0.35);
}

/* Botão Instalar */
.btn-install {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  background: var(--grad-laranja);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 20px rgba(255,107,0,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
  justify-content: center;
}
.btn-install:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(255,107,0,0.65); }
.btn-install:active { transform: scale(0.97); }
.btn-install svg { width: 20px; height: 20px; }

.footer-copy {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  text-align: center;
}
.footer-copy a {
  color: var(--azul-claro);
  opacity: 0.6;
  transition: opacity 0.2s;
}
.footer-copy a:hover { opacity: 1; }

/* --- Responsivo tablet+ --- */
@media (min-width: 480px) {
  .app-container { padding: 28px 24px 40px; }
  .radio-name { font-size: 1.4rem; }
  .album-art { width: 190px; height: 190px; }
  .btn-play { width: 82px; height: 82px; }
}

/* --- Animações de entrada --- */
.glass-card {
  animation: fadeUp 0.5s ease both;
}
.header .glass-card { animation-delay: 0.05s; }
.player-card { animation-delay: 0.15s; }
.info-card { animation-delay: 0.25s; }
.footer { animation: fadeUp 0.5s 0.35s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
