/* Color Scheme */

:root {
    /* Preview */
    --preview-background-dark: #1e1e1e;
    --preview-background-light: #ffffff;
    --toolbox-background-dark: #2c2c2c;
    --toolbox-background-light: #f5f5f5;

    --preview-background: var(--preview-background-light);
    --toolbox-background: var(--toolbox-background-light);
}

@media (prefers-color-scheme: dark) {
    :root {
        --preview-background: var(--preview-background-dark);
        --toolbox-background: var(--toolbox-background-dark);
    }
}

/* Layout */

main {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
}

.container {
    width: calc(50% - 1px);
    height: 100%;
}

/* Editor */

.editor {
    background: var(--background);
    border-right: solid 1px #00000070;
}

/* Preview */

.preview {
    position: relative;
    background: var(--preview-background);
    border-left: solid 1px #00000070;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.screen-simulate {
    width: 100%;
    height: 100%;
    top: calc(3rem + 1px);
    margin: auto;
    background: var(--background);
    z-index: 0;
}

#mobile-preview, #tablet-preview {
    width: auto;
    height: calc(100% - 1.5rem - 8rem);
    border: solid 1.5rem #000000;
    border-radius: 32px;
    filter: drop-shadow(0 4px 16px #00000050);
    -webkit-filter: drop-shadow(0 4px 16px #00000050);
}

/* Toolbox */

.preview-toolbox {
    background: var(--toolbox-background);
    width: 100%;
    height: calc(3rem);
    border-bottom: solid 1px #00000050;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}

.tool-item {
    display: flex;
    flex-direction: row;
    justify-content: start;
}

.page-name {
    font-size: 1rem;
    font-weight: 500;
}

.toolbox-item {
    width: 3rem;
    height: 3rem;
    background: transparent;
    border: none;
    overflow: hidden;
}

.toolbox-item svg {
    width: 1.5rem;
    height: 1.5rem;
    opacity: 0.75;
}

.toolbox-item svg path {
    stroke: var(--foreground);
}

.toolbox-item:hover {
    background: #00000030;
    cursor: pointer;
}

/* Preview Size */

#mobile-preview {
    aspect-ratio: 390 / 844;
}

#tablet-preview {
    aspect-ratio: 810 / 1080;
}

#simulator {
    width: 100%;
    height: 100%;
    border: none;
}

#mobile-preview.preview-zoom,
#tablet-preview.preview-zoom {
    height: calc(100% - 1.5rem);
    border: none;
    border-radius: 0;
    filter: none;
    -webkit-filter: none;
}

/* Preview Dialog */

.preview-dialog {
    position: absolute;
    width: auto;
    height: auto;
    left: 50%;
    padding: 0.5rem 1rem;
    background: var(--preview-background);
    border: solid 1px var(--toolbox-background);
    transform: translateX(-50%);
    z-index: 1;
}

.preview-dialog.show {
    animation: display-dialog 2s ease-in-out forwards;
}

@keyframes display-dialog {
    0% {
        top: 0rem;
    }

    25% {
        top: 4rem;
    }

    75% {
        top: 4rem;
        opacity: 1.0;
    }

    100% {
        top: 0rem;
        opacity: 0.0;
    }
}

/* Responsive Web */

@media (max-width: 1079px) {
    main {
        flex-direction: column-reverse;
    }

    .container {
        width: 100%;
        height: calc(50% - 1px);
    }

    #simulator {
        width: 100%;
        height: 100%;
        border: none;
        zoom: 0.85;
    }

    .editor {
        border-top: solid 1px #00000070;
        border-right: none;
    }

    .preview {
        border-bottom: solid 1px #00000070;
        border-left: none;
    }

    .preview-toolbox {
        height: calc(2.5rem);
    }

    .page-name {
        font-size: 0.9rem;
        margin-left: 0.9rem;
    }

    .preview-toolbox svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .toolbox-item {
        width: 2.5rem;
        height: 2.5rem;
    }

    .mobile-hidden {
        display: none;
    }

    @keyframes display-dialog {
        0% {
            top: 0rem;
        }

        25% {
            top: 3.5rem;
        }

        75% {
            top: 3.5rem;
            opacity: 1.0;
        }

        100% {
            top: 0rem;
            opacity: 0.0;
        }
    }

    #mobile-preview,
    #tablet-preview,
    #mobile-preview.preview-zoom,
    #tablet-preview.preview-zoom {
        width: 100%;
        height: 100%;
        border: none;
        border-radius: 0;
        filter: none;
        -webkit-filter: none;
    }
}