/* Variables */

:root {
    --background-light: #e7e7e7;
    --container-light: #f3f3f3;
    --container-accent-light: #cdd2d7;
    --heading-light: #262730;
    --text-light: #545454;
    --text-disabled-light: #f1f1f1;
    --hover-accent-light: #d9d9d9;
    --button-light: #4eaee8;
    --button-accent-light: #559bc4;
    --button-active-light: #76c4f3;
    --button-active-accent-light: #53b0e7;
    --button-disabled-light: #9cc3db;
    --key-active-light: #e5e5e5;
    --key-active-accent-light: #adadad;
    --sharpkey-active-light: #3c3c3c;
    --sharpkey-active-accent-light: #282828;

    --background-dark: #171820;
    --container-dark: #1d1e26;
    --container-accent-dark: #121216;
    --heading-dark: #ededed;
    --text-dark: #868e96;
    --text-disabled-dark: #565656;
    --hover-accent-dark: #24242e;
    --button-dark: #44496d;
    --button-accent-dark: #2f3256;
    --button-active-dark: #5c6183;
    --button-active-accent-dark: #444768;
    --button-disabled-dark: #2b2b40;
    --key-active-dark: #c1c2c9;
    --key-active-accent-dark: #888c9d;
    --sharpkey-active-dark: #3c3c3c;
    --sharpkey-active-accent-dark: #282828;
}

@media(prefers-color-scheme: dark){
    :root {
        --background: var(--background-dark);
        --container: var(--container-dark);
        --container-accent: var(--container-accent-dark);
        --heading: var(--heading-dark);
        --text: var(--text-dark);
        --text-disabled: var(--text-disabled-dark);
        --hover-accent: var(--hover-accent-dark);
        --button: var(--button-dark);
        --button-accent: var(--button-accent-dark);
        --button-active: var(--button-active-dark);
        --button-active-accent: var(--button-active-accent-dark);
        --button-disabled: var(--button-disabled-dark);
        --hightlight: var(--highlight-dark);
        --key-active: var(--key-active-dark);
        --key-active-accent: var(--key-active-accent-dark);
        --sharpkey-active: var(--sharpkey-active-dark);
        --sharpkey-active-accent: var(--sharpkey-active-accent-dark);
    }
}

@media(prefers-color-scheme: light){
    :root {
        --background: var(--background-light);
        --container: var(--container-light);
        --container-accent: var(--container-accent-light);
        --heading: var(--heading-light);
        --text: var(--text-light);
        --text-disabled: var(--text-disabled-light);
        --hover-accent: var(--hover-accent-light);
        --button: var(--button-light);
        --button-accent: var(--button-accent-light);
        --button-active: var(--button-active-light);
        --button-active-accent: var(--button-active-accent-light);
        --button-disabled: var(--button-disabled-light);
        --hightlight: var(--highlight-light);
        --key-active: var(--key-active-light);
        --key-active-accent: var(--key-active-accent-light);
        --sharpkey-active: var(--sharpkey-active-light);
        --sharpkey-active-accent: var(--sharpkey-active-accent-light);
    }
}

.dark {
    --background: var(--background-dark);
    --container: var(--container-dark);
    --container-accent: var(--container-accent-dark);
    --heading: var(--heading-dark);
    --text: var(--text-dark);
    --text-disabled: var(--text-disabled-dark);
    --hover-accent: var(--hover-accent-dark);
    --button: var(--button-dark);
    --button-accent: var(--button-accent-dark);
    --button-active: var(--button-active-dark);
    --button-active-accent: var(--button-active-accent-dark);
    --button-disabled: var(--button-disabled-dark);
    --hightlight: var(--highlight-dark);
    --key-active: var(--key-active-dark);
    --key-active-accent: var(--key-active-accent-dark);
    --sharpkey-active: var(--sharpkey-active-dark);
    --sharpkey-active-accent: var(--sharpkey-active-accent-dark); 
}

.light {
    --background: var(--background-light);
    --container: var(--container-light);
    --container-accent: var(--container-accent-light);
    --heading: var(--heading-light);
    --text: var(--text-light);
    --text-disabled: var(--text-disabled-light);
    --hover-accent: var(--hover-accent-light);
    --button: var(--button-light);
    --button-accent: var(--button-accent-light);
    --button-active: var(--button-active-light);
    --button-active-accent: var(--button-active-accent-light);
    --button-disabled: var(--button-disabled-light);
    --hightlight: var(--highlight-light);
    --key-active: var(--key-active-light);
    --key-active-accent: var(--key-active-accent-light);
    --sharpkey-active: var(--sharpkey-active-light);
    --sharpkey-active-accent: var(--sharpkey-active-accent-light);
}

/* Elements */

html, body {
    background-color: var(--background);
    position: relative;
    margin: 0;
    padding: 0;
    color: var(--text);
}

html {
    color-scheme: dark light;
    height: 100%;
}

body {
    display: flex;
    font-family: "Fustat", sans-serif;
    font-weight: 400;
    font-style: normal;
    padding: 20px;
    height: 100%;
}
main { 
    user-select: none;
    position: relative;
    z-index: 0;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading);
    margin: 0;
}

a {
    color: var(--heading);
    text-decoration: none;
}

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent; 
}

::-webkit-scrollbar-thumb {
  background: var(--text-dark); 
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #aaa; 
}

/* General Classes */

.button {
    font-weight: 600;
    height: 32px;
    width: fit-content;
    padding-inline: 0.75em;
    padding-block: 0.25em;
    border: none;
    border-radius: 5px;
    color: var(--heading-dark);
    background-color: var(--button);
    box-shadow: 0px 4px 0px var(--button-accent);
}

.text-input {
    border: none;
    background-color: var(--background);
    color: var(--text);
}

.text-input.is-invalid {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.text-input.is-valid {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.text-input:focus {
    outline: none;
}

.text {
    color: var(--text);
}

.button:active {
    background-color: var(--button-active);
    box-shadow: 0px 2px 0px var(--button-active-accent);
    margin-top: 2px;
}

.hidden {
    visibility: hidden;
}

.heading-font {
    font-family: "Bebas Neue", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.max-width {
    width: 100%;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

/* Side Navbar */

#nav {
    background-color: var(--container);
    height: 100%;
    width: 250px;
    display: flex;
    position: relative;
    flex-direction: column;
    border-radius: 5px;
    margin-right: 20px;
    padding-inline: 20px;
    padding-bottom: 20px;
}

#logo-container {
    display: flex;
    height: fit-content;
    align-items: center;
    justify-content: center;
    width: 100%;
}

#logo {
    width: 40px;
    height: 40px;
    border-radius: 7px;
    fill: var(--heading);
    background-color: transparent;
    margin: 10px;
}

#title {
    font-size: 2.5em;
    margin-top: 5px;
    margin-right: 10px;
}

#nav-links {
    font-size: 1em;
    padding: 0;
    margin-top: 5px;
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 15px;
    font-weight: 600;
}

.link {
    display: inline-block;
}

#preset-searchbar {
    padding-inline: 1em;
    margin-bottom: 20px;
    height: 25px;
    border-radius: 5px;

}

#presets {
    padding: 0;
    margin-bottom: 20px;
    list-style: none;
    background-color: var(--background);
    border-radius: 5px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    width: 210px;
}

.preset {
    position: relative;
    width: 210px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding-block: 1px;
    padding-left: 10px;
    padding-right: 35px;
    user-select: none; 
    -webkit-user-select: none; 
    -moz-user-select: none; 
    -ms-user-select: none;
    cursor: pointer;
}

.preset.active {
    cursor: default;
}

.preset:hover {
    background-color: var(--hover-accent);
    border-radius: 5px;
}

.trash {
    float: right;
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 2px;
}

/* Head Navbar */

#head-nav {
    width: 100%;
    height: 36px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
}

#login-btns {
    display: flex;
    position: absolute;
    top: 20px;
    right: 20px;
    gap: 10px;
    height: 34px;
    z-index: 1;
}

#theme-btn {
    border-top-left-radius: 100%;
    border-bottom-left-radius: 100%;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    position: relative;
    width: 38px;
}

.light-dark-icon::before {
    padding: 0;
    position: absolute;
    top: 8px;
    left: 12px;
}

#volume-container {
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
}

.range {
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    background-color: transparent;
    padding-top: 2px;
    width: 10vw;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.track {
    width: 100%;
    height: 20px;
    border-radius: 100px;
    position: absolute;
    margin-top: 2px;
    pointer-events: none;
    z-index: 0;
}

#volume-icon {
    position: absolute;
    left: calc(100% - 32px);
    top: calc(50% - 16px);
    font-size: 1.5em;
    color: var(--heading-dark);
    height: 32px;
    width: 32px;
    vertical-align: 0;
    pointer-events: none;
    z-index: 1;
}

.bi-volume-down-fill::before, .bi-volume-up-fill::before, .bi-volume-mute-fill::before {
    height: 32px;
    width: 32px;
    text-align: center;
}

.range::-webkit-slider-runnable-track {
    height: 20px;
    background-color: transparent;
    border: none;
    border-radius: 100px;
}

.range::-moz-range-track {
    height: 20px;
    background-color: transparent;
    border: none;
    border-radius: 100px;
}

.range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    background: var(--button);
    cursor: pointer;
    margin-top: -8px;
    border-radius: 50%;
    box-shadow: 0px 4px 0px var(--button-accent);
}

.range::-moz-range-thumb {
    width: 32px;
    height: 32px;
    background: var(--button);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.dropdown-menu {
    background-color: var(--container);
    border: none;
}

.dropdown-item.active, .dropdown-item:active,
.preset.active {
    background-color: var(--button);
    border-radius: 5px;
    color: var(--heading-dark);
}

.dropdown-item.active:hover, .preset.active:hover {
    background-color: var(--button-active);
    color: var(--heading-dark);
}

.dropdown-item:hover {
    background-color: var(--hover-accent);
    color: var(--text);
    border-radius: 5px;
}

/* Piano */

#piano-container {
    width: 100%;
    position: relative;
    height: 15vw;
    min-height: 15vw;
}

#keys {
    width: 100%;
    height: 100%;
    display: flex;
}

#sharp-keys {
    width: calc(100% / 22 * 20);
    height: 100%;
    display: flex;
    position: absolute;
    top: -0.2vw;
    left: calc((100% / 22) - (60% / 44));
    pointer-events: none;
    gap: calc(100% / 20 - 60% / 20);
}

.key {
    background-color: white;
    height: 100%;
    width: 100%;
    border-top-right-radius: 0;
    border-top-left-radius: 0;
    border-bottom-right-radius: 0.39vw;
    border-bottom-left-radius: 0.39vw;
    border: solid 1px #33323d24;
    box-shadow: 0px 0.39vw #cdd2d7;
    cursor: pointer;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none; 
    user-select: none;
}

.key.sharp {
    background-color: #2b2833;
    height: 8.5vw;
    width: calc(60% / 20);
    border-radius: 0.39vw;
    box-shadow: 0px 0.58vw black;
    pointer-events: auto;
}

.key.active {
    background-color: var(--key-active);
    box-shadow: 0px 0.2vw var(--key-active-accent);
    height: calc(100% + 0.2vw);
}

.key.sharp.active {
    background-color: var(--sharpkey-active);
    box-shadow: 0px 0.39vw var(--sharpkey-active-accent);
    height: calc(8.5vw + 0.2vw);

}

.low-c {
    border-top-left-radius: 1vw !important; 
    border-bottom-left-radius: 1vw !important;
}

.high-c {
    border-top-right-radius: 1vw !important; 
    border-bottom-right-radius: 1vw !important;
}

/* Pedals */

#effects-container {
    padding: 0;
    border-radius: 5px;
    width: 100%;
    max-width: calc(100vw - 310px);
    display: flex;
    flex-direction: row;
    row-gap: 20px;
    column-gap: 20px;
    margin-top: calc(20px + 0.39vw);
    overflow-y: auto;
    flex-wrap: wrap;
}

.effect-pedal {
    background-color: var(--container);
    border-radius: 20px;
    width: 250px;
    min-width: 250px;
    height: 420px;
    box-shadow: 0px 10px 0px var(--container-accent);
    margin-bottom: 10px;
    padding-block: 10px;
    padding-inline: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.knob-container{
    margin-top: 58px;
    width: fit-content;
    height: fit-content;
    display: flex;
    flex-wrap: wrap;
    column-gap: 40px;
    justify-content: center;
    position: absolute;
    z-index: 0;
}

.knob-handle-container{
    margin-top: 68px;
    width: fit-content;
    height: fit-content;
    display: flex;
    flex-wrap: wrap;
    column-gap: 40px;
    row-gap: 42px;
    justify-content: center;
    position: absolute;
    z-index: 1;
}

.knob {
    --dg-margin: -15px;
    --dg-height: 120px;
    --dg-width: 100px;
    --dg-background-color: transparent;
    --dg-border: none;
    --dg-box-shadow: none;

    --dg-arc-width: 8px;
    --dg-arc-background-color: var(--background);
    --dg-arc-color: var(--button);

    --dg-subtitle-color: var(--text);
    --dg-subtitle-font-family: "Fustat", sans-serif;
    --dg-subtitle-font-size: 1em;
    

    --dg-numeric-color: var(--text);
    --dg-numeric-font-family: "Fustat", sans-serif;
    --dg-numeric-font-size: 0em;
    font-weight: 600;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none; 
    user-select: none;
}

.knob-handle {
    width: 70px;
    height: 70px;
    border-radius: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
}

/* Login/Register */

.centered-page {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

#login-container {
    background-color: var(--container);
    padding-inline: 40px;
    padding-block: 25px;
    border-radius: 20px;
    position: relative;
    text-align: center;
}

.login {
    width: 300px;
    height: 400px;
}

.register {
    width: 300px;
    height: 420px;
}

.login-form {
    margin-top: 20px;
}

#login-text {
    position: absolute;
    bottom: 40px;
    width: 220px;
    text-align: left;
}

.form-button {
    align-self: flex-end;
    box-shadow: none;
    height: 35px;
}

.form-button:active {
    background-color: var(--button-active);
    box-shadow: none;
    margin-top: 0;
}

.form-button.disabled {
    background-color: var(--button-disabled);
    color: var(--text-disabled);
    pointer-events: none;
}

.invalid-feedback {
    height: 30px;
    width: 100%;
    display: block;
    text-align: left;
    padding-inline: 1em;
}

.login-input {
    border-radius: 5px;
    height: 35px;
    padding-inline: 1em;
}

/* Popups */

.popup {
    background-color: var(--container);
    padding: 30px;
    border-radius: 20px;
    position: relative;
    text-align: center;
    width: 300px;
    height: fit-content;
    transform: translate(0, -7.5vh);
    gap: 30px;
}

.overlay {
    position: absolute;
    z-index: 2;
    background-color: var(--background);
}

.buttons-container {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.popup-btn {
    width: 100%;
}

/* Account page */

.update-password {
    width: 350px;
    height: 420px;
}

/* Mobile */

#mobile-piano-container {
    width: 100%;
    position: relative;
    display: none;
    height: 100%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none; 
    user-select: none;
}

#mobile-keys {
    width: 100%;
    height: calc(100% - 8px);
    display: flex;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none; 
    user-select: none;
}

#mobile-keys.vertical {
    flex-direction: column-reverse;
    width: calc(100% - 8px);
    height: 100%;
}

#mobile-sharp-keys {
    width: calc(100% / 8 * 6);
    height: 100%;
    display: flex;
    position: absolute;
    top: -5px;
    left: calc((100% / 8) - (60% / 16));
    pointer-events: none;
    gap: calc(100% / 6 - 60% / 6);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none; 
    user-select: none;
}

#mobile-sharp-keys.vertical {
    height: calc(100% / 8 * 6);
    width: 100%;
    top: calc(100% / 8 + (60% / 16));
    left: -5px;
    flex-direction: column-reverse;
}

.mobile-key {
    background-color: white;
    height: 100%;
    width: 100%;
    border-top-right-radius: 0;
    border-top-left-radius: 0;
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 10px;
    border: solid 1px #33323d24;
    box-shadow: 0px 8px #cdd2d7;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none; 
    user-select: none;
}

.mobile-key.vertical {
    border-top-right-radius: 10px;
    border-top-left-radius: 0;
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 0;
    box-shadow: 8px 0px #cdd2d7;
}

.mobile-key.sharp {
    background-color: #2b2833;
    height: 55%;
    width: calc(60% / 6);
    border-radius: 10px;
    box-shadow: 0px 10px black;
    pointer-events: auto;
}

.mobile-key.sharp.vertical {
    background-color: #2b2833;
    width: 55%;
    height: calc(60% / 6);
    box-shadow: 10px 0px black;
}

.mobile-key.active {
    background-color: var(--key-active);
    box-shadow: 0px 4px var(--key-active-accent);
    height: calc(100% + 4px);
}

.mobile-key.sharp.active {
    background-color: var(--sharpkey-active);
    box-shadow: 0px 5px var(--sharpkey-active-accent);
    height: calc(55% + 5px);
}

.mobile-key.vertical.active {
    background-color: var(--key-active);
    box-shadow: 4px 0px var(--key-active-accent);
    width: calc(100% + 4px);
}

.mobile-key.sharp.vertical.active {
    background-color: var(--sharpkey-active);
    box-shadow: 5px 0px var(--sharpkey-active-accent);
    width: calc(55% + 5px);
    height: calc(60% / 6);
}

.mobile-key.low-c {
    border-top-left-radius: 20px !important; 
    border-bottom-left-radius: 20px !important;
}

.mobile-key.high-c {
    border-top-right-radius: 20px !important; 
    border-bottom-right-radius: 20px !important;
}

.vertical.low-c {
    border-top-right-radius: 10px !important;
    border-top-left-radius: 0 !important;
    border-bottom-right-radius: 20px !important;
    border-bottom-left-radius: 20px !important;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none; 
    user-select: none;
}

.vertical.high-c {
    border-top-right-radius: 20px !important;
    border-top-left-radius: 20px !important;
    border-bottom-right-radius: 10px !important;
    border-bottom-left-radius: 0 !important;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none; 
    user-select: none;
}

@media (max-width: 1200px) {
    #mobile-piano-container {
        display: block;
    }
    .desktop {
        display: none !important;
    }
  }
