@import '../custom.less';
@import '../mixins/tooltip.less';
@import '../animation/zoom.less';

@poptip-tag-name: r-poptip;
@poptip-prefix-cls: ~'@{css-prefix}poptip';
@poptip-arrow: ~'@{poptip-prefix-cls}-arrow';
@poptip-max-width: 250px;
@poptip-arrow-width: 7px;
@poptip-arrow-outer-width: (@poptip-arrow-width + 1);
@poptip-distance: @poptip-arrow-width - 1 + 4;
@poptip-arrow-color: hsla(0, 0%, 85%, 0.5);

@{poptip-tag-name} {
    display: inline-block;
}

.@{poptip-prefix-cls} {
    &-rel {
        display: inline-block;
        position: relative;
    }

    &-title {
        min-width: 177px;
        min-height: 32px;
        margin: 0;
        padding: @padding-xs @padding-md;
        position: relative;
        border-bottom: @border-width-base @border-style-base @border-color-split;
        color: @title-color;
        font-size: @font-size-base;
        font-weight: 500;

        // &-inner {
        //     color: @title-color;
        //     font-size: @font-size-base;
        //     font-weight: 500;
        // }
    }

    &-body {
        padding: @padding-sm @padding-md;

        &-content {
            color: @text-color;
            overflow: auto;

            &-word-wrap {
                white-space: normal;
                text-align: justify;
            }

            // &-inner {
            //     color: @text-color;
            // }
        }
    }

    &-inner {
        width: 100%;
        background-color: @white;
        background-clip: padding-box;
        border-radius: @border-radius-base;
        box-shadow: 0 3px 6px -4px rgb(0 0 0 / 12%), 0 6px 16px 0 rgb(0 0 0 / 8%),
            0 9px 28px 8px rgb(0 0 0 / 5%);
        white-space: nowrap;
        text-align: left;
    }

    &-popper {
        min-width: 170px;
        font-size: @font-size-base;
        will-change: top, left;
        .popper(@poptip-arrow, @poptip-arrow-width, @poptip-distance, @poptip-arrow-color);
        visibility: hidden;
        opacity: 0;

        &[x-placement^='top'] .@{poptip-arrow}:after {
            content: ' ';
            bottom: 1px;
            margin-left: -@poptip-arrow-width;
            border-bottom-width: 0;
            border-top-width: @poptip-arrow-width;
            border-top-color: @white;
        }

        &[x-placement^='right'] .@{poptip-arrow}:after {
            content: ' ';
            left: 1px;
            bottom: -@poptip-arrow-width;
            border-left-width: 0;
            border-right-width: @poptip-arrow-width;
            border-right-color: @white;
        }

        &[x-placement^='bottom'] .@{poptip-arrow}:after {
            content: ' ';
            top: 1px;
            margin-left: -@poptip-arrow-width;
            border-top-width: 0;
            border-bottom-width: @poptip-arrow-width;
            border-bottom-color: @white;
        }

        &[x-placement^='left'] .@{poptip-arrow}:after {
            content: ' ';
            right: 1px;
            border-right-width: 0;
            border-left-width: @poptip-arrow-width;
            border-left-color: @white;
            bottom: -@poptip-arrow-width;
        }
    }

    &-arrow {
        &,
        &:after {
            display: block;
            width: 0;
            height: 0;
            position: absolute;
            border-color: transparent;
            border-style: @border-style-base;
        }
    }

    &-arrow {
        border-width: @poptip-arrow-outer-width;
    }

    &-arrow:after {
        content: '';
        border-width: @poptip-arrow-width;
    }

    &-confirm &-popper {
        max-width: 300px;
    }

    &-confirm &-inner {
        white-space: normal;
    }

    &-confirm &-body {
        padding: @padding-md @padding-md @padding-xs;

        .rab-icon {
            font-size: @font-size-large + 2;
            color: @warning-color;
            line-height: 16px;
            position: absolute;
        }

        &-message {
            padding: 0 0 @padding-sm @padding-sm * 2;
            color: @title-color;
        }
    }

    &-confirm &-footer {
        text-align: right;
        margin-bottom: 6px;

        button {
            margin-left: 4px;
        }
    }
}
