/* === CONTENEDOR FLOTANTE === */
#chatbot-container {
  
  position: fixed;
  bottom: 200px;
  right: 20px;
  z-index: 9999;
  display: none;
}

#chatbot-container.activo {
  display: block;
}

#abrir-chatbot {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background-color: #25d366;
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* === CUADRO DEL CHAT === */
#chatbot {
  width: 264px;
  height: 450px;
  background-color: #ece5dd;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* === CABECERA === */
#chat-header {
  display: flex;
  align-items: center;   /* ❗ Alinea verticalmente el título y la X */
  background-color: #075e54;
  color: white;
  padding: 8px 14px;
  font-weight: bold;
}


#chat-header h4 {
  margin: 0;
  padding: 0;
  line-height: 1;     /* ❗ elimina el espacio vertical */
  font-size: 20px;    /* ajusta si lo quieres más chico */
  display: flex;
  align-items: center; /* ❗ asegura alineación con la X */
}

#cerrar-chatbot {
  background: none;
  border: 2px solid white;
  color: white;
  font-size: 16px;     /* ❗ debe ser más pequeño que el texto */
  width: 26px;
  height: 26px;

  border-radius: 50%;
  display: flex;
  align-items: center;   /* ❗ centra la X dentro del círculo */
  justify-content: center;

  margin-left: 25px;
  margin-top: 0px;
  padding: 0;           /* ❗ el padding es el que rompía la alineación */
  cursor: pointer;
}



/* === CUERPO DEL CHAT === */
#chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* === MENSAJES === */
#chatbot .mensaje-bot {
  align-self: flex-start;
  background-color: #ffffff;
  color: #000;
  border-radius: 10px 10px 10px 0;
  padding: 8px 12px;
  max-width: 80%;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  font-family: 'Segoe UI', sans-serif;
}

#chatbot .mensaje-usuario {
  align-self: flex-end;
  background-color: #dcf8c6;
  color: #000;
  border-radius: 10px 10px 0 10px;
  padding: 8px 12px;
  max-width: 80%;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  font-family: 'Segoe UI', sans-serif;
}

/* === INPUT === */
#chat-input {
  display: flex;
  
  align-items: center;
  gap: 6px;
  background-color: #f0f0f0;
  border-top: 1px solid #ccc;
  padding: 8px;
}

/* Input ocupa todo el ancho */
#userInput {
  
  flex: 1;
  border: none;
  border-radius: 20px;
  padding: 10px 14px;
  outline: none;
  font-size: 14px;
}

/* BOTÓN ENVIAR — versión pequeña y proporcionada */
#enviarBtn {
  width: 70px;           /* 🔥 Botón pequeño y uniforme */
  height: 38px;          /* 🔥 Misma altura visual que el input */
  background-color: #075e54;
  color: white;
  border: none;
  border-radius: 18px;
  font-size: 14px;
  cursor: pointer;
  padding: 0;            /* evita ensanchamiento */
  display: flex;
  justify-content: center;
  align-items: center;
}


#boton-chatbot-con-imagen {
  position: fixed;
  bottom: 25px;
  right: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

/* === GLOBO DE MANU === */
#globo-chatbot {
  position: absolute;
  bottom: 150px;
  right: 0;
  background-color: #ffffff;
  color: #000;

  /* 🔵 MÁS ANCHO */
  max-width: 400px;      /* Ajusta si quieres más (300–400px recomendado) */

  /* 🔵 MENOS ALTO (reduciendo padding vertical) */
  padding: 18px 25px;    /* Antes eran 45px 40px → era demasiado alto */

  border-radius: 15px;
  font-size: 20px;       /* 🔵 Tamaño de letra (ajústalo) */
  font-weight: 500;

  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  border: 2px solid #007bff;

  animation: flotar 3s ease-in-out infinite;
  transition: opacity 0.3s ease;
}

#globo-chatbot::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 20px;
  border-width: 10px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

/* ✨ Animación de “flotar” */
@keyframes flotar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Animación de aparición cuando reaparece */
@keyframes aparecer {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Imagen del chatbot (Manu) */
#imagen-chatbot {
  width: 150px;
  height: auto;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#imagen-chatbot:hover {
  transform: scale(1.05);
}

/* Animación de aparición del globo */
@keyframes aparecer {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}



/* Chatbot - versión móvil */
@media (max-width: 850px) {
    #globo-chatbot {
        font-size: 1.2rem;        /* letra más pequeña */
        padding: 10px 18px;     /* globo más pequeño */
        top: -200px;             /* sube un poco para no ocupar tanto espacio */
    }

    #imagen-chatbot {
        width: 100px;            /* imagen más pequeña */
    }
}