/* Chatbot toggle button */
#chatToggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);

  /* Center icon properly */
  display: flex;
  align-items: center;
  justify-content: center;

  /* Reset unwanted defaults */
  padding: 0;
  line-height: 0;
  outline: none;
}

/* If the icon is an <img> or inline <svg>, control its size */
#chatToggle img,
#chatToggle svg {
  width: 28px;
  /* tweak as needed */
  height: 28px;
  display: block;
  object-fit: contain;
}

/* Chatbot iframe */
#chatFrame {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 400px;
  height: 600px;
  border: none;
  z-index: 9998;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  overflow: hidden;

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Fade-in visible */
#chatFrame.visible {
  opacity: 1;
  visibility: visible;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  #chatFrame {
    transition: none;
  }
}

/* Keyboard focus styles */
#chatToggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.35), 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Mobile / small screen styles */
@media (max-width: 600px) {
  #chatFrame {
    width: 100%;
    left: 0;
    right: 0;
    bottom: 110px;
    /* leave space for toggle button */
    height: calc(100vh - 100px);
    /* full viewport minus bottom space */
    border-radius: 0;
    box-shadow: none;
  }
}