@import url("https://fonts.googleapis.com/css2?family=Baloo+2&display=swap");
:root {
  --body-bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  --msger-bg: #fff;
  --left-msg-bg: linear-gradient(to right, #1346d3e1, #47f441);
  --right-msg-bg: #ececec;
}

html {
  box-sizing: border-box;
}
*,
*:before,
*:after {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}

body {
  justify-content: center;
  align-items: center;
  height: 100vh;

  font-family: "Baloo 2", cursive;
}

.msger {
  display: flex;
  flex-flow: column wrap;
  justify-content: space-between;
  width: 100%;
  max-width: 386px;
  margin: 25px 10px;
  border-radius: 10px;
  height: calc(100% - 100px);
  background: var(--msger-bg);
  box-shadow: 0 15px 15px -5px rgba(0, 0, 0, 0.2);
}
.msger-header {
  display: flex;
  justify-content: center;
  padding: 10px;
  border-radius: 10px 10px 0px 0px;
  background: #3c3c3d;
  color: #ffffff;
}
.msger-header-title {
  display: flex;
  align-items: center;
}
.msger-header-title img {
  height: 2.5rem;
  width: auto;
}
.msger-header-title p {
  letter-spacing: 1px;
  font-size: 1.8rem;
  font-weight: bold;
}
.msger-chat {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}
.msger-chat::-webkit-scrollbar {
  width: 6px;
}
.msger-chat::-webkit-scrollbar-track {
  background: #ddd;
}
.msger-chat::-webkit-scrollbar-thumb {
  background: #bdbdbd;
  border-radius: 10px;
}
.msg {
  display: flex;
  align-items: flex-end;
  margin-bottom: 10px;
}
.msg:last-of-type {
  margin: 0;
}
.msg-img {
  width: 60px;
  height: 60px;
  margin-right: 10px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  border-radius: 50%;
}
.msg-bubble {
  max-width: 350px;
  padding: 15px;
  border-radius: 15px;
  background: var(--left-msg-bg);
}
.msg-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.msg-info-name {
  margin-right: 10px;
  font-weight: bold;
}
.msg-info-time {
  font-size: 0.85em;
}
.left-msg .msg-bubble {
  color: #fff;
  border-bottom-left-radius: 0;
}
.right-msg {
  flex-direction: row-reverse;
}
.right-msg .msg-bubble {
  background: var(--right-msg-bg);
  color: #000;
  border-bottom-right-radius: 0;
}
.right-msg .msg-img {
  margin: 0 0 0 10px;
}
.msger-inputarea {
  display: flex;
  padding: 10px;
  background: #1ef83b83;
  border-radius: 0px 0px 10px 10px;
}
.msger-inputarea * {
  padding: 5px;
  border: none;
  border-radius: 3px;
  font-size: 1em;
}
.msger-input {
  flex: 1;
  background: transparent;
  outline: none;
  border: 1px solid rgba(255, 255, 255, 0.7);
}
.msger-send-btn {
  margin-left: 10px;
  background: transparent;
  color: #070707;
  font-size: 1.5rem;
  cursor: pointer;
}
.msger-chat {
  background-color: #2c2b2b85;
  border-radius: 10px;
}

#chatbot-container {
  position: relative;
}

#open-chatbot {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 15px 20px;
  border: none;
  border-radius: 5px;
  background-color: #23ec5f;
  color: #fff;
  cursor: pointer;
  z-index: 10; /* Asegúrate de que el botón esté encima del chatbot */
}

.msger {
  /* ... (tu código CSS existente) */
  position: fixed;
  bottom: 20px;
  right: 20px;
  transform: scale(0); /* Inicialmente oculto */
  transition: transform 0.3s ease-in-out;
  z-index: 9999;
}

.close-btn {
  display: inline;
  background: none;
  border: none;
  color: #000000;
  font-size: 1.5em;
  cursor: pointer;
  /* Agrega más estilos para personalizar el botón */
  position: absolute;
  top: 5px;
  right: 10px;
}

@media (max-width: 768px) {
  /* Ajustes para tabletas */
  .msger {
    width: 90%; /* Hace que el contenedor sea más pequeño en tabletas */
    max-width: 400px; /* Limita el tamaño máximo para que no sea demasiado ancho */
    margin: 20px;
  }

  .msger-header {
    padding: 8px;
  }

  .msger-header-title p {
    font-size: 1.5rem; /* Reduce el tamaño del texto en el encabezado */
  }

  .msger-chat {
    padding: 8px;
  }

  .msg {
    margin-bottom: 8px;
  }

  .msg-img {
    width: 50px; /* Reduce el tamaño de la imagen del mensaje */
    height: 50px;
  }

  .msger-inputarea {
    padding: 8px;
  }

  .msger-input {
    font-size: 0.9em; /* Ajusta el tamaño de fuente en dispositivos más pequeños */
  }

  .msger-send-btn {
    font-size: 1.2rem; /* Ajusta el tamaño del botón de envío */
  }

  #open-chatbot {
    padding: 12px 16px; /* Ajusta el tamaño del botón de abrir el chatbot */
  }
}

@media (max-width: 480px) {
  /* Ajustes para dispositivos móviles */
  .msger {
    width: 100%; /* Hace que el contenedor ocupe el ancho completo en móviles */
    margin: 15px;
    max-width: 350px;
  }

  .msger-header {
    padding: 6px;
  }

  .msger-header-title p {
    font-size: 1.3rem; /* Reducir aún más el tamaño del texto en el encabezado */
  }

  .msger-chat {
    padding: 6px;
  }

  .msg {
    margin-bottom: 6px;
  }

  .msg-img {
    width: 40px; /* Hace que la imagen del mensaje sea más pequeña */
    height: 40px;
  }

  .msger-inputarea {
    padding: 6px;
  }

  .msger-input {
    font-size: 0.85em; /* Ajusta el tamaño de la fuente */
  }

  .msger-send-btn {
    font-size: 1.2rem;
  }

  #open-chatbot {
    padding: 10px 14px; /* Ajusta el tamaño del botón de abrir el chatbot */
  }
}

@media (max-width: 375px) {
  /* Ajustes para dispositivos móviles más pequeños */
  .msger {
    width: 100%;
    max-width: 320px;
    margin: 10px;
  }

  .msger-header {
    padding: 5px;
  }

  .msger-header-title p {
    font-size: 1.2rem; /* Ajusta aún más el tamaño del texto */
  }

  .msg-img {
    width: 35px; /* Imagen más pequeña */
    height: 35px;
  }

  .msger-inputarea {
    padding: 5px;
  }

  .msger-input {
    font-size: 0.8em; /* Ajusta la fuente en dispositivos más pequeños */
  }

  .msger-send-btn {
    font-size: 1.1rem;
  }

  #open-chatbot {
    padding: 8px 12px; /* Ajusta el tamaño del botón de abrir el chatbot */
  }
}
