/******************************************************************************
 * Copyright 2009-2019 Exactpro (Exactpro Systems Limited)
 *
 * 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.
 ******************************************************************************/
 
@import "./common/vars";
@import "./machinelearning.scss";

.header {
    @include status-card-with-running;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;

    &__main {
        background-color: white;
        color: var(--status-primary-color);
    }

    &__info {
        width: 100%;
        display: flex;
        min-height: 38px;
        justify-content: center;
        align-items: center;
        z-index: 0;
        margin-top: -5px;
        padding-top: 5px;
        position: relative;
        border-bottom-left-radius: 7px;
        border-bottom-right-radius: 7px;
        background-color: var(--status-secondary-header-background-color);
    }

    &__description {
        text-align: center;
        padding: 5px;
        font-weight: bold;
        font-size: 19px;
        color: var(--status-primary-color);
    }

    &__info-element {
        width: auto;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0 10px;
        font-size: 13px;
        white-space: nowrap;
        padding: 0 5px;

        span {
            color: $secondaryLightTextColor;
            padding-right: 9px;
        }

        p {
            color: $secondaryTextColor;
            font-weight: 600;
        }
        
        .ml__submit {
            @include ml-indicator;
        }
    }

    &__dropdown {
        margin-left: 12px;
    }

    &__group {
        display: flex;
        align-items: center;
        flex: 1;
        height: 100%;

        &:first-child {
            justify-content: flex-start;
        }

        &:nth-child(2) {
            flex-grow: 2;
            justify-content: center;
        }

        &:last-child {
            justify-content: flex-end;
        }
    }
}

.header-main {
    width: 100%;
    height: 47px;
    border: 3px solid var(--status-primary-color);
    border-radius: 5px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;

    &__name {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    &__spinner {
        @include spinner(3px, 19px, 2s);
        margin-right: 12px;
    }

    &__title {
        display: flex;
        justify-content: center;
        align-items: center;
        font-weight: bold;
        -webkit-margin-before:0em;
        -webkit-margin-after:0em;
        font-size: 20px;
        padding: 0 10px;
    }

    &__search {
        padding-right: 10px;
    }
}

.header-filter {
    padding: 3px 0;
    background-color: $filterPrimaryColor;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid $filterPrimaryColor;
    border-bottom-right-radius: 7px;
    border-bottom-left-radius: 7px;

    &__togglers {
        margin: 0 20px;
        display: flex;
        justify-content: center; 
        align-items: center;
    }

    &__togglers-title {
        color: $primaryTextColor;
        margin-right: 10px;
        font-size: 14px;
        font-weight: bold;
    }
}

.header-button {
    @include unselectable;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0px 10px;
    cursor: pointer;

    &__icon {
        width: 20px;
        height: 20px;
        background-size: 100%;

        &.go-back {
            background-image: url(../../resources/icons/arr2-left.svg);
        }    

        &.filter-icon {
            background-image: url(../../resources/icons/filter.svg);

            &.applied {
                background-image: url(../../resources/icons/filter-applied.svg);
            }

            &.active {
                background-image: url(../../resources/icons/filter-white.svg);
            }
        }

        &.left {
            background-image: url(../../resources/icons/arr1-left-enabled.svg);
        }

        &.right {
            background-image: url(../../resources/icons/arr1-right-enabled.svg);
        }

        &.export {
            @include icon(url(../../resources/icons/export.svg), 19px, 19px);
            margin-right: 8px;
        }

        &.down {
	        @include icon(url(../../resources/icons/arr1-down.svg), 11px, 13px);
            margin-left: 6px;
            margin-top: 3px;
        }
    }

    &__filter-wrapper {
        position: relative;
        height: calc(100% - 10px);
        margin: 0 5px;
        border-radius: 5px 5px 0 0;
        display: flex;
        align-items: center;

        &.active {
            @include card-shadow;
            background-color: $filterPrimaryColor;
        }
    }

    &__filter-counter {
        width: 30px;
        background-color: $filterPrimaryColor;
        color: $filterTextColor;
        font-weight: bold;
        border-radius: 3px;
        font-size: 14px;
        text-align: center;
        margin: 0 5px;
        padding: 0 5px;
    }

    &__title {
        color: $primaryTextColor;
        font-size: 14px;
        font-weight: bold;
        display: inline;
        white-space: nowrap;
        -webkit-margin-before:0em;
        -webkit-margin-after:0em;
        padding-left: 15px;

        &.active {
            color: $filterTextColor;
        }

        &.applied {
            color: $filterPrimaryColor;
        }
    }

    &.disabled {
        cursor: default;
        opacity: 0.6;
    }
}
