#chetty-chatbot-button, .chetty-animation-button {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 40px;
  width: 80px;
  height: 80px;
  border: none;
  border-radius: 0%;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 2147483643;  /* Ensure it's always on top */
  transition: width 0.2s, height 0.2s;
  background-color: transparent;
  margin-left: -100px;
  overflow: hidden;
  padding-block-end: 1px;
  padding-block-start: 1px;
  padding-inline-end: 6px;
  padding-inline-start: 6px;  
}

#chetty-logoContainer, #chetty-crossContainer {
  animation: chetty-pulse 1.5s infinite;  /* Makes them pulse by default */
}

#chetty-logoContainer:active, #chetty-crossContainer:active {
  animation: chetty-click 0.2s;  /* Applies the 'click' animation when pressed */
}

#chetty-chatbot-button.displayed, .chetty-animation-button.displayed {
  animation: chetty-bubblePop 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes chetty-bubblePop {
  0% {
      opacity: 0;
      transform: scale(0);
  }
  70% {
      opacity: 1;
      transform: scale(1.2);
  }
  100% {
      opacity: 1;
      transform: scale(1);
  }
}

@keyframes chetty-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.chetty-pulse {
  animation: chetty-pulse 1.5s infinite;
}

@keyframes chetty-click {
  50% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes chetty-grow {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes chetty-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#chetty-chatbot-button:active {
  animation: chetty-click 0.2s;
}

@media (max-width: 768px) {
  #chetty-chatbot-button {
    bottom: 50px;
    right: 10px;
    width: 60px;    
    height: 60px;
    font-size: 12px;
  }

  #chetty-chatbot-iframe {
    bottom: 0 !important;
    right: 0 !important;
    top: 0 !important; 
    left: 0 !important;  
    width: 100vw !important;  /* Corrected to viewport width */
    /*height: 88vh !important;  Keeps as viewport height */
    height: 100% !important;
    /*max-height: 1500px!important;*/
    border-radius: 0 !important;  /* No rounded corners */
  }
}

#chetty-chatbot-iframe {
  background-size: cover;
  position: fixed;
  bottom: 130px;
  right: 35px;  /* adjusted back to original */
  width: 400px;
  height: 711px;
  border: none;
  box-shadow: 
    0 4px 10px rgba(0, 0, 0, 0.09), 
    0 10px 25px rgba(0, 0, 0, 0.06), 
    0 20px 40px rgba(0, 0, 0, 0.03);
  z-index: 2147483643;
  display: none;
  border-radius: 15px;
  opacity: 0;
  transform: scale(0);
  transform-origin: bottom right;
  transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
}

/* Reduce height for smaller screens */
@media (max-height: 810px) {
  #chetty-chatbot-iframe {
    height: 600px;
  }
}

@media (max-height: 730px) {
  #chetty-chatbot-iframe {
    height: 520px;
  }
}

@media (max-height: 650px) {
  #chetty-chatbot-iframe {
    height: 400px;
  }
}

#chetty-chatbot-iframe.visible {
  transition: width 200ms ease 0s, height 200ms ease 0s, max-height 200ms ease 0s, transform 300ms cubic-bezier(0, 1.2, 1, 1) 0s, opacity 83ms ease-out 0s;
  opacity: 1;
  transform: scale(1);
}