/* Container must be position: relative for the tooltip */
.tooltip-container {
  position: relative;
  display: inline-block; /* shrinkwrap to text width */
}

/* The tooltip text (hidden by default) */
.tooltip-container .tooltip-text {
  visibility: hidden;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 4px;
  padding: 6px;

  /* Position the tooltip below */
  position: absolute;
  top: 125%; /* move it below the trigger element */
  left: 50%;
  transform: translateX(-50%);

  /* Fade-in effect */
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 10;
}

/* Arrow pointing up */
.tooltip-container .tooltip-text::after {
  content: "";
  position: absolute;
  bottom: 100%; /* at the top of tooltip */
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent #333 transparent;
}

/* Show the tooltip text on hover */
.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}