@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(white, purple);

}

#chatbot-toggler {
  position: fixed;
  bottom: 30px;
  right: 35px;
  border: none;
  height: 50px;
  width: 50px;
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: plum;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}


body.show-chatbot #chatbot-toggler {
  transform: rotate(90deg);
}

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

#chatbot-toggler span:last-child,
body.show-chatbot #chatbot-toggler span:first-child {
  opacity: 0;
}

body.show-chatbot #chatbot-toggler span:last-child {
  opacity: 1;
}


.chatbot-popup {
  position: fixed;
  right: 35px;
  bottom: 90px;
  width: 420px;
  height: 550px;
  background: white;
  border-radius: 15px;

  opacity: 0;
  pointer-events: none;
}

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


.chat-header {
  display: flex;
  align-items: center;
  padding: 15px 22px;
  background: plum;
  justify-content: space-between;

}

.chat-header .header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-info .chatbot-logo {
  width: 35px;
  height: 35px;
  background: white;
  padding: 6px;
  fill: plum;
  border-radius: 50%;
  flex-shrink: 0;
}

.header-info .logo-text {
  color: white;
  font-weight: 600;
  font-size: 1.31rem;
  letter-spacing: 0.02rem;

}

.chat-header #close-chatbot {
  border: none;
  background: none;
  color: white;
  height: 40px;
  width: 40px;
  font-size: 1.9rem;
  padding-top: 2px;
  cursor: pointer;
  border-radius: 50%;
}

.chat-header #close-chatbot:hover {
  background: purple;
}

.chat-body {
  display: flex;
  padding: 25px 22px;
  height: 460px;
  margin-bottom: 82px;
  flex-direction: column;
  overflow-y: auto;
  gap: 20px;
  margin-bottom: 82px;
  scrollbar-width: thin;

}

.chat-body,
.chat-form .message-input:hover {
  scrollbar-color: #ccccf5 transparent;
}



.chat-body .message {
  display: flex;
  align-items: center;
  gap: 11px;
}

.chat-body .message .bot-avatar {
  width: 35px;
  height: 35px;
  padding: 6px;
  background: plum;
  border-radius: 50%;
  fill: white;
}

.chat-body .message .message-text {
  max-width: 75%;
  padding: 12px 16px;
  font-size: 0.95rem;
}

.chat-body .bot-message.thinking .message-text {
  padding: 2px 16px;
}

.chat-body .bot-message .message-text {
  background: #F2F2FF;
  border-radius: 13px 13px 13px 3px;
}

.chat-body .user-message {
  flex-direction: column;
  align-items: flex-end;
}

.chat-body .user-message .message-text {
  background: plum;
  color: white;
  border-radius: 13px 13px 3px 13px;
}

.chat-body .user-message .attachment {
  width: 50%;
  border-radius: 13px 3px 13px 13px;
  margin-top: -7px;
}

.chat-body .bot-message .thinking-indicator {
  display: flex;
}

.chat-body .bot-message .thinking-indicator .dot {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: purple;
  opacity: 0.7;
  animation: dotPulse 1.8s ease-in-out infinite;
}


.chat-body .bot-message .thinking-indicator .dot:nth-child(1) {
  animation-delay: 0.2s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(2) {
  animation-delay: 0.3s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {

  0%,
  44% {
    transform: translateY(0);
  }

  28% {
    opacity: 0.4;
    transform: translateY(-4px);
  }

  44% {
    opacity: 0.2;
  }

}


.chat-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: white;
  padding: 15px 22px 20px;
}

.chat-footer .chat-form {
  display: flex;
  align-items: center;
  background: white;
  position: relative;
  border-radius: 32px;
  outline: 1px solid #CCCCE5;
}

.chat-form:focus-within {
  outline: 2px solid plum;
}

/* Message Input */
.chat-form .message-input {
  width: 100%;
  height: 47px;
  outline: none;
  resize: none;
  border: none;
  max-height: 180px;
  border-radius: inherit;
  font-size: 0.95rem;
  padding: 14px 0 12px 18px;

  scrollbar-width: thin;

}

.chat-form .chat-controls {
  height: 47px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding-right: 6px;
  /* align-self: flex-end; */
}

.chat-form .chat-controls button {
  height: 35px;
  width: 35px;
  border: none;
  cursor: pointer;
  color: purple;
  border-radius: 50%;
  font-size: 1.15rem;
  background: none;
}

.chat-form .chat-controls button:hover,
body.show-emoji-picker .chat-controls #emoji-picker {
  color: purple;
  background: #f1f1ff;
}

.chat-form .chat-controls #send-message {
  /* color: white; */
  background: plum;
  color: white;
  display: none;
}

.chat-form .chat-controls #send-message:hover {
  background: purple;
}

.chat-form .message-input:valid~.chat-controls #send-message {
  display: block;
}

.chat-form .file-upload-wrapper {
  position: relative;
  height: 35px;
  width: 35px;
}

.chat-form .file-upload-wrapper:where(button, img) {
  position: absolute;
}

.chat-form .file-upload-wrapper img {
  height: 100%;
  width: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.chat-form .file-upload-wrapper #file-cancel {
  color: #ff0000;
  background: #fff;
}



/* #chatbot-toggler {
    position: fixed;
    bottom: 30px;
    right: 35px;
    border: none;
    height: 50px;
    width: 50px;
    display: flex;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: plum;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
} */

/* #chatbot-toggler span {
    position: absolute;
    color: white;
} */

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

/* body.show-chatbot #chatbot-toggler {
    transform: rotate(90deg);
} */

/* #chatbot-toggler span:last-child,
body.show-chatbot #chatbot-toggler span:first-child {
    opacity: 0;
}

body.show-chatbot #chatbot-toggler span:last-child {
    opacity: 1;
} */

.chat-form .file-upload-wrapper :where(img, #file-cancel),
.chat-form .file-upload-wrapper.file-uploaded #file-upload {
  display: none;
}

.chat-form .file-upload-wrapper.file-uploaded img,
.chat-form .file-upload-wrapper.file-uploaded:hover #file-cancel {
  display: block;
}

/* .chat-body .user-message {
    flex-direction: column;
    align-items: flex-end;
} */

/* .chat-body .user-message .message-text {
    background: plum;
    color: white;
    border-radius: 13px 13px 3px 13px;
} */

/* .chat-body .user-message .attachment {
    width: 50%;
    border-radius: 13px 3px 13px 13px;
    margin-top: -7px;
} */

/* .chat-body .bot-message .thinking-indicator {
    display: flex;
} */


em-emoji-picker {
  position: absolute;
  visibility: hidden;
  left: 50%;
  max-width: 350px;
  width: 100%;
  transform: translateX(-50%);
  top: -336px;
  max-height: 330px;
}

body.show-emoji-picker em-emoji-picker {
  visibility: visible;
}


/*write css for mobile screens (media query)*/

@media (max-width:520px) {
  #chatbot-toggler {
    right: 20px;
    bottom: 20px;
  }
  .chatbot-popup {
    right: 0;
    bottom: 0;
    height: 100%;
    border-radius: 0;
    width: 100%;
  }
  .chatbot-popup .chat-header {
    padding: 25px 15px;
  }
  .chat-body{
    padding: 25px 15px;
  }

  .chat-footer {
    padding: 10px 15px 15px;
  }

  /* .chat-form .file-upload-wrapper.file-upload-wrapper.file-uploaded #file-cancel{
    opacity: 0;
  } */
}