/* ********************************************************************************************** */
/* HubSpot Chat Widget Styles */
/* ********************************************************************************************** */

@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* 1. Style the main container for the inline chat */
#hubspot-widget-container {
  position: fixed;
  bottom: 90px; /* try position it above the toggle button */
  right: 20px;
  width: 400px;
  height: 600px;
  z-index: 2224;
  border-radius: 1rem;
  /* Hide the widget by default */
  visibility: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease-in-out;
}

/* 2. Add a class to show the widget */
#hubspot-widget-container.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* 3. Ensure the HubSpot content fills our container */
#hubspot-conversations-inline-parent,
#hubspot-conversations-inline-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 1rem; /* Match the container's radius */
  background: transparent;
}

/* 4. Processing overlay for blocking interactions */
/* Style for the overlay to disable interaction */
.processing-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2225; /* Make sure it's on top of the iframe content and other elements on the website*/
  background: transparent;
  pointer-events: none; /* By default, it allows clicks to go through */
  cursor: wait;
  border-radius: 1rem; /* Match the container's radius */
}

/* When the glow is active, enable pointer-events on the overlay to block clicks */
#hubspot-widget-container.processing-glow .processing-overlay {
  pointer-events: auto;
  /* Add a subtle visual indication that interactions are blocked */
  background: rgba(0, 0, 0, 0.01);
}

/* Prevent text selection and other interactions when processing */
#hubspot-widget-container.processing-glow {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

#hubspot-widget-container.processing-glow * {
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

/* 5. Glow effect in the container */
/* --- Base state for the pseudo-elements (invisible) --- */
#hubspot-widget-container::before,
#hubspot-widget-container::after {
  content: "";
  position: absolute;
  inset: -0.5rem;
  z-index: -1;
  border-radius: 1rem;
  background: conic-gradient(
    from var(--gradient-angle),
    #03045e,
    #0077b6,
    #00b4d8,
    #90e0ef,
    #03045e
  );

  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

/* --- Activation: When the class is added... --- */
#hubspot-widget-container.processing-glow::before,
#hubspot-widget-container.processing-glow::after {
  opacity: 1;
  animation: rotation 3s linear infinite;
}

#hubspot-widget-container.processing-glow::after {
  filter: blur(1.5rem);
}

@keyframes rotation {
  0% {
    --gradient-angle: 0deg;
  }
  100% {
    --gradient-angle: 360deg;
  }
}

/* ********************* */
/* HubSpot Chat Toggle Button */
/* ********************* */
.chat-toggle-button {
  position: fixed;
  bottom: 20px;
  right: 20px; /* Keep it in the same corner */
  z-index: 200;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #0077b6;
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease-in-out, background-color 0.2s;
}

.chat-toggle-button:hover {
  transform: scale(1.1);
  background-color: #00b4d8;
}

.chat-toggle-button:disabled {
  cursor: not-allowed;
  background-color: #6c757d;
}
