/* ===== CHATBOT STYLES ===== */

/* Botón flotante */
.chatbot-button {
  position: fixed;
  bottom: 160px;
  right: 150px;
  width: 1px;
  height: 1px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #000;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 9999;
  transition: all 0.3s ease;
}

.chatbot-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

/* Contenedor del chat */
#chatbot-container {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 420px;
  height: 500px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.3);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  overflow: hidden;
}

.chatbot-hidden {
  display: none !important;
}



/* Header del chat */
.chatbot-header {
  background: #EEBA0B;
  color: #000;
  padding: 15px;
  border-radius: 15px 15px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Rubik', sans-serif;
}

.chatbot-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
}

.chatbot-header small {
  display: block;
  font-weight: normal;
  opacity: 0.9;
}

#chatbot-close {
  background: none;
  border: none;
  color: #000;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
}

/* Body del chat */
.chatbot-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 15px;
  min-height: 0;
  overflow: hidden;
}

/* Contenedor de mensajes */
#chatbot-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 15px;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 10px;
  min-height: 0;
  scroll-behavior: smooth;
}

/* Estilo para la barra de scroll */
#chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

#chatbot-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#chatbot-messages::-webkit-scrollbar-thumb {
  background: #EEBA0B;
  border-radius: 10px;
}

#chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #d4a509;
}

/* Contenedor del input */
.chatbot-input-container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  height: 50px;
}

#chatbot-input {
  flex: 1;
  padding: 10px;
  border: 2px solid #EEBA0B;
  border-radius: 20px;
  font-family: 'Rubik', sans-serif;
}

#chatbot-input:focus {
  outline: none;
  border-color: #d4a509;
}

#chatbot-send {
  background: #EEBA0B;
  color: #000;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#chatbot-send:hover {
  background: #d4a509;
}

/* Responsive */
@media (max-width: 768px) {
  #chatbot-container {
    width: calc(100% - 40px);
    right: 20px;
    left: 20px;
    bottom: 90px;
  }
}




/* Speech Bubble (Bocadillo de diálogo) */
.chatbot-speech-bubble {
  position: absolute;
  bottom: 150px;
  right: 80px;
  background: white;
  padding: 12px 18px;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  color: #4d3d2d;
  white-space: nowrap;
  animation: fadeInBounce .5s ease-out;
  border: 2px solid #EEBA0B;
}

/* Flecha del bocadillo */
.chatbot-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid white;
}

.chatbot-speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -13px;
  right: 18px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid #EEBA0B;
  z-index: -1;
}

/* Animación */
@keyframes fadeInBounce {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  50% {
    transform: translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ocultar bocadillo */
.chatbot-speech-bubble.hidden {
  display: none;
}

/* Ajustar posición del botón wrapper */
.chatbot-button-wrapper {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}









.chatbot-button-hidden {
  display: none !important;
}




/* Estilos para los mensajes */
.chatbot-message {
    margin-bottom: 15px;
    display: flex;
}

.chatbot-message-user {
    justify-content: flex-end;
}

.chatbot-message-bot {
    justify-content: flex-start;
}

.chatbot-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    font-family: 'Rubik', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.chatbot-message-user .chatbot-message-content {
    background-color: #EEBA0B;
    color: #000;
    border-bottom-right-radius: 4px;
}

.chatbot-message-bot .chatbot-message-content {
    background-color: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

/* Indicador de escribiendo */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Burbuja de ayuda */




.chatbot-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 30px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

