@import "../../../../assets/less/core/boot.less";

@preview-height: 104px;
@preview-sidebar: 58px;
@preview-header: 32px;

.field-paletteeditor {

    div.control-simplelist.is-selectable-box.color-preset-selector {
        margin-left: 0;
        margin-top: 10px;
        border: none;
        margin-bottom: -16px;

        li {
            margin: 0 16px 16px 0;
            width: 215px;

            &.active .color-preset-box {
                border-color: @brand-accent;
            }

            .heading {
                margin: 0;
                text-align: left;
                padding: 12px 17px;
            }
        }

        .color-preset-box {
            display: block;
            border: 2px solid @border-color;
            background: @input-bg;
            border-radius: 10px;

            .mode-image {
                display: block;
                border-bottom: 1px solid @border-color;
                position: relative;

                &:before {
                    position: absolute;
                    left: 17px;
                }
            }
        }
    }

    .palette-show-custom {
        position: relative;
        border: 1px dashed @dropdown-trigger-border;
        border-radius: 5px;
        background: @dropdown-trigger-bg;
        display: inline-block;

        > a {
            color: @dropdown-trigger-color;
            text-align: center;
            text-decoration: none;
            padding: 7px 15px;
            font-weight: normal;
            font-size: @font-size-base;
            display: block;

            > i {
                margin-right: 4px;
                margin-left: -2px;
                position: relative;
                top: 1px;
            }
        }

        &:hover, &:focus {
            background-color: @dropdown-hover-bg;
            border-color: transparent;

            > a, > a > i {
                color: @dropdown-hover-color;
            }
        }
    }

    .preview-placeholder {
        position: relative;
        height: @preview-height;

        > .p-header {
            display: flex;
            height: @preview-header;

            border-top-left-radius: 8px;
            border-top-right-radius: 8px;
            background: var(--oc-mainnav-bg);

            > .p-nav {
                flex-grow: 1;

                position: relative;
                padding-top: 2px;

                > .p-item {
                    position: relative;
                    top: 3px;
                    float: left;

                    opacity: .5;

                    &.is-active {
                        opacity: 1;
                    }

                    > * {
                        background: var(--oc-mainnav-color);
                        display: inline-block;
                    }

                    > .p-icon {
                        border-radius: 2px;
                        height: 9px;
                        width: 9px;
                        margin-left: 12px;
                    }
                    > .p-text {
                        border-radius: 4px;
                        height: 4px;
                        width: 20px;
                        position: relative;
                        top: -2px;
                    }

                    &:nth-child(1) {
                        > .p-icon {
                            margin-left: 7px;
                        }
                    }

                    &:nth-child(2) {
                        > .p-text {
                            width: 28px;
                        }
                    }
                    &:nth-child(3) {
                        > .p-text {
                            width: 15px;
                        }
                    }
                }
            }

            > .p-controlpanel {
                width: 30px;
                position: relative;
                display: flex;
                justify-content: center;
                align-items: center;

                > .p-avatar {
                    border-radius: 10px;
                    height: 10px;
                    width: 10px;
                    background: #ccc;
                    margin: 0 2px;
                }
            }
        }

        > .p-sidebar {
            height: @preview-height - @preview-header;
            width: @preview-sidebar;
            background: var(--oc-sidebar-bg);
            position: relative;
            float: left;

            > .p-link {
                display: block;
                > * {
                    position: relative;
                    float: left;
                    background: var(--oc-sidebar-color);
                }

                height: 10px;
                padding-left: 8px;
                width: @preview-sidebar;
                margin-top: 5px;

                &.is-active {
                    background: var(--oc-sidebar-active-bg);
                    border-top-right-radius: 3px;
                    border-bottom-right-radius: 3px;
                    width: 38px;

                    > * {
                        background: var(--oc-sidebar-active-color);
                    }
                }

                > .p-icon {
                    border-radius: 2px;
                    height: 5px;
                    width: 5px;
                    top: 2px;
                }
                > .p-text {
                    border-radius: 4px;
                    height: 3px;
                    width: 18px;
                    margin-left: 3px;
                    top: 3px;
                }

                &:nth-child(2) {
                    > .p-text {
                        width: 28px;
                    }
                }
                &:nth-child(3) {
                    > .p-text {
                        width: 15px;
                    }
                }
            }
        }

        > .p-content {
            background: var(--bs-body-bg);
            margin-left: @preview-sidebar;
            height: @preview-height - @preview-header;
            display: block;
            padding: 6px;
            display: flex;
            flex-direction: column;

            > .p-form {
                flex-grow: 1;

                .p-input {
                    display: block;
                    background: var(--oc-form-control-bg);
                    border: 1px solid var(--bs-border-color);
                    height: 8px;
                    border-radius: 3px;
                    margin-bottom: 3px;

                    &.span-left,
                    &.span-right {
                        width: 48%;
                    }

                    &.span-right {
                        float: right;
                    }

                    &.size-medium {
                        height: 20px;
                    }
                }
            }

            > .p-buttons {
                height: 14px;

                > .p-button {
                    background: var(--bs-secondary);
                    position: relative;
                    float: left;
                    width: 24px;
                    height: 7px;
                    margin-top: 6px;
                    margin-right: 3px;
                    border-radius: 2px;

                    &.is-primary {
                        background: var(--bs-primary);
                    }
                }
            }
        }
    }

}