@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;
}
:root {
  --text-color: #f5f5f5;
  --hover-color: #12f7ff;
  --bg-color: #250821;
  --secon-bg-color: #292e33;
  --big-font: 2.5rem;
  --norma-font: 2rem;
  --neon-box-shadow: 0 0 0.5rem #12f7ff;
  --h2-font: 3rem;
  --font-neon-text-shadow: 0 0 10px rgba(18, 247, 233, 0.3),
    0 0 20px rgba(18, 247, 255, 0.3), 0 0 30px rgba(18, 247, 255, 0.3),
    0 0 40px rgba(18, 247, 255, 0.3), 0 0 70px rgba(18, 247, 255, 0.3),
    0 0 80px rgba(18, 247, 255, 0.3), 0 0 100px rgba(18, 247, 255, 0.3),
    0 0 150px rgba(18, 247, 255, 0.3);
}

body {
  min-height: 100vh;
  background: linear-gradient(#250821, #4e1547);
}

#chatbot-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* Semi-transparent dark background */
  backdrop-filter: blur(8px); /* Apply blur effect */
  z-index: 998; /* Below chatbot, above everything else */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Show overlay when chatbot is active */
body.show-chatbot #chatbot-overlay {
  opacity: 1;
  pointer-events: auto;
}

#chatbot-toggler{
  position: fixed;
  bottom: 30px;
  right: 35px;
  border: none;
  height: 50px;
  width: 50px;
  cursor: pointer;
  display: flex;
  align-items:center ;
  justify-content: center;
  border-radius: 50%;
  background: var(--hover-color);
  transition: all 0.2s ease;
}
body.show-chatbot #chatbot-toggler{
  transform: rotate(90deg);
}

#chatbot-toggler span{
  color: var(--bg-color);
  position: absolute;
}
body.show-chatbot #chatbot-toggler span:first-child,
#chatbot-toggler span:last-child{
  opacity: 0;
}

body.show-chatbot #chatbot-toggler span:last-child{
  opacity: 1;
}
.chatbot-popup {
  /* border: 1px solid var(--bg-color); */
  position: fixed;
  right: 35px;
  bottom: 90px;
  width: 420px;
  overflow: hidden;
  border-radius: 15px;
  transform: scale(0.2);
  transform-origin:bottom right ;
  box-shadow: 0 0 128px 0 rgba(18, 242, 250, 0.1),
    0 32px 64px -48px rgba(21, 255, 224, 0.5);
  color: rgb(22, 184, 206);
  opacity: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  transition: all 0.1s ease;
  z-index: 999;
}
body.show-chatbot .chatbot-popup{
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}
.chat-header {
  display: flex;
  align-items: center;
  background: var(--bg-color);
  padding: 15px 22px;
  justify-content: space-between;
}
.chat-header .header-info {
  display: flex;
  gap: 10px;
  align-items: center;
}
.header-info .chatbot-logo {
  height: 35px;
  width: 35px;
  background: #12f7ff;
  padding: 6px;
  fill: #250821;
  box-shadow: 2px 2px 7px #12f7ff;
  flex-shrink: 0;
  border-radius: 50%;
}
.chat-header .logo-text {
  color: var(--text-color);
  text-shadow: 0 0 10px rgba(18, 247, 233, 0.3),
    0 0 10px rgba(18, 247, 255, 0.3), 0 0 20px rgba(18, 247, 255, 0.3),
    0 0 30px rgba(18, 247, 255, 0.3), 0 0 70px rgba(18, 247, 255, 0.3),
    0 0 80px rgba(18, 247, 255, 0.3), 0 0 100px rgba(18, 247, 255, 0.3),
    0 0 150px rgba(18, 247, 255, 0.3);
  font-size: 1.31rem;
  font-weight: 600;
}
.chat-header #close-chatbot {
  border: none;
  color: var(--hover-color);
  height: 40px;
  width: 40px;
  font-size: 1.9rem;
  margin-right: -10px;
  padding-top: 2px;
  cursor: pointer;
  border-radius: 50%;
  background: none;
  transition: 0.3s ease;
}
.chat-header #close-chatbot:hover {
  background: var(--hover-color);
  color: var(--bg-color);
}
.chat-body {
  padding: 25px 22px;
  display: flex;
  gap: 20px;
  height: 460px;
  margin-bottom: 82px;
  overflow-y: auto;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #ccccf5 transparent;
}
.chat-body .message {
  display: flex;
  align-items: center;
  gap: 11px;
}
.chat-body .bot-message .bot-avatar {
  height: 35px;
  width: 35px;
  padding: 6px;
  fill: var(--bg-color);
  flex-shrink: 0;
  margin-bottom: 2px;
  align-self: flex-end;
  background: var(--hover-color);
  padding: 6px;
  border-radius: 50%;
}
.chat-body .message .message-text {
  padding: 12px 16px;
  max-width: 75%;
  font-size: 0.95rem;
}

.chat-body .bot-message.thinking .message-text {
  padding: 2px 16px;
}
.chat-body .user-message {
  flex-direction: column;
  align-items: flex-end;
}

.chat-body .bot-message .message-text {
  background: var(--bg-color);
  border-radius: 13px 13px 13px 3px;
  box-shadow: var(--neon-box-shadow);
}
.chat-body .user-message .message-text {
  color: var(--bg-color);
  background: var(--hover-color);
  border-radius: 13px 13px 3px 13px;
  font-weight: 600;
}
.chat-body .user-message .attachment {
  width: 50%;
  margin-top: -7px;
  border-radius: 13px 3px 13px 13px;
}
.chat-body .bot-message .thinking-indicator {
  display: flex;
  gap: 4px;
  padding-block: 15px;
}
.chat-body .bot-message .thinking-indicator .dot {
  height: 7px;
  width: 7px;
  background: var(--hover-color);
  opacity: 0.7;
  border-radius: 50%;
  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: rgba(255, 255, 255, 0);
  padding: 15px 22px 20px;
}
.chat-footer .chat-form {
  display: flex;
  position:relative ;
  align-items: center;
  background: var(--bg-color);
  border-radius: 32px;
  outline: 1px solid var(--hover-color);
}
.chat-footer .chat-form:focus-within {
  background: var(--bg-color);
  box-shadow: var(--font-neon-text-shadow);
  transition: 0.5s ease;
}
.chat-form .message-input {
  border: none;
  outline: none;
  height: 47px;
  resize: none;
  max-height: 180px;
  white-space: pre-line;
  width: 100%;
  font-size: 0.99rem;
  padding: 14px 0px 13px 18px;
  border-radius: inherit;
  background: var(--bg-color);
  color: var(--hover-color);
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.chat-form .message-input:hover{
scrollbar-color: var(--hover-color) transparent;
}

.chat-form .chat-controls {
  display: flex;
  height: 47px;
  align-items: center;
  align-self: flex-end;
  padding-right: 6px;
}
.chat-form .chat-controls button {
  height: 35px;
  width: 35px;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--hover-color);
  background: none;
  border-radius: 50%;
  transition: 0.2s ease;
}
.chat-form .chat-controls #send-message {
  color: var(--hover-color);
  display: none;
  background: var(--bg-color);
}
.chat-form .message-input:valid ~ .chat-controls #send-message {
  display: block;
}
.chat-form .chat-controls #send-message:hover {
  background: var(--hover-color);
  color: var(--bg-color);
}
.chat-form .chat-controls button:hover {
  background: var(--hover-color);
  color: var(--bg-color);
}

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

.chat-form .file-upload-wrapper :where(img,button){
  position: absolute;
}
.chat-form .file-upload-wrapper img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.chat-form .file-upload-wrapper #file-cancel{
  color: #ff0000;
  background: #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;
}

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

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

/* Responsive media-query for chat-bot */
@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: 12px 15px;
  }
  .chat-body{
    height: calc(90% - 55px);
    padding: 25px 15px;
  }
  .chat-footer{
    padding: 10px 15px 15px;
  }
  .chat-form .file-upload-wrapper.file-uploaded #file-cancel{
    opacity: 0;
  }
}