/**
* DevExtreme (widgets/common/diagram.less)
* Version: 20.1.10
* Build date: Fri Jan 15 2021
*
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
@import (once) "./drawer.less";
@import (once) "./loadIndicator.less";
@import (once) "./tooltip.less";
@import (once) "./accordion.less";
@import (once) "./scrollView.less";
@import (once) "./form.less";
@import (once) "./toolbar.less";
@import (once) "./contextMenu.less";
@import (once) "./fileUploader.less";
@import (once) "./popup.less";

@TRANSPARENT_BORDER: 1px solid transparent;

.dx-diagram {
    border: @TRANSPARENT_BORDER;
    display: flex;
    flex-flow: column;
    height: 600px;
    min-height: 350px;

    .dx-diagram-toolbar-wrapper {
        padding: 5px;
        flex-grow: 0;

        .dx-diagram-toolbar {
            background-color: transparent;
        }
    }

    .dx-diagram-content-wrapper {
        display: flex;
        flex-grow: 1;
        flex-basis: 0;
        overflow: hidden;
    }

    .dx-diagram-content,
    .dx-diagram-scroll-view {
        height: 100%;
        width: 100%;
    }

    &.dx-diagram-fullscreen {
        left: 0;
        top: 0;
        width: 100% !important; // stylelint-disable-line declaration-no-important
        height: 100% !important; // stylelint-disable-line declaration-no-important
        position: fixed;
        z-index: 2;
    }

    .dxdi-control { // stylelint-disable-line selector-class-pattern
        width: auto;
        height: auto;
        overflow: visible;
    }

    .dxdi-canvas { // stylelint-disable-line selector-class-pattern
        overflow: hidden;
    }
}

.dx-diagram-toolbox-popup {
    &.dx-popup-wrapper .dx-overlay-content {
        border-radius: 0;
    }

    .dx-popup-title.dx-toolbar {
        padding: 0;
        background-color: rgba(0, 0, 0, 0.05);
    }

    .dx-popup-title .dx-button.dx-button-has-icon:not(.dx-button-has-text),
    .dx-popup-title .dx-button-content {
        background-color: transparent;
        border: 0;
        border-radius: 0;
        padding: 0;
        min-width: 0;
    }

    .dx-popup-title .dx-button:not(.dx-closebutton) {
        cursor: inherit;
        pointer-events: none;
    }

    .dx-popup-content {
        padding: 0;

        .dx-diagram-toolbox-input {
            border-color: transparent;
        }

        .dx-diagram-toolbox-input input,
        .dx-diagram-toolbox-input .dx-placeholder:before {
            min-height: 0;
            font-size: 0.9em;
        }

        .dx-diagram-toolbox-input .dx-button {
            border: 0;
            border-radius: 0;
            min-height: 14px;
        }

        .dx-diagram-toolbox-panel {
            position: relative;
            height: 100%;
            width: 100%;
            overflow-y: auto;

            & > * {
                position: absolute;
            }

            & > .dx-scrollview {
                width: 100%;
            }
        }
    }
}

.dx-diagram-properties-popup {
    .dx-scrollview {
        width: 100%;
    }

    .dx-popup-content {
        padding: 0;
    }

    .dx-tabs {
        border: 0;
    }

    .dx-tabpanel .dx-multiview-wrapper {
        border-left: 0;
        border-right: 0;
    }

    .dx-diagram-properties-panel-group-toolbar {
        .dx-toolbar-items-container {
            display: block;
            height: auto;

            & > div {
                display: flex;
                flex-wrap: wrap;
                width: 100%;
                height: auto;
                position: inherit;
            }

            .dx-toolbar-item {
                display: flex;
                align-items: center;
            }
        }
    }

    &:not(.dx-diagram-mobile-popup) {
        .dx-tabpanel .dx-multiview-wrapper {
            border-bottom: 0;
        }
    }

    &.dx-diagram-mobile-popup {
        width: calc(100% - 2px) !important; // stylelint-disable-line declaration-no-important

        .dx-popup-title {
            border: 0;
            min-height: 0;
            position: relative;
            z-index: 1;
        }

        .dx-toolbar .dx-toolbar-items-container {
            height: auto;

            .dx-toolbar-item {
                padding-top: 0;
                padding-bottom: 0;
            }
        }

        .dx-tabpanel {
            display: flex;
            flex-direction: column-reverse;

            .dx-multiview-wrapper {
                border-top: 0;
            }
        }
    }
}

.dx-diagram-floating-toolbar-container {
    position: absolute;
    z-index: @OVERLAY_ZINDEX + 1;
    width: 100%;
    transition: opacity 400ms ease;

    &.dx-diagram-properties-panel-toolbar-container {
        background: transparent;
        border-radius: 50%;
        border: 0;
        padding: 0;

        .dx-toolbar {
            background: transparent;
        }

        div {
            border-radius: 50%;
        }
    }

    .dx-diagram-toolbar .dx-toolbar-items-container > * {
        padding-left: 0;
        padding-right: 0;
    }
}

.dx-diagram-toolbar {
    .dx-diagram-toolbar-separator {
        height: 100%;
        border-left: @TRANSPARENT_BORDER;
    }

    .dx-diagram-toolbar-menu-separator {
        width: 100%;
        border-top: @TRANSPARENT_BORDER;

        &::before {
            content: none;
        }
    }
}

.dx-diagram-toolbar,
.dx-dropdownmenu-popup {
    .dx-diagram-image-dropdown-item,
    .dx-diagram-color-edit-item {
        .dx-texteditor {
            width: auto;
        }

        .dx-dropdowneditor-field-template-wrapper {
            display: flex;
            align-items: center;

            .dx-diagram-i {
                display: block;
            }

            .dx-textbox {
                width: 0;

                .dx-texteditor-input {
                    width: 0;
                    padding-left: 0;
                }
            }
        }
    }
}

.dx-diagram-mobile-toolbar-color-box-opened {
    .dx-dropdowneditor-overlay {
        transform: none !important; // stylelint-disable-line declaration-no-important
        width: 100% !important; // stylelint-disable-line declaration-no-important
        height: 100% !important; // stylelint-disable-line declaration-no-important

        .dx-overlay-content {
            transform: none !important; // stylelint-disable-line declaration-no-important
            width: 100% !important; // stylelint-disable-line declaration-no-important
            top: initial !important; // stylelint-disable-line declaration-no-important
            bottom: 0 !important; // stylelint-disable-line declaration-no-important

            .dx-popup-content {
                padding: 8px;
            }

            .dx-colorview-container {
                width: 100%;

                .dx-colorview-container-row {
                    display: flex;

                    .dx-colorview-palette-cell {
                        flex-grow: 1;

                        .dx-colorview-palette {
                            width: 100%;
                            min-width: 300px;
                        }
                    }

                    .dx-colorview-hue-scale-cell {
                        margin-left: 12px;
                    }

                    .dx-colorview-controls-container {
                        margin-left: 12px;
                    }
                }
            }
        }
    }
}

.dx-diagram-i {
    background-repeat: no-repeat;
    background-position: 0 0;
    display: inline-block;
}

.dx-diagram-loading-indicator {
    position: absolute;
    top: calc(50% - 32px);
    left: calc(50% - 32px);
    width: 64px;
    height: 64px;
}

.dx-diagram-touchbar-overlay,
.dx-diagram-touch-context-toolbox .dx-popover-wrapper {
    z-index: 1 !important; // stylelint-disable-line declaration-no-important
}

.dx-diagram-touchbar.dx-context-menu {
    .dx-menu-items-container {
        display: block;
        height: 100%;
        padding: 0;
    }

    .dx-menu-items-container::after {
        display: block;
        content: "";
        clear: both;
    }

    .dx-menu-items-container > li {
        display: block;
        float: left;
    }

    .dx-menu-item.dx-menu-item-has-text.dx-menu-item-has-icon .dx-menu-item-content .dx-icon {
        margin: 0;
    }

    .dx-menu-item .dx-menu-item-content .dx-menu-item-text {
        display: none;
    }
}

.dx-diagram-touchbar-target,
.dx-diagram-context-toolbox-target {
    position: absolute;
    background-color: transparent;
    pointer-events: none;
}

.dx-diagram-context-toolbox-target {
    width: 1px;
    height: 1px;
}

.dx-diagram-context-toolbox .dx-popup-content {
    padding: 8px;
}

.dx-diagram-context-toolbox-content {
    width: 152px;
}
