@use "_theme.scss";

.defaultStylesTooltip {
  position: relative;
  .tooltip-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    &.lines {
      &-1 {
        -webkit-line-clamp: 1;
      }
      &-2 {
        -webkit-line-clamp: 2;
      }
      &-3 {
        -webkit-line-clamp: 3;
      }
      &-4 {
        -webkit-line-clamp: 4;
      }
      &-5 {
        -webkit-line-clamp: 5;
      }
    }
  }
  .tooltip-text {
    display: none;
    background-color: var(--color-fill) !important;
    color: var(--text-color-dark) !important;
    text-align: center;
    white-space: pre-wrap;
    height: auto;
    border: 1px solid var(--color-line);
    z-index: 10;
    padding: 15px;
    max-width: 240px;
    min-width: 100px;
    border-radius: var(--form-input-border-radius);
    line-height: 1.3;
    font-size: var(--text-size-regular);
    box-shadow: 0 0 4px 0 var(--dark);
    position: absolute;
    top: 0;
    left: calc(1px - 15%);
    .arrow-true {
      position: absolute;
      width: 0;
      height: 0;
      border-color: transparent;
      border-style: solid;

    }
      &::after {
        content: '';
        position: absolute;
        width: 0;
        height: 0;
        border-color: transparent;
        border-style: solid;
      }
  }

  &.placement-top {
    .tooltip-text {
      top: auto;
      bottom: calc(100% + 18px);
      &::after {
        top: 100%;
        bottom: auto;
        left: 50%;
        margin-left: 0;
        border-width: 10px;
        border-top-color: var(--color-fill);
        translate: -50%;
      }
    }

    .arrow-true {
      top: 100%;
      bottom: auto;
      left: 50%;
      margin-left: 0;
      border-width: 12px;
      border-top-color: #fff;
      filter: drop-shadow(0px 3px 2px #938e8e);
      translate: -50%;

    }
  }

  &.placement-bottom {
    .tooltip-text {
      bottom: auto;
      top: calc(100% + 18px);
      &::after {
        top: -20px;
        left: 50%;
        margin-left: 0;
        border-width: 10px 10px 10px 10px;
        border-bottom-color: var(--color-fill);
        translate: -50%;
      }
    }

    .arrow-true {
      top: -24px;
      bottom: auto;
      left: 50%;
      margin-left: 0;
      border-width: 12px;
      border-bottom-color: #fff;
      filter: drop-shadow(0 -3px 2px #938e8e);
      translate: -50%;
    }
  }
}

@media (min-width: theme.$sm) {
  .defaultStylesTooltip {
    &:hover .tooltip-text {
      display: -webkit-box;
    }
  }
}
