body {
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f7f6;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.chat-container {
  background: white;
  width: 95%;
  max-width: 900px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

header {
  background-color: #2ecc71;
  color: white;
  padding: 20px;
  text-align: center;
}

#chat-box {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-line;
  font-size: 15px;
}

.user {
  background-color: #eafaf1;
  align-self: flex-end;
  border-bottom-right-radius: 0;
}

.bot {
  background-color: #f0f0f0;
  align-self: flex-start;
  border-bottom-left-radius: 0;
}

/* Indicador de escritura */
#typing-indicator {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 10px 20px;
}

#typing-indicator.hidden {
  display: none;
}

#typing-indicator span {
  width: 8px;
  height: 8px;
  background-color: #bbb;
  border-radius: 50%;
  margin-right: 6px;
  animation: blink 1.4s infinite both;
}

#typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

#typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0% { opacity: 0.2; }
  20% { opacity: 1; }
  100% { opacity: 0.2; }
}

/* Formulario */
#chat-form {
  display: flex;
  padding: 15px;
  border-top: 1px solid #ddd;
  background: #fff;
}

#user-input {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #ccc;
  outline: none;
  font-size: 15px;
}

#user-input:focus {
  border-color: #2ecc71;
}

button {
  background: #2ecc71;
  color: white;
  border: none;
  padding: 12px 18px;
  margin-left: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background: #27ae60;
}

/* Responsive */
@media (max-width: 600px) {
  .chat-container {
    height: 100vh;
    width: 100%;
    border-radius: 0;
  }
}
