$tooltip-bg: $color-primary;
$arrow-size: 5px;
$offset: 8px;

.container {
    width: 200px;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: $zindex-sky + 10;
    line-height: 1.4;

    &__position_top {
        bottom: $offset;
        // left: 50%;
        // margin-left: -100px;
    }

    &__position_right {
        // top: 50%;
        // margin-top: -10px;
        left: $offset;
        justify-content: flex-start;
    }

    &__position_bottom {
        // left: 50%;
        // margin-left: -100px;
        top: $offset;
    }

    &__position_left {
        // top: 50%;
        // margin-top: -10px;
        right: $offset;
        justify-content: flex-end;
    }
}

.tooltip {
    background: $tooltip-bg;
    color: white;
    padding: 4px 8px;
    text-align: center;
    border-radius: $radius;
    font-size: $font-size-sm;
    max-width: 200px;
    display: block;
    position: relative;
    box-shadow: $overlay-shadow;

    &_text {
        display: block;
        width: 100%;
    }

    // &:after {
    //     border: solid transparent;
    //     content: " ";
    //     height: 0;
    //     width: 0;
    //     position: absolute;
    //     pointer-events: none;
    //     border-color: rgba(0, 0, 0, 0);
    //     border-width: $arrow-size;
    // }

    // .container__position_bottom &:after {
    //     bottom: 100%;
    //     left: 50%;
    //     margin-left: -$arrow-size;
    //     border-bottom-color: $tooltip-bg;
    // }

    // .container__position_left &:after {
    //     left: 100%;
    //     top: 50%;
    //     margin-top: -$arrow-size;
    //     border-left-color: $tooltip-bg;
    // }

    // .container__position_right &:after {
    //     right: 100%;
    //     top: 50%;
    //     margin-top: -$arrow-size;
    //     border-right-color: $tooltip-bg;
    // }

    // .container__position_top &:after {
    //     top: 100%;
    //     left: 50%;
    //     margin-left: -$arrow-size;
    //     border-top-color: $tooltip-bg;
    // }
}

@each $kind, $color in $color-presets {
    .tooltip__#{$kind} {
        background: $color;
        color: text-color($color);
    }
}

.tooltip_text a {
    color: inherit;
}
