@import url("https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,100..900&display=swap");

/* ====================================================================== */
/* ESTILOS BASE (PARA MÓVILES) */
/* Estos estilos se aplicarán a todas las pantallas por defecto,
   y son optimizados para dispositivos móviles. */

* {
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: linear-gradient(#eeeeff, #c8c7ff);
}

/* Chatbot Toggler (Botón flotante del chatbot) */
#chatbot-toggler {
  position: fixed;
  bottom: 30px;
  right: 20px; /* Ajustado para móviles: más cerca del borde */
  height: 50px;
  width: 50px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  background: #5350c4;
  transition: all 0.2s ease;
  z-index: 1000; /* Asegura que esté por encima de otros elementos */
}

body.show-chatbot #chatbot-toggler {
  transform: rotate(90deg);
}

#chatbot-toggler span {
  color: #fff;
  position: absolute;
}

body.show-chatbot #chatbot-toggler span:first-child,
body.show-chatbot #chatbot-toggler span:last-child {
  opacity: 0;
}

body.show-chatbot #chatbot-toggler span:last-child {
  opacity: 1;
}

/* Chatbot Popup (Ventana del chatbot) */
.chatbot-popup {
  position: fixed;
  /* --- CAMBIOS CLAVE AQUÍ para 95% de ancho y alto y centrado en móviles --- */
  width: 95vw; /* 95% del ancho del viewport */
  height: 95vh; /* 95% del alto del viewport */
  top: 50%;    /* Posiciona el borde superior a la mitad de la pantalla */
  left: 50%;   /* Posiciona el borde izquierdo a la mitad de la pantalla */
  transform: translate(-50%, -50%) scale(0.2); /* Primero centrar, luego escalar */
  transform-origin: center center; /* El origen de la transformación para el escalado */

  border-radius: 15px; /* Bordes redondeados para móviles (ajusta a 0 si no los quieres) */
  background: #fff;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 128px rgba(0, 0, 0, 0.1), 0 32px 64px -48px rgba(0, 0, 0, 0.5);
  transition: all 0.1s ease; /* La transición ahora aplica al transform completo */
  z-index: 999; /* Debajo del botón */
}

body.show-chatbot .chatbot-popup {
  opacity: 1;
  pointer-events: auto;
  /* Aplicamos solo la parte de escalado para que el popup se muestre */
  transform: translate(-50%, -50%) scale(1);
}

/* Chat Header (Encabezado del chat) */
.chat-header {
  display: flex;
  align-items: center;
  background: #5350c4;
  padding: 15px 22px;
  justify-content: space-between;
}

.chat-header .header-info {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-info .chatbot-logo {
  height: 50px;
  width: 50px;
  padding: 6px;
/*  fill: #5350c4; */
  flex-shrink: 0;
  background: #5350c4;
/*  background: #fff;  */
/*  border-radius: 50%;  */
}

.header-info .logo-text {
  color: #fff;
  font-size: 1.1rem; /* Ajustado para móviles */
  font-weight: 600;
}

.chat-header #close-chatbot {
  border: none;
  color: #fff;
  height: 40px;
  width: 40px;
  font-size: 1.9rem;
  margin-right: -10px;
  padding-top: 2px;
  cursor: pointer;
  border-radius: 50%;
  background: none;
  transition: 0.2s ease;
}

.chat-header #close-chatbot:hover {
  background: #3d39ac;
}

/* Chat Body (Cuerpo del chat, donde van los mensajes) */
.chat-body {
  padding: 25px 22px;
  display: flex;
  gap: 20px;
  /* Altura dinámica: 100% del popup - altura del header - altura del footer */
  height: calc(100% - (65px + 82px)); /* Ajusta 65px y 82px si las alturas varían */
  margin-bottom: 0;
  overflow-y: auto;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #ccccf5 transparent;
}

.chat-body .message {
  display: flex;
  gap: 11px;
  align-items: center;
}

.chat-body .bot-message .bot-avatar {
  height: 35px;
  width: 35px;
  padding: 6px;
  fill: #fff;
  flex-shrink: 0;
  margin-bottom: 2px;
  align-self: flex-end;
  background: #5350c4;
  border-radius: 50%;
}

.chat-body .user-message {
  flex-direction: column;
  align-items: flex-end;
}

.chat-body .message .message-text {
  padding: 12px 16px;
  max-width: 85%; /* Más ancho en móvil */
  font-size: 0.95rem;
  background: #f2f2ff;
}

.chat-body .bot-message.thinking .message-text {
  padding: 2px 16px;
}

.chat-body .bot-message .message-text {
  background-color: #f2f2ff;
  border-radius: 13px 13px 13px 3px;
}

.chat-body .user-message .message-text {
  color: #fff;
  background-color: #5350c4;
  border-radius: 13px 13px 3px 13px;
}

.chat-body .bot-message .thinking-indicator {
  display: flex;
  gap: 4px;
  padding-block: 15px;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(1) {
  animation-delay: 0.2s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(2) {
  animation-delay: 0.3s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(3) {
  animation-delay: 0.4s;
}

.chat-body .bot-message .thinking-indicator .dot {
  height: 7px;
  width: 7px;
  opacity: 0.7;
  border-radius: 50%;
  background: #6f6bc2;
  animation: dotPulse 1.8s ease-in-out infinite;
}

@keyframes dotPulse {
  0%,
  44% {
    transform: translateY(0);
  }

  28% {
    opacity: 0.4;
    transform: translateY(-4px);
  }

  44% {
    opacity: 0.2;
  }
}

/* Chat Footer (Pie de página del chat con el formulario de entrada) */
.chat-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: white;
  padding: 15px 22px 20px;
}

.chat-footer .chat-form {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 25px; /* Bordes redondeados más suaves para móvil */
  outline: 1px solid #cccce5;
}

.chat-footer .chat-form:focus-within {
  outline: 2px solid #5350c4;
}

.chat-form .message-input {
  border: none;
  outline: none;
  height: 47px;
  width: 100%;
  resize: none;
  max-height: 180px;
  white-space: pre-line;
  font-size: 1rem;
  padding: 13px;
  border-radius: inherit;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.chat-form .message-input::hover {
  scrollbar-color: #ccccf5 transparent;
}

.chat-form .chat-controls {
  display: flex;
  height: 47px;
  gap: 3px;
  align-items: center;
  align-self: flex-end;
  padding-right: 10px; /* Más padding en móvil */
}

.chat-form .chat-controls button {
  height: 40px; /* Botones más grandes en móvil */
  width: 40px;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  color: #706db0;
  background: none;
  border-radius: 50%;
  transition: 0.2s ease;
}

.chat-form .chat-controls #send-message {
  color: #fff;
  display: none;
/*  background: #5350c4;  */
  background: #fff;
}

.chat-form .message-input:valid ~ .chat-controls #send-message {
  display: block;
}

.chat-form .chat-controls #send-message:hover {
  background: #3d39ac;
}

.chat-form .chat-controls button:hover {
  background: #f1f1f1;
}

.chat-body .user-message .attachment {
  width: 50%;
  margin-top: -7px;
  border-radius: 13px 3px 13px 3px;
}

em-emoji-picker {
  position: absolute;
  left: 50%;
  top: -337px;
  width: 100%;
  max-width: 350px;
  max-height: 330px;
  visibility: hidden;
  transform: translateX(-50%);
}

body.show-emoji-picker em-emoji-picker {
  visibility: visible;
}

/* ====================================================================== */
/* MEDIA QUERIES (DE TABLET A ESCRITORIO) */

/* Para pantallas de tablets y laptops pequeñas (min-width: 601px) */
@media screen and (min-width: 601px) {
  /* Restablecemos el tamaño y la posición del chatbot para desktop */
  #chatbot-toggler {
    right: 35px; /* Vuelve a la posición original del desktop */
  }

  .chatbot-popup {
    width: 420px; /* Ancho fijo para desktop */
    height: 800px; /* La altura será determinada por el contenido */
    right: 25px; /* Posición original del desktop */
    bottom: 90px; /* Posición original del desktop */
    top: auto; /* Desactivar top:50% para desktop */
    left: auto; /* Desactivar left:50% para desktop */
    transform: scale(0.2); /* Vuelve al escalado original */
    transform-origin: bottom right; /* Origen de transformación original */
    border-radius: 15px; /* Bordes redondeados del desktop */
  }

  body.show-chatbot .chatbot-popup {
    transform: scale(2); /* Solo escalar en desktop */
  }

  .chat-header .header-info .logo-text {
    font-size: 1.31rem; /* Tamaño original del desktop */
  }

  .chat-body {
    height: 460px; /* Altura fija para desktop */
    margin-bottom: 82px; /* Margen para el footer del desktop */
  }

  .chat-body .message .message-text {
    max-width: 75%; /* Ancho original del desktop */
  }

  .chat-footer .chat-form {
    border-radius: 32px; /* Bordes redondeados del desktop */
  }

  .chat-footer .chat-form .chat-controls {
    padding-right: 6px; /* Padding original del desktop */
  }

  .chat-footer .chat-form .chat-controls button {
    height: 35px; /* Tamaño original del desktop */
    width: 35px;
  }
}

.paleta-emojis {
    font-size: 2rem; /* Tamaño para el selector de EMOJIS */
	color:orange;
  }
  
.anexo-files {
    font-size: 2rem; /* Tamaño para el icono de SUBIR ARCHIVOS */
	color:black;
  }
  
