@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;800&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons+Round');

:root {
  --app-bg: #FFD700;       
  --app-text: #000000;
  --card-bg: #111111;
  --white: #FFFFFF;
  
  /* VARIÁVEIS DE SEGURANÇA (SAFE AREA) */
  --safe-top: env(safe-area-inset-top, 20px);
  --safe-bottom: env(safe-area-inset-bottom, 20px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--app-bg);
  color: var(--app-text);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  padding: 0;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ================= SPLASH DE CARREGAMENTO ================= */

.boot-splash {
  position: fixed;
  inset: 0;
  z-index: 20000;
  overflow: hidden;
  background: #000;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.boot-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-splash-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  animation: boot-image-fade 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes boot-image-fade {
  from {
    opacity: 0;
    transform: scale(1.08);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}


.boot-splash-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.5) 100%);
}

.boot-splash-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(24px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}

.boot-splash-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #FFD700;
  animation: boot-splash-spin 0.85s linear infinite;
}

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

/* ================= MENU UNIFICADO (CÁPSULA) ================= */

.floating-menu-container {
  position: fixed; 
  /* ALINHAMENTO IGUAL AO CHAT */
  bottom: calc(30px + var(--safe-bottom)); 
  left: calc(20px + var(--safe-left));
  
  z-index: 9999;
  display: flex;
  
  /* Itens abrem para CIMA */
  flex-direction: column-reverse; 
  
  /* MUDANÇA: 'center' para alinhar os botões menores com o centro da cápsula */
  align-items: center; 
  gap: 15px;
}

/* BOTÃO CÁPSULA (Hambúrguer + Avatar) */
.menu-toggle-btn {
  width: auto;             /* Largura ajustável */
  height: 56px;            /* Altura confortável */
  padding: 5px 6px 5px 16px; /* Padding assimétrico: Mais espaço na esquerda */
  
  border-radius: 35px;     /* Formato de Pílula */
  background: #000000;
  border: 2px solid rgba(255, 215, 0, 0.4); /* Borda dourada sutil */
  color: #FFF;
  
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;               /* Espaço entre o ícone Menu e o Avatar */
  
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
  cursor: pointer;
  z-index: 102;
  transition: all 0.2s ease;
}

.menu-toggle-btn:active {
  transform: scale(0.96);
  background: #111;
}

/* Ícone Hambúrguer (Esquerda) */
.hamburger-icon {
    font-size: 22px;
    color: #FFF;
    opacity: 1;
}

/* Container Redondo do Avatar (Direita) */
.menu-user-avatar {
    width: 42px;
    height: 42px;
    background: #222;       /* Fundo cinza escuro */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #FFD700; /* Borda fina dourada no avatar */
}

/* Ícone Padrão (Account) - Ajustado para parecer um placeholder elegante */
#menu-default-icon {
    font-size: 44px;    /* Grande para preencher */
    color: #666;        /* Cinza */
    margin-top: 8px;    /* Desce um pouco para focar no "ombro/cabeça" */
}

/* Imagem do Avatar (Se tiver) */
#menu-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Dropdown de itens (Abrindo para CIMA) */
.menu-items-wrapper {
  display: flex;
  flex-direction: column-reverse; 
  gap: 12px;
  padding-bottom: 5px;
  
  opacity: 0;
  visibility: hidden;
  
  transform: translateY(20px); 
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 101;
  
  /* Garante que os itens internos fiquem centralizados */
  align-items: center; 
}

.floating-menu-container.menu-active .menu-items-wrapper {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Botões Pequenos do Dropdown */
.mini-fab {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFF;
  color: #000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  position: relative; 
  transition: transform 0.2s;
}

.mini-fab:active {
  background: var(--app-bg);
  transform: scale(0.95);
}

/* Legendas */
.fab-label {
  position: absolute;
  left: 55px; 
  bottom: 8px; 
  background: #000;
  color: #FFF;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  pointer-events: none; 
}

.fab-label::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-right: 4px solid #000;
}

/* Removemos o widget antigo de pontos */
.points-display { display: none !important; }
.capsule-points-area { display: none !important; }

/* ================= LOGO CENTRAL NO HEADER (LIVRE) ================= */
.header-center-logo {
  position: absolute;
  top: calc(15px + var(--safe-top)); 
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  height: 70px; 
  
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none; 
}

.header-center-logo img {
  height: 100%; 
  width: auto;  
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2)); 
}

/* Camada escura e desfocada */
.menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4); 
  backdrop-filter: blur(8px); 
  -webkit-backdrop-filter: blur(8px); 
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 9000; 
}

.floating-menu-container.menu-active ~ .menu-backdrop {
  opacity: 1;
  visibility: visible;
}

/* ================= HOME SCREEN (ADAPTATIVA) ================= */

#screen-home {
  padding-top: calc(110px + var(--safe-top)) !important; 
  padding-bottom: calc(20px + var(--safe-bottom)) !important;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  justify-content: flex-start; 
  overflow-y: auto; 
}

#screen-home::-webkit-scrollbar {
  display: none;
}

/* ================= RESTO DO APP ================= */

.station-selector-container {
  margin-bottom: 25px; 
  text-align: center;
}

.station-buttons {
  display: flex;
  background: #000;
  padding: 5px;
  border-radius: 30px;
  max-width: 280px;
  margin: 0 auto;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.station-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #777;
  padding: 12px 0;
  border-radius: 25px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
}

.station-btn.active-station {
  background: var(--app-bg);
  color: #000;
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

/* Player Container (Ajustado) */
.big-player-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px; 
}

/* Player Disc (Reduzido para 140px) */
.player-disc {
  width: 140px;  
  height: 140px; 
  border-radius: 50%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 15px 40px rgba(0,0,0,0.3); 
  margin-bottom: 15px; 
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent; 
  transition: transform 0.1s ease-in-out, box-shadow 0.2s ease;
}

.player-disc:active {
  transform: scale(0.97);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Disc Inner (Reduzido para 110px) */
.disc-inner {
  width: 110px; 
  height: 110px;
  border-radius: 50%;
  background: var(--app-bg); 
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2; 
  overflow: hidden; 
  box-shadow: inset 0 0 15px rgba(0,0,0,0.1); 
}

/* Ícone Player (Reduzido para 40px) */
.player-icon {
  color: #000;
  position: absolute;
  z-index: 5;
  font-size: 40px !important; 
}

.player-info {
  text-align: center;
  margin-bottom: 10px;
}

/* Título da Rádio (Reduzido para 18px) */
.player-info h2 {
  font-size: 18px; 
  font-weight: 800;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.player-info p {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.pulse-ring {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  border: 3px solid rgba(0,0,0,0.8); 
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.playing .pulse-ring {
  animation: pulseOuter 1.8s infinite ease-out;
}

.internal-waves {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 3;
}

.i-wave {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid rgba(0,0,0,0.2); 
  opacity: 0;
}

.playing .iw-1 {
  animation: pulseInner 1.2s infinite ease-out;
}

.playing .iw-2 {
  animation: pulseInner 1.2s infinite ease-out 0.4s; 
}

@keyframes pulseOuter {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes pulseInner {
  0% { width: 80%; height: 80%; opacity: 0.8; border-width: 5px; }
  100% { width: 120%; height: 120%; opacity: 0; border-width: 1px;}
}

#screen-login {
  display: flex; 
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.login-container {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  text-align: center;
  padding: 20px;
}

.app-logo {
  width: 120px;
  height: auto;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.login-header h2 {
  font-weight: 800;
  font-size: 24px;
  margin-bottom: 5px;
  color: #000;
}

.login-header p {
  font-size: 14px;
  color: #444;
  margin-bottom: 30px;
  font-weight: 600;
}

.input-group {
  position: relative;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.input-group.hidden {
  display: none;
}

.input-group input {
  width: 100%;
  padding: 15px 15px 15px 45px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: #FFF;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  outline: none;
  transition: border 0.3s;
}

.input-group input:focus {
  border-color: #000;
}

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 20px;
}

.forgot-pass-container {
  text-align: right;
  margin-bottom: 15px;
  margin-top: -5px;
}

.forgot-pass-container.hidden {
  display: none;
}

#btn-forgot {
  color: #000;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

#btn-forgot:hover {
  opacity: 1;
  text-decoration: underline;
}

.btn-primary {
  width: 100%;
  padding: 15px;
  border-radius: 12px;
  background: #000;
  color: var(--app-bg); 
  border: none;
  font-weight: 800;
  font-size: 16px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-google {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: #FFF;
  color: #333;
  border: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.divider {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  opacity: 0.5;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #000;
}
.divider span {
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.toggle-text {
  margin-top: 25px;
  font-size: 13px;
  font-weight: 600;
}

#btn-toggle-mode {
  background: none;
  border: none;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
  color: #000;
  margin-left: 5px;
  font-family: inherit;
}

.btn-skip {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  background: transparent;     
  border: 2px solid #000;      
  color: #000;                 
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 1;                 
}

.btn-skip:active {
  background: #000;
  color: #FFD700; 
  transform: scale(0.98);
}

/* ================= BANNERS (SLIDER) ================= */
.banners-container {
  width: 100%;
  max-width: 340px; 
  margin: 0 auto;
  margin-top: 10px;   
  margin-bottom: 15px; 
  overflow: hidden;
  border-radius: 15px; 
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.banners-wrapper {
  display: flex;
  width: 100%;
  overflow-x: auto; 
  scroll-snap-type: x mandatory; 
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; 
}

.banners-wrapper::-webkit-scrollbar {
  display: none; 
}

.banner-item {
  min-width: 100%; 
  position: relative;
  aspect-ratio: 1080 / 400; 
  background-color: #000;
  scroll-snap-align: center;
}

.banner-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; 
  display: block;
}

/* ================= NOVO WIDGET: MEUS PONTOS ================= */
.home-points-widget {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    margin-bottom: 15px; /* Espaço para o chat abaixo */
    
    background: #000000;
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 15px;
    padding: 15px;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.home-points-widget:active {
    transform: scale(0.98);
    background: #111;
}

.points-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 5px;
}

.points-value {
    font-size: 24px;
    font-weight: 800;
    color: #FFF;
    display: flex;
    align-items: center;
}

/* ================= CHAT FLUTUANTE ALINHADO ================= */

/* Botão de Chat (Agora fixado na mesma linha do menu) */
.fab-chat-btn {
  position: fixed;
  /* ALINHAMENTO IGUAL AO MENU */
  bottom: calc(30px + var(--safe-bottom)); 
  right: calc(20px + var(--safe-right));
  
  width: fit-content;
  min-width: 0;
  max-width: none;
  height: 56px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  background: #000000;   
  color: var(--app-bg);  
  border: 2px solid rgba(255, 215, 0, 0.22); 
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.34);
  z-index: 1000;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  text-transform: none;
  font-size: 15px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  flex: none;
}

/* Caso especial: Inline Mode (Mantivemos a classe caso use em outro lugar, mas na Home vai usar position fixed acima) */
.fab-chat-btn.inline-mode {
  /* Vamos forçar ele a se comportar como fixed na Home Screen se estiver fora do fluxo normal, 
     ou podemos removê-lo do fluxo HTML e deixar o CSS controlar.
     No HTML atual, ele está "solto" no final da section home.
     O estilo acima (.fab-chat-btn) já garante o position fixed. 
     Vamos resetar styles inline que possam atrapalhar. */
  margin: 0;
  transform: none;
  width: fit-content;
  min-width: 0;
  max-width: none;
}

.fab-chat-btn:hover {
  transform: translateY(-5px); 
  box-shadow: 0 14px 34px rgba(0,0,0,0.42);
  background: #111;
}

.fab-chat-btn .material-icons-round {
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
}

.fab-chat-btn .fab-label-text {
  line-height: 1;
  display: inline-block;
  flex: 0 0 auto;
}

/* ================= TELA DE PERFIL ================= */

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  
  /* Ajuste de topo para Perfil */
  padding-top: calc(30px + var(--safe-top)); 
}

.screen-header h2 {
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-icon-back {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  color: #000;
  border-radius: 50%;
  transition: background 0.2s;
}

.btn-icon-back:active {
  background: rgba(0,0,0,0.1);
}

.profile-content {
  padding: 0 20px 40px 20px;
  overflow-y: auto;
  height: calc(100vh - 100px);
}

.profile-card-main {
  background: #111;
  color: #FFF;
  border-radius: 25px;
  padding: 30px 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  margin-bottom: 25px;
  position: relative;
}

.profile-avatar-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 15px auto;
}

.profile-avatar-wrapper img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--app-bg); 
}

.btn-edit-avatar {
  position: absolute;
  bottom: 0;
  right: 0;
  background: #FFF;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.btn-edit-avatar .material-icons-round {
  font-size: 16px;
  color: #000;
}

.profile-card-main h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--app-bg);
}

.profile-card-main p {
  font-size: 13px;
  opacity: 0.6;
  margin-bottom: 25px;
}

.profile-stats-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  border-top: 1px solid #333;
  padding-top: 20px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.stat-box .material-icons-round {
  color: var(--app-bg);
  font-size: 20px;
  margin-bottom: 5px;
}

.stat-box strong {
  font-size: 18px;
  font-weight: 800;
}

.stat-box small {
  font-size: 10px;
  text-transform: uppercase;
  opacity: 0.5;
  margin-top: 2px;
}

.profile-form-container label {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
  margin-left: 5px;
  text-transform: uppercase;
}

.input-group.dark-theme input {
  background: #FFF;
  border: 2px solid #000;
  color: #000;
}

.input-group.dark-theme.disabled input {
  background: #e0e0e0; 
  border-color: transparent;
  color: #555;
}

.btn-logout-outline {
  width: 100%;
  padding: 15px;
  margin-top: 15px;
  background: transparent;
  border: 2px solid #d32f2f;
  color: #d32f2f;
  border-radius: 12px;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout-outline:active {
  background: #d32f2f;
  color: #FFF;
}
