/* Base */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  background: transparent;
  overflow: hidden;
}

/* Header */
.chat-header {
  background: #74A199;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px 12px 0 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header .logo {
  height: 32px;
}

.brand-name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #fff;
}

/* Caja de mensajes */
.chat-box {
  width: 100%;
  height: calc(600px - 130px);
  padding: 16px;
  margin: 0;
  overflow-y: auto;
  background: #fafafa;
  border: none;
  box-sizing: border-box;
}

/* Scrollbar estilizado */
.chat-box::-webkit-scrollbar {
  width: 6px;
}
.chat-box::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
.chat-box::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* Bloque de bienvenida */
.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 24px 0;
}

.welcome-logo {
  width: 80px;
  height: auto;
  margin-bottom: 8px;
}

.welcome-text {
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.welcome-subtext {
  font-size: 14px;
  color: #555;
  margin-top: 4px;
}

/* Mensajes base */
.msg {
  line-height: 1.4;
  word-wrap: break-word;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mensajes del usuario */
.user-row {
  display: flex;
  justify-content: flex-end;
  margin: 12px 8px;
}

.user-msg {
  display: inline-block;
  background: #74A199;
  color: #fff;
  border-radius: 12px;
  border-bottom-right-radius: 0;
  padding: 10px 14px;
  max-width: calc(100% - 32px);
  width: fit-content;
  transition: background 0.2s;
  word-break: break-word;
}

.user-msg:hover {
  background: #5f837d;
}

/* Mensajes del asistente */
.assistant-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 8px;
}

.assistant-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.assistant-msg {
  background: #eaeaea;
  color: #333;
  border-radius: 12px;
  border-bottom-left-radius: 0;
  padding: 10px 14px;
  max-width: 80%;
  display: inline-block;
  word-break: break-word;
}

/* Barra de entrada */
.input-container {
  display: flex;
  align-items: center;
  padding: 10px;
  border-top: 1px solid #ddd;
  background: #f9f9f9;
  border-radius: 0 0 12px 12px;
  margin-bottom: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Input */
#userInput {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 25px;
  padding: 12px 16px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}

#userInput:focus {
  border-color: #74A199;
  box-shadow: 0 0 5px rgba(116, 161, 153, 0.5);
}

/* Bot¨Žn */
#sendBtn {
  margin-left: 10px;
  background: #74A199;
  color: #fff;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}

#sendBtn:hover {
  background: #5f837d;
}

#sendBtn:active {
  transform: scale(0.95);
}

/* Animaci¨Žn "escribiendo..." */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eaeaea;
  color: #333;
  border-radius: 12px;
  border-bottom-left-radius: 0;
  padding: 6px 10px;
  max-width: fit-content;
  margin: 6px 0;
}

.typing span {
  width: 6px;
  height: 6px;
  background: #555;
  border-radius: 50%;
  display: inline-block;
  animation: blink 1.4s infinite both !important;
}

.typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}
