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

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

body {
  width: 100%;
  min-height: 100vh;
  background: linear-gradient(#1f2430, #2d3344);
}

#chatbot-toggler {
  position: fixed;
  bottom: 30px;
  right: 35px;
  border: none;
  height: 50px;
  width: 50px;
  display: flex;
  cursor: pointer;
  border-radius: 50%;
  background: #ffcc66;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 1001;
}

#chatbot-toggler:hover {
  background-color: #8a6e38;
}
#chatbot-toggler:active {
  background-color: #1f2430;
}

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

/* Chat Popup */
.chatbot-popup {
  position: fixed;
  bottom: 90px;
  right: 35px;
  width: 420px;
  height: 600px;
  background: #1f2430;
  border-radius: 15px;
  box-shadow: 0 0 128px 0 rgba(0, 0, 0, 0.1),
    0 32px 64px -48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.2);
  transform-origin: bottom right;
  transition: all 0.1s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.container.show-chatbot .chatbot-popup {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.chatbot-popup .chat-header {
  display: flex;
  padding: 15px 22px;
  align-items: center;
  justify-content: space-between;
  background: #2d3344;
}
.chat-header .header-info {
  display: flex;
  gap: 10px;
  align-items: center;
}
.header-info svg {
  height: 35px;
  width: 35px;
  padding: 6px;
  flex-shrink: 0;
  fill: #1f2430;
  background: #ffcc66;
  border-radius: 50%;
}
.header-info .logo-text {
  color: #cbccc6;
  font-size: 1.31rem;
  font-weight: 600;
}
.chat-header button {
  height: 40px;
  width: 40px;
  border: none;
  outline: none;
  color: #ffcc66;
  cursor: pointer;
  font-size: 1.9rem;
  border-radius: 50%;
  background: none;
  transition: 0.2s ease;
}
.chat-header button:hover {
  background: #453b1d;
}

/* Chat Body */
.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding: 25px 22px;
  scrollbar-width: thin;
  scrollbar-color: #5c6773 transparent;
  color: #cbccc6;
  font-size: 1.15rem;
  font-weight: bold;
}
.chat-body::-webkit-scrollbar {
  width: 6px;
}
.chat-body::-webkit-scrollbar-thumb {
  background-color: #5c6773;
  border-radius: 10px;
}
.chat-body .message {
  display: flex;
  gap: 11px;
  align-items: center;
}
.chat-body .message.error .message-text {
  color: #ff3333;
}
.chat-body .bot-message svg {
  height: 35px;
  width: 35px;
  padding: 6px;
  flex-shrink: 0;
  fill: #1f2430;
  align-self: flex-end;
  margin-bottom: 2px;
  background: #b8cc52;
  border-radius: 50%;
}
.chat-body .message .message-text {
  padding: 12px 16px;
  max-width: 75%;
  word-wrap: break-word;
  white-space: pre-line;
  font-size: 1.15rem;
  font-style: bold;
}
.chat-body .bot-message .message-text {
  background: #2d3344;
  color: #cbccc6;
  border-radius: 13px 13px 13px 3px;
}
.chat-body .user-message {
  flex-direction: column;
  align-items: flex-end;
}
.chat-body .user-message .message-text {
  color: #1f2430;
  background: #ffcc66;
  border-radius: 13px 13px 13px 3px;
}

.chat-footer {
  flex-shrink: 0;
  background: #1f2430;
  padding: 15px 22px 20px;
  position: relative;
}
.chat-footer .chat-form {
  display: flex;
  align-items: center;
  background: #2d3344;
  border-radius: 32px;
  outline: 1px solid #5c6773;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.06);
}
.chat-footer .chat-form:focus-within {
  outline: 2px solid #ffcc66;
}
.chat-form .message-input {
  border: none;
  outline: none;
  width: 100%;
  background: none;
  color: #cbccc6;
  height: 47px;
  padding: 0 17px;
  font-size: 1.15rem;
  font-weight: bold;
}
.chat-form button {
  height: 35px;
  width: 35px;
  border: none;
  display: none;
  outline: none;
  cursor: pointer;
  font-size: 1.15rem;
  color: #1f2430;
  flex-shrink: 0;
  margin-right: 6px;
  border-radius: 50%;
  background: #ffcc66;
  transition: 0.2s ease;
}
.chat-form button:hover {
  background: #caab50;
}
.chat-form button:focus {
  outline: 2px solid #ffd866;
  outline-offset: 2px;
}
.chat-form .message-input:valid ~ button {
  display: block;
}

@media (max-width: 500px) {
  .chatbot-popup {
    width: 100%;
    height: 100dvh;
    bottom: 0;
    right: 0;
    border-radius: 0;
    transform-origin: bottom center;
  }

  .chat-body {
    padding: 20px 16px;
  }

  .chat-footer {
    padding: 12px 16px 16px;
  }

  #chatbot-toggler {
    bottom: 20px;
    right: 20px;
  }

  .container.show-chatbot #chatbot-toggler {
    display: none;
  }

  .container.show-chatbot .chatbot-popup .chat-header button {
    display: none;
  }

  .container.show-chatbot .chatbot-popup .chat-header button {
    display: flex;
  }
}
