/******************************************************************************
 * 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";

.filter-wrapper {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
}

.filter {
    @include scrollbar;
    @include card-shadow;
    min-width: 850px;
    padding: 12px 7px;
    border-radius: 5px 0 5px 5px;

    background-color: $filterPrimaryColor;

    color: $filterTextColor;
    font-size: 15px;
    font-weight: bold;
    white-space: nowrap;

    overflow-y: auto;

    &__path {
        color: $filterPathColor;
        font-weight: bold;
        margin-right: 20px;
        background-color: rgba(#FFF, 0.75);
    }

    &__controls {
        margin-left: 65px;
        margin-right: 25px;
        height: 35px;
    }

    &__bubble {
        color: $primaryTextColor;
        background-color: #FFF;
        margin: 0 10px;
    }
}

.filter-controls {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;

    &__counts {
        flex: auto;
        width: 100%;
    }

    &__transparency {
        flex: initial;
        display: flex;
        margin: 0 20px;
        align-items: center;

        input {
            margin: 2px 3px 0 10px;
            cursor: pointer;
        }

        label {
            opacity: 0.7;
            cursor: pointer;
        }

        input[type="radio"]:checked + label {
            opacity: 1;
        }
    }

    &__clear-btn {
        @include clickable;
        flex: initial;
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 0 7px 0 5px;
        border-radius: 10px;
    }

    &__clear-icon {
        @include icon(url(../../resources/icons/cross-icon-white.svg), 25px, 25px);
    }
}

.filter-row {
    height: 46px;
    width: 100%;
    font-size: 15px;
    font-weight: bold;

    display: flex;
    justify-content: flex-start;
    align-items: center;

    &:hover &__divider-text {
        display: none;
    }

    &:hover &__remove-btn {
        display: block;
    }

    &__remove-btn {
        @include round-button(url(../../resources/icons/cross-icon-white.svg));
        display: none;
        flex: 0 0 20px;
    }

    &__divider-text {
        display: block;
    }

    &__divider {
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        width: 60px;
        padding-left: 10px;
        font-weight: bold;
        font-size: 16px;
    }

    &__wrapper {
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
    }

    &__input {
        border: 0;
        margin: 0 5px 0 10px;
        padding: 3px 5px;
        border-radius: $bubbleBorderRadius;
        width: 100%;
        min-width: 70px;
        height: 24px;
        background-color: rgba(#FFFFFF, 0.5);
        font-size: 15px;
        color: $primaryTextColor;

        &:focus {
            background-color: #FFF;

            &::placeholder {
                color: $secondaryTextColor;
            }
        }

        &::placeholder {
            color: transparent;
        }
    }

    &__select {
        margin: 0 10px;
        height: $filterBubbleHeight;
        font-size: 15px;
        min-width: 105px;
        flex-shrink: 0;
    }
}
