/* ─────────────────────────────────────────────────── */
/* Ocultar el chat por defecto                       */
/* ─────────────────────────────────────────────────── */
.hidden {
  /* Forzamos ocultación absoluta para que ninguna otra regla lo sobrescriba */
  display: none !important;
}

/* ─────────────────────────────────────────────────── */
/* Contenedor principal del chat (posición y tamaño) */
/* ─────────────────────────────────────────────────── */
#chat-box {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 300px;          /* ancho final del chat */
  height: 450px;         /* alto final del chat */
  background: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  border-radius: 10px;            /* ← Esquinas redondeadas “normales”, no 50% */
  border: 2px solid orange;       /* contorno naranja */

  /* Por defecto, está oculto: */
  display: none;                   /* este display será anulado por .hidden */
  z-index: 10000;                  /* ← Muy alto para que quede por encima de todo */
  flex-direction: column;
  overflow: hidden;
}

/* ─────────────────────────────────────────────────── */
/* Mostrar el chat cuando ya no tenga la clase .hidden */
/* ─────────────────────────────────────────────────── */
#chat-box:not(.hidden) {
  /* Forzamos display:flex para que ningún otro CSS lo oculte */
  display: flex !important;
  animation: chat-expand 0.5s ease forwards;
}

/* ─────────────────────────────────────────────────── */
/* Animación que crece desde 60×60 hasta 300×450 px   */
/* ─────────────────────────────────────────────────── */
@keyframes chat-expand {
  0% {
    width: 60px;
    height: 60px;
    opacity: 0;
  }
  100% {
    width: 300px;
    height: 450px;
    opacity: 1;
  }
}

/* ─────────────────────────────────────────────────── */
/* Cabecera del chat                                  */
/* ─────────────────────────────────────────────────── */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #007bff;
  border-bottom: 1px solid #ddd;
  padding: 8px 12px;
}

/* ─────────────────────────────────────────────────── */
/* Dentro de la cabecera, contenedor para foto+texto   */
/* ─────────────────────────────────────────────────── */
.chat-header-perfil {
  display: flex;
  align-items: center;
}

/* ─────────────────────────────────────────────────── */
/* La imagen de perfil a la izquierda (dentro del chat)*/
/* ─────────────────────────────────────────────────── */
.chat-header-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;       /* ← Imagen circular dentro del chat */
  margin-right: 10px;
}

/* ─────────────────────────────────────────────────── */
/* El texto “Asistente GP Building”                   */
/* ─────────────────────────────────────────────────── */
.chat-header-text {
  font-family: sans-serif;
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────── */
/* Botón de cierre “✕”                                 */
/* ─────────────────────────────────────────────────── */
.chat-header-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}

/* ─────────────────────────────────────────────────── */
/* Zona de mensajes con scroll                         */
/* ─────────────────────────────────────────────────── */
.chat-log {
  flex: 1;
  padding: 10px;
  background: #fafafa;
  overflow-y: auto;
  font-family: sans-serif;
  font-size: 14px;
}

/* ─────────────────────────────────────────────────── */
/* Estilos para mensajes de usuario/cliente             */
/* ─────────────────────────────────────────────────── */
.user {
  text-align: right;
  margin: 6px 0;
  color: #444;
}

/* ─────────────────────────────────────────────────── */
/* Estilos para mensajes de “bot”                       */
/* ─────────────────────────────────────────────────── */
.bot {
  text-align: left;
  margin: 6px 0;
  color: #fff;
  background: #007bff;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
}

/* ─────────────────────────────────────────────────── */
/* Formulario inferior para escribir mensaje           */
/* ─────────────────────────────────────────────────── */
.chat-form {
  display: flex;
  border-top: 1px solid #ddd;
}

.chat-form input[type="text"] {
  flex: 1;
  border: none;
  padding: 10px;
  font-size: 14px;
  outline: none;
}

.chat-form button {
  background: #007bff;
  color: white;
  border: none;
  padding: 0 16px;
  cursor: pointer;
  font-size: 14px;
}

/* ─────────────────────────────────────────────────── */
/* Scroll fino en .chat-log (opcional)                 */
/* ─────────────────────────────────────────────────── */
.chat-log::-webkit-scrollbar {
  width: 6px;
}

.chat-log::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}
