.tooltip {
  position: absolute;
  z-index: 10001;
  top: 40px;
  max-width: 70%;
  padding: 10px 15px;
  color: var(--ui-on-primary-color);
  font-weight: normal;
  text-decoration: none;
  pointer-events: none;
  border-radius: 5px;
  background-color: var(--ui-primary-color);
  box-shadow: var(--ui-box-shadow);

  opacity: 0;
  @include transition(opacity 0.15s ease);

  &.visible {
    opacity: 1;
  }

  &:after {
    content: '';
    border-top: solid 10px transparent;
    border-right: solid 10px var(--ui-primary-color);
    border-bottom: solid 10px transparent;
    border-left: solid 10px transparent;
    position: absolute;
    top: 7px;
    left: -20px;
  }

  &.align_bottom_right,
  &.align_bottom_left {
    &:after {
      border-top: solid 10px transparent;
      border-right: solid 10px transparent;
      border-bottom: solid 10px var(--ui-primary-color);
      border-left: solid 10px transparent;

      top: -20px;
      left: 7px;
    }
  }

  &.align_top_center {
    transform: translate(-50%, -100%);

    &:after {
      border-top: solid 10px var(--ui-primary-color);
      border-right: solid 10px transparent;
      border-bottom: solid 10px transparent;
      border-left: solid 10px transparent;

      top: 100%;
      left: 50%;
      transform: translateX(-50%);
    }
  }

  &.align_bottom_right {
    @include transform(translateX(-100%));

    &:after {
      right: 7px;
      left: auto;
    }
  }
}
