/*!
 * Copyright 2020 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
.k-badge {
    margin: 0 0 0 .5em;
    padding: @badge-padding;
    box-sizing: border-box;
    border-width: @badge-border-width;
    border-style: solid;
    border-radius: @badge-border-radius;
    font-size: @badge-font-size;
    line-height: @badge-line-height;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    // RTL
    .k-rtl &,
    &[dir="rtl"],
    [dir="rtl"] & {
        margin: 0 .5em 0 0;
    }
}

.k-badge > * {
    color: inherit;
}

.k-badge.k-badge-pill {
    min-width: @badge-size;
    min-height: @badge-size;
    border-radius: 5rem;
}

.k-badge.k-badge-pill:empty {
    min-width: auto;
    min-height: auto;
}

a.k-badge,
.k-badge > a {
    text-decoration: none;
}

a.k-badge:hover,
.k-badge > a:hover {
    text-decoration: underline;
}

.k-badge-overlay {
    position: relative;
    overflow: visible;
}

.k-badge-overlay .k-badge {
    margin: 0;
    position: absolute;
    top: @badge-overlay-y;
    right: @badge-overlay-x;
    z-index: 9999;
    transform: translate(100%, -100%);

    &:empty {
        top: (@badge-padding + @badge-border-width);
        right: (@badge-padding + @badge-border-width);
    }

    // RTL
    .k-rtl &,
    &[dir="rtl"],
    [dir="rtl"] & {
        right: auto;
        left: @badge-overlay-x;
        transform: translate(-100%, -100%);

        &:empty {
            left: (@badge-padding + @badge-border-width);
        }
    }
}
