/*!
 * Copyright (C) 2023 Xibo Signage Ltd
 *
 * Xibo - Digital Signage - https://xibosignage.com
 *
 * This file is part of Xibo.
 *
 * Xibo is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * Xibo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Xibo.  If not, see <http://www.gnu.org/licenses/>.
 */

// Imports
@import "variables";
@import "mixins";

// CSS
body.editor-opened {
    overflow: hidden;
}

#read-only-message {
    display: block;
    margin: 5px 5%;
    padding: 10px;
    width: 90%;
    line-height: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

// Change top bar to match layout editor
body.editor-opened .row.header.header-side {
    position: relative;
    background-color: $xibo-color-neutral-0;
    @include box-shadow(0px 2px 2px $xibo-color-shadow);
    z-index: $header-z-index;
}

/* Flex structure */
.layout-editor-flex {
    display: flex;

    .flex-h {
        display: flex;
        flex: 1;
        flex-flow: row;
        justify-content: space-between;
    }

    .flex-v {
        display: flex;
        flex: 1;
        flex-direction: column;
    }

    .min-fix {
        min-width: 0;
    }

    .rowspan2 {
        flex: 1 1 100%;
    }
}

.container-designer {
    // height: calc(100vh - 90px);
    // Change height for now
    height: calc(100vh - 50px);
}

.main-panel, .playlist-panel {
    flex: 1;

    /* Prevent growing more than the allocated space, a fix for overlay in the viewer toolbar */
    max-width: calc(100% - 320px);

    .main-panel-wrapper {
        position: relative;
        height: 100%;
        padding: 0;
        background-color: $xibo-color-neutral-900;
        border-width: 2px;
        border-style: solid;
        @include border-radius(4px 4px 0 0);
    }
}

#layout-editor.overlay-on, #playlist-editor.overlay-on {
    .properties-panel-container {
        z-index: auto;
    }
}

.properties-panel-container {
    flex: 0;
    width: auto;
    height: 100%;
    display: flex;
    z-index: $properties-panel-z-index;

    &.closed {
        width: 0;
    }

    .bootstrap-tagsinput {
        width: 100%;
    }
}

.toggle-flex {
    flex-basis: 0 !important;
}

/* Page content wrapper */
body.editor-opened #content-wrapper .page-content>.row {
    >div {
        margin: 0;
    }

    &.header.header-side {
        height: 50px;
        margin-bottom: 0;

        .navbar-toggler-side {
            margin-top: 8px;
            margin-right: 8px;
        }

        .user {
            &>.item {
                width: auto;
                height: 50px;
                padding-right: 16px;

                &>a {
                    padding: 7px 0;
                }

                img.nav-avatar {
                    width: 36px;
                    height: 36px;
                    border-radius: 2px;
                }
            }
        }

        .xibo-logo-container {
            margin-left: 50%;
            transform: translateX(-50%);

            .page {
                width: auto;
                padding: 0;

                .xibo-logo {
                    height: 30px;
                    margin: 10px 0;
                }
            }
        }

        .user-notif > .item > a {
            display: flex;
            height: 50px;
            width: 50px;
            align-items: center;
            justify-content: center;
            gap: 4px;
            color: #f9f9f9;

            & > i {
                color: $xibo-color-secondary;
            }

            &:hover {
                & > .red {
                    background: #df4040 !important;
                }

                & > i {
                    color: lighten($xibo-color-secondary, 20%);
                }
            }
        }
    }
}


/* Main Editor */
#layout-editor {
    overflow: hidden;
    margin: 0 -15px -15px -15px;
    background-color: $xibo-color-neutral-100;

    /* SCROLLBAR */
    scrollbar-color: $xibo-color-primary lighten($xibo-color-primary, 40%);
    /* For firefox */
    scrollbar-width: thin;
    /* For firefox */

    #fullscreenBtn {
        position: absolute;
        top: 6px;
        right: 6px;
        opacity: 0.9;
        font-size: 1rem;
        background-color: $xibo-color-neutral-0;
        color: $xibo-color-primary;
        z-index: $viewer-button-z-index;

        &:hover {
            opacity: 1;
        }
    }

    #layerManagerBtn {
        position: absolute;
        bottom: 6px;
        left: 6px;
        opacity: 0.9;
        font-size: 1rem;
        background-color: $xibo-color-neutral-0;
        color: $xibo-color-primary;
        z-index: $viewer-button-z-index;

        &.active {
            background-color: $xibo-color-primary;
            color: $xibo-color-neutral-0;
        }

        &:hover {
            opacity: 1;
        }
    }

    &.preview-playing {
        .custom-overlay-preview-playing {
            display: block !important;
            z-index: $preview-playing-z-index !important;
            opacity: 0.5;
        }

        .main-panel {
            z-index: calc(#{$preview-playing-z-index} + 10);

            #fullscreenBtn, #layerManagerBtn {
                display: none;
            }

            .main-panel-wrapper, .editor-bottom-bar {
                outline: 4px solid $xibo-color-primary-l60;
            }
        }
    }

    .snap-controls {
        position: absolute;
        display: flex;
        gap: 3px;
        bottom: 6px;
        right: 6px;

        .snap-to-grid-value {
            width: 50px;
            color: $xibo-color-primary;
            margin-right: -6px;
        }

        & > .btn {
            opacity: 0.9;
            width: 30px;
            font-size: 1rem;
            background-color: $xibo-color-neutral-0;
            color: $xibo-color-primary;
            z-index: $viewer-button-z-index;

            &.active {
                background-color: $xibo-color-primary;
                color: $xibo-color-neutral-0;
            }
    
            &:hover {
                opacity: 1;
            }
        }
    }

    /* width */
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }

    /* Track */
    ::-webkit-scrollbar-track {
        background: $xibo-color-primary-l5;
        @include border-radius(6px);
    }

    /* Handle */
    ::-webkit-scrollbar-thumb {
        background: $xibo-color-primary-d60;
        @include border-radius(4px);
    }

    /* Handle on hover */
    ::-webkit-scrollbar-thumb:hover {
        background: lighten($xibo-color-primary-d60, 20%);
    }

    ::-webkit-scrollbar-corner {
        @include box-shadow(inset 0 0 5px $xibo-color-neutral-700);
    }

    .back-button-playlist {
        position: fixed;
        left: 6px;
        top: 4px;
    }

    .back-button {
        text-transform: uppercase;
        z-index: $header-z-index;

        a {
            padding: 0.5rem 1rem;
            color: $xibo-color-secondary;

            &:hover {
                background-color: $xibo-color-primary-l10;
            }
        }

        span {
            margin-left: 6px;
            font-weight: bold;
        }
    }

    .center-msg {
        position: relative;
        text-align: center;
        font-size: 1.4rem;
        overflow: hidden;
        font-weight: bold;
        @include set-transparent-color(color, $xibo-color-primary-l5, 0.5);
        top: 50%;
        transform: translateY(-50%);
    }

    .hide-on-fs {
        display: inline-block;
    }

    .show-on-fs {
        display: none;
    }

    &.inline-edit-mode {
        .custom-overlay, .custom-overlay-clone {
            display: block !important;
            opacity: 0.3;
            z-index: $inline-editing-z-index;
        }

        .main-panel {
            z-index: calc(#{$inline-editing-z-index} + 10);

            button {
                display: none;
            }
        }
    }
}

@media (max-width: 768px) {
    #layout-editor {
        margin-top: 50px;
    }
}

/* Layout Viewer */
#layout-editor #layout-viewer-container {
    height: calc(100% - $viewer-bottom-bar-plus-border-height - 16px);
    padding: 16px 16px 0px 16px;

    .main-panel-wrapper {
        border-color: $xibo-color-primary-l60;
    }

    .viewer-overlay {
        display: none;
        z-index: $viewer-overlay-index;
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        background-color: rgb(255 255 255 / 80%);
    }

    #layout-viewer {
        height: 100%;
        border: none;
        position: relative;
        background: $xibo-color-neutral-900;
        padding: 6px;
        border-radius: 2px 2px 0 0;
        /* Prevent text select */
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;

        .layout-viewer-border {
            @include set-transparent-color(background, $xibo-color-neutral-900, 0.9);
            position: absolute;
        }

        .viewer-object {
            position: relative;
            overflow: clip;
            // overflow-clip-margin: 6px;
        }

        .viewer-object .module-preview-icon {
            font-size: 4em;
            margin-top: 10px;
        }

        .ck-editor__editable_inline {
            display: none;
        }

        .widget-preview {
            color: $xibo-color-neutral-700;
            text-shadow: 0px 0px 2px $xibo-color-neutral-900;

            iframe {
                @include user-select-none();
            }
        }

        .layout-player {
            background: #000;
        }

        .designer-region-playlist {
            background: transparent;

            .playlist-edit-btn, .dynamic-playlist-icon {
                position: absolute;
                top: 2px;
                right: 2px;
                background-color: darken($xibo-color-accent, 20%);
                color: $xibo-color-neutral-100;
                padding: 2px 5px;
                font-weight: bold;
                border-radius: 4px;
                z-index: 1;
                opacity: 0.3;
                width: 1.8rem;
                text-align: center;
                cursor: pointer;
    
                .fa-edit {
                    display: initial;
                }
    
                &::after {
                    content: ' ';
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100%;
                }
            }

            .dynamic-playlist-icon {
                background-color: darken($xibo-color-primary, 20%);
                opacity: 0.7;
                cursor: inherit;
            }

            &:hover > .playlist-edit-btn {
                opacity: 0.7;

                &:hover {
                    opacity: 0.9;
                }
            }

            &:hover > .playlist-preview-paging {
                display: block;
            }

            .playlist-preview-empty {
                text-align: center;
                position: absolute;
                top: 0;
                background: $xibo-color-neutral-300;
                width: 100%;
                height: 100%;
            }

            .playlist-preview-paging {
                color: $xibo-color-neutral-0;
                display: none;
                position: absolute;
                min-width: 100%;
                width: max-content;
                height: 22px;
                bottom: 0;
                z-index: 2;
                @include set-transparent-color(background, $xibo-color-neutral-900, 0.5);
                opacity: 1;
                padding: 0 4px;
                white-space: nowrap;
                left: 50%;
                transform: translate(-50%, 0);

                &-message {
                    font-weight: bold;
                    font-size: 1rem;
                }

                &-name {
                    font-weight: bold;
                    font-style: italic;
                    max-width: 150px;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }

                .widget-arrow {
                    cursor: pointer;
                    padding: 2px 3px;
                }
            }
        }

        .designer-region {
            &.empty-region {
                width: 100%;
                height: 100%;
            }

            .module-preview-icon {
                font-size: 2em;
            }

            &::after {
                content: ' ';
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
            }

            .loading-icon {
                font-size: inherit;
            }

            .center-msg {
                font-size: 0.85rem;
                overflow: visible;
                position: absolute;
                left: 50%;
                transform: translate(-50%, -50%);
            }

            &:not(.empty) .preview-select {
                cursor: pointer;
                width: 100%;
                height: 100%;
                position: absolute;
                z-index: 1;
            }

            .loading-container {
                height: 100%;
            }
        }

        .designer-region-canvas {
            width: 0;
            height: 0;

            &.canvas-element-selected-from-layer-manager {
                z-index: auto !important;
            }
        }

        .designer-region-frame.invalid-region {
            background-color: $xibo-color-semantic-error;
            display: flex;
            justify-content: center;
            align-items: center;

            .invalid-region-message {
                text-align: center;
            }
        }

        .designer-region-drawer {
            &::before {
                content: "";
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                outline: 3px dashed $xibo-color-neutral-100;
                outline-offset: -3px;
            }

            .action-label {
                color: $xibo-color-neutral-0;
                font-weight: bold;
                width: 100%;
                height: 100%;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            &.ui-droppable-active {
                background-color: $xibo-color-accent !important;
                opacity: 0.8;

                &:hover, &.ui-droppable-hover {
                    opacity: 1;
                }
            }
        }

        .viewer-object {
            &.theme-light {
                .designer-region-drawer::before {
                    outline-color: $xibo-color-neutral-100;
                }

                .action-label {
                    color: $xibo-color-neutral-0;
                }

                .custom-overlay-action-widget-edit {
                    background: white;
                }
            }

            &.theme-dark {
                .designer-region-drawer::before {
                    outline-color: $xibo-color-neutral-700;
                }

                .action-label {
                    color: $xibo-color-neutral-900;
                }

                .custom-overlay-action-widget-edit {
                    background: black;
                }
            }
        }

        .designer-region-zone {
            outline: 2px dashed $xibo-color-region-hover;
            outline-offset: -4px;
        }

        .action-layout-dock-control {
            position: absolute;
            left: 6px;
            bottom: 6px;
            display: flex;
            align-items: flex-start;
            gap: 12px;
            width: calc(100% - 12px);
            height: 40px;

            .action-screen-helper {
                cursor: pointer;
                display: flex;
                justify-content: center;
                position: relative;
                height: 40px;
                min-width: 100px;
                max-width: 200px;
                padding: 8px 16px;
                align-items: center;
                flex-shrink: 0;
                border-radius: 3px;
                opacity: 0.9;
                background-color: $xibo-color-neutral-0;
                color: $xibo-color-primary;
                font-size: 20px;
                font-style: normal;
                font-weight: 700;
                line-height: normal;
                border: 1px solid $xibo-color-primary-l30;

                & > div.action-screen-helper-label {
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    pointer-events: none;
                }

                &:hover {
                    opacity: 1;
                    border: 1px solid $xibo-color-primary-l60;
                }
            }

            .action-layout-dock-recents {
                display: flex;
                align-items: flex-start;
                gap: 12px;
                overflow-y: visible;
                overflow-x: auto;
                scrollbar-width: none;

                .action-screen-recent {
                    position: relative;
                    cursor: unset;
                    background-color: $xibo-color-neutral-0;
                    color: $xibo-color-neutral-900;
                    height: 40px;
                    font-size: 16px;
                    font-style: normal;
                    font-weight: 400;
                    line-height: 24px;

                    & > i.delete-btn {
                        display: none;
                        cursor: pointer;
                        position: absolute;
                        top: 3px;
                        right: 3px;
                        font-size: 13px;
                    }

                    &:not(.action-target):hover > i.delete-btn {
                        display: unset;
                    }
                }

                &:hover {
                    scrollbar-width: initial !important;

                    .action-screen-recent {
                        margin-bottom: 2px;
                    }
                }
            }

            .action-layout-dock-search {
                position: relative;

                .action-layout-dock-search-button {
                    background-color: $xibo-color-neutral-0;
                    color: $xibo-color-primary;
                    display: flex;
                    width: 40px;
                    height: 40px;
                    padding: 4px;
                    align-items: center;
                    gap: 10px;
                    flex-shrink: 0;
    
                    i {
                        font-size: 32px;
                        flex-shrink: 0;
                        color: $xibo-color-primary;
                    }
                }
    
                .action-layout-dock-search-results-container {
                    position: absolute;
                    width: 292px;
                    z-index: $layout-dock-results-z-index;
                    align-items: flex-start;
                    border-radius: 3px;
                    background: $xibo-color-neutral-100;
                    top: -4px;
                    left: 0;
                    transform: translate(0, -100%);
                    @include box-shadow(0px 4px 10px 0px rgba(0, 0, 0, 0.25));
                    scrollbar-color: $xibo-color-neutral-700 $xibo-color-neutral-100;

                    .action-layout-dock-search-find-container {
                        width: 100%;
                        padding: 10px;
                        display: flex;

                        .action-layout-dock-search-find {
                            width: 100%;
                            @include box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075));
                            border: 1px solid $xibo-color-neutral-600;
                            border-radius: 4px;
                            outline: none;
                            color: $xibo-color-neutral-900;
                            font-size: 14px;
                            font-style: normal;
                            font-weight: 400;
                            line-height: normal;
                            padding: 6px 40px 6px 14px;
                        }

                        .input-info {
                            position: absolute;
                            right: 24px;
                            top: 10px;
                            height: 30px;
                            display: flex;
                            align-items: center;
                        }
                    }

                    .action-layout-dock-search-results {
                        overflow-y: auto;
                        max-height: 120px;
                        width: 100%;

                        .action-layout-dock-option {
                            cursor: pointer;
                            background: $xibo-color-neutral-100;
                            padding: 6px 12px;
                            min-height: 24px;
                            white-space: nowrap;
                            overflow: hidden;
                            text-overflow: ellipsis;
        
                            &:hover {
                                font-weight: bold;
                                color: $xibo-color-neutral-0;
                                background: $bootstrap-theme-main-color;
                            }
                        }

                        .error-message {
                            padding: 6px 12px;
                        }
                    }
                }
            }
        }
    }

    /* Viewer fullscreen */
    &.fullscreen {
        @include set-transparent-color(background-color, $xibo-color-neutral-900, 0.9);
        position: fixed;
        z-index: $designer-overlay-z-index;
        left: 0;
        top: 0;
        padding: 0;
        height: calc(100% - $viewer-bottom-bar-plus-border-height);
        width: 100%;

        #fullscreenBtn,
        .snap-controls {
            z-index: calc(#{$designer-overlay-z-index} + 10);
        }

        #layout-viewer {
            position: fixed;
            /* Stay in place */
            z-index: calc(#{$designer-overlay-z-index} + 10);
            left: 6px;
            top: 6px;
            width: calc(100% - 12px);
            height: calc(100% - $viewer-bottom-bar-plus-border-height - 12px);
            @include set-transparent-color(background-color, $xibo-color-neutral-900, 0.9);
        }

        .hide-on-fs {
            display: none;
        }

        .show-on-fs {
            display: inline-block;
        }
    }
}

/* Viewer inline editor */
#layout-editor {
    #inline-editor {
        height: inherit;
    }

    /* Inline Editor Overlay */
    #inline-editor-overlay {
        position: absolute;
        text-align: center;
        cursor: pointer;
        width: 100%;
        height: 100%;
        @include set-transparent-color(background, $xibo-color-neutral-500, 0.2);
        @include box-shadow(inset $xibo-color-neutral-500 0px 0px 10px 0px);

        &:hover {
            @include set-transparent-color(background, $xibo-color-neutral-500, 0.5);
        }

        .edit-btn-container {
            display: table;
            width: 100%;
            height: 100%;

            #edit-btn {
                font-size: 4.3rem;
                text-shadow: 0px 0px 5px $xibo-color-neutral-900;
                @include set-transparent-color(color, $xibo-color-neutral-100, 0.8);
                vertical-align: middle;
                display: table-cell;

                &:hover {
                    @include set-transparent-color(color, $xibo-color-neutral-100, 0.9);
                }
            }
        }
    }

    .inline-editor-opened,
    .inline-editor-closed,
    .inline-editor-closed#inline-editor-overlay {
        display: none;
    }

    &.interactive-mode, &.interactive-edit-widget-mode {
        #fullscreenBtn, #layerManagerBtn {
            display: none !important;
        }

        #layout-viewer {
            .playlist-edit-btn, .slot {
                opacity: 0.6 !important;
                cursor: auto !important;
                background-color: $xibo-color-overlay !important;
            }

            .designer-element-group .group-edit-btn, .playlist-preview-paging {
                display: none !important;
            }
        }

        #layout-viewer-container {
            height: calc(100% - 16px);

            .main-panel-wrapper {
                @include border-radius(4px);
            }

        }
    }

    &.interactive-edit-widget-mode {
        .editor-top-bar {
            .back-button, .layout-action-menu {
                display: none;
            }

            #layoutInfo > span {
                cursor: initial;
            }

            .layout-info-name:hover {
                border-bottom: none;
            }
        }
    }
}

/* Properties Panel */
.properties-panel-container #properties-panel {
    padding: 0;
    width: $properties-panel-width;
    height: 100%;

    .nav {
        width: 100% !important;
        border: none;

        .nav-item {
            flex: 1 1 auto;
            text-align: center;
        }
    }

    .hidden {
        margin-right: -370px;
    }

    .unsuccessMessage {
        text-align: center;
        font-weight: bold;
        font-size: 1.2em;
        color: $xibo-color-primary-l5;
        padding: 30px;
        background-color: $xibo-color-semantic-error;
        border-radius: 4px;
        margin: 16px 16px 0 0;
    }

    .loading-container {
        position: relative;
        background: $xibo-color-primary-l5;
        border: none;

        .loading-icon {
            color: $xibo-color-primary;
        }
    }

    #properties-panel-form-container {
        background: $xibo-color-neutral-0;
        position: relative;
        height: 100%;
        display: flex;
        flex-direction: column;

        /* Hide playlist editor only messages */
        .playlist-editor-message {
            display: none;
        }

        .form-title {
            display: none;
        }

        .form-container {
            overflow: hidden;
            margin-top: 8px;
            flex: 1;

            & > form, & > .actions-container {
                height: 100%;
                display: flex;
                flex-direction: column;

                .form-content {
                    overflow: hidden auto;
                    padding: 0 1rem;
                    margin-top: 0.5rem;
                    flex: 1;
                }

                .actions-content {
                    margin-top: 0;
                    padding: 0 1rem;
                    flex: 1;
                    overflow: hidden;

                    .actions-content-button {
                        color: $xibo-color-primary;
                        background-color: $xibo-color-primary-l20;
                        border: 1px solid $xibo-color-primary-l30;
                        justify-content: space-between;
                        font-weight: 600;
                        display: flex;
                        width: 100%;
                        padding: 10px 12px;
                        border-radius: 3px;
                        height: 40px;
                        align-items: center;
                        font-size: 16px;
                        margin-top: 8px;

                        span.icon {
                            font-size: 15px;
                        }

                        &:hover {
                            color: darken($xibo-color-primary, 5%) !important;
                            border-color: darken($xibo-color-primary-l30, 5%) !important;
                            background: darken($xibo-color-primary-l20, 5%) !important;
                        }
                    }

                    .actions-list {
                        overflow-y: auto;
                        max-height: calc(100% - 56px);
                        scrollbar-width: thin;
                        display: flex;
                        flex-direction: column;
                        gap: 8px;
                        margin-top: 8px;
                    }

                    .action-edit-form, .action-view {
                        display: flex;
                        flex-direction: column;
                        padding: 10px;
                        gap: 15px;
                        border-radius: 3px;
                        border: 1px solid $xibo-color-neutral-300;
                        background: $xibo-color-neutral-100;

                        .action-group {
                            display: flex;
                            flex-direction: column;
                            align-items: flex-start;
                            gap: 4px;
                            align-self: stretch;
                        }

                        .form-group {
                            align-self: stretch;
                            margin-bottom: 0;

                            label {
                                margin-bottom: 8px;
                            }
                        }

                        .action-label, .action-value {
                            color: #333;
                            font-size: 14px;
                            font-style: normal;
                            font-weight: 700;
                            line-height: normal;
                            margin-bottom: 4px;
                        }

                        .action-value {
                            font-weight: 400;
                        }

                        .action-btn-container {
                            display: flex;
                            align-items: center;
                            gap: 12px;
                            justify-content: space-between;
                            flex-direction: row-reverse;

                            .right-buttons {
                                display: flex;
                                gap: 12px;
                            }

                            .action-btn {
                                display: flex;
                                padding: 9px 11px;
                                align-items: center;
                                gap: 10px;
                                font-size: 14px;
                                border-radius: 2px;
                                color: $xibo-color-neutral-0;
                                cursor: pointer;

                                &[data-action="close"] {
                                    color: $bootstrap-theme-main-color;
                                    border: 1px solid $bootstrap-theme-main-color;

                                    &:hover {
                                        background-color: $xibo-color-primary-l20;
                                    }
                                }

                                &[data-action="edit"], &[data-action="save"] {
                                    background: $bootstrap-theme-main-color;
                                    border: 1px solid $bootstrap-theme-main-color;

                                    &:hover {
                                        background-color: darken($bootstrap-theme-main-color, 5%);
                                    }
                                }

                                &[data-action="delete"] {
                                    background: $xibo-color-semantic-error;

                                    &:hover {
                                        background-color: darken($xibo-color-semantic-error, 5%);
                                    }
                                }
                            }
                        }
                
                        .error-message, .warning-message {
                            display: none;
                        }
                    }

                    .action-view:hover {
                        border-color: $xibo-color-accent;
                    }

                    .action-target-widget-add-container {
                        .action-edit-widget-btn {
                            display: flex;
                            cursor: pointer;
                            height: 33px;
                            padding: 8px 12px;
                            justify-content: center;
                            align-items: center;
                            gap: 32px;
                            flex-shrink: 0;
                            border-radius: 2px;
                            border: 1px solid $bootstrap-theme-main-color;
                            color: $bootstrap-theme-main-color;
                            font-size: 13px;
                            font-style: normal;
                            font-weight: 400;
                            line-height: normal;

                            &:hover {
                                background-color: $xibo-color-primary-l20;
                            }
                        }
                    }

                    .action-target-widget-edit-container {
                        display: flex;
                        gap: 6px;
                        display: flex;
                        width: 272px;
                        height: 34px;
                        padding: 7px 11px 7px 13px;
                        justify-content: space-between;
                        align-items: center;
                        border-radius: 3px;
                        background: $xibo-color-primary-l20;

                        .action-target-widget-edit-name {
                            white-space: nowrap;
                            overflow: hidden;
                            text-overflow: ellipsis;
                            flex: 1;
                        }

                        .action-target-widget-dropdown-button {
                            position: relative;
                            cursor: pointer;
                            display: flex;
                            height: 23px;
                            width: 26px;
                            padding: 1px 3px;
                            align-items: center;
                            justify-content: center;
                            gap: 10px;
                            border-radius: 2px;
                            border: 1px solid $bootstrap-theme-main-color;
                            color: $bootstrap-theme-main-color;

                            &:hover {
                                background-color: $xibo-color-primary-l30;
                            }
                        }
                        .action-target-widget-dropdown-container {
                            position: absolute;
                            display: none;
                            flex-direction: column;
                            align-items: flex-start;
                            gap: 2px;
                            border-radius: 3px;
                            border: 1px solid $bootstrap-theme-main-color;
                            background: $xibo-color-neutral-100;
                            box-shadow: 0px 4px 10px 0px $xibo-color-shadow-2;

                            .action-edit-widget-btn {
                                cursor: pointer;
                                display: flex;
                                height: 32px;
                                padding: 7px 12px;
                                align-items: center;
                                gap: 10px;
                                align-self: stretch;
                                color: $xibo-color-neutral-900;
                                font-size: 14px;
                                font-style: normal;
                                font-weight: 400;
                                line-height: normal;
                                @include user-select-none();

                                &:hover {
                                    display: flex;
                                    flex-shrink: 0;
                                    background-color: $bootstrap-theme-main-color;
                                    color: $xibo-color-neutral-0;
                                }

                                &[data-action="delete-widget"] {
                                    color: $xibo-color-semantic-error;

                                    &:hover {
                                        color: $xibo-color-neutral-0;
                                        background-color: $xibo-color-semantic-error;
                                    }
                                }
                            }

                            &.active {
                                display: flex;
                                bottom: 24px;
                                right: 0;
                            }
                        }
                    }

                    &.editing-action {
                        button[data-action="add"], button[data-action="edit"], button[data-action="delete"] {
                            display: none;
                        }

                        .action-view {
                            display: none;
                        }
                    }
                }
            }

            .nav>li>a {
                color: $xibo-color-primary;
                background-color: $xibo-color-neutral-0  !important;
                border-color: $xibo-color-primary  !important;
                border-width: 0px 0px 2px 0px !important;
                font-size: 0.9rem;
                font-weight: bold;
                opacity: 50%;
                padding-bottom: 7px;

                &.active {
                    opacity: 100%;
                    border-width: 0px 0px 4px 0px !important;
                    padding-bottom: 5px;
                }
            }

            .card {
                border: none;
            }

            .row>div {
                padding: 6px;
                margin: 0;
            }

            .row>div>form {
                padding: 0 6px;

                .row>div {
                    padding: 4px 8px;
                }

                .form-group {
                    display: flex;
                    margin-right: -5px;
                    margin-left: -5px;

                    .col-sm-2 {
                        flex: 0 0 22%;
                        max-width: 22%;
                    }

                    .col-sm-10 {
                        flex: 0 0 78%;
                        max-width: 78%;
                    }

                    .col-sm-1,
                    .col-sm-10,
                    .col-sm-11,
                    .col-sm-12,
                    .col-sm-2,
                    .col-sm-3,
                    .col-sm-4,
                    .col-sm-5,
                    .col-sm-6,
                    .col-sm-7,
                    .col-sm-8,
                    .col-sm-9 {
                        padding-left: 4px;
                        padding-right: 4px;
                    }

                    .offset-sm-2 {
                        margin-left: 22%;
                    }
                }

                .sub-playlists {
                    margin-left: -10px;
                }

                .row-special {
                    margin-right: -5px;
                    margin-left: -5px;

                    .col-sm-1,
                    .col-sm-10,
                    .col-sm-11,
                    .col-sm-12,
                    .col-sm-2,
                    .col-sm-3,
                    .col-sm-4,
                    .col-sm-5,
                    .col-sm-6,
                    .col-sm-7,
                    .col-sm-8,
                    .col-sm-9 {
                        padding-left: 3px;
                        padding-right: 3px;
                    }
                }

                #orderClause {
                    .form-group {
                        padding: 0;
                        margin-left: 4px;
                        margin-right: 0;
                        display: inline-block;
                    }
                }

                #filterClause {
                    .form-group {
                        padding: 0;
                        margin: 0;
                        display: inline-block;
                    }

                    select,
                    input {
                        padding: 5px;
                        max-width: 90px;
                    }

                    select {
                        max-width: 120px;
                    }
                }

                #worldClocksContainer {
                    .form-group {
                        padding: 2px 0;
                        margin: 0;
                        display: inline-block;
                    }

                    select,
                    input[type="text"] {
                        max-width: 95%;
                    }

                    .select2 {
                        width: 95% !important;
                        text-align: left;
                    }

                    button {
                        padding: 5px 10px;
                        margin: 3px 0;
                    }

                    input[type="checkbox"] {
                        margin: 8px 0;
                    }
                }

                /* Layout background form special case */
                #layoutEditFormBackgroundUpload {
                    .upload-table-container {
                        overflow-x: auto;

                        table td {
                            max-width: 100px;

                            canvas {
                                max-width: 60px;
                                max-height: 60px;
                            }

                            input[type="text"] {
                                max-width: 100px;
                            }

                            .progress {
                                min-width: 80px;
                            }
                        }
                    }
                }

                #zonesContainer {

                    .structure,
                    .categoriesNotAssigned {
                        display: grid;
                        width: 100%;
                    }

                    .connectedlist {
                        outline: 2px solid $xibo-color-primary-l60;
                        outline-offset: -4px;
                        background-color: lighten($xibo-color-primary-l60, 10%);

                        ul.ui-sortable {
                            width: 100%;
                            min-height: 90px;
                            margin: 0;
                            background-color: initial;

                            ul {
                                height: 100%;
                            }

                            li {
                                width: initial;
                                text-align: center;
                            }
                        }
                    }
                }
            }

            .form-content-title {
                margin: -5px 0 10px 0;
                padding: 5px 0;
                border-bottom: 1px solid #e5e5e5;

                h4 {
                    font-size: 18px;
                    line-height: 38px;
                    margin: 0;
                    padding: 0px 8px;
                }
            }

            table td span.label {
                white-space: inherit;
            }

            .no-widget-action-edit-message {
                padding: 8px;

                .alert {
                    min-height: 120px;
                }
            }
        }

        .button-container {
            display: flex;
            flex-direction: column-reverse;
            padding: 1rem 1rem 8px 1rem;
            bottom: 0;
            font-size: 0;
            width: 100%;

            .btn-info {
                background-color: $xibo-color-primary;
                border-color: $xibo-color-primary-l60;
            }

            .btn-white {
                color: $xibo-color-secondary;
                background-color: $xibo-color-neutral-0;
                border-color: $xibo-color-primary;
            }

            &>button {
                margin-bottom: 8px;
            }
        }

        &.form-editor-enabled {

            .form-container,
            form {
                margin-left: -450px !important;
                padding-left: 450px !important;

                div.cke:hover {
                    position: absolute;
                    right: 4px;
                    width: 810px;
                    z-index: 3;
                }
            }
        }
    }
}

/* Object selection */
#layout-editor {
    .selectable {
        @include user-select-none();
    }

    .designer-region {
        &::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            outline: 2px solid $xibo-color-neutral-100;
            outline-offset: -2px;
        }
    }

    .designer-widget {
        width: 100%;
        height: 100%;
        overflow: hidden;

        &.selected {
            outline: 2px solid $xibo-color-neutral-100;
            outline-offset: 1px;

            &::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                outline: 2px solid $xibo-color-widget-selected;
                outline-offset: -1px;
            }
        }
    }

    .designer-element {
        &::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            outline: 2px dotted $xibo-color-neutral-100;
            outline-offset: -1px;
        }

        &.selected {
            &::after {
                outline-offset: 0;
                outline-style: solid;
            }
        }

        .slot {
            position: absolute;
            left: 2px;
            top: 2px;
            background-color: $xibo-color-neutral-700;
            color: $xibo-color-neutral-100;
            padding: 2px 5px;
            border-radius: 4px;
            font-weight: bold;
            z-index: 100;
            opacity: 0.3;
        }

        &:hover .slot {
            opacity: 0.8;
        }

        &.ui-droppable-active {
            @include z-index-set($designer-select-z-index);
            background: $xibo-color-accent !important;
            outline: 3px solid $xibo-color-accent;

            &.ui-droppable-hover,
            &:hover {
                background: darken($xibo-color-accent, 20%) !important;
            }

            * {
                opacity: 0.6;
            }
        }

        .element-content {
            font-family: sans-serif, Arial, Verdana, "Trebuchet MS";
        }

        &.inline-editing {
            &::after {
                display: none;
            }
        }
    }

    .designer-element-group {
        .group-select-overlay {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            outline: 2px dashed $xibo-color-primary;
            outline-offset: -1px;
            z-index: $viewer-object-group-overlay-z-index;
        }

        &.selected {
            .group-select-overlay {
                outline-offset: 0;
                outline-style: solid;
            }
        }

        &:not(.editable) .group-edit-btn {
            display: none;
        }

        .group-edit-btn {
            position: absolute;
            top: 2px;
            right: 2px;
            background-color: darken($xibo-color-accent, 20%);
            color: $xibo-color-neutral-100;
            padding: 2px 5px;
            font-weight: bold;
            border-radius: 4px;
            z-index: $viewer-object-group-bts-z-index;
            opacity: 0.05;
            width: 1.8rem;
            text-align: center;
            cursor: pointer;

            .fa-edit {
                display: initial;
            }
            .fa-close {
                display: none;
            }

            &::after {
                content: ' ';
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
            }
        }

        &.editing {
            outline-width: 3px;
            outline-style: dashed;
            outline-color: darken($xibo-color-accent, 20%);
            outline-offset: 1px;

            .group-select-overlay {
                display: none;
            }

            .fa-edit {
                display: none;
            }
            .fa-close {
                display: initial;
            }
        }

        &:not(.editing) {
            .designer-element::after {
                outline: none;
            }
        }

        .designer-element .slot {
            display: none;
        }

        & > .slot {
            position: absolute;
            left: 2px;
            top: 2px;
            background-color: $xibo-color-primary;
            color: $xibo-color-neutral-100;
            padding: 2px 5px;
            font-weight: bold;
            border-radius: 4px;
            z-index: $viewer-object-group-bts-z-index;
            opacity: 0.3;
        }

        & > .message-container {
            z-index: $viewer-object-group-bts-z-index !important;
        }

        &:hover > .slot, &:hover > .group-edit-btn {
            opacity: 0.8;
        }

        &.ui-droppable-active {
            @include z-index-set($designer-select-z-index);
            background: $xibo-color-accent !important;
            outline: 3px solid $xibo-color-accent;

            .group-select-overlay {
                display: initial;
            }

            &.ui-droppable-hover,
            &:hover {
                background: darken($xibo-color-accent, 20%) !important;
            }

            * {
                opacity: 0.6;
            }
        }
    }

    .designer-element, .designer-element-group {
        .loader {
            position: absolute;
            z-index: 1000;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            @include set-transparent-color(background-color, $xibo-color-primary-l5, 0.4);
            opacity: 0.8;

            .loading-container {
                height: 100% !important;

                .loading-icon {
                    font-size: 3rem !important;
                }
            }
        }

        .message-container {
            display: flex;
            flex-direction: column-reverse;
            gap: 4px;
            position: absolute;
            left: auto;
            top: auto;
            right: 2px;
            bottom: 2px;
            z-index: 100;
        }

        .error-message, .empty-element-data, .warning-message {
            padding: 2px 5px;
            border-radius: 4px;
            font-weight: bold;
            background-color: $xibo-color-semantic-error;
            color: $xibo-color-neutral-0;
            opacity: 0.6;
        }

        .warning-message {
            color: $xibo-color-neutral-1000;
            background-color: $xibo-color-semantic-warning;
        }

        .empty-element-data {
            background-color: $xibo-color-semantic-info;
        }

        &:hover {
            .error-message, .empty-element-data, .warning-message {
                opacity: 0.8;

                &:hover {
                    opacity: 1;
                }
            }
        }
    }

    .designer-region:not(.selected):hover::before {
        outline-color: $xibo-color-neutral-0;
    }

    /* Viewer */
    #layout-viewer {
        .designer-region.ui-droppable-active {
            @include z-index-set($designer-select-z-index);
            background: $xibo-color-region-hover !important;
            outline: 3px solid $xibo-color-region-hover;

            &.ui-droppable-hover,
            &:hover {
                background: darken($xibo-color-region-hover, 20%) !important;
            }

            .widget-preview[data-type="playlist"] {
                color: $xibo-color-neutral-0 !important;
            }

            * {
                opacity: 0.6;
            }
        }

        .designer-region:not(.designer-region-playlist) .designer-widget.ui-droppable-active,
        .widget-preview.ui-droppable-active {
            @include z-index-set($designer-select-z-index);
            background: $xibo-color-widget-hover !important;
            width: 100%;
            height: 100%;

            &::after {
                content: ' ';
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
            }

            &.ui-droppable-hover,
            &:hover {
                background: darken($xibo-color-widget-hover, 20%) !important;
            }

            * {
                opacity: 0.5;
            }
        }

        .layout.ui-droppable-active {
            @include z-index-set($designer-select-z-index);
        }

        &.ui-droppable-active {
            @include z-index-set($designer-select-z-index);
            position: relative;
        }

        /* Layout viewer theme */
        .viewer-object {
            .selected-from-layer-manager {
                opacity: 0.95;
                z-index: $viewer-moveable-z-index !important;
            }

            &.theme-light {
                .designer-region::before, .designer-widget.selected {
                    @include set-transparent-color(outline-color, $xibo-color-neutral-0, 0.5);
                }

                .designer-element::after, .designer-element-group::after {
                    @include set-transparent-color(outline-color, $xibo-color-neutral-0, 0.25);
                }
            }

            &.theme-dark {
                .designer-region::before, .designer-widget.selected {
                    @include set-transparent-color(outline-color, $xibo-color-neutral-900, 0.5);
                }

                .designer-element::after, .designer-element-group::after {
                    @include set-transparent-color(outline-color, $xibo-color-neutral-900, 0.25);
                }
            }
        }

        /* Layout tbackgrouynd */
        .viewer-object .layout-background-image {
            position: absolute;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }
    }

    .viewer-object-select {
        .selected-temp {
            &::after, &.designer-element-group  .group-select-overlay{
                @include set-transparent-color(background-color, $xibo-color-primary, 0.4);
                outline: 2px solid $xibo-color-primary;
            }
        }

        .moveable-disabled {
            outline: 1px solid $xibo-color-primary-l60;
        }
    }

    .highlighted-action-object:not([data-type="helper"]) {
        &.action-screen-helper {
            border-color: $xibo-color-accent !important;
        }

        &:not(.action-screen-helper) {
            outline: 1px solid $xibo-color-accent !important;
            outline-offset: 0 !important;
        }
    }

    .selected-action-trigger {
        outline: 2px solid $xibo-color-accent !important;
        outline-offset: 0 !important;

        .trigger-add-button {
            display: none;
            position: absolute;
            cursor: pointer;
            top: 50%;
            left: 100%;
            transform: translate(-50%, -50%);
            background: $xibo-color-accent;
            color: white;
            border-radius: 25px;
            width: 20px;
            height: 20px;
            justify-content: center;
            align-items: center;
            font-size: 18px;
            border: 2px solid $xibo-color-accent;
            z-index: 1;
        }

        &[data-trigger-pos="top"] .trigger-add-button {
            top: 50%;
            left: 100%;
        }

        &[data-trigger-pos="top"] .trigger-add-button {
            top: 0;
            left: 50%;
        }

        &[data-trigger-pos="left"] .trigger-add-button {
            top: 50%;
            left: 0;
        }

        &[data-trigger-pos="bottom"] .trigger-add-button {
            top: 100%;
            left: 50%;
        }

        &:hover .trigger-add-button{
            display: flex;
        }
    }

    .selected-action-trigger-parent {
        &::after, &::before {
            display: none;
        }

        .selected-action-trigger::after {
            content: ' ';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }
    }

    .action-trigger-adding .trigger-add-button {
        display: none;
    }

    .selected-action-trigger.action-screen-helper {
        outline: 2px solid $xibo-color-accent !important;

        .trigger-add-button {
            top: 0%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
    }

    .ui-droppable-active {
        @include box-shadow(inset 0 0 2px $xibo-color-primary-l5);
    }

    .ui-droppable-hover {
        @include box-shadow(inset 0 0 4px #313131);
    }
}

/* Loading Container */
#layout-editor .loading-container {
    height: calc(100vh - 50px);
    width: 100%;
    position: absolute;

    .loading-icon {
        position: relative;
        text-align: center;
        top: 50%;
        transform: translateY(-50%);
        font-size: 4rem;
        color: $xibo-color-primary;
        z-index: 0;
        opacity: 0.6;
    }
}

/* Select2 width fix */
#layout-editor .select2-container {
    width: auto !important;
}

/* Locked mode */
#layout-editor #lockedOverlay {
    display: block;
    position: absolute;
}

/* Locked mode message */
#layout-editor #lockedLayoutMessage {
    margin: 5px 5%;
    padding: 10px;
    width: 90%;
    line-height: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: $designer-overlay-z-index;
    position: fixed;
    bottom: 0;
}

/* Hide or show content based on the lock */
#layout-editor.locked-for-user {
    .hide-on-lock {
        display: none;
    }

    .designer-region .preview-paging {
        z-index: 1;
    }
}

#layout-editor:not(.locked) .show-on-lock,
#layout-editor.locked.locked-for-user .show-on-lock {
    display: none;
}

/* Resize unlock layout modal */
#unlockLayoutModal .modal-content {
    width: 60%;
    margin: 0 auto;
}

/* Layout background image */
.background-image-add {
    position: relative;
    min-height: 100px;
    padding: 4px 0 7px 0;
    background-color: $xibo-color-primary-l5;
    border-radius: 4px 4px 0 0;
    border: 2px solid darken($xibo-color-primary-l5, 10%);
    display: flex;
    align-content: center;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: -3px;
    flex-wrap: wrap;

    &.resolution-orientation {
        &--portrait {
            min-height: 360px;
        }
    }
}

.background-image-actions .btn-group {
    width: 100%;
    padding: 0;
    background-color: $xibo-color-neutral-0;
    border-radius: 4px;
}

.background-image-drop {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    @include set-transparent-color(background-color, $xibo-color-primary, 0.6);
    border-radius: 6px;
    padding: 3rem 1rem;
    color: $xibo-color-primary-l5;
    border: 2px dashed $xibo-color-primary-l5;
    border-style: dashed;
    @include user-select-none();

    &:hover {
        @include set-transparent-color(background-color, $xibo-color-primary, 0.9);
    }
}

.background-image-add.ui-droppable-active {
    .background-image-drop {
        display: block;
        z-index: $designer-select-z-index;
    }
    &.ui-droppable-hover {
        .background-image-drop {
            @include set-transparent-color(background-color, $xibo-color-primary, 0.9);
        }
    }

    &.resolution-orientation {
        &--portrait {
            .background-image-drop {
                display: flex;
                align-items: center;
                justify-content: center;
            }
        }
    }
}

div#bg_not_found_icon {
    width: 60%;
}

div#bg_media_name {
    padding-left: 20px;
    padding-right: 20px;
    word-break: break-all;
}

#layerManager {
    width: 240px;
    min-height: 60px;
    border-radius: 4px;
    background-color: $xibo-color-neutral-0;
    color: $xibo-color-primary;
    outline: 1px solid $xibo-color-primary;
    z-index: $viewer-layer-editor-z-index;

    .empty-layout-message {
        height: 32px;
        font-weight: bold;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .layer-manager-header {
        background-color: $xibo-color-primary;
        color: $xibo-color-neutral-0;
        font-weight: bold;
        font-size: 1.2rem;
        padding: 0 0.5rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: grab;
    }

    .layer-manager-header, .expand-group-button {
        i {
            font-size: 1rem;
            padding: 3px 5px;
            cursor: pointer;
            border-radius: 4px;
            margin-right: -4px;
    
            &:hover {
                @include set-transparent-color(background-color, $xibo-color-neutral-0, 0.3);
            }
        }
    }

    .expand-group-button {
        color: inherit;
    }

    .element-group.expanded .expand-group-button {
        .show-expanded {
            display: block;
        }

        .hide-expanded {
            display: none;
        }
    }

    .element-group:not(.expanded) .expand-group-button {
        .show-expanded {
            display: none;
        }

        .hide-expanded {
            display: block;
        }
    }

    .layer-manager-body {
        max-height: 500px;
        overflow: auto;
    }

    .layer-manager-layer-item, .layer-manager-layer-canvas {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 6px;
        padding: 0 4px;
        height: 34px;
        cursor: pointer;

        .layer {
            flex-basis: 30px;
            font-weight: bold;
            text-align: center;
            background-color: $xibo-color-primary-l10;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .label {
            flex: 1;
        }

        .name {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
        }

        .duration {
            flex-basis: 44px;
            text-align: center;
        }

        &.selected, &.multi-selected {
            color: $xibo-color-neutral-0;
            background-color: $xibo-color-accent !important;
            
            .layer {
                background-color: darken($xibo-color-accent, 5%) !important;
            }

            .layer-item-in-group-helper {
                background-color: darken($xibo-color-accent, 10%) !important;
            }
        }

        &.selectable:not(.selected) {
            cursor: pointer;

            &:hover {
                color: $xibo-color-secondary;
                background-color: lighten($xibo-color-accent, 20%) !important;

                .layer {
                    background-color: lighten($xibo-color-accent, 15%) !important;
                }
            }
        }
    }

    .layer-manager-canvas-layers {
        .layer-manager-layer-item {
            padding-left: 16px;
            background-color: $xibo-color-primary-l5;

            .layer {
                background-color: darken($xibo-color-primary-l5, 5%);
            }

            .layer-item-in-group {
                display: flex;
                width: 4px;
                height: 100%;
                background-color: unset;
                flex-direction: column;

                .layer-item-in-group-helper {
                    background-color: darken($xibo-color-primary-l5, 5%);
                    width: 100%;
                    height: 100%;
                }
            }

            &.element-group {
                .name {
                    font-size: 0.9rem;
                }
            }

            &.has-group {
                padding-left: 22px;
                background-color: $xibo-color-primary-l10;

                .layer {
                    margin-left: -2px;
                    background-color: darken($xibo-color-primary-l10, 5%);
                }
    
                .module-icon {
                    padding: 2px;
                    border: 2px solid $xibo-color-neutral-0;
                }
            }
        }
    }
}

/* Moveable elements */
.moveable-control-box {
    z-index: $viewer-moveable-z-index !important;
}

.moveable-control .moveable-origin {
    display: none;
}

body[multi-select-active] {
    .moveable-control-box .moveable-area {
        display: none;
    }
}

body[layout-editor-fs] .moveable-control-box {
    z-index: calc(#{$designer-overlay-z-index} + 30) !important;
}

.moveable-line, .moveable-control {
    background: $xibo-color-primary-l60 !important;
}

.moveable-normal {
    opacity: 0.6 !important;
}

.moveable-bounds {
    background: $xibo-color-semantic-error !important;
}

.moveable-control.moveable-origin, .moveable-normal.red {
    background: $xibo-color-accent !important;
}

.moveable-size-value {
    color: $xibo-color-accent !important;
    font-size: 1rem !important;
}

/* Custom tooltip */
.custom-tooltip {
    text-align: left;
    color: $xibo-color-neutral-0;
    line-height: 1.2;

    p {
       margin: 0.3rem 0; 
    }

    .sample-data {
        color: $xibo-color-tertiary;
    }
}

/* Action Lines */
.xibo-editor-action-line {
    z-index: $viewer-layer-editor-z-index;

    path {
        pointer-events: stroke !important;
        cursor: pointer;
    }
}
