/* =========================
   CONTENEDOR GENERAL
========================== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%; 
    margin: 0 auto;
    background: #fff;
    overflow: hidden; 
}

/* =========================
   ENCABEZADO (HEADER)
========================== */
.chat-header {
  background-color: #23395b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  height: 30px;
  font-weight: bold;
  border-bottom: 1px solid #ccc;
}
/* Títulos a la izquierda */
.header-left {
  display: flex;
  flex-direction: row; /* Elementos en línea horizontal */
  align-items: center; /* Centra verticalmente la imagen y el texto */
}
.header-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.header-left .title {
  font-size: 16px;
  font-weight: 600;
  color: white;
}
.header-left .subtitle {
  font-size: 12px;
  color: white;
}

/* =========================
   CONTENIDO PRINCIPAL
========================== */
.chat-content {
  flex: 1; 
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* Permitir scroll vertical interno en el índice */
  overflow-x: hidden; /* Evitar scroll horizontal en el índice */
}
/* Parte superior: logo, títulos y tarjetas */
.top-content {
  padding: 1rem;
  text-align: center;
}
.logo-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #ddd;
  margin: 0 auto 0.5rem auto;
}
.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 0.25rem;
}
.chat-subtitle {
  font-size: 13px;
  color: #777;
  margin-bottom: 0.75rem;
}
.central-messages {
  max-width: 400px;
  margin: 0 auto;
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}
/* Tarjetas de pasos */
.steps-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
  margin-bottom: 1rem;
}
.step-card {
  flex: 0 0 130px;
  background-color: #fafafa;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  padding: 0.75rem;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}
.step-card:hover {
  background-color: #f0f0f0;
}

/* =========================
   SECCIÓN DE MENSAJES
========================== */
.chat-messages {
  flex: 1;              
  overflow-y: auto;     
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;            
}
.message-bubble {
  max-width: 80%;
  padding: 0.75rem;
  border-radius: 10px;
  line-height: 1.4;
}
.user-message {
  align-self: flex-end;
  font-size: 14px;
  background-color: #cce7ff;
  overflow-wrap: break-word; 
  word-wrap: break-word;
}
.bot-message {
  align-self: flex-start;
  background-color: #f0f0f0;
}
.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}

/* =========================
   FOOTER (COMPOSER)
========================== */
.chat-footer {
  border-top: 1px solid #ddd;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  background-color: #f0f0f0;
  justify-content: space-between;
}
.footer-newchat-btn {
  width: 40px;
  height: 40px;
  background-color: #23395b;
  border: none;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.footer-newchat-btn:hover {
  background-color: #e0e0e0;
}
.footer-newchat-btn svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}
/* Zona a la derecha: Input y Botón Enviar */
.footer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: flex-end;
}
.footer-input {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 25px;
  border: 1px solid #ccc;
  padding: 0.3rem 0.75rem;
  flex: 1;
}
.footer-input input {
  width: 100%;
  border: none;
  outline: none;
  padding: 0.5rem;
  font-size: 14px;
}
.footer-btn {
  width: 40px;
  height: 40px;
  background-color: #23395b;
  border: none;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.footer-btn:hover {
  background-color: #e0e0e0;
}
.footer-btn svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}
.footer-btn:disabled {
  background-color: #e0e0e0;
  cursor: not-allowed; /* Cambia el cursor para indicar que está inactivo */
}
.footer-btn:disabled svg {
  fill: #fff; /* Mantiene el color del ícono */
}

/* =========================
   NOTA FINAL
========================== */
.footer-note {
  background-color: #fff;
  padding: 0.5rem;
  text-align: center;
  font-size: 11px;
  color: #555;
  border-top: 1px solid #ddd;
}

#mensajes-restantes {
  display: none;
  background-color: #fff;
  padding: 0.25rem;
  text-align: center;
  font-size: 11px;
  color: #555;
  border-top: 1px solid #ddd;
}

.no-disponible {
    display: inline-block;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.85em;
    background-color: red;
    font-weight: bold;
    color: white;
}

/* ===============================
   MENSAJE DEL AGENTE (NUEVOS COMPONENTES)
================================ */
.agent-answer {
  font-size: 14px;
  color: #333;       /* Color del texto final del agente */
  line-height: 1.4;
  margin-bottom: 4px; /* Espacio entre la respuesta y el estado */
  overflow-wrap: break-word; 
  white-space: pre-wrap;
  word-wrap: break-word;
}

.agent-status {
  font-style: italic;
  font-size: 0.9em;
  color: #777;       /* Color para el estado temporal */
  margin-top: 4px;
}

/* Variante opcional para indicar que se está en estado activo/procesando */
.agent-status.loading {
  color: #999;
}

/* Media Queries para pantallas pequeñas */
@media (max-width: 1020px) {
  .header-left {
    margin-left: 85px;
  }
}