/* chat.css
   el area principal donde van los mensajes. incluye la pantalla de bienvenida
   con las sugerencias, las burbujas de mensaje (usuario e IA) y el loader
   de los tres puntitos que aparece mientras la IA piensa.
   necesita base.css y animations.css. */

/* contenedor principal del chat */
.chat {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-chat);
  transition: background var(--transition);
}

/* pantalla de bienvenida */
.chat__welcome {
  max-width: 600px;
  margin: auto;
  text-align: center;
  animation: fadeUp .5s ease both;
}
.chat__welcome-icon {
  font-size: 3rem;
  margin-bottom: .75rem;
}
.chat__welcome h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: .5rem;
}
.chat__welcome p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* botones de sugerencias */
.chat__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
}
.suggestion {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .45rem 1rem;
  font-size: .85rem;
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
}
.suggestion:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* contenedor de mensajes */
.chat__messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}

/* mensaje individual */
.message {
  display: flex;
  gap: .65rem;
  animation: fadeUp .35s ease both;
}
.message--user {
  flex-direction: row-reverse;
}

/* avatar circular */
.message__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
  font-weight: 700;
}
.message--user .message__avatar {
  background: var(--user-bubble);
  color: var(--user-text);
}
.message--ai .message__avatar {
  background: var(--accent-bg);
  color: var(--accent);
}

/* burbuja de texto */
.message__bubble {
  max-width: 75%;
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  line-height: 1.6;
  font-size: .92rem;
  box-shadow: var(--shadow);
  transition: background var(--transition);
}
.message--user .message__bubble {
  background: var(--user-bubble);
  color: var(--user-text);
  border-bottom-right-radius: 4px;
}
.message--ai .message__bubble {
  background: var(--ai-bubble);
  color: var(--ai-text);
  border-bottom-left-radius: 4px;
}
.message--ai .message__bubble strong {
  color: var(--accent);
}

/* indicador de carga (los tres puntitos) */
.chat__loading {
  display: flex;
  align-items: center;
  gap: .65rem;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
  padding-left: 3rem;
}
.chat__loading.hidden {
  display: none;
}
.loading-dots {
  display: flex;
  gap: 4px;
}
.loading-dots span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dot-bounce .6s ease infinite alternate;
}
.loading-dots span:nth-child(2) { animation-delay: .15s; }
.loading-dots span:nth-child(3) { animation-delay: .3s; }
.loading-text {
  font-size: .82rem;
  color: var(--text-secondary);
  font-style: italic;
}
