// INPUTS
.o_switch {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;

    >input {
        display: none;

        +span {
            background-color: $o-we-switch-inactive-color;
            box-shadow: inset 0 0 0px 1px darken($o-we-switch-inactive-color, 10%);
            border-radius: 100rem;
            height: $o-we-switch-size;
            width: $o-we-switch-size * 1.8;
            margin-right: 0.5em;
            display: inline-block;
            transition: all 0.3s $o-we-md-ease;

            &:after {
                content: "";
                background: $o-we-color-paper;
                display: block;
                width: $o-we-switch-size - 0.2;
                height: $o-we-switch-size - 0.2;
                margin-top: 0.1ex;
                margin-left: 0.1ex;
                border-radius: 100rem;
                transition: all 0.3s $o-we-md-ease;
                box-shadow: 0 1px 1px darken($o-we-switch-inactive-color, 35%), inset 0 0 0 1px lighten($o-we-switch-inactive-color, 10%);
            }
        }

        &:checked+span {
            box-shadow: none;
            background: $o-we-color-success;

            &:after {
                margin-left: ($o-we-switch-size*1.8 - $o-we-switch-size) + 0.1;
            }
        }
    }

    &.o_switch_danger {
        >input {
            &:not(:checked)+span {
                box-shadow: none;
                background: $o-we-color-danger;
            }
        }
    }
}

// ACE EDITOR
.o_ace_view_editor {
    background: $o-we-ace-color;
    color: white;
    display: flex;
    flex-flow: column nowrap;
    opacity: 0.97;

    .o_ace_view_editor_title {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        padding: $grid-gutter-width/4;

        >.o_ace_type_switcher>button::after {
            @include o-caret-down;
            margin-left: 4px;
        }

        >* {
            flex: 0 0 auto;
            margin: 0 $grid-gutter-width/4;

            &.o_include_option {
                display: flex;
                align-items: center;
                font-size: 11px;

                >.custom-control {
                    margin-right: $grid-gutter-width/4;
                }
            }

            &.o_res_list {
                flex: 1 1 auto;
                min-width: 60px;
            }
        }
    }

    #ace-view-id {
        flex: 0 0 auto;
        padding: $grid-gutter-width/4 $grid-gutter-width/2;
        background-color: lighten($o-we-ace-color, 10%);
    }

    #ace-view-editor {
        @mixin ace-line-error-mixin {
            content: "";
            z-index: 1000;
            display: block;
            background-color: theme-color('danger');
            opacity: 0.5;
            pointer-events: none;
        }

        height: 70%; // in case flex is not supported
        flex: 1 1 auto;

        .ace_gutter {
            cursor: ew-resize;

            .ace_gutter-cell.o_error {
                position: relative;

                &::after {
                    @include o-position-absolute(-100%, 0, -100%, 0);
                    @include ace-line-error-mixin;
                }
            }
        }

        .ace_resize_bar {
            @include o-position-absolute($right: 0);
            width: 25px;
            height: 100%;
            cursor: ew-resize;
        }

        .ace_scroller.o_error::after {
            @include o-position-absolute(0, auto, 0, 0);
            width: 3px;
            @include ace-line-error-mixin;
        }
    }
}

.o_ace_select2_dropdown {
    width: auto !important;
    padding-top: 4px;
    font-family: monospace !important;

    >.select2-results {
        max-height: none;
        max-height: 70vh;

        .select2-result-label {
            padding-top: 1px;
            padding-bottom: 2px;

            >.o_ace_select2_result {
                padding: 0;
                font-size: 12px;
                white-space: nowrap;
            }
        }
    }
}
