@tabs-prefix-cls: ~"@{css-prefix}tabs";

.@{tabs-prefix-cls} {
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    .clearfix;

    &-tab {
        &-label {
            display: flex;
            align-items: center;
            span {
                font-size: 14px;
                font-weight: 600;
            }
        }
    }

    &-ink-bar {
        height: 3px;
        box-sizing: border-box;
        background-color: @primary-color;
        position: absolute;
        left: 0;
        bottom: 1px;
        z-index: 1;
        transition: transform .3s @ease-in-out;
        transform-origin: 0 0;
    }

    &-bar {
        outline: none;
        line-height: 56px;
        border-bottom: 1px solid @border-color-base;
        margin-bottom: 16px;
    }

    &-nav-container {
        margin-bottom: -1px;
        line-height: @line-height-base;
        font-size: 16px;
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden;
        position: relative;
        .clearfix;
    }

    &-nav-container:focus {
        outline: none;
        .@{tabs-prefix-cls}-tab-focused {
            border-color: @link-hover-color !important;
        }
    }

    &-nav-container-scrolling {
        padding-left: 32px;
        padding-right: 32px;
    }

    &-nav-wrap {
        overflow: hidden;
        margin-bottom: -1px;
    }

    &-nav-scroll {
        overflow: hidden;
        white-space: nowrap;
    }

    &-nav-right {
        float: right;
        margin-left: 5px;
        .ivu-btn {
            margin-right: @margin-md;
        }
    }

    &-nav-prev, &-nav-next {
        width: 32px;
        text-align: center;
        position: absolute;
        line-height: 32px;
        cursor: pointer;
        i{
            font-size: 16px;
        }
    }

    &-nav-prev {
        left: 0;
    }

    &-nav-next {
        right: 0;
    }

    &-nav-scrollable {
        padding: 0 32px;
    }

    &-nav-scroll-disabled {
        display: none;
    }

    &-nav {
        padding: 10px 0;
        margin: 0;
        float: left;
        list-style: none;
        box-sizing: border-box;
        position: relative;
        transition: transform 0.5s @ease-in-out;

        &:before,
        &:after {
            display: table;
            content: " ";
        }

        &:after {
            clear: both;
        }

        .@{tabs-prefix-cls}-tab-disabled {
            pointer-events: none;
            cursor: default;
            color: #ccc;
        }

        .@{tabs-prefix-cls}-tab {
            display: inline-block;
            height: 100%;
            padding: 8px 16px;
            margin-right: 16px;
            box-sizing: border-box;
            cursor: pointer;
            text-decoration: none;
            position: relative;
            transition: color .3s @ease-in-out;

            .@{css-prefix-iconfont} {
                width: 14px;
                height: 14px;
                margin-right: 8px;
            }
        }
    }


    &-nav &-tab {
        .ivu-icon {
            height: auto;
            width: auto;
            margin: 0 8px;
        }
    }

    &-mini &-nav-container {
        font-size: @font-size-base;
    }

    &-mini &-tab {
        margin-right: 0;
        padding: 8px 16px;
        &-label {
            span {
                font-size: @font-size-small;
            }
        }
    }

    & {
        .@{tabs-prefix-cls}-content-animated {
            display: flex;
            flex-direction: row;
            will-change: transform;
            transition: transform .3s @ease-in-out;
        }

        .@{tabs-prefix-cls}-tabpane {
            flex-shrink: 0;
            width: 100%;
            transition: opacity .3s;
            opacity: 1;
            outline: none;
        }

        .@{tabs-prefix-cls}-tabpane-inactive {
            opacity: 0;
            height: 0;
        }
    }

    // stub style
    &&-stub:not(&&-border) > &-bar {
        border: 0;
    }
    &&-stub:not(&&-border) > &-bar &-nav {
        padding: 0;
    }
    &&-stub > &-bar &-tab {
        padding: 10px 0;
        margin-right: 50px;
        font-size: 16px;
    }
    &&-stub > &-bar &-tab-active {
        color: @primary-color;
        font-weight: 500;
    }
    &&-border > &-bar &-nav-scroll {
        padding: 0 22px;
    }

    // card style
    &&-card > &-bar {
        line-height: 40px;
        border: 0;
    }
    &&-card > &-bar &-nav {
        padding: 10px 0 0;
    }
    &&-card > &-bar &-ink-bar {
        visibility: hidden;
    }
    &&-card > &-bar &-tab {
        margin: 0;
        margin-right: 10px;
        height: 40px;
        padding: 8px 23px;
        border-radius: @btn-border-radius;
        transition: all 0.3s @ease-in-out;
        background: #efefef;
    }
    &&-card > &-bar &-tab-active {
        height: 40px;
        background: #efefef;
        // transform: translateZ(0);
        color: @primary-color;
        font-weight: 500;
    }
    &&-card > &-bar &-nav-wrap {
        margin-bottom: 0;
    }
    &&-card > &-bar &-tab &-close {
        width: 0;
        height: 22px;
        font-size: 22px;
        margin-right: 0;
        color: @legend-color;
        text-align: right;
        vertical-align: middle;
        overflow: hidden;
        position: relative;
        top: -1px;
        transform-origin: 100% 50%;
        transition: all 0.3s @ease-in-out;
        &:hover {
            color: #444;
        }
    }

    &&-card > &-bar &-tab-active &-close,
    &&-card > &-bar &-tab:hover &-close {
        width: 22px;
        transform: translateZ(0);
        margin-right: -6px;
    }

    &-context-menu{
        position: absolute;
    }
}

.@{tabs-prefix-cls}-no-animation{
    > .@{tabs-prefix-cls}-content {
        transform: none!important;

        > .@{tabs-prefix-cls}-tabpane-inactive {
            display: none;
        }
    }
}
