@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap");
* {
  padding: 0;
  margin: 0;
  text-decoration: none;
  list-style: none;
  box-sizing: border-box;
}
body {
  font-family: Montserrat;
}

/* chat open and close */
.chat-bar-open {
  position: fixed; /* Floating button */
  bottom: 0; /* Distance from bottom */
  left: 20%; /* Center horizontally */
  right: 20%;
}
.chat-bar-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
}
.chat-bar-open .close{
  background-color: #fff;
  cursor: pointer;
  padding: 15px;
  border-style: none;
  vertical-align: middle;
  box-shadow: rgb(0 0 0 / 10%) 0px 1px 6px, rgb(0 0 0 / 20%) 0px 2px 24px;
  width: 100%;
  border-radius: 7px;
  font-size: 20px;
}
.chat-bar-close button {
  background-color: #fff;
  cursor: pointer;
  padding: 4px;
  border-style: none;
  vertical-align: middle;
  box-shadow: rgb(0 0 0 / 10%) 0px 1px 6px, rgb(0 0 0 / 20%) 0px 2px 24px;
  width: 100%;
  border-radius: 50%;
  font-size: 20px;
}
.chat-bar-close .close {
  width: 56px;
  height: 56px;
  padding: 12px;
}
.chat-bar-open .close img {
  height: 40px;
}
.chat-bar-close .close i {
  font-size: 30px;
}
.chat-bar-close .close::after {
  position: absolute;
  content: "";
  top: 27px;
  left: 23px;
  transform: rotate(-55deg);
  border-left: 24px solid transparent;
  border-right: 29px solid transparent;
  border-top: 31px solid #fff;
}
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
  z-index: 9999; /* Below the popup but above the rest of the page */
  display: none; /* Initially hidden */
}

/* chat window */
.chat-window2 {
  display: none;
  border-radius: 10px;
  background-color: #fff;
  padding: 16px;
  z-index: 10000;
  position: fixed;
  top: 10%; /* 10% from the top of the viewport */
  left: 5%; /* Center horizontally within the viewport */
  right: 5%;
  max-height: 80%; /* Prevent it from exceeding 80% of the viewport height */
  box-shadow: rgb(0 0 0 / 10%) 0px 1px 6px, rgb(0 0 0 / 20%) 0px 2px 24px;
  overflow-y: auto; /* Add scroll if content overflows */
}
.chat-window2.show {
  display: block;
  opacity: 1;
}

/* Message container styles */
.message-box {
  height: 60vh;
  width: 100%;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.hi-there {
  background-color: #7f8ac5;
  color: #fff;
  padding: 20px 30px;
  border-radius: 5px;
}
.hi-there .p1 {
  font-size: 20px;
}
.hi-there .p2 {
  font-size: 13px;
}

/* User message styles (first-chat) */
.message-box .first-chat {
  align-self: flex-start;
  max-width: 70%;
  width: auto;
  padding: 10px;
}
.message-box .first-chat p {
  font-size: 18px;
  margin: 0;
  overflow-wrap: break-word;
  font-weight: bold;
}

/* AI message styles (second-chat) */
.message-box .second-chat {
   /* Align to right */
   width: auto;
   padding: 10px;
   margin: 8px 0;
   display: flex;
   float: none;
   flex-direction: column;
   align-items: start;
}

.message-box .second-chat p {
  padding: 12px 15px;
  margin: 0;
  border-radius: 15px 15px 0 15px;
  color: #000;
  font-size: 14px;
  float: none; 
  line-height: 1.6em;
}

/* Add styles for the new loading animation */
.typing-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 120px; /* Adjust height for larger animations */
  margin: 10px 0;
}
.second-chat.typing-indicator {justify-content: flex-start;}

.lottie-animation {
  width: 160px; /* Set width of the Lottie animation */
  height: 160px; /* Set height of the Lottie animation */
}

/* Animation for the bouncing dots */
@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Input box styles */
.input-box {
  font-size: 12px;
  padding: 0px 30px;
  padding-bottom: 18px;
  display: flex;
  max-width: 900px;
  margin: 0px auto;
  column-gap: 15px;
}
.input-box .write-reply {
  width: 100%;
}
.input-box .write-reply textarea {
  outline: none;
  font-size: 18px;
  width: 100%;
  min-height: 63px; /* Minimum height is 63px */
  max-height: 20vh; /* Maximum height is 20% of viewport height */
  border: 1px solid;
  padding: 20px;
  border-radius: 40px;
  resize: none; /* Disable manual resizing */
  overflow-y: hidden; /* Initially hide the scrollbar */
  font-family: 'Montserrat', sans-serif;
}
.input-box .send-button {
  border: none;
  outline: none;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}
.input-box .send-button button {
  border: none;
  background-color: #7f8ac5;
  cursor: pointer;
  outline: none;
  padding: 18px 20px;
  border: 1px solid;
  border-radius: 50px;
  border: 0;
}
.input-box .send-button button i {
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  line-height: 1em;
}

.markdown-content {
  font-family: Arial, sans-serif;
  line-height: 1.5;
}

.markdown-content h1,
.markdown-content h2 {
  font-weight: bold;
  margin: 10px 0;
}

.markdown-content ul {
  list-style-type: disc;
  margin: 10px 0 10px 20px;
  font-size: 14px;
}
.markdown-content ul li {
  list-style: disc;
}
.markdown-content ol {
  list-style-type: decimal;
  margin: 10px 0 10px 20px;
}

.markdown-content p {
  margin: 10px 0;
}

.markdown-content code {
  display: inline-block;
  background-color: #f4f4f4;
  color: #c7254e;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
}

.markdown-content pre {
  background-color: #f4f4f4;
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
}

.markdown-content a {
  color: #007bff;
  text-decoration: none;
}

.markdown-content a:hover {
  text-decoration: underline;
}
/* Fade-in effect */
.fade-in {
  animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* Responsive styles */
@media screen and (max-width: 396px) {
  .chat-window {
    right: 14px;
    bottom: 87px;
  }
  .chat-window2 {
    right: 14px;
    bottom: 87px;
    height: 420px;
  }
  .chat-bar-open {
    bottom: 20px;
    right: 21px;
  }
  .chat-bar-close {
    bottom: 21px;
    right: 25px;
  }
}