#document-editor-container {
    display: flex;
    flex-direction: row;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 1;
    padding: 0;

    .dropdown-menu {
        position: absolute;
        color: $text-color-default;
        background-color: $color-layer-1;
        border: 1px solid $global-border-color;

        input {
            background-color: $color-layer-2;
            color: $text-color-default;
            border: 1px solid $global-border-color;
        }

        a, a.text-light { // text-light class should be removed from the element
            color: $text-color-default  !important; //Important necessary to overrule important in the text-light class

            &:hover {
                color: $color-primary !important; //Important necessary to overrule important in the text-light class
                background-color: inherit;

                svg {
                    fill: $color-primary;
                }
            }
        }
    }

    .bootstrap-select .no-results {
        background-color: $document-editor-tab-bar-background-color;
        color: $text-color-default;
    }

    .bootstrap-select.is-valid .dropdown-toggle,
    .was-validated .bootstrap-select select:valid+.dropdown-toggle {
        border-color: #171a1d;
    }
}

#document-editor-side-menu-container {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: $document-editor-side-menu-background-color;
    width: $document-editor-side-menu-width;
    border-left: 1px $global-border-color;
    right: 0;
    z-index: $document-editor-layer-middle-z-index;

    .dbqde-document-editor-side-menu-header-container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;

        .dbqde-document-editor-title {
            display: flex;
            align-items: center;
            flex-shrink: 0;
            width: calc(100% - $document-editor-tab-bar-width);
            height: $document-editor-header-height;
            padding-left: 15px;
            font-size: 20px;
            font-weight: 600;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
        }

        .dbqde-document-editor-fullscreen-button {
            width: $document-editor-header-height;
            height: $document-editor-header-height;
            background: 0;
            border: 0;
            outline: 0;

            svg {
                fill: $text-color-default;
            }

            &:hover {
                background-color: $document-editor-tab-bar-background-color;
                border-color: $document-editor-tab-bar-background-color;
            }
        }
    }
}

.document-editor-tab-bar {
    float: right;
    width: $document-editor-tab-bar-width;
    height: 100%;
    background-color: $document-editor-tab-bar-background-color;
    z-index: $document-editor-layer-middle-z-index;

    button {
        float: left;
        height: calc($document-editor-tab-bar-width - 10px);
        width: calc($document-editor-tab-bar-width - 10px);
        border-radius: $document-editor-tab-bar-button-border-radius;
		margin: 5px;
        border: 0;
        outline: 0;
        background-color: transparent;
        color: $text-color-default;

        i {
            font-size: 23px;
        }

        svg {
            fill: $text-color-default;
        }

        &[data-view-type='4'] i {
            font-size: 21px;
        }

        &[data-view-type='99'] i {
            font-size: 28px;
        }

        &:focus {
            box-shadow: none;
        }

        &:hover {
            color: $text-color-default;
            background-color: $document-editor-tab-bar-button-background-color-hover;
            //border-color: $document-editor-side-menu-background-color;

            svg {
                fill: $text-color-default;
            }
        }

		&.active {
            background-color: $document-editor-tab-bar-button-background-color-active;
			color: $color-primary;

            svg {
                fill: $color-primary;
            }
        }

        &[data-view-type="1"] { // not allowed
            svg {
                fill: $material-design-disabled-label-color;
            }
        }

        /* Separate the close button from the rest of the buttons */
        &:first-of-type {
            background-color: $document-editor-side-menu-background-color;
            margin-bottom: $document-editor-header-height;

            &:hover {
                background-color: $document-editor-tab-bar-background-color;
            }
        }
    }
}

#document-editor-side-menu-container {
    color: $text-color-default;

    .dbqde-side-menu-container {
        width: 100%;
        height: calc(100% - #{$document-editor-header-height});
    }

    .form-control,
    .form-check-input {
        //background-color: #495057;
        //color: $text-color-default;
        //border: 1px solid #ced4da;

        &.disabled {
            cursor: not-allowed;
            pointer-events: none;
        }

        &:focus {
            //background-color: #495057;
            color: $text-color-default;
            //border-color: $text-color-default;
            outline: 0;
            box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
        }
    }

    .form-control option {
        background-color: $color-layer-1;
    }

    .was-validated {
        .form-control {
            &:valid {
                border: 1px solid $global-border-color;
                background: 0 none;
				background-color: $color-layer-0;
                padding-right: 12px;

                &:focus {
                    border: 1px solid $global-border-color;
                }
            }

            &.disabled {
                border-color: $document-editor-input-field-disabled-border-color;
				background: $document-editor-input-field-disabled-background-color;
				color: $document-editor-input-field-disabled-text-color;
            }
        }
    }

    .form-control-plaintext {
        color: #bbb;
    }
}

.document-editor-category-title {
    height: $document-editor-header-height;
    line-height: $document-editor-header-height;
    padding: 0 15px;
    font-weight: 500;
    font-size: 16px;
    text-transform: uppercase;
    color: $text-color-default;
    //background-color: $document-editor-tab-bar-background-color;
    border-color: #171a1d;
    border: 1px solid $global-border-color;
    position: relative;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;

    .document-editor-category-title-buttons {
        position: absolute;
        top: calc(0px - 100%);
        right: 15px;
        opacity: 0;

        button {
            margin-right: 5px;
            padding: 0;

            svg {
                fill: $color-white;
            }
        }
    }
}

.document-editor-scrollview {
    background-color: $document-editor-tab-bar-background-color !important;
    //border-color: #171a1d !important;
    border-radius: 5px;

    .scrollview-content {
        margin: 5px;
        overflow-y: auto;
        height: calc(100% - 10px);
        @include scrollbar;
    }
}

#editor-elements-container {
    height: calc(100% - #{$document-editor-header-height});
    overflow-y: auto;
    @include scrollbar;

    .editor-elements-row {
        padding: 7.5px;

        .editor-element-col {
            padding: 7.5px;
        }
    }
}

.editor-element-category-header {
    //border-top:  rgb(43,65,98);
    //border-bottom:  rgb(43,65,98);

    &:first-child {
        //border-top: 0;
    }

    i {
        margin-right: 15px;
    }
}

.editor-element {
    position: relative;
    overflow: hidden;
    width: 65.25px;
    height: 65.25px;
    border: 2px solid $color-layer-4 !important;
    background: transparent !important;
    color: $text-color-default !important; // Added to work properly with light/dark mode
    padding: 0 5px !important;
    text-overflow: ellipsis;
    clear: both;

    &:hover {
        border-color: $document-editor-button-background-color !important; 
        cursor: pointer;
    }

    i {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        margin-top: 0px;
        font-size: 20px;
        padding: 10px;
        width: 100%;
    }

    svg {
        margin-top: 10px;
        fill: $text-color-default;
    }

    .element-type-name {
        position: absolute;
        bottom: 5px;
        left: 5px;
        right: 5px;
        font-size: 11px;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }

    &.dbqde-editor-element-dragging {
        border-color: $document-editor-button-background-color !important; 

        .element-type-name,
        i {
            color: $document-editor-button-background-color;
        }
    }
}

.editor-element-document-template {
    overflow: hidden;
    width: 100%;
    border: 2px solid $color-layer-4 !important;
    background: transparent !important;
    color: $text-color-default !important; // Added to work properly with light/dark mode
    font-size: 12px !important;

    &:hover {
        border-color: $document-editor-button-background-color !important;
        cursor: pointer;
    }

    i {
        margin: 5px 8px 5px 0;
    }
}

.col-fixed {
    position: fixed;
    height: 100%;
    z-index: 1;
}

.col-offset-392 {
    padding-right: 392px;
    z-index: 0;
}

.is-dragover {
    background-color: grey;
}

/*********************************
*    Version state styling     *
********************************/
/*
Tab Bar
*
Disable the editor elements tab for non-draft versions
Disable the properties tab when state is not 215 = DidSelectElement
*/
#document-editor-container {
    &:not([data-document-version-state='0']) {
        .document-editor-tab-bar {
            button[data-view-type='0'] {
                // Bootstrap disabled styling
                color: $text-color-default;
                background-color: $document-editor-side-menu-background-color;
                border-color: $document-editor-side-menu-background-color;
                opacity: 0.65;
                pointer-events: none;
            }
        }

        .dbqde-function-button:not(.version-function-button):not(.dbqde-document-tags-function-button):not(.dbqde-function-button-toolbar) {
            opacity: 0 !important;
            pointer-events: none;
        }

        .dbqde-element-function-button:not(.dbqde-element-collapse-button) {
            display: none;
        }

        .document-style {
            pointer-events: none;
        }

        .element-visibility-expressions-toolbar {
            display: none;
        }

        #element-attributes-control-container {
            .dbq-card {
                display: none !important;
            }
        }

        #element-attributes-container {

            .dbq-folder-document-picker,
            .box.has-advanced-upload {
                opacity: 0.65;
                pointer-events: none;
            }
        }
    }

    &:not([data-document-editor-state='215']) {
        .document-editor-tab-bar {
            button[data-view-type='1'] {
                // Bootstrap disabled styling
                color: $document-editor-tab-bar-button-color-disabled;
                //background-color: $document-editor-side-menu-background-color;
                //border-color: $document-editor-side-menu-background-color;
                //opacity: 0.65;
				cursor: not-allowed;
                pointer-events: none;
            }
        }
    }
}

/*********************************
* Element create state styling *
********************************/
/*
EditorState 100 = WillCreateTopic
EditorState 200 = WillCreateElement
*/
#document-editor-container {

    &[data-document-editor-state='100'],
    &[data-document-editor-state='200'] {
        // #dbqde-elements-list {
        //     //background-color: #444 !important;

        //     input,
        //     select,
        //     textarea {
        //         background-color: #a1a1a1 !important;
        //         border-color: #a1a1a1 !important;
        //     }

        //     input[type='checkbox'] {
        //         opacity: 0.5; // Checkboxes ignore background color; looks disabled via opacity
        //     }

        //     .custom-file-label {
        //         background-color: #a1a1a1 !important;
        //         border-color: #a1a1a1 !important;
        //     }
        // }

        .dbqde-elements-sortable-list {
            pointer-events: none;
        }

        .document-editor-tab-bar {
            button:not([data-view-type='99']) {
                // Bootstrap disabled styling
                color: $document-editor-tab-bar-button-color-disabled;
                //background-color: $document-editor-side-menu-background-color;
                //border-color: $document-editor-side-menu-background-color;
				cursor: not-allowed;
                pointer-events: none;
            }
        }

        #topics-container {
            li {
                pointer-events: none;
            }

            .dbq-button {
                // Bootstrap disabled styling
                color: $document-editor-button-text-color;
                background-color: $document-editor-button-background-color;
                border-color: $document-editor-button-background-color;
                opacity: 0.65;
                pointer-events: none;
            }
        }
    }

    // &[data-document-editor-state='200'] {
    //     #dbqde-elements-list {
    //         .dbqde-element-selected {
    //             background-color: white !important;
    //         }
    //     }
    // }
}