:root {
  --bg-bar: rgba(14, 14, 18, 0.94);
  --border-color: rgba(255, 255, 255, 0.1);
  --station-theme: #e11d48;
  --station-glow: rgba(225, 29, 72, 0.45);
  --text-main: #f9fafb;
  --text-muted: #a1a1aa;
  --live-red: #ef4444;
  --green-status: #10b981;
  --font-display: 'Outfit', -apple-system, sans-serif;
  --font-sans: 'Inter', -apple-system, sans-serif;

  /* Cores Neon - Radio Resenha / PapoResenha */
  --neon-orange: #ff5e00;
  --neon-cyan: #00f0ff;
  --neon-purple: #a855f7;
  --neon-dark: #0e0e12;
}

*, *:before, *:after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* PREVENÇÃO DE ROLAGEM HORIZONTAL E RESPONSIVIDADE BASE */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
  background-color: #09090b;
  color: var(--text-main);
  font-family: var(--font-sans);
}

img, video, iframe {
  max-width: 100%;
}

/* SCROLLBAR MODERNA EM LARANJA NEON */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(14, 14, 18, 0.6);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--neon-orange), #ff2e00);
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(255, 94, 0, 0.5);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ff7a28, var(--neon-orange));
  box-shadow: 0 0 12px rgba(255, 94, 0, 0.8);
}

/* Suporte Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--neon-orange) rgba(14, 14, 18, 0.6);
}

/* IMPEDE ZOOM AUTOMÁTICO EM CAMPOS DE DIGITAÇÃO NO MOBILE */
input, select, textarea {
  font-size: 16px !important;
  touch-action: manipulation;
}

.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100vw;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Utilitários de Estilo Adicionais */
.glass-box {
  background: rgba(18, 18, 23, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.bg-neon-dark { background-color: var(--neon-dark); }
.text-neon-orange { color: var(--neon-orange); }
.text-neon-cyan { color: var(--neon-cyan); }
.text-neon-purple { color: var(--neon-purple); }

.gradient-orange {
  background: linear-gradient(135deg, #ff5e00, #ff2e00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-cyan {
  background: linear-gradient(135deg, #00f0ff, #00a8ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* BARRA FIXA TOP BAR (100% LARGURA) */
.radio-top-bar {
  width: 100%;
  max-width: 100vw;
  height: 80px;
  background: var(--bg-bar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  flex-shrink: 0;
}

/* CANVAS EQUALIZADOR DE ONDAS */
canvas#bgEqualizer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
}

/* CONTEÚDO DO PLAYER */
.player-left, .player-right {
  position: relative;
  z-index: 2;
}

/* SEÇÃO ESQUERDA: PLAY + CAPA + INFOS */
.player-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  color: #0d0d0e;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.play-btn:hover {
  transform: scale(1.08);
  background: #ffffff;
  box-shadow: 0 0 22px var(--station-glow);
  color: var(--station-theme);
}

.cover-art-wrapper {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.cover-art {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s ease, border-color 0.5s ease;
}

.cover-art-wrapper:hover .cover-art {
  transform: scale(1.05);
  border-color: var(--station-theme);
}

.info-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex-grow: 1;
}

.station-header-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.station-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mode-badge {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.mode-badge.live-dj {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.track-details {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 0 18px var(--station-glow);
  transition: text-shadow 0.5s ease;
}

.sub-details {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

.sub-details span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* BOTÃO PEDIR MÚSICA NA BARRA */
.request-song-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.request-song-btn:hover {
  background: var(--station-theme);
  border-color: var(--station-theme);
  box-shadow: 0 0 10px var(--station-glow);
  transform: translateY(-1px);
}

/* SEÇÃO DIREITA: ORGANIZADA EM COLUNA */
.player-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
}

.controls-top-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* BADGE LIVE MODERNO COM ANTENA E MUDANÇA DE COR */
.live-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.live-badge.online {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.live-badge.online .antenna-icon { stroke: #10b981; }
.live-badge.online .signal-wave { animation: signalPulse 1.4s infinite ease-in-out; }

.live-badge.offline {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

.live-badge.offline .antenna-icon { stroke: #ef4444; }
.live-badge.offline .signal-wave { opacity: 0.25; animation: none; }

@keyframes signalPulse {
  0% { opacity: 0.3; }
  50% { opacity: 1; filter: drop-shadow(0 0 4px #10b981); }
  100% { opacity: 0.3; }
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.2s;
}

.volume-btn:hover { color: var(--text-main); }

.volume-slider {
  -webkit-appearance: none;
  width: 70px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-main);
  cursor: pointer;
  transition: transform 0.15s, background 0.3s;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background: var(--station-theme);
}

/* SELECT DAS ESTAÇÕES */
.station-select-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.station-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 5px 28px 5px 10px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-select:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--station-theme);
  box-shadow: 0 0 12px var(--station-glow);
}

.station-select option {
  background: #18181b;
  color: #ffffff;
  font-family: var(--font-sans);
}

.select-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* MODAL DE PEDIDOS DE MÚSICA E GENÉRICOS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: #121217;
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 520px;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--station-glow);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-modal-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}

.close-modal-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.search-box {
  position: relative;
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 12px 16px 12px 42px;
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.3s;
}

.search-input:focus {
  border-color: var(--station-theme);
  box-shadow: 0 0 10px var(--station-glow);
}

.search-icon-inside {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.song-results-list {
  overflow-y: auto;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.song-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 14px;
  border-radius: 10px;
  gap: 12px;
  transition: background 0.2s;
}

.song-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.song-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.song-item-art {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
}

.song-item-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.song-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-item-artist {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.send-request-btn {
  background: var(--station-theme);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.send-request-btn:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

.send-request-btn.success {
  background: var(--green-status) !important;
  cursor: default;
}

.send-request-btn.error {
  background: var(--live-red) !important;
  cursor: default;
}

.no-results {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* RESPONSIVIDADE MOBILE */
@media (max-width: 768px) {
  .radio-top-bar { 
    padding: 0 12px; 
    gap: 10px;
  }
  .player-left {
    gap: 10px;
  }
  .cover-art-wrapper {
    width: 46px;
    height: 46px;
  }
  .play-btn {
    width: 42px;
    height: 42px;
  }
  .track-details { font-size: 0.85rem; }
  .sub-details { display: none; }
  #chat-viewport { 
      margin: 0 !important; 
      border-radius: 0 !important; 
      border: none !important;
  }
}

/* AJUSTES DE DISPLAY PARA DISPOSITIVOS MÓVEIS PEQUENOS */
@media (max-width: 520px) {
  .volume-container { 
      display: none !important; 
  }
  .live-badge { 
      display: flex !important; 
      padding: 3px 6px;
      font-size: 0.65rem;
  }
  .station-select {
      font-size: 0.75rem;
      padding-left: 6px;
  }
}