@import '~@thumbtack/thumbprint-tokens/dist/scss/_index';

@keyframes tooltip-animation {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

$tooltip-max-width: 235px;

.childrenWrapper {
    display: inline-flex;
}

.tooltip {
    animation: tooltip-animation $tp-duration__2 $tp-ease__out;
    box-shadow: 0px 1px 3px 0px rgba($tp-color__black, 0.5);
    font-size: $tp-font__body__3__size;
    // Prevent font-weight from being inherited.
    font-weight: 400;
    line-height: $tp-font__body__3__line-height;
    padding: $tp-space__2 $tp-space__3;
    border-radius: $tp-border-radius__base;
    max-width: $tooltip-max-width;

    &Dark {
        background: $tp-color__black;
        color: $tp-color__white;
    }

    &Light {
        background: $tp-color__white;
        color: $tp-color__black;
    }
}

.nubbin {
    width: 0;
    height: 0;
    border-style: solid;
    position: absolute;
    margin: $tp-space__2;
    // Create a arrow with CSS.
    border-width: $tp-space__2 $tp-space__2 0 $tp-space__2;
    border-left-color: transparent;
    border-right-color: transparent;
    border-bottom-color: transparent;
    margin-top: 0;
    margin-bottom: 0;

    &Top {
        transform: rotate(0deg);
        bottom: -#{$tp-space__2};
    }

    &Bottom {
        transform: scale(-1);
        top: -#{$tp-space__2};
    }

    &Dark {
        border-top-color: $tp-color__black;
    }

    &Light {
        border-top-color: $tp-color__white;
    }
}

.tooltipContent {
    white-space: pre-line !important;
}
