.select2-container {
    .loading-indicator {
        background: transparent;

        > span {
            background-image: url('../../images/loader-transparent.svg');
            left: auto;
            right: 10px;
            top: 19px;
            background-size: 17px 17px;
        }
    }

    &.in-progress {
        .select2-selection .select2-selection__arrow b {
            display: none !important;
        }
    }
}


.select2-container--default {
    display: block;

    button {
        padding: 0;
        border: 0;
        background: transparent;
        line-height: 20px;
    }

    .select2-selection {
        .select-input-defaults();
        outline: 0;
    }

    .select2-search--dropdown {
        position: relative;
        padding: 7px 7px 0;

        &:after {
            position: absolute;
            .icon(@icon-search);
            right: 16px;
            top: 12px;
            color: #95a5a6;
        }

        .select2-search__field {
            .select-input-defaults();
            padding-left: 6px;
        }
    }

    // .select2-dropdown--below {
    //     .select2-search--dropdown {
    //         &:after {
    //         }
    //     }
    // }

    .select2-search__field {
        outline: 0;

        &::placeholder {
            color: @input-color-placeholder;
        }
    }

    .select2-results__option {
        border-radius: @border-radius-base;

        &[role=group] {
            padding: 0;
        }

        &[aria-disabled=true] {
            color: @color-select-link-disabled;
            cursor: @select-cursor-disabled;
        }

        &[aria-selected=true] {
            background-color: @color-select-hover-bg;
            color: @color-select-hover;
        }

        &--highlighted[aria-selected] {
            background-color: @color-select-active-bg;
            color: @color-select-active;
        }

        .select2-results__option {
            padding: @padding-base-vertical @padding-base-horizontal;

            .select2-results__group {
                padding-left: 0;
            }

            .select2-results__option {
                margin-left: -@padding-base-horizontal;
                padding-left: @padding-base-horizontal*2;

                .select2-results__option {
                    margin-left: -@padding-base-horizontal*2;
                    padding-left: @padding-base-horizontal*3;

                    .select2-results__option {
                        margin-left: -@padding-base-horizontal*3;
                        padding-left: @padding-base-horizontal*4;

                        .select2-results__option {
                            margin-left: -@padding-base-horizontal*4;
                            padding-left: @padding-base-horizontal*5;

                            .select2-results__option {
                                margin-left: -@padding-base-horizontal*5;
                                padding-left: @padding-base-horizontal*6;
                            }
                        }
                    }
                }
            }
        }
    }

    .select2-results__group {
        color: @color-select-header;
        display: block;
        padding: @padding-base-vertical 6px;
        line-height: @line-height-base;
        white-space: nowrap;
        font-weight: 600;
    }

    &.select2-container--focus,
    &.select2-container--open {
        .select2-selection {
            transition: @input-transition;
            border-color: @input-border-focus;

            &:focus-visible {
                box-shadow: @input-focus-box-shadow;
            }
        }
    }

    &.select2-container--open {
        //
        // Make the dropdown arrow point up while the dropdown is visible.
        //
        .select2-selection .select2-selection__arrow b {
            &:before {
                .icon(@icon-angle-up);
                line-height: inherit;
            }
        }

        //
        // Handle border radii of the container when the dropdown is showing.
        //
        // &.select2-container--below {
        //     .select2-selection:not(.select-no-dropdown) {
        //         .border-bottom-radius(0);
        //         border-bottom-color: transparent;
        //     }
        // }

        // &.select2-container--above {
        //     .select2-selection:not(.select-no-dropdown) {
        //         .border-top-radius(0);
        //         border-top-color: transparent;
        //     }
        // }
    }

    .select2-selection__clear {
        color: @color-select-icon;
        cursor: pointer;
        float: right;
        font-weight: bold;
        margin-right: 10px;

        &:hover {
            color: #333;
        }
    }

    &.select2-container--disabled {

        .select2-selection {
            border-color: @input-border;
            box-shadow: none;
        }

        .select2-selection,
        .select2-search__field {
            cursor: @select-cursor-disabled;
        }

        .select2-selection {
            background-color: @input-disabled-bg;
        }

        .select2-selection--multiple .select2-selection__choice {
            background: #ccc;
        }

        .select2-selection__clear,
        .select2-selection--multiple .select2-selection__choice__remove {
            display: none;
        }
    }

    // Dropdown
    //------------------------------------

    .select2-dropdown {
        overflow-x: hidden;
        margin-top: 5px;
        padding-top: 0;
        background-color: @input-bg;
        border: 1px solid @input-border;
        border-radius: @border-radius-base;
        box-shadow: @box-shadow-z1;

        &--above {
            margin-top: -5px;
            box-shadow: @box-shadow-z1;
        }
    }

    .select2-results > .select2-results__options {
        font-size: @input-font-size;
        max-height: 200px;
        overflow-y: auto;
        padding: 7px;
    }

    // No Dropdown
    //------------------------------------

    .select2-dropdown.select-no-dropdown {
        display: none !important;
    }

    .select2-dropdown.select-hide-selected {
        .select2-results__option--selected {
            display: none !important;
        }
    }

    // Auto Width
    //------------------------------------

    .select2-dropdown.select-dropdown-auto-width {
        .select2-results__options {
            overflow-x: hidden;
        }

        .select2-results__option {
            white-space: nowrap;
        }
    }
}
