@charset "UTF-8";

/* Reset e fontes */
/* body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
   background: #f5f5f5; 
}*/

/* Overlay */
#chat-popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;              /* oculto por padrão */
  align-items: center;
  justify-content: center;
  z-index: 100000;
}

/* === Adicionado: exibe o overlay quando ganhar a classe .active === */
#chat-popup-overlay.active {
  display: flex;
}

/* Popup */
#chat-popup {
  position: relative;
  width: 90%; max-width: 480px;
  height: 600px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#chat-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 32px; height: 32px;
  background: #fafafa;
  border: 1px solid #ccc;
  border-radius: 50%;
  font-size: 20px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
  z-index: 100001;
  transition: background 0.2s, transform 0.2s;
}
#chat-close:hover {
  background: #eee;
  transform: scale(1.1);
}

#messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

#chat-footer {
  padding: 8px 12px;
  text-align: center;
  font-size: 12px;
  color: #666;
  background: #f9f9f9;
  border-top: 1px solid #e0e0e0;
}

/* Mensagens */
.message {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}
@keyframes fadeIn { to { opacity: 1; } }

.message.bot { flex-direction: row; }
.message.user { flex-direction: row-reverse; }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%; margin: 0 8px;
  flex-shrink: 0;
}

.bubble {
  max-width: 75%; padding: 12px 16px;
  border-radius: 18px; line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.message.bot .bubble { background: #f0f0f0; color: #222; }
.message.user .bubble { background: #0062cc; color: #fff; }

.input-container {
  display: flex; width: 100%; margin-top: 8px;
}
.input-container input,
.input-container textarea {
  flex: 1; border: 1px solid #ccc; border-radius: 12px;
  padding: 10px 14px; font-size: 16px; resize: none;
}
.input-container textarea { min-height: 80px; }
.input-container button {
  background: #0062cc; color: #fff; border: none;
  border-radius: 12px; padding: 0 16px; margin-left: 8px;
  cursor: pointer; font-size: 16px;
}




/*Arruma Bot*/
/* Overlay full-viewport, sempre acima de tudo */
#chat-popup-overlay {
  position: fixed !important;
  inset: 0 !important;                /* top/right/bottom/left = 0 */
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0,0,0,0.5);
  display: none;                      /* controlado por .active */
  align-items: center;
  justify-content: center;
  z-index: 2147483646 !important;     /* maior que qualquer header/menu */
  transform: none !important;         /* evita “containment” por transform */
}

/* Mostra quando ativo */
#chat-popup-overlay.active { display: flex !important; }

/* Evita rolagem do fundo quando o chat está aberto */
body.chat-open { overflow: hidden !important; }

/* Botão fechar sempre clicável dentro do popup */
#chat-close { position: absolute; top: 8px; right: 8px; cursor: pointer; z-index: 1; }


/* Fim Arruma Bot */