/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Arial", sans-serif;
}

/* Corpo */
body {
  background-color: #343541;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100vh;
  overflow: hidden;
}

/* Contêiner do chat */
.chat-container {
  width: 100%;
  max-width: 900px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Área do chat */
.chat {
  flex: 1;
  width: 100%;
  max-width: 900px;
  padding: 15px;
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: #555 #343541;
  padding-bottom: 80px;
  margin-bottom: 20px; /* Espaço extra entre a área do chat e a caixa de input */
}

/* Scrollbar fina */
.chat::-webkit-scrollbar {
  width: 4px;
}

.chat::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 4px;
}


/* Ajuste para mensagens longas não quebrarem o layout */
.message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 75%;
  padding: 12px;
  border-radius: 10px;
  word-wrap: break-word;
  /* 🔹 Quebra palavras longas */
  overflow-wrap: break-word;
  /* 🔹 Garante a quebra em navegadores modernos */
  white-space: normal;
  /* 🔹 Mantém o texto ajustado */
  opacity: 0;
  animation: fadeIn 0.3s ease-in-out forwards, slideUp 0.3s ease-in-out forwards;
}

/* Ajuste no texto dentro da mensagem */
.text {
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  max-width: 100%;
  /* 🔹 Garante que o texto respeite o limite da mensagem */
}

/* Animação de fadeIn */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Animação de slide-up (movimento suave ao surgir) */
@keyframes slideUp {
  from {
    transform: translateY(10px);
  }

  to {
    transform: translateY(0);
  }
}

/* Mensagem do bot */
.message.bot {
  align-self: flex-start;
  background-color: #444654;
  color: white;
}

/* Ajuste para mensagens de usuário */
.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
  background-color: #0FA47F;
  color: white;
  max-width: 60%;
  /* 🔹 Garante que as mensagens não fiquem muito grandes */
}

/* Avatar */
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  color: white;
}

/* Caixa de entrada */
.chat-input {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 900px;
  background: linear-gradient(to top, rgba(64, 65, 79, 0.98), rgba(64, 65, 79, 0.8));
  padding: 12px;
  display: flex;
  align-items: center;
  border-radius: 20px;
  box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease-in-out;
}

/* Input */
.chat-input textarea {
  flex: 1;
  min-height: 45px;
  max-height: 150px;
  resize: none;
  padding: 12px;
  border: none;
  border-radius: 20px;
  font-size: 16px;
  background-color: #555;
  color: white;
  outline: none;
  transition: all 0.2s ease-in-out;
}

/* Botão */
.chat-input button {
  background-color: #0FA47F;
  border: none;
  padding: 12px 16px;
  margin-left: 10px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 18px;
  color: white;
  transition: background 0.3s ease, transform 0.1s ease-in-out;
}

/* Efeito ao clicar no botão */
.chat-input button:active {
  transform: scale(0.9);
}

/* Efeito ao passar o mouse no botão */
.chat-input button:hover {
  background-color: #19C37D;
}

/* Botão desativado */
.chat-input button:disabled {
  background-color: #555;
  cursor: not-allowed;
}

/* Indicador de "digitando..." */
.typing {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 5px;
  border-radius: 50%;
  background-color: white;
  animation: blink 1.0s infinite ease-in-out;
}

@keyframes blink {
  0% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.3;
  }
}

/* Efeito de digitação do botão de envio */
@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.chat-input button:enabled:hover {
  animation: pulse 0.5s ease-in-out infinite alternate;
}

/* Tela de introdução */
.intro-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #343541;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeOut 1s ease-out 2.5s forwards;
}

/* Conteúdo da animação */
.intro-content {
  display: flex;
  align-items: center;
  gap: 15px;
  opacity: 0;
  animation: fadeIn 1.5s ease-out forwards, pulse 1.5s ease-in-out infinite alternate;
}

/* Ícone do alien */
.alien-logo {
  font-size: 100px;
}

/* Nome do aplicativo */
.app-name {
  font-size: 48px;
  font-weight: bold;
  color: white;
  letter-spacing: 2px;
}

/* Animação de fade-in */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animação de fade-out para esconder */
@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* Efeito de pulsação (Alien e Nome pulsando juntos) */
@keyframes pulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.1);
  }
}

/* Header fixo no topo */
.chat-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #2a2b32;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

/* Conteúdo do header */
.header-content {
  width: 100%;
  max-width: 900px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logo no header - Alinhada à esquerda */
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 0;
  /* Garante que fique à esquerda */
}

/* Ícone do alien */
.header-logo .alien-logo {
  font-size: 32px;
}

/* Nome do aplicativo */
.header-logo .app-name {
  font-size: 20px;
  font-weight: bold;
  color: white;
  letter-spacing: 1px;
}


/* Ajusta o chat para não ficar sobre o header */
.chat {
  flex: 1;
  width: 100%;
  max-width: 900px;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: #555 #343541;
  padding-top: 70px;
  /* Adiciona espaço para o header */
  padding-bottom: 80px;
}
