/* Botón de iniciar conversación */
#startConversationButton {
  padding: 10px;
  border: none;
  background-color: #4473B2;
  color: white;
  border-radius: 20px;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.3s ease;
}

#startConversationButton:hover {
  background-color: #5A8BCC;

}

/* Botón de enviar mensaje */
#sendButton {
  padding: 10px;
  border: none;
  background-color: #4473B2;
  color: white;
  border-radius: 0 5px 5px 0;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#sendButton:hover {
  background-color: #5A8BCC;
}

/* Burbuja de chat */
.chat-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px; /* Ubicada a la derecha */
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #4473B2;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1000;
  transition: background-color 0.3s ease;
}

.chat-bubble:hover {
  background-color: #5A8BCC;
}

.chat-bubble img {
  width: 40px;
  height: 40px;
}

.chat-container {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px; /* Ubicada a la derecha */
  width: 450px;
  height: 600px;
  background-color: rgba(68, 115, 178, 0.9);
  z-index: 1000;
  border-radius: 20px;
  font-family: 'Montserrat', sans-serif;
}

@media (min-width: 769px) {
    .chat-container {
        border: 0px solid black; /* Contorno negro más grueso */
    }
}

.chat-content-vertical {
  width: 100%;
  height: 100%;
  background-color: #F1F4F9;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #6d8fc5;
  height: 60px;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 0 15px;
  position: relative;
}

.chat-header img {
  max-height: 40px;
}

.chat-header-title {
  display: none;
}

.chat-bot-info {
  text-align: center;
  margin-top: 10px;
  margin-bottom: 10px;
}

.chat-bot-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.chat-bot-title {
  display: block;
  font-size: 14px;
  font-weight: bold;
  margin-top: 5px;
  color: #4473B2;
}

.chat-bot-subtitle {
  display: block;
  font-size: 12px;
  color: #555;
}

.chat-close {
  cursor: pointer;
  font-size: 20px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 20px;
  background-color: transparent;
  border: none;
  border-radius: 5px;
  padding: 5px;
  transition: background-color 0.3s ease;
  color: #4473B2;
}

.chat-close:hover {
  background-color: #FF4D4D;
  color: white;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #E0E0E0;
  border-radius: 10px;
  padding: 10px;
  margin: 10px;
  font-size: 14px;
  color: #333;
  background-color: #FFFFFF;
}

.chat-messages p {
  margin: 0 0 10px;
}

.chat-input-container {
  display: flex;
  padding: 10px;
  border-top: 1px solid #E0E0E0;
  background-color: #F1F4F9;
}

.chat-input-container input {
  flex: 1;
  padding: 10px;
  border: 1px solid #E0E0E0;
  border-radius: 5px 0 0 5px;
  background-color: #FFFFFF;
  color: #333;
}

.chat-input-container button {
  padding: 10px;
  border: none;
  background-color: #4473B2;
  color: white;
  border-radius: 0 5px 5px 0;
  cursor: pointer;
}

@media (max-width: 768px) {
  .chat-container {
    width: 100%;
    height: 100%;
    right: 0; /* Ubicada a la derecha */
    bottom: 0;
    border-radius: 0;
  }

  .chat-input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid #E0E0E0;
    width: 100%;
    background-color: #F1F4F9;
  }

  .chat-input-container input {
    flex: 1;
    padding: 10px;
    border: 1px solid #E0E0E0;
    border-radius: 0;
    background-color: #FFFFFF;
    color: #333;
  }

  .chat-input-container button {
    padding: 10px;
    border: none;
    background-color: #4473B2;
    color: white;
    border-radius: 0;
    cursor: pointer;
    flex-shrink: 0;
  }

  .chat-header {
    height: 60px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    padding: 0 15px;
    position: relative;
  }

  .chat-messages {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #E0E0E0;
    border-radius: 0;
    padding: 10px;
    margin: 0;
    font-size: 14px;
    color: #333;
    background-color: #FFFFFF;
  }
}

@media (max-width: 768px) {
  /* Ajustes para el botón de iniciar conversación */
  #startConversationButton {
    padding: 10px;
    border-radius: 20px;
    width: calc(100% - 20px); /* Asegurarse que el botón no se corte */
    margin: 10px; /* Añadir márgenes alrededor del botón */
    box-sizing: border-box; /* Para incluir el padding en el ancho total */
  }

  /* Ajustes para el botón de enviar mensaje */
  #sendButton {
    border-radius: 0 5px 5px 0;
    margin: 0 10px 10px 0; /* Añadir margen inferior */
    box-sizing: border-box; /* Para incluir el padding en el ancho total */
  }

  /* Ajustes para el input de chat */
  .chat-input-container input {
    border-radius: 5px 0 0 5px;
    margin: 0 0 10px 10px; /* Añadir margen inferior */
    box-sizing: border-box; /* Para incluir el padding en el ancho total */
  }

  /* Ajustes generales para asegurar el centrado y alineación */
  .chat-input-container {
    display: flex;
    padding: 10px; /* Añadir padding alrededor */
    box-sizing: border-box; /* Para incluir el padding en el ancho total */
  }
}

.user-message {
  justify-content: flex-end;
  margin-right: 0;
  margin-left: auto; /* Asegura que la burbuja del usuario no tenga margen derecho */
}

.assistant-message {
  justify-content: flex-start;
  margin-left: 0;
  margin-right: auto; /* Asegura que la burbuja del asistente no tenga margen izquierdo */
}

.message-wrapper {
  display: flex;
  margin-bottom: 5px; /* Aumentar el espaciado entre los mensajes */
  padding: 5px;
  max-width: 100%; /* Permitir que las burbujas ocupen hasta el ancho completo */
}

.message-bubble {
    display: inline-flex;
    padding: 10px;
    border-radius: 10px;
    position: relative;
    font-size: 14px;
    word-wrap: break-word;
    max-width: 80%;
    align-items: center;
}


.user-message .message-bubble {
  background-color: #c4d8f8; /* Color similar a WhatsApp para el usuario */
  color: #000; /* Texto negro */
  border-top-right-radius: 0;
  justify-content: flex-end;
  align-self: flex-end;
}

.assistant-message .message-bubble {
  display: flex;
  align-items: center;
  background-color: #ececec;
  color: #000;
  border-top-left-radius: 0;
  justify-content: flex-start;
  align-self: flex-start;
}

.assistant-icon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
}

.message-text {
  display: inline-block;
  max-width: 100%; /* Ajustar según el tamaño de la imagen */
}



/* Estilos para el nombre del remitente */
.message-bubble strong {
    display: block;
    margin-bottom: 5px;
}

/* Estilos para el botón deshabilitado */
.button-disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Efecto de carga en el botón */
#startConversationButton.loading {
  background-color: #5A8BCC;
  cursor: wait;
}
