// Copyright (C) 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT

@import '../../base.scss';

.cvat-annotation-page.ant-layout {
    height: 100%;
    overflow: hidden;
}

.ant-layout-header.cvat-annotation-header {
    background-color: $background-color-2;
    border-bottom: 1px solid $border-color-1;
    height: 54px;
    padding: 0;
}

.cvat-annotation-header-left-group {
    > button:first-child {
        filter: invert(0.9);
        background: $background-color-1;
        border-radius: 0;
        width: 70px;
    }
}

.ant-btn.cvat-annotation-header-button {
    padding: 0;
    width: 54px;
    height: 54px;
    float: left;
    text-align: center;
    user-select: none;
    color: $text-color;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 3px;

    > span:not([role='img']) {
        margin-left: 0;
        font-size: 10px;
    }

    > span[role='img'] {
        transform: scale(0.8);
        padding: 3px;
    }

    &:hover > span[role='img'] {
        transform: scale(0.85);
    }

    &:active > span[role='img'] {
        transform: scale(0.8);
    }

    > * {
        display: block;
        line-height: 0;
    }
}

.cvat-annotation-disabled-header-button {
    @extend .cvat-annotation-header-button;

    opacity: 0.5;
    pointer-events: none;
}

.cvat-annotation-header-player-group > div {
    height: 54px;
    line-height: 0;
}

.cvat-player-buttons {
    display: flex;
    align-items: center;
    position: relative;
    height: 100%;
    margin-right: 10px;

    > span {
        font-size: 25px;
        margin: 0 7px;
        color: $player-buttons-color;

        &:hover {
            transform: scale(1.1);
        }

        &:active {
            transform: scale(1);
        }
    }
}

.cvat-player-controls {
    height: 100%;
    line-height: 27px;

    > div {
        height: 50%;
    }
}

.cvat-player-slider {
    width: 350px;
    margin: 0;

    > .ant-slider-rail {
        background-color: $player-slider-color;
    }
}

.cvat-player-filename-wrapper {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
    word-break: break-all;
}

.cvat-player-frame-url-icon {
    opacity: 0.7;
    color: $objects-bar-icons-color;

    &:hover {
        opacity: 1;
    }

    &:active {
        opacity: 0.7;
    }
}

.cvat-player-frame-selector {
    width: 5em;
    padding-right: 5px;
    margin-left: 5px;
}

.cvat-annotation-header-right-group {
    > div {
        float: left;
        display: block;
        height: 54px;
        margin-right: 15px;
    }
}

.cvat-workspace-selector {
    width: 150px;
}

.cvat-job-info-modal-window {
    > div {
        margin-top: 10px;
    }

    > div:nth-child(1) {
        > div {
            > span {
                font-size: 20px;
            }
        }
    }

    > div:nth-child(2) {
        > div {
            display: grid;
        }
    }

    > .cvat-job-info-bug-tracker {
        > div {
            display: grid;
        }
    }

    > .cvat-job-info-statistics {
        > div {
            > span {
                font-size: 20px;
            }

            .ant-table-thead {
                > tr > th {
                    padding: 5px 5px;
                }
            }
        }
    }
}

.ant-menu.cvat-annotation-menu {
    box-shadow: $box-shadow-base;

    > li:hover {
        background-color: $hover-menu-color;
    }

    .ant-menu-submenu-title {
        margin: 0;
        width: 15em;
    }
}

// TODO: Move canvas from standard workspace and create its own .scss
.cvat-canvas-context-menu {
    opacity: 0.6;
    position: fixed;
    width: 300px;
    z-index: 10;
    max-height: 50%;
    overflow-y: auto;

    &:hover {
        opacity: 1;
    }
}

.cvat-canvas-point-context-menu {
    display: grid;
    opacity: 0.6;
    position: fixed;
    z-index: 10;
    background-color: #fff;
    border-radius: 4px;

    &:hover {
        opacity: 1;
    }
}

.cvat-canvas-z-axis-wrapper {
    position: absolute;
    background: $background-color-2;
    bottom: 10px;
    right: 10px;
    height: 150px;
    z-index: 100;
    border-radius: 6px;
    opacity: 0.5;
    border: 1px solid $border-color-3;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3px;

    &:hover {
        opacity: 1;
    }

    > .ant-slider {
        height: 75%;
        margin: 5px 3px;

        > .ant-slider-rail {
            background-color: #979797;
        }

        > .ant-slider-handle {
            transform: none !important;
        }
    }

    > span[role='img'] {
        opacity: 0.7;
        color: $objects-bar-icons-color;

        &:hover {
            opacity: 1;
        }

        &:active {
            opacity: 0.7;
        }
    }
}

.cvat-annotations-filters-input.ant-select {
    > .ant-select-selector {
        height: 32px;
        overflow: auto;
    }

    > .ant-select-clear {
        right: 20px;
    }
}

.cvat-player-previous-inlined-button,
.cvat-player-next-inlined-button,
.cvat-player-previous-filtered-inlined-button,
.cvat-player-next-filtered-inlined-button,
.cvat-player-previous-empty-inlined-button,
.cvat-player-next-empty-inlined-button {
    color: $player-buttons-color;

    &:not(:first-child) {
        margin-left: 12px;
    }

    > svg {
        transform: scale(1.8);
    }
}

.cvat-request-review-dialog {
    > .ant-modal-content > .ant-modal-body {
        > div:nth-child(2) {
            margin-top: $grid-unit-size * 2;
        }

        > div:nth-child(3) {
            margin-top: $grid-unit-size * 2;
        }
    }
}

.cvat-submit-review-dialog {
    > .ant-modal-content > .ant-modal-body {
        > div:nth-child(2) > div:nth-child(2) {
            .ant-col {
                > div:nth-child(2) {
                    margin-top: $grid-unit-size * 2;
                    margin-bottom: $grid-unit-size * 2;
                }
            }
        }
    }
}
