/* Ajuste para mostrar correctamente la respuesta del bot y el avatar */
.message.bot.show {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  padding-left: 15px;
  padding-right: 15px;
}

.message.bot .bot-text {
  color: black;
  background: none;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}

.message.bot .profile {
  margin-top: 8px;
  align-self: flex-start;
}

.message.bot .profile img {
  width: 40px;
  height: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message.bot .bot-text p {
  color: black;
  margin: 0;
  overflow: visible;
  text-overflow: initial;
}
#chatContainer {
  position: fixed;
  bottom: 30px;
  right: 30px;
  height: 620px;
  max-width: 420px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  opacity: 1;
  z-index: 1000;
  transition: height 0.5s ease, opacity 0.4s ease;
}

#chatContainer.chat-close {
  height: 0;
  opacity: 0;
}

.chatbot-button {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  width: 100px;
  bottom: 25px;
  right: 50px;
  transition: transform 0.3s ease;
}

.chatbot-button:hover {
  transform: scale(1.1);
}

.chatbot-button img {
  width: 100px;
  height: 100px;
}

#chatHeader {
  background-color: #fff;
  border-bottom: 1px solid #f5f5f5;
  text-align: center;
  font-weight: bold;
  position: relative;
}

.chatbot__profile {
  display: flex;
  flex-direction: row;
  padding: 20px 25px;
  gap: 20px;
}

.chat__avatar {
  width: 80px;
  height: 70px;
}

.chatbot__data {
  display: flex;
  flex-direction: column;
}

.chatbot__name {
  color: black;
  font-size: 30px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
}

.chatbot__status {
  display: flex;
  flex-direction: row;
  gap: 3px;
  align-items: center;
  justify-content: center;
}

.chatbot__status img {
  width: 10px;
  height: auto;
}

.chatbot__status span {
  color: #3abf38;
}

.chat-header-close {
  position: absolute;
  top: 16px;
  right: 23px;
  width: 25px;
  transition: transform 0.2s ease;
  filter: invert(1);
}

.chat-header-close:hover {
  transform: scale(1.1);
}

#chatbox {
  padding: 15px;
  overflow-y: auto;
  flex-grow: 1;
  margin-bottom: 80px; /* Deja espacio para el input */
  box-sizing: border-box;
}

#userInputContainer {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 30px;
  display: flex;
  padding-left: 15px;
  border-radius: 40px;
  width: auto;
  max-width: none;
  box-shadow: 17.2px 13.76px 68.8px 0px rgba(0, 0, 0, 0.13);
  background: #fff;
  z-index: 1100;
}

#userInputContainer input {
  color: #a1a1a1 !important;
}

#userInput::placeholder {
  color: #a1a1a1 !important;
  opacity: 1;
}

#userInput {
  width: 100%;
  border: none;
  font-size: 16px;
  padding-left: 15px;
  outline: none;
  box-sizing: initial !important;
  margin-bottom: 0px !important;
  background-color: transparent !important;
}

#sendButton {
  border: none;
  padding: 10px 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.message {
  margin-top: 15px;
  margin-left: 30px;
  padding: 0 15px;
  border-radius: 20px 20px 20px 0px;
  max-width: 85%;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.message.show {
  opacity: 1;
}

.bot.profile {
  opacity: 1;
  margin: 0px;
  background-color: transparent;
}

.profile {
  height: auto;
  padding: 0px 15px;
}

.profile img {
  width: 40px;
}

.message.waiting {
  display: none;
  padding: 10px 15px;
  justify-content: center;
  align-items: center;
}

.message.waiting img {
  width: 20px;
  height: auto;
}

.message ul {
  padding-left: 25px;
}

.message li {
  margin-bottom: 15px;
}

.message p {
  margin: 15px 0;
  text-overflow: ellipsis;
  font-size: 14px;
  overflow: hidden;
}

.message li p {
  margin: 0;
}

.user {
  background-color: black;
  color: white;
  border-radius: 86px 0px 86px 86px;
  align-self: flex-end;
}

.bot {
  background-color: #f1f1f1;
  color: black;
  align-self: flex-start;
}

#sendButton > img {
  width: 25px;
  height: auto;
}

/* Scrollbar */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

@media (max-width: 900px) {
  .chatbot-button {
    bottom: 20px;
    right: 20px;
  }
}

.chatbot-button.hidden {
  display: none;
}

/* Ajuste para avatar fuera del mensaje y visibilidad del texto bot */
.profile img {
  width: 40px;
  height: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message.bot .bot-text,
.message.bot .bot-text p {
  color: black !important;
  opacity: 1 !important;
  display: block !important;
  background: none !important;
  font-size: 14px;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  text-overflow: initial !important;
}

.message.bot .bot-text p {
  margin: 15px 0px !important;
}

.message.bot .bot-text, .message.bot .bot-text p {
  border-radius: 0 !important;
}

@media (max-width: 900px) {
  .chatbot-button img {
    width: 70px;
    height: 70px;
  }

  #chatContainer {
    bottom: 20px;
    right: 20px;
    height: 690px;
    max-width: 410px;
  }
}

@media (max-width: 500px) {
  #chatContainer {
    bottom: 5px;
    right: 5px;
    height: 555px;
    max-width: 340px;
  }

  .chat__avatar {
    width: 60px;
    height: 65px;
  }
}
