@import "_Mixins.scss";


.divided-content-side, .tabs-column-container {
    .tabs-container {
        height: auto;
    }
}

.tabs-container {
    position: relative;
    display: flex;
    flex-direction: column;
    height: calc(100% - 50px);

    .tab-content {
        & > div.row:not(.buttons-tabbed):not(.document-head) {
            overflow: auto;
            margin-bottom: 15px;

            &.tab-content-full-page {
                height: 100%;
                margin-top: -20px;
                margin-bottom: 0px;
            }

            &.margin-b-none {
                margin-bottom: 0;
            }
        }
    }

    .nav-tabs {
        border-bottom: 0;

        li {
            a {
                color: $tabs-nonactive-text;
                text-decoration: none;
                border-radius: 0;
                border: 0;
                border-top: 3px solid transparent;
                transition: all 0.2s ease;
                padding: 12px 15px;
                font-weight: 600;
                @include text-unselectable();
                font-size: 14px;
                padding: 14px 15px 8px 15px;

                &:hover {
                    border-top: 3px solid darken($content-background-color, 2.5%);
                }
            }

            &.active {
                a, a:hover, a:focus {
                    color: $main-text-color;
                    background-color: none;
                    font-weight: 700;
                    border-radius: 0;
                    border: 1px solid transparent;
                    border-top: 3px solid $divider-color;
                    border-bottom: 1px solid $divider-color;
                }
            }
        }
    }
}

.tabs-container:not(.tabs-normal) {
    .tab-content {
        display: flex;
        flex-direction: column;

        .tab-pane {
            .panel-body {
                padding: 0;
                background: transparent;
                border: none;
                border-top: 0;
                position: inherit;

                .tabs-loading {
                    color: #6d6e70;
                }

                .tab-title {
                    font-size: 13px;
                    font-weight: bold;
                    margin-bottom: 20px;
                }
            }
        }
    }
}

@mixin dividedTabs($number) {
    @for $i from 1 through $number {
        li.divided-tab-#{$i} {
            width: #{100% / $i};
            text-align: center;
            @include overflow-ellipsis();

            a {
                padding-left: 5px;
                padding-right: 5px;
            }
        }
    }
}


.nav.horizontal-menu {
    border-bottom: 2px solid $divider-color;
    margin-left: -15px;
    padding-left: 5px;
    margin-right: -15px;
    padding-right: 5px;
    max-height: 47px;
    min-height: 47px;
    overflow: hidden;
    display: flex;

    &:empty {
        max-height: 0;
        min-height: 0;
    }

    & > li {
        flex-shrink: 0;
    }

    & + .tab-content, & + .buttons-tabbed + .tab-content {
        height: calc(100% - 47px);

        @media (max-width: 767.98px) {
            height: auto;
            min-height: calc(100% - 47px);
        }


        & > form {
            height: 100%;
        }
    }

    @include dividedTabs(10);

    li {
        & > a {
            border-top: 0px;
            user-select: none;
            -webkit-user-drag: none;
        }

        &.active > a, &.active a:active, &.active a:focus, &.active a:visited, & > a:focus {
            background-color: transparent;
            border: 0;
            border-bottom: 4px solid $accent-color;
        }

        & a:hover, &.active a:hover {
            border: 0;
            border-bottom: 4px solid $accent-color;
            background-color: none;
        }
    }
}

@media(max-width:767px) {
    *:not(.divided-content-side) > .tabs-container {
        & > .nav.nav-tabs.horizontal-menu:not(.custom-scrollable-tabs) {
            & > li {
                clear: both;

                &:not(.active) {
                    display: none;

                    a:hover {
                        border: 0;
                        margin-bottom: 0px;
                    }
                }
            }

            &.horizontal-menu-open {
                & > li {
                    display: block;
                }
            }

            & > li.active:not(.divided-tab-1) {
                cursor: pointer;

                &:after {
                    content: "\f0d7";
                    position: absolute;
                    top: 35%;
                    right: 2px;
                    font-family: "Font Awesome 5 Pro";
                }
            }
        }
    }
}
