@import './Base.scss';

@import './SiteBuilder/Toolbar';

* {
    box-sizing: border-box;
}

.#{$prefix}-toolbar-container {
    margin-right: var(--scrollbar-width);
}

.#{$prefix}page-editor-toggler {
    position: fixed;
    transition: all 0.3s ease;
    top: 0;
    padding: 4px;
    right: 0;
    z-index: 10;
    display: flex;
    border-start-start-radius: 20px;
    border-end-start-radius: 20px;
    gap: 0.25rem;
    z-index: 100;
}

.#{$prefix}page-editor-toggler .#{$prefix}page-editor-toggler-button {
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    background-color: #f0f0f0;
    border: none;
    border-radius: 20px;
}

body {
    padding: 0;
    margin: 0;
}

.#{$prefix}page-editor {
    width: 100%;
    overflow: hidden;
    height: 100vh;
}

.#{$prefix}page-editor-iframe-wrapper {
    background-color: #EBEBEB;
    position: relative;
    height: calc(100% - 40px);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.#{$prefix}page-editor-iframe {
    position: absolute;
    /* transition: all 0.1s ease; */
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.#{$prefix}page-editor-iframe-resizer {
    border-radius: 2px;
    box-shadow: 0 0 8px -4px rgb(129, 129, 129);
    display: none;
    background-color: #cfcfcf;
    height: 64px;
    width: 12px;
    position: absolute;
    right: 2px;
    top: 50%;
    bottom: 50%;
    cursor: grab;
}
.#{$prefix}page-editor-iframe-resizer:hover {
    background-color: #d4d4d4;
    height: 64px;
    width: 12px;
    position: absolute;
    right: 2px;
    top: 50%;
    bottom: 50%;
    cursor: grab;
}

.#{$prefix}page-editor-iframe-resizer::before, .#{$prefix}page-editor-iframe-resizer::after {
    content: '';
    background-color: #aaaaaa;
    position: absolute;
    height: 48px;
    width: 2px;
    top: 8px;
    bottom: 8px;
}

.#{$prefix}page-editor-iframe-resizer:hover::after, .#{$prefix}page-editor-iframe-resizer:hover::before {
    background-color: #c0c0c0;
}

.#{$prefix}page-editor-iframe-resizer::before {
    left: 3px;
}

.#{$prefix}page-editor-iframe-resizer::after {
    right: 3px;
}

[data-responsive-mode] .#{$prefix}page-editor-iframe {
    left: auto;
    right: auto;
    top: 1rem;
    bottom: 1rem;

    height: calc(100% - 2rem);
    max-width: calc(100% - 2rem);
}

[data-responsive-mode] .f-page-editor-iframe-resizer {
    display: flex;
}

.#{$prefix}page-editor-header {
    width: 100%;
    height: 40px;
    background-color: rgb(24, 24, 24);
    display: flex;
    justify-content: space-between;
    padding: 4px;
    gap: 4px;
    box-sizing: border-box;
}

.#{$prefix}page-editor-header-separator {
    transition: all 0.3s ease;
    width: 0;
}

.#{$prefix}page-editor-sidebar-close .#{$prefix}page-editor-header-separator {
    /* width: 240px; */
}

.#{$prefix}page-editor-header-button-list {
    display: flex;
    gap: 4px;
    /* justify-content: space-between; */
}

.#{$prefix}page-editor-header-button {
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;

    background-color: #404040;
    color: white;
    border: 1px solid #505050;
}
.#{$prefix}page-editor-header-button svg {
    width: 16px;
    height: 16px;
}

.#{$prefix}page-editor-header-button-primary {
    background-color: #2558a5;
    border: 1px solid #3b48bd;
}

.#{$prefix}page-editor-header-button-primary:hover {
    background-color: #2c6bc9;

}


.#{$prefix}page-editor-sidebar-open .#{$prefix}page-editor-toggler {
    right: 240px;
    margin-right: -1px;
}

.#{$prefix}page-editor-toggler .#{$prefix}page-editor-toggler-button:hover {
    background-color: #dbdbdb;
}

.#{$prefix}page-editor-toggler .#{$prefix}page-editor-toggler-button-primary {
    color: white;
    background-color: #2558a5;
    border: none;
}

.#{$prefix}page-editor-toggler .#{$prefix}page-editor-toggler-button-primary:hover {
    background-color: #2c6bc9;
}

.#{$prefix}plugin-container {
    position: relative;
}

.#{$prefix}page-editor-forms {
    display: none;
}

.#{$prefix}only-sidebar-opened {
    display: none;
}

.#{$prefix}page-editor-sidebar-open .#{$prefix}only-sidebar-opened {
    display: inherit;
}

.#{$prefix}page-editor-sidebar-open .#{$prefix}only-sidebar-closed {
    display: none;
}

.#{$prefix}page-editor-sidebar-close .#{$prefix}only-sidebar-opened {
    display: none;
}

.#{$prefix}page-editor-sidebar-close .#{$prefix}only-sidebar-closed {
    display: inherit;
}

/* Dark mode */

.dark .#{$prefix}page-editor-sidebar {
    background-color: #242424;
    border-color: #303030;
    color-scheme: dark;
}


.dark .#{$prefix}plugin-definition-item {
    background-color: #383838;
    border-color: #404040;
    color: white;
}
.dark .#{$prefix}plugin-definition-item:hover {
    background-color: #444444;
    border-color: #707070;
}

.dark .#{$prefix}page-editor-toggler-button {
    background-color: #505050;
    border-color: #404040;
    color: white;
    fill: white;
}
.dark .#{$prefix}page-editor-toggler-button:hover {
    background-color: #606060;
    border-color: #404040;
}
.dark .#{$prefix}page-editor-toggler-button-primary {
    background-color: #2e3bb3;
}
.dark .#{$prefix}page-editor-toggler-button-primary:hover {
    
    background-color: #3b48bd;
}


.f-plugin-edit-iframe {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    z-index: 100;
    background-color: white;
}

.f-plugin-edit-iframe.open {
    display: block;
}
