@import (once) "../../include/vars";
@import (once) "../../include/mixins";

:root {
    --tabs-material-background: #ffffff;
    --tabs-material-color: #191919;
    --tabs-material-marker-color: #000000;
}

.dark-side {
    --tabs-material-background: #343637;
    --tabs-material-color: #dbdfe7;
    --tabs-material-marker-color: #ff6211;
}

.tabs-material-wrapper {
    overflow: hidden;
    height: 48px;
    display: block;
    width: 100%;
}

.tabs-material {
    margin: 0;
    padding: 0 52px;
    position: relative;
    height: auto;
    display: flex;
    flex-flow: row nowrap;
    overflow: auto;
    overflow-y: hidden;
    width: 100%;
    z-index: @z-index-fixed;
    background-color: var(--tabs-material-background);
    color: var(--tabs-material-color);
    white-space: nowrap;
    list-style: none inside;
    line-height: 1;

    li {
        flex-shrink: 0;
        position: relative;
        display: block;
        height: 48px;
        cursor: pointer;
        opacity: .6;
        text-align: center;
        margin: 0;
        overflow: hidden;
        max-width: 360px;
        min-width: 90px;
        background-color: inherit;
        color: inherit;

        a {
            display: block;
            position: relative;
            padding: 16px 16px;
            background-color: inherit;
            color: inherit;
            text-decoration: none;
            font-weight: 500;
            white-space: nowrap;
            font-size: 14px;
            text-transform: uppercase;
            line-height: 20px;
            width: 100%;

            &:hover {
                text-decoration: none;
            }
        }

        .icon {
            width: 24px;
            height: 24px;
            line-height: 24px;
            font-size: 22px;
            display: block;
        }
    }

    &::after {
        content: " ";
        min-width: 52px;
    }

    &.with-icons {
        li {
            height: 72px;
        }
    }

    li {
        &.active, &:hover {
            opacity: 1;
            transition: .3s linear;
        }
    }

    .tab-marker {
        display: block;
        position: absolute;
        height: 2px;
        bottom: 0;
        left: 0;
        color: transparent;
        opacity: 1;
        z-index: 1;
        background-color: var(--tabs-material-marker-color);
    }

    .tab-badge {
        position: absolute;
        top: 8px;
        right: 8px;
        padding: 4px;
    }
}

.tabs-material {
    &.deep {
        z-index: @z-index-fixed - 1;
    }

    &.fixed-tabs {
        overflow-x: hidden;
        padding: 0;

        li {
            flex-basis: 0;
            flex-grow: 1;
        }

        &::after {
            content: "";
            min-width: 0;
        }
    }
}

.head-bar ~ .fixed-tabs, .tabs-material-wrapper.app-bar-present {
    top: 56px;
}

.head-bar.more ~ .fixed-tabs, .tabs-material-wrapper.app-bar-present-more {
    top: 112px;
}
