html, body {
    margin: 0;
    padding: 0;
    background-color: #F5F1E7;
    font-size: 18px;
    
    font-family: 'Suisse', sans-serif;
    
    --text-xl: 3.05rem;
    --text-l: 1.66rem;
    --text-m: 1rem;
    --text-s: 0.66rem;
    font-synthesis: none;
    
    --orange: rgb(255, 106, 0);
    --orange-light: #f7be56;
    --sand: #F5F1E7;
}
canvas {
    display: block;
}
a {
    color: inherit;
    text-decoration: none;
    background: none;
    font: inherit;
    cursor: pointer;
}

h1,h2,h3{
    letter-spacing: -0.01em;
    font-family: 'Suisse', sans-serif;
}
h1{
    font-size: var(--text-xl);
}
h2{
    font-size: var(--text-l);
}
h3{
    font-size: var(--text-m);
}

.button, button{
    border: none;
    border-radius: 5em;
    padding-top: .3em;
    padding-bottom:.3em;
    padding-left: .6em;
    padding-right: .6em;
    width: fit-content;
    cursor: pointer;
    &.button--l{
        font-size: var(--text-l);
    }
    &.button--m{
        font-size: var(--text-m);
    }
    &.button--s{
        font-size: var(--text-s);
    }
    
    &.button--primary{
        background-color: var(--orange);
        color: white;
        &:hover{
            background: var(--orange-light)
        }
    }
    &.button--secondary{
        background-color: lightgrey;
        color: black;
    }
    &.button--tertiary{
        background-color: none;
        outline: 2px solid lightgrey
        color: lightgrey;
    }
}

@font-face {
    font-family: 'Suisse';
    src: url('./SuisseIntl-Medium.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Suisse-Mono';
    src: url('./SuisseIntlMono-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

body {
    margin: 0;
    padding: 0;
    color: black;
    
    --ui-accent: #3163ef;;
}

main{
}

.selection-screen{
    width: max(100%, 100vw);
    height: 100dvh;
    overflow-y: flex;
    box-sizing: border-box;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    
    .topbar{
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        
        div, h1{
            display: inline-block;
            margin: 0;
            
        }
        .tab-selector{
            display: flex;
            gap: .6rem;
            color: rgb(158, 158, 158);
            cursor: pointer;
            .tab-button.active{
                color: black;
            }
        }
        .title, .tab-selector{
            white-space: nowrap;
            
            
        } 
    }
}


.editor-screen{
    position: fixed;
    inset: 0;
    display: none;
    background: var(--sand);
    grid-template-columns: auto 1fr;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    &.visible{
        display: grid;
    }
    .floating-box{
        display: block;
        position: relative;
        height: 100%;
        width: max(30vw, 400px);
    }
    .canvas-container{
        box-sizing: border-box;
        padding: 3rem;
        height: 100%;
        width: 100%;
        width: 100%;
        height: 100%;
        position: relative;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .p5Canvas{
        /* width: 100% !important;
        height: auto !important; */
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.377); 
        width: 100% !important;
        height: auto !important;
    }
}


@view-transition {
  .preset-list, .select-ui {
    transition: opacity 0.3s ease, flex 0.3s ease;
  }
}
.main-selector{
    display: grid;
    grid-template-columns: 4fr 1fr;
    grid-column-gap: 1rem;
    margin-top: 2rem;
    flex-grow: 2;
    .preset-list{
        display: none;
        &.visible{
            display: grid;
        }
        grid-template-columns: repeat(4, 1fr);
        grid-column-gap: .2rem;
        .preset{
            padding: .8rem;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            height: fit-content;
            border-radius: .8rem;
            gap: .5rem;
            cursor: pointer;
            .thumb{
                background-color: white;
                box-shadow: 0 0 10px rgba(0,0,0,.1);
            }
            h3{
                margin-top: 0;
                margin-bottom: 0;
            }
            .metadata{
                font-size: var(--text-s);
                font-family: 'Suisse-Mono';
                display: flex;
                gap: .2rem;
                align-items: first baseline;
                justify-content: space-between;
            }
            &:hover{
                background: rgba(0,0,0,.05);
            }
            &.selected{
                background: rgba(0,0,0,..5);
                outline: 2px solid orangered;
            }
        }
    }
    
    .select-ui{
        display: none;
        flex-direction: column;
        height: 100%;
        justify-content: space-between;
        &.visible{
            display: block;
            display: flex;
        }
        
        .preset-details{
            display: flex;
            flex-direction: column;
            h1,h2,h3{
                margin: 0;
            }
            
            .technical-details{
                margin-top: 2rem;
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 2rem;
                .entry{
                    display: flex;
                    flex-direction: row;
                    justify-content: space-between;
                    align-items: baseline;
                    .category{
                        font-size: var(--text-s);
                    }
                    .value{
                        font-family: 'Suisse-Mono';
                        letter-spacing: 0;
                    }
                    &.colorspace .value{
                        text-transform: uppercase;
                    }
                }
            }
        }
        .actions{
            display: flex;
            justify-content: right;
        }
    }
}


/* All Stuff related to the Canvas UI */
.floating-box {
    background: var(--sand);
    border-top-right-radius: .8rem;
    border-bottom-right-radius: .8rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.377);
    padding: 0;
    box-sizing: border-box;
    height: calc(100vh - 40px);
    z-index: 1000;
    overflow: clip;
    overflow-y: scroll;
    
    &::-webkit-scrollbar {
        background-color: transparent;
        width: 15px;
    }
    &::-webkit-scrollbar-track {
        background-color: transparent;
    }
    &::-webkit-scrollbar-thumb {
        border-radius: 20px;
        border: 4px solid transparent;
        background-color: rgba(0,0,0,0.2);
        background-clip: content-box;
    }
}
.group {
    margin-bottom: 1.5rem;
    margin-left: 1rem;
    margin-right: 1rem;
    
    &.disabled h3{
        opacity: 0;
        display: none;
    }
}
.group:first-child {
    margin-top: 20px;
}
.group.export {
    padding-bottom: 1rem;
    background: linear-gradient(to top, var(--sand) 80%, transparent 100%);
    position: sticky;
    bottom: 0;
    padding-top: 10px;
    margin-bottom: 0;
    margin-right: 0;
    margin-left: 0;
    padding-left: 1rem;
    flex-direction: row;
    padding-right: 1rem;
    display: flex;
    align-items: baseline;
    justify-self: end;
    .button-container{
        display: flex;
        justify-content: end;
        align-items: baseline;
        *{
            height: fit-content;
        }
    }
    
    
}
.group h3 {
    margin-bottom: 10px;
    font-size: var(--text-l);
    color: var(--black, black);
    padding-bottom: 5px;
    font-weight: normal;
}
.slider-container, .color-picker-container, .checkbox-container {
    margin-bottom: 15px;
    
}
.checkbox-container{
    display: flex;
    align-items: flex-end;
}
.slider-container{
    flex-grow: 1;
}
.ui-row{
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}
label {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-s);
    margin-bottom: 5px;
    color: var(--black, black);
}
input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    height: 4px;
    background: var(--grey-1, lightgrey);
    outline: none;
    border-radius: 2px;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--orange);
    outline: 2px solid var(--sand);
    border-radius: 50%;
}
input[type="color"] {
    width: 100%;
    height: 30px;
    border: 1px solid var(--grey-1, lightgrey);
    background: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 2px;
}
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    cursor: pointer;
    border: 1px solid #444;
    background: #2b2b2b;
}
input[type="number"] {
    background-color: var(--grey-1, lightgrey);
    color: #d1d1d1;
    border: none;
    padding-top: .2em;
    font-family: 'Suisse-Mono';
    padding-bottom: .3em;
    color: black;
    padding-left: .5em;
    font-size: var(--text-m);
    margin-right: 10px;
    cursor: pointer;
    border-radius: 3rem;
    margin-left: .4em;
    margin-right: .4em;
    margin-top: .2em;
    margin-bottom: .2em;

}
.checkbox-container label {
    display: flex;
    align-items: center;
}
.slider-value {
    font-size: var(--text-s);
    font-family: 'Suisse-Mono';
    color: var(--orange, blue);
    margin-left: 10px;
}
select {
    background-color: var(--grey-1, lightgrey);
    color: #d1d1d1;
    border: none;
    padding-top: .2em;
    padding-bottom: .3em;
    color: black;
    padding-left: .5em;
    font-size: var(--text-m);
    margin-right: 10px;
    cursor: pointer;
    border-radius: 3rem;
}


select, .slider-container, .checkbox-container, .color-picker-container, .button-container, .file-upload-container, .color-picker-container {
    &.disabled {
        opacity: 0;
        display: none;
        pointer-events: none;
    } 
}

#config-string-container{
        font-family: monospace;
    width: 100%;
    height: 100px;
    height: 101px;
    margin-top: 10px;
    margin-bottom: 10px;
    overflow-y: scroll;
    word-wrap: break-word;
    white-space: break-spaces;
}