html,
body {
    padding: 0;
    margin: 0;
    user-select: none;
}

#app {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    
    display: grid;
    grid-template-columns: 1fr auto;
    background: #ffffff;
}

#viewport {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 1em;
    overflow: hidden;
}

#viewport[loading]::before,
#viewport[loading]::after {
    opacity: 0;
}

#viewport:fullscreen .pre_next_file,
#viewport:has(.clipping_container_active) .pre_next_file {
    display: none;
}

img.project_cover {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project_loading {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgb(100 100 100 / 30%);
    backdrop-filter: blur(10px);
}

.project_loading_inner {
    position: absolute;
    width: 25em;
    height: 0.5em;
    background: #fff;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    --pro: 0%;
}

.project_loading_inner::before {
    content: "Loading 3D Model";
    font-size: 2em;
    position: absolute;
    left: 50%;
    top: -0.25em;
    transform: translate(-50%, -100%);
    white-space: nowrap;
    color: #fff;
}

.project_loading_inner::after {
    content: "";
    display: inline-block;
    width: var(--pro);
    background: var(--el-color-primary);
    height: 100%;
    transition: width .2s;
    position: absolute;
    top: 0;
}

.helpers {
    position: absolute;
    display: flex;
    column-gap: 2em;
}

.helpers[righttop] {
    top: 3em;
    right: 3em;
}

.helpers[bottomright] {
    right: 3em;
    bottom: 3em;
}

.helper {
    width: 3em;
    height: 3em;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0.5em;
    padding: 0.5em;
}

.helper svg {
    width: 100%;
    height: 100%;
}

.helper svg path {
    fill: #fff;
}

.helper_focus svg path {
    fill: var(--el-color-primary);
}

.logo {
    position: fixed;
    left: 1em;
    bottom: 1em;
    width: 3em;
    height: 3em;
    z-index: 999999999999999;
}

img {
    width: 100%;
    height: 100%;
}

img.show_mage_file {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@keyframes loading {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.files {
    --fileWidth: 24em;
    width: var(--fileWidth);
    margin-left: 1em;
    height: 100%;
    overflow: hidden;
    overflow-y: auto;
    padding-right: 1em;
}

.files:has(.file[loading]) {
    pointer-events: none !important;
}

.file {
    position: relative;
    margin-bottom: 1em;
    border-radius: 1em;
    overflow: hidden;
    border: 2px solid var(--el-border-color-darker);
    cursor: pointer;
    box-sizing: border-box;
    width: var(--fileWidth);
    height: calc(var(--fileWidth) / 1.5);
    flex-shrink: 0;
}

*[loading]::before {
    content: "";
    width: 2em;
    height: 2em;
    border: 2px solid var(--el-color-primary);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    z-index: 2;
    border-radius: 100%;
    border-top-color: transparent;
    animation: modelLoading 1s linear infinite;
}

@keyframes modelLoading {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

*[loading]::after {
    content: "";
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    cursor: default;
}

.file img {
    width: 100%;
    min-width: 100%;
    height: calc(var(--fileWidth) / 1.5);
    object-fit: contain;
}

.rotation_image {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 1500% !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
    object-fit: unset !important;
}

.image-progress {
    position: absolute;
    top: calc(var(--fileWidth) / 1.5 - 4px);
    height: 0.5em;
    transform: translateY(-100%);
    background: var(--el-color-primary);
    transition: width .2s;
    z-index: 1;
}

.file_focus {
    border-color: var(--el-color-primary) !important;
}

.file:hover {
    border-color: var(--el-color-primary);
}

.file_type {
    position: absolute;
    left: 0.75em;
    top: 0.75em;
    z-index: 1;
    background: var(--el-color-primary);
    color: #fff;
    padding: 0.5em 1em;
    border-radius: 0.5em;
}

.file_name {
    position: absolute;
    left: 0.75em;
    bottom: 0.75em;
    pointer-events: none;
    color: #000;
    background: #fff;
    padding: 0.25em 1em;
    border-radius: 0.2em;
    z-index: 1;
}

.pre_next_file {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    pointer-events: none;
}

.pre {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    pointer-events: all;
}

.next {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    pointer-events: all;
}

.pre_next_file svg {
    width: 4em;
    height: 4em;
}

.pre_next_file svg path {
    fill: #fff;
}

.current_file_type {
    position: absolute;
    left: 1em;
    top: 1em;
    width: fit-content;
    background: var(--el-color-primary);
    color: #fff;
    padding: 0.5em 1em;
    border-radius: 0.3em;
    z-index: 1;
}

.more_edit_container {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.8);
    height: 100vh;
    color: #fff;
    display: grid;
    grid-template-rows: auto 1fr;
    transform: translateX(-100%);
    transition: transform .2s;
}

.more_edit_container_active {
    transform: translateX(0%);
}

.more_edit_container_title {
    font-size: 1.25em;
    box-sizing: border-box;
    padding: 0.5em;
    width: 100%;
    height: 3em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.more_edit_container_title>svg {
    width: 1.5em;
    height: 1.5em;
    cursor: pointer;
    margin-left: 1em;
}

.more_edit_container_title>svg path {
    fill: #fff;
}

.more_edit_container_title>svg:hover path {
    fill: var(--el-color-primary);
}

.more_edit_container_body {
    width: 100%;
    height: calc(100vh - 3.75em);
    box-sizing: border-box;
    padding: 0.75em;
    overflow: hidden;
    overflow-y: auto;
}

.more_edit_item {
    width: 100%;
    height: 2.5em;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    cursor: pointer;
    box-sizing: border-box;
    padding: 0 1em;
    border-radius: 0.25em;
    margin: 0.5em 0;
}

.more_edit_item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.more_edit_active {
    background: var(--el-color-primary) !important;
}

.clipping_container {
    position: absolute;
    right: 1em;
    top: 1em;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    transform: translateX(calc(100% + 1em));
    transition: transform .2s;
}

.clipping_container_active {
    transform: translateX(0);
}

.clipping_container>span {
    font-weight: 700;
    margin-bottom: 0.5em;
}

.clipping_inner {
    width: 1em;
    height: calc(100vh - 20em);
    background: var(--el-bg-color-page);
    margin-top: 0.5em;
    box-sizing: border-box;
    border: 1px solid var(--el-border-color-darker);
    position: relative;
}

.clipping_btn {
    position: absolute;
    height: 0.8em;
    width: 2em;
    background: var(--el-color-primary);
    left: 50%;
    transform: translate(-50%, 50%);
    bottom: 100%;
    border: 1px solid var(--el-border-color-darker);
    box-sizing: border-box;
    cursor: pointer;
}

@media screen and (max-width: 800px) {
    .files {
        display: none;
    }

    #viewport[loading]::before,
    #viewport[loading]::after {
        opacity: 1;
    }
}