[not-edit="true"] {

    opacity: 0.5 !important;

    pointer-events: none !important;

}

[not-edit="true"] * {

    pointer-events: none !important;

}

#app {
    width: 100vw;
    --innerHeight: calc(100dvh - 5rem);
    height: 100dvh;
    overflow: hidden;
    overflow-y: auto;
    user-select: none;

    .index-page {
        box-sizing: border-box;
        padding: 5rem 10rem;
        text-align: center;

        & h1 {
            font-size: 3rem;
        }
    }

    .upload-file-container {
        width: calc(100% - 20rem);
        margin: 0 auto;
        padding: 10rem 0;
        box-sizing: border-box;
        border: 1px dashed var(--color-primary);
        display: flex;
        justify-content: space-evenly;
        align-items: center;
        gap: 1rem;
        border-radius: 0.5rem;
        flex-direction: column;
        position: relative;

        & input {
            font-size: 0;
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            cursor: pointer;
            z-index: 1;
            opacity: 0;
        }

        &>div {
            display: flex;
            align-items: center;
            gap: 1rem;

            &:nth-child(2) {
                background-color: var(--color-primary);
                color: #fff;
                padding: 0.5rem 1rem;
                border-radius: 0.25rem;
                cursor: pointer;

                &>svg {
                    width: 1.5rem;
                    height: 1.5rem;

                    & path {
                        fill: #fff;
                    }
                }
            }
        }
    }

    .editor-container {
        width: 100%;
        height: var(--innerHeight);
        position: relative;
        display: grid;
        grid-template-columns: auto 1fr;

        .editor-menus {
            width: 25rem;
            height: var(--innerHeight);
            border: 1px solid var(--border-color-darker);
            box-sizing: border-box;
            overflow: hidden;
            overflow-y: auto;
            border-radius: 0.25rem;
            margin-right: 1rem;
            display: flex;
            flex-direction: column;
            gap: 2rem;

            .editor-menu {
                display: grid;
                grid-template-columns: 4rem 1fr;
                padding: 0 1rem;
                box-sizing: border-box;
                align-items: center;

                &[sticky-top] {
                    padding: 1rem;
                    background: #fff;
                    flex-shrink: 0;
                    position: sticky;
                    top: 0;
                    z-index: 1;
                }

                .editor-menu-title {
                    font-weight: 700;
                }

                & pea-select {
                    width: 100%;
                    height: 2.5rem;
                    border-radius: 0.25rem;
                }

                .add-object {
                    background-color: var(--color-primary);
                    color: #fff;
                    padding: 0.5rem 1rem;
                    border-radius: 0.25rem;
                    cursor: pointer;
                    width: fit-content;
                    margin-left: auto;
                    position: relative;

                    &>input {
                        font-size: 0;
                        position: absolute;
                        left: 0;
                        top: 0;
                        width: 100%;
                        height: 100%;
                        cursor: pointer;
                        z-index: 1;
                        opacity: 0;
                    }
                }
            }

            .editor-menus-body {
                overflow: hidden;
                overflow-y: auto;
                display: flex;
                gap: 2rem;
                flex-direction: column;

                &>* {
                    flex-shrink: 0;
                }

                .onject-name {
                    width: calc(100% - 2rem);
                    margin: 0 auto;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    position: relative;
                    border-radius: 0.25rem;
                    background-color: var(--border-color-darker);
                    padding: 0.25rem;
                    box-sizing: border-box;
                    flex-shrink: 0;
                    height: 2.5rem;
                    display: flex;
                    justify-content: space-evenly;
                    align-items: center;
                }

                .transformations {
                    padding: 0 1rem;
                    box-sizing: border-box;

                    .transformations-title {
                        font-weight: 700;
                    }

                    .transformation {
                        width: 100%;
                        box-sizing: border-box;
                        padding-left: 1rem;
                        margin: 1rem 0;
                        align-items: center;

                        &:last-child {
                            margin-bottom: 0;
                        }

                        .transformation-title {
                            margin-bottom: 0.5rem;
                        }

                        .xyz-input {
                            width: 100%;
                            display: grid;
                            gap: 0.5rem;
                            align-items: center;
                            box-sizing: border-box;
                            padding-left: 1rem;

                            & pea-input-number {
                                width: 100%;
                                height: 2.5rem;
                            }
                        }
                    }
                }

                .detials {
                    padding: 0 1rem;
                    box-sizing: border-box;

                    .detial {
                        box-sizing: border-box;
                        padding: 0.5rem;
                    }
                }
            }

            .convert-download-btns {
                width: 100%;
                height: fit-content;
                padding: 0.5rem 1rem;
                position: sticky;
                bottom: 0;
                background-color: #fff;
                box-sizing: border-box;

                &>div {
                    background-color: var(--color-primary);
                    color: #fff;
                    width: 100%;
                    padding: 0.5rem;
                    border-radius: 0.25rem;
                    cursor: pointer;
                    box-sizing: border-box;
                    margin: 0 auto;
                    text-align: center;

                    &[export][loading="true"] {
                        display: flex;
                        pointer-events: none !important;
                        opacity: 0.5;
                        align-items: center;
                        justify-content: center;
                        gap: 0.5rem;

                        &::before {
                            content: "";
                            width: 1rem;
                            height: 1rem;
                            border-radius: 1.5rem;
                            border: 1px solid #fff;
                            border-top-color: transparent;
                            display: inline-block;
                            box-sizing: border-box;
                            transform: rotate(0deg);
                            animation: exportLoading 5s linear infinite;
                        }
                    }
                }
            }
        }

        #viewport {
            width: 100%;
            height: 100%;
            position: relative !important;
            overflow: hidden;
            border: 1px solid var(--border-color-darker);
            box-sizing: border-box;
            border-radius: 0.25rem;

            #info,
            #viewportInfo {
                display: none;
            }
        }

        .layer-slider-container {
            position: absolute;
            right: 1rem;
            top: 50%;
            transform: translateY(-50%);
            height: 90%;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            z-index: 1;

            &>svg {
                width: 2rem;
                height: 2rem;
                background: rgba(0, 0, 0, 0.8);
                box-sizing: border-box;
                padding: 0.25rem;
                border-radius: 0.25rem;
                cursor: pointer;

                &>path {
                    fill: #fff;
                }
            }

            .layer-slider {
                transform: translate(-50%, -50%) rotate(-90deg);
                position: absolute;
                left: 50%;
                top: 50%;
                width: calc((var(--innerHeight) - 2rem) * 0.9 - 5rem);

                &>input {
                    width: 100%;
                    opacity: 0;

                    &::-webkit-slider-thumb {
                        -webkit-appearance: none;
                        -moz-appearance: none;
                        appearance: none;
                        cursor: pointer;
                        border: 1rem solid transparent;
                    }
                }

                .slider-btn {
                    content: attr(layer, "1");
                    width: 2rem;
                    height: 2rem;
                    background: rgba(0, 0, 0, 0.8);
                    position: absolute;
                    top: 50%;
                    transform: rotate(90deg) translateX(-50%);
                    z-index: 1;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    color: #fff;
                    left: calc(100% * var(--value) - 2rem * var(--value));
                    pointer-events: none;
                    border-radius: 0.25rem;
                }

                &::after {
                    content: "";
                    width: 100%;
                    background: rgba(0, 0, 0, 0.5);
                    position: absolute;
                    left: 1px;
                    top: calc(50% - 1px);
                    height: 0.5rem;
                    transform: translateY(-50%);
                    border-radius: 1rem;
                    pointer-events: none;
                }
            }
        }

        .commands-pop {
            position: absolute;
            left: 0;
            top: 0;
            z-index: 1;
            width: 100vw;
            height: 100dvh;
            background: rgba(0, 0, 0, 0.3);

            .commands-inner {
                position: absolute;
                left: 50%;
                top: 50%;
                transform: translate(-50%, -50%);
                background: #fff;
                box-sizing: border-box;
                padding: 1rem;
                border-radius: 0.5rem;
                width: 40rem;
                max-width: 95vw;

                .commands-title {
                    font-weight: 700;
                    font-size: 1.5rem;
                }

                .commands-body {
                    max-height: 15rem;
                    overflow: hidden;
                    overflow-y: auto;
                    margin: 1rem 0;
                    display: flex;
                    flex-direction: column;
                    gap: 1rem;

                    .command-item {
                        border: 1px solid var(--border-color-darker);
                        box-sizing: border-box;
                        padding: 1rem;

                        .command-item-title {
                            display: flex;
                            align-items: center;
                            justify-content: space-between;
                            border-bottom: 1px solid var(--border-color-darker);
                            padding-bottom: 1rem;
                            font-weight: 700;

                            &>svg {
                                width: 1.5rem;
                                height: 1.5rem;
                                cursor: pointer;

                                &:hover path {
                                    fill: var(--color-primary);
                                }
                            }
                        }

                        .command-text {
                            width: 100%;
                            overflow: hidden;
                            white-space: nowrap;
                            overflow-x: auto;
                        }
                    }
                }

                .download-command {
                    color: #fff;
                    background: var(--color-primary);
                    width: fit-content;
                    margin-left: auto;
                    padding: 0.5rem 1rem;
                    border-radius: 0.25rem;
                    cursor: pointer;
                }
            }
        }
    }

    .page {
        box-sizing: border-box;
        padding: 7rem 10rem;
        text-align: center;

        & h2 {
            font-size: 2.5rem;
            margin-bottom: 4rem;

            &:has(+p) {
                margin-bottom: 0 !important;
            }
        }

        & p {
            line-height: 1.8;
        }

        .how-to-items {
            width: 80%;
            margin: 5rem auto 1.5rem;
            box-sizing: border-box;
            box-shadow: 0 0.5rem 0 1rem var(--color-primary), 0 -0.5rem 0 1rem var(--color-primary);
            padding: 3rem 5rem;

            .how-to-item {
                width: 100%;
                text-align: start;
                box-sizing: border-box;
                padding: 2rem 4rem;
                border-left: 4px solid var(--color-primary-light-5);
                position: relative;

                &>h3 {
                    margin-bottom: 1.5rem;
                    color: var(--color-primary);
                }

                &::before {
                    content: "";
                    width: 1.5rem;
                    height: 1.5rem;
                    background: var(--color-primary);
                    position: absolute;
                    left: -2px;
                    top: 3.15rem;
                    transform: translateX(-50%);
                    border-radius: 10rem;
                }
            }
        }

        .features-items {
            display: grid;
            grid-template-columns: repeat(3, calc(33.33% - 1.35rem));
            gap: 2rem;

            .features-item {
                border: 1px dashed var(--color-primary);
                border-radius: 1rem;
                box-sizing: border-box;
                padding: 2rem;
                text-align: start;

                &>img {
                    width: 2rem;
                    height: 2rem;
                    background: var(--color-primary-light-8);
                    box-shadow: 0 0 0 0.7rem var(--color-primary-light-8);
                    clip-path: circle(80%);
                }
            }
        }

        .faqs {
            text-align: center;
            width: 80%;
            margin: 0 auto;

            .faq {
                text-align: start;
                background: var(--bg-color-page);
                box-sizing: border-box;
                margin-bottom: 2rem;
                border-radius: 1rem;

                &>h3 {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    margin: 0;
                    position: relative;
                    padding: 1.5rem;

                    &>input {
                        width: 100%;
                        height: 100%;
                        position: absolute;
                        left: 0;
                        top: 0;
                        opacity: 0;
                        margin: 0;
                        cursor: pointer;
                    }

                    &>svg {
                        transform: rotate(0deg);
                        transition: transform .2s;
                        pointer-events: none;
                        flex-shrink: 0;
                    }
                }

                &>div {
                    display: grid;
                    grid-template-rows: 0fr;
                    transition: grid-template-rows .2s;

                    &>* {
                        grid-row: 1 / 10;
                        overflow: hidden;
                        margin: 0;
                        padding: 0rem 1.5rem;
                        transition: padding .2s;
                    }

                    & ul {
                        margin: 0 0.5rem;
                    }
                }

                &:has(input:checked) {
                    & svg {
                        transform: rotate(95deg);
                    }

                    &>div {
                        grid-template-rows: 1fr;

                        &>* {
                            padding: 0 1.5rem 2rem;
                        }
                    }
                }
            }
        }
    }

    .start-creating {
        position: relative;
        box-sizing: border-box;
        padding: 7rem 10rem;
        text-align: center;
        font-size: 1.5rem;

        &>img {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            z-index: -1;
            opacity: 0.5;
        }

        &>h2 {
            font-size: 3rem;
            margin: 2rem 0 5rem;
        }

        .start-creating-btn {
            background: var(--color-primary);
            width: fit-content;
            margin: 3rem auto 0;
            color: #fff;
            padding: 1rem 2rem;
            border-radius: 0.5rem;
            cursor: pointer;
        }
    }
}

@media screen and (max-width: 900px) {

    .head {
        font-size: 1.25rem;
    }

    #app {

        .index-page {
            padding: 1rem 2.5vw;

            & h1 {
                font-size: 2.5rem;
            }
        }

        .upload-file-container {
            width: 95vw;
        }

        .editor-container {
            grid-template-columns: unset;
            height: auto;
            width: 95vw;
            margin: 0 auto;

            .editor-menus {
                border: none;
                width: 100%;
                height: 70vh;
            }

            .layer-slider-container {
                height: 54vh;
                top: unset;
                bottom: 3vh;
                transform: unset;

                .layer-slider {
                    width: calc((60vh - 2rem) * 0.9 - 5rem);

                    .slider-btn {
                        pointer-events: unset;
                    }
                }
            }

            #viewport {
                height: 60vh;
            }
        }

        .page {
            padding: 4rem 2.5vw;

            &>h2 {
                font-size: 2rem;
            }

            .index-page {
                display: flex;
                flex-direction: column;
                align-items: center;

                .index-page-left {
                    text-align: center;
                    margin-bottom: 1rem;

                    a.start-GPR {
                        margin: 0 auto;
                    }
                }

                &>img {
                    margin: 0;
                    width: 100%;
                    max-width: unset;
                }
            }

            .how-to-items {
                margin: 5rem auto 1.5rem;
                width: 95vw;
                box-shadow: unset;
                padding: 0 1rem;

                .how-to-item {
                    padding: 2rem 0 2rem 2rem;
                }
            }

            .how-use-items {
                flex-direction: column;
                align-items: center;

                .how-use-item {
                    margin: 0;
                    width: 100%;
                }
            }

            .features-items {
                display: flex;
                flex-direction: column;
            }

            .editor-controls {
                display: flex;
                flex-direction: column;

                .editor-control {
                    &>span {
                        width: 1.7rem;
                        height: 1.7rem;
                    }

                    &>img {
                        width: 2rem;
                        height: 2rem;
                        margin: 1rem 1rem 0 1rem;
                    }
                }
            }

            .faqs {
                width: 100%;
            }
        }

        .start-creating {
            padding: 4rem 2.5vw;
            font-size: 1rem;

            &>h2 {
                font-size: 2rem;
            }

            & br {
                display: none;
            }
        }
    }

}

@keyframes exportLoading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(3600deg);
    }
}