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

.heatmap {
    position: relative;
    width: 100%;
    height: 100%;

    &-wrapper {
        width: 100%;
        height: 100%;
        padding-right: 15px;
    }

    &-scrollbar {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 15px;
        display: grid;
        grid-auto-rows: 1fr;
        z-index: 1;

        &.smart {
            display: block;
        }

        &-track {
            background-color: $scrollbarTrackBackground;
            width: 10px;
            right: 2px;
            bottom: 2px;
            top: 2px;
        }

        &-thumb {
            z-index: 0;
            background-color: $scrollbarThumbBackground;
            border-radius: 5px;
            z-index: 5;
        }

        &-item {
            border: 2px solid transparent;
            border-radius: 4px;
            opacity: 0.7;
            height: 100%;

            &.smart {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
            }

            &.passed {
                background-color: $passedBackgroundColor;
                border-color: $passedBorderColor;
            }
        
            &.failed {
                background-color: $failedBackgroundColor;
                border-color: $failedBorderColor;
            }
        
            &.conditionally_passed {
                background-color: $conditionallyPassedBackgroundColor;
                border-color: $conditionallyPassedBorderColor;
            }

            &.conditionally_failed {
                background-color: $conditionallyFailedBackgroundColor;
                border-color: $conditionallyFailedBorderColor;
            }

            &.na {
                border-color: $primaryTextColor;
            }
        }
    }
}

.scroll-hint {
    position: absolute;
    left: 28px;
    top: 50%;
    height: 64px;
    transform: translate(0, -32px);
    background-color: white;
    border: 2px solid $primaryTextColor;
    border-radius: 6px;
    line-height: 22px;
    font-size: 16px;
    text-align: center;
    box-sizing: border-box;
    padding: 8px 25px;
    white-space: nowrap;
    font-weight: 600;
    box-sizing: border-box;

    &:before, &:after {
        content: "";
        position: absolute;
        border-top: 12px solid transparent;
        border-bottom: 12px solid transparent;
        top: 50%;
        left: 0;
        z-index: -1;
        transform: translate(-100%, -50%);
    }

    &:before {
        border-right: 12px solid $primaryTextColor;;
    }

    &:after {
        border-right: 12px solid white;
        margin-left: 2px;
    }

    &.left {
        right: 28px;
        left: unset;

        &:before, &:after {
            border-top: 12px solid transparent;
            border-bottom: 12px solid transparent;
            right: 0;
            left: unset;
            transform: translate(100%, -50%);
        }
    
        &:before {
            border-left: 12px solid $primaryTextColor;
            border-right: none;
        }
    
        &:after {
            border-left: 12px solid white;
            margin-right: 2px;
            border-right: none;
        }
    }

    &__title {
        color: $primaryTextColor;
        text-align: inherit;
        font-size: inherit;
        line-height: inherit;
    }

    &__id {
        color: $errorMsgBackgroundColor;
        text-decoration: underline;
        font-size: inherit;
        line-height: inherit;
        cursor: pointer;
    }
}