.tooltip {
  position: absolute;
  margin: 0;
  background-color: #3f3f43;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  z-index: 99;
  padding: 4px 8px;
  opacity: 0;
  white-space: wrap;
  max-width: 140px;
  pointer-events: none;
  transform: translate(0, 0);
  font-size: 0.86em;
  transition: all 0.2s ease;
  transition-property: opacity, transform;
}

.tooltip.show {
  opacity: 1;
}

.tooltip::after {
  content: '';
  position: absolute;
  border-width: 5px;
  border-style: solid;
}

.tooltip-top::after {
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-color: #3f3f43 transparent transparent transparent;
}

.tooltip-left::after {
  top: 50%;
  left: 100%;
  margin-top: -5px;
  border-color: transparent transparent transparent #3f3f43;
}

.tooltip-right::after {
  top: 50%;
  right: 100%;
  margin-top: -5px;
  border-color: transparent #3f3f43 transparent transparent;
}

.tooltip-bottom::after {
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border-color: transparent transparent #3f3f43 transparent;
}

.tooltip-top {
  transform: translate(-50%, -100%);
}

.tooltip-bottom {
  transform: translate(-50%, 0);
}

.tooltip-top.show {
  transform: translate(-50%, calc(-100% - 12px));
}
.tooltip-bottom.show {
  transform: translate(-50%, 12px);
}

.tooltip-left {
  transform: translate(-100%, -50%);
}

.tooltip-right {
  transform: translate(0, -50%);
}

.tooltip-left.show {
  transform: translate(calc(-100% - 12px), -50%);
}

.tooltip-right.show {
  transform: translate(12px, -50%);
}
