.tooltip {
  position: absolute;
  display: block;
  left: -9999px;
  top: -9999px;
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 2px;
  padding: 4px 8px;
  color: #fff;
  max-width: 240px;
  word-break: break-word;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  text-align: center;
  transition: opacity 450ms cubic-bezier(0.23, 1, 0.32, 1) 10ms;
  margin-top: -4px;
}

.tooltip.tooltip-active {
  opacity: 1;
}

.tooltip:after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid rgba(0, 0, 0, 0.8);
  position: absolute;
  top: 100%;
  left: calc(50% - 4px);
}

.tooltip[data-tooltip-direction="down"] {
  margin-top: 4px;
}

.tooltip[data-tooltip-direction="down"]:after {
  top: -4px;
  border-top: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 4px solid rgba(0, 0, 0, 0.8);
}

.tooltip[data-tooltip-direction="left"] {
  margin-top: 0;
  margin-left: -4px;
}

.tooltip[data-tooltip-direction="left"]:after {
  top: calc(50% - 4px);
  left: 100%;
  border-right: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 4px solid rgba(0, 0, 0, 0.8);
}

.tooltip[data-tooltip-direction="right"] {
  margin-top: 0;
  margin-left: 4px;
}

.tooltip[data-tooltip-direction="right"]:after {
  top: calc(50% - 4px);
  left: -4px;
  border-left: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-right: 4px solid rgba(0, 0, 0, 0.8);
}
