.globalhelpIcon {
  display: inline-block; /* Allow the background color to fill the element's box */
  color: var(--secondary-color) !important;
  background-color: #ffffff !important;
  cursor: pointer;
  vertical-align: middle; /* Add this to vertically center the icon */
}

.custom-tooltip {
  position: absolute;
  display: none; /* Hidden by default */
  background-color: #ffffff;
  color: var(--text-primary);
  padding: 5px 8px;
  border-radius: 4px;
  border: 1px solid var(--secondary-color);
  font-size: 0.8em;
  z-index: 9999;
  white-space: normal;  /* Allow text wrapping */
  max-width: 350px;     /* Adjust as needed */
  overflow-wrap: break-word; /* Ensure long words break if necessary */
  box-sizing: border-box; /* Ensure padding and border are included in the width */
}

/* Close button for tooltip */
.tooltip-close {
  position: absolute;
  top: 5px;
  right: 5px;
  display: none;  /* Hidden by default, shown on mobile */
  width: 20px;
  height: 20px;
  text-align: center;
  line-height: 20px;
  background-color: var(--secondary-color);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
}

/* Mobile styles - Show close button when tooltip is visible on mobile */
@media (max-width: 767px) {
  .custom-tooltip {
    max-width: 85vw;
    width: 85vw;
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding-top: 20px; /* Add space for close button */
    z-index: 9999;
  }
  
  .tooltip-close {
    display: block;
  }
}

/* For Firefox - prevent tap-to-hover behavior on mobile */
@media (hover: none) {
  .globalhelpIcon:hover + .custom-tooltip {
    display: none;
  }
}
