@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap');

:root {
    font-family: 'Roboto Mono', monospace;
    color: white;
    font-size: 0.75em;
}

* {
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: inherit;
}

html, body {
    height: 100vh;
    height: fill-available;
    height: -moz-fill-available;
    height: -webkit-fill-available;
}

body {
    margin: 0;
    background-color: #242424;
    position: relative;
}

@media (min-width: 720px) {
    body {
        height: 100vh;
    }
}

#page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: stretch;
    align-items: stretch;
}

/* Actual Code */

/* Collapse Box (Always vertical) */

.collapse-container {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.collapse-box {
    outline: 1px solid #363636;
    flex: 1 1 auto;
    /* background-color: black; */
    display: flex;
    flex-direction: column;
    overflow: hidden;

    transition: flex 250ms linear;
}

.collapse-box > * {
    width: 100%;
}

.collapse-box > header {
    position: relative;
    font-size: 2em;
    width: 100%;
    height: auto;
    cursor: pointer;

    display: flex;
    align-items: center;
    padding: 0.5em 0.25em;
    overflow: hidden;

    background-color: rgba(0, 0, 0, 0.25);
}

.collapse-box > header::before {
    filter: invert(0.5);
    content: '';
    position: relative;
    height: 50%;
    aspect-ratio: 1 / 1;
    background: url(images/right-arrow.png) 0/contain no-repeat;
    margin-right: 0.5em;
    transform: rotate(90deg);
    transition: transform 250ms ease;
}

.collapse-box.collapsed > header::before {
    transform: rotate(0);
}

.collapse-box > .collapsible {
    /* height: 0; */
    flex: 1 1 0;
    overflow: hidden;
}

.collapsed {
    flex: 0 0 auto;
}

.collapsed > .collapsible {
    /* flex: 0 0 0; */
}

/* The section with images */

.image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-container.upload-area {
    cursor: pointer;
}

.upload-area::after {
    content: '';
    position: absolute;
    z-index: 999;
    margin: auto;
    width: 100%;
    height: 100%;
    opacity: 0;
    background-color: rgba(245, 245, 220, 0.5);
    background-image: url(images/move.png);
    background-size: 25%;
    background-position: center center;
    background-repeat: no-repeat;

    transition: 250ms ease;

    overflow: hidden;
}

.upload-area.upload-area--dragenter::after {
    backdrop-filter: blur(5px);
    opacity: 1;
}

.upload-area:not(.image-uploaded) {
    background: url(images/upload.png) center/25% no-repeat;
}

.image-container #uploaded-image {
    user-select: none;
    pointer-events: none;
    display: none;
}

.image-container.image-uploaded #uploaded-image {
    display: block;
}

.image-container > :is(img#uploaded-image, canvas) {
    max-height: 100%;
    max-width: 100%;
}

.image-container > canvas {
    display: block;
}

/* The section with inputs and editor */

.section-editor {
    height: 100%;
    width: 100%;
    overflow: auto;
}

.CodeMirror {
    height: 100%;
    font-size: 22px;
}

/* The section with execution UI */

.section-runtime {
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    align-items: stretch;
}

/* Notifications */

.notification-container {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1.5em;
}

.notification {
    font-size: 1em;
    padding: 0.25em 0.5em;
    width: 100%;
    color: black;
    font-weight: 800;
    animation: fadeout 2s ease 3s forwards;
}

@keyframes fadeout {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

button {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 2.5em;
    text-align: center;
    border: none;
    outline: none;
    padding: 0.5em;
    cursor: pointer;
    color: black;
    background-color: transparent;
    transition: background-color 250ms ease;

    width: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
}

#button-run:hover, .notification-execution {
    background-color: hsl(150, 100%, 50%);
}

#button-download:hover, .notification-download {
    background-color: hsl(200, 100%, 50%);
}

#button-save-progress:hover, .notification-save-progress {
    background-color: rgb(255, 196, 0);
}

#button-reset:hover, .notification-reset {
    background-color: rgb(255, 64, 0);
}

button img {
    height: 1em;
}

button:hover img {
    mix-blend-mode: difference;
}