@import "../styles/base/fn.wxss";

.@{wuxClassNamePrefix}-badge {
    position: relative;
    display: inline-block;
    line-height: 1;
    vertical-align: middle;

    &__count {
        position: absolute;
        transform: translateX(50%);
        top: -6px;
        right: 0;
        height: 18px;
        border-radius: 9px;
        min-width: 18px;
        background: #ed3f14;
        border: 1px solid transparent;
        color: #fff;
        line-height: 18px;
        text-align: center;
        padding: 0 5px;
        font-size: 12px;
        white-space: nowrap;
        transform-origin: -10% center;
        z-index: 10;
        box-shadow: 0 0 0 1px #fff;
        box-sizing: border-box;
        text-rendering: optimizeLegibility;
    }

    &__dot {
        position: absolute;
        transform: translateX(-50%);
        transform-origin: 0 center;
        top: -4px;
        right: -8px;
        height: 8px;
        width: 8px;
        border-radius: 100%;
        background: #ed3f14;
        z-index: 10;
        box-shadow: 0 0 0 1px #fff;
    }

    &__status {
        line-height: inherit;
        vertical-align: baseline;
    }

    &__status-dot {
        width: 6px;
        height: 6px;
        display: inline-block;
        border-radius: 50%;
        vertical-align: middle;
        position: relative;
        top: -1px;

        &--success {
            background-color: #52c41a;
        }
        
        &--processing {
            background-color: #1890ff;
            position: relative;
        }
        
        &--processing:after {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            border: 1px solid #1890ff;
            content: "";
            animation: statusProcessing 1.2s infinite ease-in-out;
        }
        
        &--default {
            background-color: #d9d9d9;
        }
        
        &--error {
            background-color: #f5222d;
        }
        
        &--warning {
            background-color: #faad14;
        }
    }

    &__status-text {
        display: inline-block;
        color: rgba(0,0,0,.65);
        font-size: 14px;
        margin-left: 8px;
    }
}

@keyframes statusProcessing {
    0% {
        transform: scale(.8);
        opacity: .5
    }

    to {
        transform: scale(2.4);
        opacity: 0
    }
}