@import url("https://fonts.googleapis.com/css2?family=DM+Serif+Text&display=swap");

.chatbot-container {
  height: max-content;
  width: max-content;
  position: relative;
  z-index: 40;
}

#chatbot-toggler {
  position: fixed;
  bottom: 30px;
  right: 35px;
  border: none;
  height: 100px;
  width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  border-radius: 50%;
  transition: all 0.3s ease;
  background: transparent;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% {
    box-shadow:
      0 0 0 0 rgba(155, 252, 255, 0.7),
      0 0 0 0 rgba(147, 51, 234, 0.4);
  }

  40% {
    box-shadow:
      0 0 0 20px rgba(155, 252, 255, 0),
      0 0 0 10px rgba(147, 51, 234, 0);
  }

  80% {
    box-shadow:
      0 0 0 20px rgba(155, 252, 255, 0),
      0 0 0 10px rgba(147, 51, 234, 0);
  }

  100% {
    box-shadow:
      0 0 0 0 rgba(155, 252, 255, 0),
      0 0 0 0 rgba(147, 51, 234, 0);
  }
}

#chatbot-toggler:hover {
  transform: scale(1.05) rotate(5deg);
}

#jarvis {
  filter: drop-shadow(0 0 10px rgba(155, 252, 255, 0.8)) drop-shadow(0 0 20px rgba(147, 51, 234, 0.4));
  animation: jarvis-glow 3s infinite;
  transition: all 0.2s ease;
}

@keyframes jarvis-glow {
  0% {
    filter: drop-shadow(0 0 10px rgba(155, 252, 255, 0.8)) drop-shadow(0 0 20px rgba(147, 51, 234, 0.4));
    transform: scale(1) rotate(0deg);
  }

  50% {
    filter: drop-shadow(0 0 15px rgba(155, 252, 255, 0.9)) drop-shadow(0 0 30px rgba(147, 51, 234, 0.6));
    transform: scale(1.05) rotate(5deg);
  }

  100% {
    filter: drop-shadow(0 0 10px rgba(155, 252, 255, 0.8)) drop-shadow(0 0 20px rgba(147, 51, 234, 0.4));
    transform: scale(1) rotate(0deg);
  }
}

body.show-chatbot #jarvis {
  opacity: 0;
  transform: scale(0.8) rotate(-180deg);
}

body.show-chatbot #chatbot-toggler {
  transform: rotate(90deg);
  box-shadow:
    0 0 20px rgba(155, 252, 255, 0.4),
    0 0 40px rgba(147, 51, 234, 0.2);
}

#chatbot-toggler svg {
  position: absolute;
}

#chatbot-toggler svg {
  fill: white;
}


#chatbot-toggler i {
  opacity: 0;
  font-size: 1.3rem;
  color: black;
  text-shadow: 0 0 10px rgba(155, 252, 255, 0.5);

}

html.dark #chatbot-toggler i {
  color: white;
}

body.show-chatbot #chatbot-toggler i {
  opacity: 1;
}

.chatbot-popup {
  position: fixed;
  right: 35px;
  bottom: 90px;
  width: 420px;
  background: rgba(17, 25, 40, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  opacity: 0;
  transform: scale(0.2);
  transform-origin: bottom right;
  pointer-events: none;
  border-radius: 15px;
  box-shadow:
    0 8px 32px 0 rgba(147, 51, 234, 0.37),
    0 0 0 1px rgba(155, 252, 255, 0.1);
  overflow: hidden;
  transition: all 0.2s ease-in-out;
  z-index: 40;
}

html.dark .chatbot-popup {
  background: rgba(17, 25, 40, 0.85);
  box-shadow:
    0 8px 32px 0 rgba(147, 51, 234, 0.45),
    0 0 0 1px rgba(155, 252, 255, 0.2);
}

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

.chatbot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: rgba(17, 25, 40, 0.8);
  border-bottom: 1px solid #9333ea;
}

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

.header-info .bot-logo {
  width: 40px;
  height: 40pxx;
  fill: #9333ea;
  padding: 5px;
  border-radius: 50%;
  margin-right: 20px;

  display: flex;
  box-shadow: 0 4px 16px #9333ea;
  align-items: center;
  justify-content: center;
}

.header-info .logo-text {
  font-size: 1.3rem;
  font-weight: 600;
  color: #9bfcff;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow:
    0 0 10px rgba(155, 252, 255, 0.5),
    0 0 20px rgba(155, 252, 255, 0.3),
    0 0 30px rgba(155, 252, 255, 0.1);
  animation: pulse 2s infinite;
}

.chatbot-header #close-chatbot {
  border: none;
  height: 40px;
  width: 40px;
  border-radius: 100%;
  background: none;
  font-size: 0.9rem;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

.chatbot-header #close-chatbot:hover {
  background-color: #97458b;
}

.chat-body {
  padding: 20px 15px;
  display: flex;
  gap: 10px;
  flex-direction: column;
  height: 440px;
  overflow-y: auto;
  margin-bottom: 60px;
  scrollbar-width: thin;
  scrollbar-color: #ccccf5 transparent;
  padding-bottom: 50px;
}

.chat-body .message {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.chat-body .message.bot-message {
  display: flex;
  align-items: center;
}

.chat-body .bot-message .bot-avatar {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-body .bot-message .thinking {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 15px;
  margin-left: 8px;
  background: rgba(17, 25, 40, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(155, 252, 255, 0.2);
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.1);
  backdrop-filter: blur(8px);

}

.bot-message.thinking  #sent-message{
  display: none;
}


.chat-body .bot-message .thinking .dot {
  width: 4px;
  height: 16px;
  border-radius: 4px;
  background: #9bfcff;
  display: inline-block;
  animation: thinking 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 5px rgba(155, 252, 255, 0.8));
  transform-origin: center;
}

.bot-message.thinking .submit {
  display: none;
}

.chat-body .bot-message .thinking .dot:nth-child(1) {
  animation-delay: 0s;
  height: 12px;
}

.chat-body .bot-message .thinking .dot:nth-child(2) {
  animation-delay: 0.2s;
  height: 16px;
}

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

.chat-body .user-message {
  display: flex;
  flex-direction: column;
  align-items: end;
  margin-bottom: 2px;
}

.chat-body .user-message .attachment {
  width: 50px;
  padding: 13px 0 13px 13px;
  flex: shrink 0;
  margin-top: -7px;
}

.chat-body .message .message-test {
  max-width: 75%;
  padding: 10px 10px;
  border-radius: 20px;
  background: rgba(155, 252, 255, 0.1);
  color: #9bfcff;
  font-size: 0.9rem;
  word-wrap: break-word;
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(155, 252, 255, 0.2);
  display: flex;
  align-items: center;
}

.chat-body .bot-message .message-test {
  border-radius: 13px 13px 13px 0;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
  border: 1px solid rgba(155, 252, 255, 0.3);
  background: linear-gradient(135deg,
      rgba(17, 25, 40, 0.8),
      rgba(155, 252, 255, 0.1));
  text-shadow: 0 0 8px rgba(155, 252, 255, 0.5);
  animation: textGlow 2s infinite alternate;
}

@keyframes textGlow {
  from {
    text-shadow: 0 0 4px rgba(155, 252, 255, 0.5);
  }

  to {
    text-shadow: 0 0 8px rgba(155, 252, 255, 0.8),
      0 0 12px rgba(147, 51, 234, 0.4);
  }
}

.chat-body .bot-message .thinking-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 15px;
  margin-left: 8px;
  background: rgba(155, 252, 255, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(155, 252, 255, 0.2);
}


.chatbot-popup:has(.thinking-indicator) .chat-form #sent-message {
  pointer-events: none;
  opacity: 0.4;
  filter: grayscale(1);
  cursor: not-allowed;
}

.chat-body .bot-message .thinking-indicator .dot {
  width: 4px;
  border-radius: 4px;
  background: #9bfcff;
  display: inline-block;
  animation: thinking 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 5px rgba(155, 252, 255, 0.8));
}

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

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

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

@keyframes thinking {
  0% {
    transform: scaleY(1);
    background: #9bfcff;
    box-shadow:
      0 0 10px rgba(155, 252, 255, 0.8),
      0 0 20px rgba(147, 51, 234, 0.4);
  }

  50% {
    transform: scaleY(0.4);
    background: #9333ea;
    box-shadow:
      0 0 15px rgba(155, 252, 255, 0.9),
      0 0 25px rgba(147, 51, 234, 0.6);
  }

  100% {
    transform: scaleY(1);
    background: #9bfcff;
    box-shadow:
      0 0 10px rgba(155, 252, 255, 0.8),
      0 0 20px rgba(147, 51, 234, 0.4);
  }
}

@keyframes typing {
  from {
    border-right: 2px solid rgba(155, 252, 255, 0.8);
  }

  to {
    border-right: 2px solid transparent;
  }
}

.chat-body .bot-message .message-test {
  position: relative;
  overflow: hidden;
  white-space: pre-wrap;
}

.chat-body .bot-message:last-child .message-test {
  animation: typing 0.8s steps(1) infinite;
}

.chat-body .user-message .message-test {
  color: #fff;
  border-radius: 13px 13px 0 13px;
  background: rgba(147, 51, 234, 0.25);
  border: 1px solid rgba(147, 51, 234, 0.5);
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.2);
}

.chat-footer {
  position: absolute;
  width: 100%;
  bottom: 0;
  left: 0;
  background: rgba(155, 252, 255, 0.05);
  backdrop-filter: blur(10px);
  padding: 15px 20px;
  z-index: 10;
  border-top: 1px solid rgba(155, 252, 255, 0.1);
}

.chat-footer .chat-form {
  display: flex;
  position: relative;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 32px;
  outline: 1px solid rgba(147, 51, 234, 0.3);
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.1);
}

html.dark .chat-footer .chat-form {
  background-color: rgba(17, 25, 40, 0.6);
  color: #fff;
}

.chat-footer .chat-form:focus-within {
  outline: 2px solid #9333ea;
  background-color: rgba(255, 255, 255, 0.1);
}

html.dark .chat-footer .chat-form:focus-within {
  background-color: rgba(17, 25, 40, 0.8);
}

.chat-form .message-input {
  width: 100%;
  padding: 10px 15px;
  border: none;
  outline: none;
  max-height: 45px;
  min-height: 45px;
  white-space: pre-line;
  font-size: 0.9rem;
  resize: none;
  color: inherit;
  background: transparent;
  border-radius: inherit;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: all 0.3s ease;
}

.chat-form .message-input:hover {
  scrollbar-color: rgba(147, 51, 234, 0.5) transparent;
}

.chat-form .chat-controls {
  display: flex;
  height: 45px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
}

.chat-form .chat-controls button {
  border: none;
  height: 35px;
  width: 35px;
  background: none;
  font-size: 1rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: rgba(82, 81, 81, 0.808);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

html.dark .chat-form .chat-controls button {
  background-color: rgba(147, 51, 234, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.chat-form .chat-controls button:hover {
  background-color: rgba(147, 51, 234, 0.2);
  color: #9333ea;
}

html.dark .chat-form .chat-controls button:hover {
  background-color: rgba(147, 51, 234, 0.3);
  color: #9bfcff;
}

.chat-form .chat-controls #sent-message {
  color: white;
  display: none;
  background-color: #9333ea;
}

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

.chat-form .chat-controls #sent-message:hover {
  background-color: #af54a2;
}

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

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

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

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

.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-form em-emoji-picker {
  position: absolute;
  left: 50%;
  top: -337px;
  width: 100%;
  visibility: hidden;
  max-width: 350px;
  max-height: 330px;
  transform: translateX(-50%);
}

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

/* this is for swiper bullet */
.swiper-pagination span {
  background-color: #007bff;
}

/* // media queries */

@media (max-width: 640px) {
  #chatbot-toggler {
    right: 20px;
    bottom: 20px;
  }

  .chatbot-popup {
    right: 0;
    bottom: 0;
    height: 100%;
    border-radius: 0;
    width: 100%;
  }

  .chatbot-popup .chat-header {
    padding: 12px 15px;
  }

  .chat-body {

    padding: 25px 15px;
    height: calc(100% - 155px);
    padding-bottom: 0px;

  }

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

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