﻿.page-wrapper {
    .custom-input-group.custom-select {
        overflow: initial;
    }

    .custom-input-group {
        min-height: 48px;
        position: relative;

        &.custom-textarea {
            textarea {
                display: block;
                box-sizing: border-box;
                border: solid 1px var(--Stroke);
                border-radius: 4px;
                color: var(--Main1);
                font-size: 14px;
                line-height: 160%;
                width: 100%;
                min-height: 48px;
                padding: 12px 16px;
                -webkit-appearance: none;
                overflow: auto; //Remove the default vertical scrollbar in IE.
                resize: none;

                //Для автовысоты не задавать высоты
                //Имя аттрибута используется в CustomTextAreaInputTagHelper
                &:not([autoheight='true']) {
                    height: 100%;
                }

                &[readonly] {
                    border-color: var(--Good);
                }
            }

            .textarea-counter {
                position: absolute;
                right: 6px;
                bottom: 1px;
                font-size: 11px;
                line-height: 160%;
                color: var(--Stroke);
                z-index: 1;
            }
        }

        &.custom-select {
            background: none;

            & li[disabled] {
                color: var(--Secondary);
            }

            .input-icon {
                svg{
                    width: 16px;
                    height: 16px;
                }
            }
        }

        &.custom-multiple-select {
            height: auto !important;
            overflow: initial;
            z-index: unset;
            background: transparent;

            .chosen-container {
                height: auto;
                font-size: 14px;
                min-height: 48px;
                position: relative;
                border: none !important;

                &.chosen-disabled {
                    opacity: 1 !important;

                    .chosen-choices {
                        background-color: var(--Disabled);
                        cursor: default;

                        .search-choice{
                            border: 1px solid var(--Stroke);
                            padding-right: 12px;

                            &-close{
                                display: none;
                            }
                        }
                    }

                    &+.input-icon {
                        display: none;
                    }
                }

                .chosen-choices {
                    position: unset;
                    min-height: 48px;
                    display: flex;
                    flex-wrap: wrap;
                    box-shadow: none;
                    background-image: none;
                    border: none;
                    border-radius: 4px;
                    padding-bottom: 5px;
                    padding-right: 45px;
                    z-index: 1;
                    background: #fff;
                    border: solid 1px var(--Stroke);
                    border-radius: 4px;
                    position: relative;

                    &.data-text-none {
                        &:before {
                            display: none !important;
                        }
                    }

                    .search-choice {
                        border-radius: 4px;
                        background-color: var(--Bg2);
                        border: none;
                        min-height: 32px;
                        display: flex;
                        align-items: center;
                        margin: 5px;
                        margin-left: 0;
                        margin-bottom: 0;
                        box-shadow: none;
                        background-image: none;
                        padding: 5px 12px;
                        padding-right: 32px;
                        max-width: calc(~"100% - 30px");

                        &-close {
                            width: 16px;
                            height: 16px;
                            background: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%0A%3Cpath%20d%3D%22M12%204.00195L4%2012.002%22%20stroke%3D%22%23624E33%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22/%3E%0A%3Cpath%20d%3D%22M4%204.00195L12%2012.002%22%20stroke%3D%22%23624E33%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22/%3E%0A%3C/svg%3E%0A%0A%0A")center no-repeat !important;
                            background-size: cover;
                            background-position: center !important;
                            top: 50%;
                            transform: translateY(-50%);
                            right: 12px;
                        }

                        span {
                            color: var(--Subsidiary);
                            font-weight: 400;
                            font-size: 12px;
                            line-height: 16px;  
                        }
                    }

                    .search-field {
                        input {
                            padding-left: 11px;
                            min-height: 41px;
                            margin: 0;
                            padding-top: 5px;
                        }
                    }
                }

                .chosen-drop {
                    top: 100%;
                    background: #fff;
                    box-shadow: 0px 8px 16px rgba(57, 52, 66, 0.0978475), 0px 0px 1px rgba(57, 52, 66, 0.08);
                    border-radius: 4px;
                    margin-top: 4px;
                    border: none;

                    .chosen-results {
                        border: none;

                        &::-webkit-scrollbar {
                            width: 8px;
                            background-color: transparent;
                        }

                        &::-webkit-scrollbar-track {
                            border-radius: 8px;
                            background-color: transparent;
                        }

                        &::-webkit-scrollbar-thumb {
                            border-radius: 8px;
                            background-color: var(--Secondary);
                        }

                        li {
                            font-size: 14px;
                            padding: 15px 16px;
                            padding-right: 35px;
                            border-bottom: 1px solid var(--Stroke);
                            transition: 0.2s;

                            &:last-child {
                                border-bottom: none;
                            }

                            &:not(.group-result):hover {
                                background: var(--Bg2) !important;
                                color: var(--Main2) !important;
                            }

                            &.highlighted {
                                background-color: transparent;
                                background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
                                background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%);
                                background-image: none;
                                color: var(--Main1);
                            }

                            &.result-selected {
                                color: initial;
                                position: relative;

                                &:after {
                                    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cdefs/%3E%3Cpath stroke='%233A3A3A' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M20 7L9 18l-5-5'/%3E%3C/svg%3E");
                                    position: absolute;
                                    top: 50%;
                                    transform: translateY(-50%);
                                    right: 15px;
                                    width: 20px;
                                }

                                &:hover {
                                    background: transparent;
                                    color: initial;
                                }
                            }
                        }
                    }
                }

                &.chosen-with-drop {
                    +.input-icon {
                        svg {
                            transform: rotate(180deg);
                        }
                    }
                }

                &.input__valid {
                    .chosen-choices {
                        border-color: var(--Green) !important;
                    }
                }

                &.input__invalid {
                    .chosen-choices {
                        border-color: var(--Red) !important;
                    }
                }
            }

            &.v-2 {
                .input-icon {
                    height: 46px !important;
                }

                .search-field {
                    width: 90%;

                    .chosen-search-input {
                        width: 100% !important;
                    }
                }

                .chosen-drop {
                    .chosen-results {
                        li {
                            position: relative;
                            padding-right: 95px !important;
                        }

                        .active-result {
                            &:after {
                                content: 'Выбрать';
                                font-weight: bold;
                                width: 90px !important;
                                color: var(--Main2);
                                position: absolute;
                                top: 50%;
                                transform: translateY(-50%);
                                right: 5px !important
                            }
                        }

                        .result-selected {
                            &:after {
                                content: 'Отменить' !important;
                                font-weight: bold;
                                width: 90px !important;
                                color: var(--Red);
                                right: 5px !important;
                                cursor: pointer;
                            }
                        }
                    }
                }
            }

            .chosen-choices-outfield {
                display: flex;
                flex-wrap: wrap;
                z-index: 1;
                position: relative;
                margin: 0 -4px;
                padding: 0;
                margin-top: 8px;

                &.data-text-none {
                    &:before {
                        display: none !important;
                    }
                }

                .search-choice {
                    border-radius: 4px;
                    background-color: var(--Bg2);
                    height: 32px;
                    display: flex;
                    align-items: center;
                    margin: 0 4px;
                    margin-bottom: 8px;
                    padding: 5px 12px;
                    padding-right: 32px;
                    max-width: 100%;
                    white-space: nowrap;
                    position: relative;
                    transition: 0.2s;

                    &-close {
                        width: 16px;
                        height: 16px;
                        background: url("data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2217%22%20viewBox%3D%220%200%2016%2017%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%0A%3Cpath%20d%3D%22M12%204.00195L4%2012.002%22%20stroke%3D%22%23624E33%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22/%3E%0A%3Cpath%20d%3D%22M4%204.00195L12%2012.002%22%20stroke%3D%22%23624E33%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22/%3E%0A%3C/svg%3E%0A")center no-repeat !important;
                        background-size: cover;
                        background-position: center !important;
                        top: 50%;
                        transform: translateY(-50%);
                        right: 12px;
                        position: absolute;
                    }

                    >div {
                        display: flex;
                        align-items: center;

                        svg {
                            margin-left: 4px;
                        }
                    }

                    span {
                        overflow: hidden;
                        text-overflow: ellipsis;
                        transition: 0.2s;
                        color: var(--Main2);
                    }

                    &--added {
                        background-color: var(--Good) !important;

                        span {
                            color: var(--Green) !important;
                        }
                    }

                    &--removed {
                        background-color: var(--Warning) !important;

                        span {
                            color: var(--Red) !important;
                            text-decoration: line-through;
                        }
                    }

                    &--new {
                        background-color: var(--BackgroundBlue) !important;

                        span {
                            color: var(--Blue) !important;
                        }
                    }
                }
            }
        }

        .select {
            cursor: pointer;
            box-sizing: border-box;
            display: inline-block;
            padding-right: 33px;
            border: solid 1px var(--Stroke);
            border-radius: 4px;
            display: flex;
            align-items: center;
            min-height: 48px;
            width: 100%;

            select {
                display: none;
            }
        }

        .styledSelect {
            background-color: white;
            padding: 0 10px;
            overflow: hidden;
            color: var(--Main1);
            line-height: 20px;
            font-size: 14px;
            z-index: 1;
            
            &[select-val="0"] {
                color: var(--Secondary);
            }

            &:empty:not(:focus):before {
                content: attr(data-text);
                color: var(--Stroke);
            }
        }

        .options {
            max-height: 250px;
            overflow: auto;
            display: none;
            position: absolute;
            top: 100%;
            right: 0;
            left: 0;
            z-index: 999;
            margin: 0 0;
            padding: 0 0;
            list-style: none;
            margin-top: 4px;
            background-color: white;
            box-shadow: var(--secondary_shadow);
            border-radius: 4px;

            &::-webkit-scrollbar {
                width: 8px;
                background-color: transparent;
            }

            &::-webkit-scrollbar-track {
                border-radius: 8px;
                background-color: transparent;
            }

            &::-webkit-scrollbar-thumb {
                border-radius: 8px;
                background-color: var(--Secondary);
            }

            li {
                margin: 0 0;
                font-size: 14px;
                padding: 8px 16px;
                border-bottom: 1px solid var(--Stroke);
                transition: 0.2s;
                display: flex;
                align-items: center;
                min-height: 40px;

                &:last-child {
                    border-bottom: none;
                }

                &:hover {
                    background: var(--Bg2);
                }

                &.highlighted {
                    background-color: none;
                    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
                    background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%);
                    background-image: none;
                    color: var(--Main1);
                }

                &.selected {
                    position: relative;
                    padding-right: 40px;

                    &:before {
                        content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.3336 4.6665L6.00032 11.9998L2.66699 8.66649' stroke='%23000' stroke-width='0.999998' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
                        position: absolute;
                        top: 50%;
                        transform: translateY(-50%);
                        right: 16px;
                        line-height: 0;
                    }
                }

                &.groupItem {
                    padding-left: 20px !important;
                }

                &.groupParent {
                    cursor: default !important;
                    font-weight: bold;

                    &:hover {
                        background: inherit;
                        color: inherit;
                    }
                }
            }
        }

        .div-option {
            display: flex;
            justify-content: space-between;
            position: relative;

            .option-lock {
                margin-right: 36px;
                width: 24px;
                height: 24px;
                position: absolute;
                top: 50%;
                right: 0px;
                transform: translateY(-50%);
                z-index: 999;
            }

            .option-delete {
                visibility: hidden;
                opacity: 0;
                transition: 0.2s;
                position: absolute;
                top: 50%;
                right: 15px;
                transform: translateY(-50%);
                cursor: pointer;
                font-size: 12px;
                z-index: 999;
            }

            &:hover {
                .option-delete {
                    visibility: visible;
                    opacity: 1;
                    border: none;
                }
            }

            li {
                width: 100%;
            }
        }

        &.with-icon {
            .styledSelect {
                box-sizing: border-box;
                padding-left: 15px;
                padding-right: 33px;
                width: calc(~"100% + 33px");
                margin-right: -33px;
                min-height: 46px;
                border-radius: 4px;
                display: flex;
                align-items: center;
                border: none !important;
            }

            label.input-icon {
                background-color: transparent;
                border: none;
                height: ~"calc(100% - 4px)" !important;
                width: auto;
                position: absolute;
                top: 2px;
                right: 2px;
                padding: 0 10px;
                margin-bottom: 0;
                display: flex;
                justify-content: center;
                align-items: center;
                z-index: 1;
                cursor: pointer;

                svg {
                    transition: 0.2s;
                    height: 24px;
                    width: 24px;
                }

                &.active {
                    svg {
                        transform: rotate(180deg);
                    }
                }

                .icon-active {
                    display: none;
                }

                .icon-calm {
                    display: initial;
                }
            }

            input {
                padding-right: 33px;
            }

            input.chosen-search-input {
                padding-right: 0px;
            }

            input:focus+.input-icon,
            .select+.input-icon.active {

                .icon-active {
                    display: initial;
                }

                .icon-calm {
                    display: none;
                }
            }
        }

        input {
            padding-left: 15px;
            width: 100%;
            min-height: 48px;
            box-sizing: border-box;
            overflow: visible; //Show the overflow in Edge.
            color: var(--Main1);
            font-family: 'PT Sans', sans-serif;
            border: solid 1px var(--Stroke);
            border-radius: 4px;
            font-size: 14px;
        }

        &.integer-input {
            input {
                width: 100%;
                padding-right: 16px;
                overflow: visible; //Show the overflow in Edge.
            }
        }

        &.custom-date-time {
            input {
                padding-left: 15px;
            }
        }

        &.custom-date-time,
        &.custom-air-date-time {
            input {
                padding-left: 45px;
                padding-right: 12px;
            }

            &.with-icon {
                label.input-icon {
                    right: initial;
                    left: 2px;

                    svg {
                        width: 24px;
                        height: 24px;
                    }
                }
            }
        }

        &.address-input {
            margin-bottom: 8px;
        }

        .s-hidden {
            visibility: hidden;
            padding-right: 10px;
        }

        select {
            /*for firefox*/
            -moz-appearance: none;
            /*for chrome*/
            -webkit-appearance: none;
            max-width: 100%;
        }

        select::-ms-expand {
            display: none;
        }

        .phone-input {
            background-color: #fff;
        }

        input.phone-input__valid {
            border: var(--Green) solid 1px;
        }

        input.phone-input__invalid {
            border: var(--Red) solid 1px;
        }

        input.email-input__valid {
            border: 1px var(--Green) solid;
        }

        input.email-input__invalid {
            border: 1px var(--Red) solid;
        }
    }

    .integer-input__valid {
        border: 1px var(--Green) solid !important;
    }

    .integer-input__invalid {
        border: 1px var(--Red) solid !important;
    }
}