/* Tooltip container */
.tooltip {
  position: relative;
  display: inline-block;
}

/* Tooltip text */
.tooltip .tooltip-text {
  width: 150px;
  background-color: black;
  color: #fff;
  text-align: center;
  padding: 5px;
  border-radius: 6px;
  font-size: 1.2rem;

  /* Position the tooltip text - see examples below! */
  position: absolute;
  z-index: 1;

  /* animate */
  display: none;
  transition: display 0.3s;
}

.tooltip .tooltip-text--bottom {
  width: 150px;
  top: 100%;
  left: 50%;
  margin-left: -75px; /* Use half of the width (150/2 = 75), to center the tooltip */
}

.tooltip .tooltip-text--bottom::after {
  content: " ";
  position: absolute;
  bottom: 100%;  /* At the top of the tooltip */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent black transparent;
}

.tooltip .tooltip-text--left {
  top: 3px;
  right: 105%;
}

.tooltip .tooltip-text--left::after {
  content: " ";
  position: absolute;
  top: 50%;
  left: 100%; /* To the right of the tooltip */
  margin-top: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent transparent black;
}

.tooltip .tooltip-text--right {
  top: 3px;
}

.tooltip .tooltip-text--right::after {
  content: " ";
  position: absolute;
  top: 50%;
  right: 100%; /* To the left of the tooltip */
  margin-top: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent black transparent transparent;
}

.tooltip .tooltip-text--top {
  width: 150px;
  bottom: 100%;
  left: 50%;
  margin-left: -75px; /* Use half of the width (150/2 = 60), to center the tooltip */
}

.tooltip .tooltip-text--top::after {
  content: " ";
  position: absolute;
  top: 100%; /* At the bottom of the tooltip */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: black transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
  display: inline-block;
}