/* 1. BASE E FUNDO */
#root {
  padding-top: env(safe-area-inset-top);padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: black;
  margin: 0;
}

body { 
  margin: 0; 
  background-color: black; 
  overflow: hidden; 
  height: 100vh;
  height: -webkit-fill-available;
}

/* 2. ECRÃ DE LOGIN */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  text-align: center;
}

.logo-text {
  font-size: 3rem;
  color: #39FF14;
  text-shadow: 0 0 20px #39FF14;
}

.photo-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px dashed #39FF14;
  background-size: cover;
  background-position: center;
}

.neon-input {
  background: #1a1a1a;
  border: 2px solid #39FF14;
  padding: 15px;
  border-radius: 10px;
  color: white;
  width: 90%;max-width: 300px;
  text-align: center;
}

.enter-btn {
  background-color: #39FF14;
  color: black;
  padding: 15px 60px;
  font-weight: bold;
  border-radius: 10px;
  box-shadow: 0 0 15px #39FF14;
  cursor: pointer;
}

/* 3. FEED TIKTOK (VÍDEOS E FOTOS) */
.video-container {
  width: 100vw;
  height: 100vh;
  background-color: black;
  position: relative;
  overflow-y: scroll;
  scroll-snap-type: y mandatory; /* "Tranca" o vídeo no ecrã */
  scrollbar-width: none; /* Esconde a barra no PC */
}

.video-container::-webkit-scrollbar { display: none; } /* Esconde a barra no Chrome */

.content-box {
  width: 100vw;
  height: 100vh;
  scroll-snap-align: start; /* Define onde o scroll deve parar */
  scroll-snap-stop: always; /* Garante que não salta vídeos ao deslizar rápido */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: black;
}

.main-video, .main-photo {
  max-width: 100%; /* Nunca ultrapassa a largura do ecrã */
  max-height: 100%; /* Nunca ultrapassa a altura do ecrã */
  width: auto; /* Ajusta a largura proporcionalmente */
  height: auto; /* Ajusta a altura proporcionalmente */
  object-fit: contain; 
  background-color: black;
}
  

/* 4. ABAS DO TOPO (CANTO ESQUERDO) */
.feed-tabs {
  position: absolute;
  top: 50px;
  left: 25px;
  display: flex;
  gap: 20px;
  z-index: 100;
}

.tab-icon-box { color: white; opacity: 0.4; cursor: pointer; }

.tab-icon-box.active {
  color: #39FF14 !important;
  opacity: 1 !important;
  filter: drop-shadow(0 0 10px #39FF14);
}

.tab-icon-box.active svg { stroke: #39FF14 !important; }

/* 5. BARRA LATERAL E INFO */
.side-bar {
  position: fixed;
  right: 15px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  z-index: 10;
}

.action-btn { font-size: 30px; color: white; cursor: pointer; }

.video-info {
  position: absolute;
  left: 15px;
  bottom: 130px;
  color: white;
  z-index: 10;
}

/* 6. MENU INFERIOR */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 70px;
  background: black;
  border-top: 1px solid #333;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.upload-btn {
  background-color: #39FF14;
  color: black;
  width: 50px;
  height: 35px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  box-shadow: 0 0 15px #39FF14;
  cursor: pointer;
}

/* 7. SALDO E DINHEIRO */
.saldo-container {
  position: absolute;
  top: 50px;
  right: 25px;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 15px;
  border-radius: 20px;
  border: 1px solid #39FF14;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #39FF14;
  font-weight: bold;
  z-index: 100;
  cursor: pointer;
}

/* 8. JANELA NEON DE CARREGAMENTO */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999 !important; /* Este valor garante que ele tapa tudo o que estiver por trás */
}

.saldo-menu {
  background: #000;
  width: 80%;
  max-width: 350px;
  border: 2px solid #39FF14;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 0 25px rgba(57, 255, 20, 0.4);
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #39FF14;
}

.valores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.valor-btn {
  background: transparent;
  border: 1px solid #39FF14;
  color: #39FF14;
  padding: 12px 5px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
}

.valor-btn:hover {
  background: #39FF14;
  color: black;
}

/* 9. MENU DE COMENTÁRIOS (ESTILO TIKTOK) */
.comentarios-menu {
  background: #000;
  width: 100%;
  height: 60vh; /* Ocupa um pouco mais de metade do ecrã */
  position: absolute;
  bottom: 0;
  border-top: 2px solid #39FF14;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 20px rgba(57, 255, 20, 0.2);
}

.lista-comentarios {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 20px;
}

.input-comentario {
  display: flex;
  gap: 10px;
  padding-bottom: 20px;
}

.neon-input-chat {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #333;
  padding: 12px;
  border-radius: 10px;
  color: white;
  outline: none;
}

.neon-input-chat:focus {
  border-color: #39FF14;
}

.send-btn {
  background: #39FF14;
  color: black;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
}

/* AJUSTE DAS IMAGENS DOS PRESENTES */
.presentes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 por linha */
  gap: 15px;
  margin-top: 20px;
  overflow-y: auto;
  padding: 10px;
}

.presente-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.presente-item img {
  width: 60px;
  height: 60px;
  object-fit: contain; /* Não distorce a tua arte */
  margin-bottom: 5px;
  filter: drop-shadow(0 0 5px rgba(57, 255, 20, 0.3));
}

.presente-item p {
  color: white;
  font-size: 10px;
  margin: 0;
  font-weight: bold;
}

.presente-item small {
  color: #39FF14;
  font-size: 11px;
  font-weight: bold;
}

.presente-item:hover {
  transform: scale(1.1);
}

/* Estilo para o presente saltar no ecrã */
.contentor-presente {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px; /* Tamanho ideal para o telemóvel */
  z-index: 9999;
  pointer-events: none;
}

/* Nova animação: apenas entrada triunfal */
.animacao-entrada {
  animation: aparecer-presente 0.5s ease-out forwards;
}

@keyframes aparecer-presente {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.container-botao-live {
  position: absolute;
  top: 90px;
  left: 20px;
  z-index: 1000;
}

.btn-acao-live {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #00ff00;
  border-radius: 20px;
  padding: 1px 2px;
  color: #00ff00;
  cursor: pointer;
  box-shadow: 0 0 10px #39FF14;
  transition: all 0.3s ease;
  font-weight: bold;
}

.btn-acao-live.live-on {
  border-color: #ff4d4d;
  color: #ff4d4d;
  box-shadow: 0 0 15px #ff4d4d;
}

.texto-live {
  font-size: 12px;
  letter-spacing: 1px;
}

/* CHAT DA LIVE ESTILO TIKTOK - VERSÃO FINAL LIMPA */
.chat-live-overlay {
  position: absolute;
  bottom: 80px; /* Ajusta conforme o teu botão */
  left: 15px;
  right: 65px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  pointer-events: auto; /* <--- LIBERTADO PARA O DEDO MANDAR EM TUDO! */
}

.mensagens-scroll {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px; 
  overflow-y: auto !important; /* Força o aparecimento do scroll real */
  pointer-events: auto !important; /* Garante que o toque do dedo funciona */
  -webkit-overflow-scrolling: touch; /* Deixa o scroll super fluido no iOS/iPhone */
  padding-right: 5px;
}

.msg-item {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(5px);
  color: white;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  width: fit-content;
  max-width: 90%;
  border-left: 3px solid #39FF14;
  text-shadow: 1px 1px 2px black;
  margin-bottom: 2px;
}

.input-chat-live {
  display: flex;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 25px;
  padding: 5px;
  border: 1px solid #39FF14;
  pointer-events: auto;
}

.input-chat-live input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px 12px;
  color: white;
  outline: none;
}

.btn-enviar-live {
  background: #39FF14;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 10px #39FF14;
}

/* AJUSTE PARA A LIVE NÃO OCUPAR O ECRÃ TODO */
.ecra-live-principal {
  position: relative;
  width: 100%;
  max-width: 400px; /* Largura de um telemóvel */
  margin: 10px auto;
  height: 65vh;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid #39FF14;
  background: #000;
  z-index: 10;
}

.ecra-live-principal video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Corta o vídeo para caber no retângulo sem esticar */
}

.overlay-direto {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 0, 0, 0.8);
  color: white;
  padding: 4px 10px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 12px;
}

.side-bar {
  position: absolute !important;
  right: 15px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
}

.side-bar .action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60px;
}

/* ESTILO NEON PARA ALERTAS */
.neon-sistema {
  color: #39FF14 !important;
  font-weight: bold !important;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
  border-left-color: #ffffff !important;
}

/* RESOLUÇÃO DO BOTÃO DE PRESENTES DA LIVE */

/* 1. Alarga a margem direita do chat para desimpedir o canto do telemóvel */
.chat-live-overlay {
  right: 75px !important;
}

/* 2. Captura o botão de presente dentro do input e força-o a sair para a direita */
.input-chat-live button[style*="position: 'absolute'"],
.input-chat-live button:not(.btn-enviar-live) {
  position: absolute !important;
  right: -55px !important; /* Empurra o presente para fora da barra verde, para o espaço em branco */
  bottom: 4px !important;  /* Alinha horizontalmente com o centro da barra de escrita */
  margin: 0 !important;
  pointer-events: auto !important; /* Garante que o clique continua 100% ativo */
}

/* DESIGN NÉON DO BOTÃO DE MICROFONE DO ANFITRIÃO */
.btn-mic-live-neon {
  background: rgba(0, 0, 0, 0.65) !important;
  border: 1px solid #39FF14 !important; /* Linha de contorno verde néon */
  border-radius: 50% !important;        /* Força o botão a ser redondo */
  width: 40px !important;                 /* Tamanho ideal para o toque */
  height: 40px !important;
  font-size: 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.6) !important; /* Brilho néon */
  transition: all 0.2s ease !important;
}

/* Efeito visual ao carregar no botão */
.btn-mic-live-neon:active {
  transform: scale(0.9) !important;
  box-shadow: 0 0 15px #39FF14 !important;
}

/* ESTILO VERMELHO SE O MIGUEL DESLIGAR O SOM (IGUAL ÀS SALAS DE ÁUDIO) */
.btn-mic-live-neon.mic-mutado {
  border-color: #ff4444 !important;
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.6) !important;
}

/* DESIGN NÉON DO BOTÃO DE PARTILHA DA LIVE */
.btn-partilha-live-neon {
  background: rgba(0, 0, 0, 0.65) !important;
  border: 1px solid #39FF14 !important; /* Contorno verde néon */
  border-radius: 50% !important;        /* Força o formato redondo */
  width: 40px !important;                 /* Tamanho idêntico ao microfone */
  height: 40px !important;
  font-size: 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.6) !important; /* Brilho néon */
  transition: all 0.2s ease !important;
}

/* Efeito visual ao clicar no botão */
.btn-partilha-live-neon:active {
  transform: scale(0.9) !important;
  box-shadow: 0 0 15px #39FF14 !important;
}
