@import '../_vars.less';
@import '../bs/variables.less';
@import '../bs/mixins.less';

@headColor: #677A8F;
@headColorHover: @MainBlueColor;

.regsel {
    position: relative;
    padding: 0 3px;
    color: @gray;

    > .loading {
        padding-top: 25px;
        font-weight: bold;
        text-align: center;
        color: #888;
        background: url(/img/misc/load.gif) 50% 15px no-repeat;
    }

    .namehead {
        font-weight: bold;
    }

    .offsetwrap {
        margin-left: 22px;
    }

    .inputwrap {
        margin-left: 21px;
        padding: 5px 0;

        &.surrogate {
            display: none;

            &.sticked {
                display: block;
            }
        }

        &.origin {
            top: auto;
            left: auto;
            width: auto;
            z-index: 1000;
            background-color: @modal-bg;

            &.sticked {
                position: fixed;
                margin-left: 23px;
                padding: 3px 21px 1px;

                > .regionsgroup {
                    .box-shadow(0 3px 8px 0px #888);
                }
            }
        }

        > .regionsgroup {
            position: relative;
            margin: 0;
            //transition: box-shadow .1s linear;
        }
    }

    .regionsHead {
        position: relative;
        margin: 1px 0 5px;
        .user-select(none);
    }

    .sortOption {
        display: inline;
        text-decoration-skip: ink;

        &:not(.selected) {
            color: #868585;
            cursor: pointer;
            text-decoration: underline #868585 dotted;

            &:hover {
                color: #606060;
                text-decoration: underline #606060 solid;
            }
        }

        &.selected {
            color: #545c8a;
        }
    }

    .headElem {
        position: relative;
        display: inline-block;
        margin: 0 1px 3px 0;
        padding: 0 7px 1px;
        vertical-align: top;
        color: #f5f5f5;
        cursor: default;
        white-space: nowrap;
        text-decoration: none;
        background-color: @headColor;

        &.interact {
            cursor: pointer;

            &:hover {
                color: #fff;
                background-color: @headColorHover;
            }
        }
    }

    .tree {
        .user-select(none);

        > ul {
            margin: 0;
            padding: 0;

            > li {
                margin: 0 !important;
                padding-left: 0;

                &::before,
                &::after {
                    border: 0;
                }

                &:first-child {
                    padding-top: 0;
                }
            }
        }

        li {
            position: relative;
            margin: 0 0 0 50px;
            padding: 7px 0 0 5px;
            cursor: default;
            list-style-type: none;

            &::before,
            &::after {
                position: absolute;
                left: -28px;
                right: auto;
                content: '';
            }

            &::before {
                width: 1px;
                bottom: 50px;
                height: 100%;
                top: 0;
                border-left: 1px solid #999;
            }

            &:last-child::before {
                height: 20px;
            }

            &::after {
                width: 33px;
                height: 20px;
                top: 19px;
                border-top: 1px solid #999;
            }

            .chevron {
                display: inline-block;
                width: 22px;
                padding: 2px 0;
                color: @gray-light;
                text-align: center;
                cursor: pointer;
                border-width: 1px 0 1px 1px;
                border-style: solid;
                border-color: transparent;
            }

            .rname {
                position: relative;
                display: inline-block;
                min-width: 100px;
                margin-left: 22px;
                padding: 2px 6px;
                color: @gray;
                cursor: default;
                text-decoration: none;
                border: 1px solid #999;
                background-color: #dfdff0;
            }

            .name {
                display: inline-block;
                padding-right: 10px;
            }

            .nameborder {
                border-right: 1px solid #f2f2f2;
            }

            .section {
                display: inline-block;
                padding-left: 10px;
                font-size: 11px;
                color: #525252;
            }

            .homeDivider {
                margin: 7px 22px 0;
                padding: 0;
                border: none;
                border-bottom: 1px #d6d6d6 solid;
            }

            .home {
                display: inline-block;
                width: 22px;
                padding: 2px 0;
                color: @gray-light;
                text-align: center;
            }

            &.isparent {
                margin: 0 0 0 28px;

                &::before,
                &::after {
                    left: -6px;
                }

                &:last-child::before {
                    height: 20px;
                }

                &::after {
                    width: 10px;
                }

                .rname {
                    margin-left: 0;
                }
            }

            > .lirow.selectable {
                .chevron {
                    &:hover {
                        border-color: #999;
                    }
                }

                .rname {
                    color: @gray-dark;
                    cursor: pointer;

                    &:hover {
                        padding-right: 23px;

                        &::after {
                            position: absolute;
                            display: block;
                            content: '\e013';
                            top: 4px;
                            right: 4px;
                            width: 14px;
                            font-family: 'Glyphicons Halflings';
                            font-style: normal;
                            font-weight: normal;
                            line-height: 1;
                            color: #00c300;
                            -webkit-font-smoothing: antialiased;
                            -moz-osx-font-smoothing: grayscale;
                        }
                    }
                }

                .chevron,
                .rname {
                    &:hover {
                        color: @gray-darker;
                        background-color: @MainLigthColor;
                    }
                }
            }

            > .lirow.selected {
                > .rname {
                    background-color: #94ff82;

                    &:hover {
                        color: @gray-darker;
                        background-color: #ffd8b5;

                        &::after {
                            top: 5px;
                            content: '\e014';
                            color: #c30000;
                        }
                    }
                }
            }
        }
    }
}
