/* Untuk tooltip */

.tooltip {
  position: relative;
}

.tooltip::after {
  text-transform: none;
  font-size: 16px;
  line-height: 0;
  user-select: none;
  pointer-events: none;
  position: absolute;
  display: none;
  opacity: 0;
  box-shadow: 0 0.1rem 0.4rem #00000020;
  content: attr(pesan);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 12px 10px;
  border-radius: 0.3ch;
  background: white;
  color: black;
  z-index: 1000;
}

.tooltip:hover::after {
  display: block;
}

[pesan='']::after {
  display: none !important;
}

.tooltip:not([flow])::after,
.tooltip.top::after {
  bottom: calc(100% + 5px);
}

.tooltip.top::after {
  left: 50%;
  transform: translate(-50%, -0.5em);
}

.tooltip.bottom::after {
  top: calc(100% + 5px);
  left: 50%;
  transform: translate(-50%, 0.5em);
}

.tooltip.left::after {
  top: 50%;
  right: calc(100% + 5px);
  transform: translate(-0.5em, -50%);
}

.tooltip.right::after {
  top: 50%;
  left: calc(100% + 5px);
  transform: translate(0.5em, -50%);
}

@keyframes animasi {
  to {
    opacity: 0.9;
    transform: translate(-50%, 0);
  }
}

@keyframes animasii {
  to {
    opacity: 0.9;
    transform: translate(0, -50%);
  }
}

.tooltip.top:hover::after,
.tooltip.bottom:hover::after {
  animation: animasi 300ms ease-out forwards;
}

.tooltip.left:hover::after,
.tooltip.right:hover::after {
  animation: animasii 300ms ease-out forwards;
}
