/* === General styles === */

:root {
    --white: #FFFFFF;
    --cream: #F1EBEC;
    --lilac: #F3EEFF;
    --lavender: #B581BC;
    --lavender-traslucent: rgba(181, 129, 188, 0.3);
    --purple: #736A91;
    --black: #373247;
}

*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    background: var(--cream);
    font-family: "Nunito Sans", sans-serif;
    color: var(--black);
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    outline: none;
    -moz-appearance:textfield; /* Firefox */
}

/* === Nav bar === */

nav {
    width: 100%;
    padding: 0 60px;
}

.nav__container {
    height: 60px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    border-bottom: 1px dashed var(--lavender);
}

.nav__group {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
}

.nav__logo {
    display: flex;
    align-items: flex-end;
}

.nav__logo svg {
    color: var(--purple);
    transform: translateY(16px);
}

.nav__logo path {
    animation-name: none;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-fill-mode: both;
}

.nav__logo.playing path,
.nav__logo:hover path {
    animation-name: logoAnimation;
}

.nav__logo path:nth-child(2) { animation-delay: 0.0s; }
.nav__logo path:nth-child(3) { animation-delay: 0.05s; }
.nav__logo path:nth-child(4) { animation-delay: 0.10s; }
.nav__logo path:nth-child(5) { animation-delay: 0.15s; }
.nav__logo path:nth-child(6) { animation-delay: 0.20s; }
.nav__logo path:nth-child(7) { animation-delay: 0.25s; }

@keyframes logoAnimation {
    0% {
        transform: translateY(0%);
    }
    25% {
        transform: translateY(-8%) rotate(-3deg);
        color: var(--lavender);
    }
    50% {
        transform: translateY(2%) rotate(3deg);
        color: var(--lavender);
    }
    100% {
        transform: translateY(0%);}

}

.nav__controls {
    display: flex;
    align-items: center;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
}

.nav__controls__input {
    display: flex;
    align-items: center;
}

.nav__controls__input,
.nav__controls__button {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    position: relative;
    display: flex;
}

.nav__controls__button {
    cursor: pointer;
}

.nav__controls__input svg,
.nav__controls__button svg {
    color: var(--purple);
    transition: .2s;
}

.nav__controls__input:hover svg,
.nav__controls__button:hover svg {
    color: var(--lavender);
}

.nav__controls__input::after,
.nav__controls__button::after {
    pointer-events: none;
    position: absolute;
    bottom: -30px;
    right: 0;
    background-color: var(--lavender-traslucent);
    color: var(--white);
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: .2s;
}

.nav__controls__input:hover::after,
.nav__controls__button:hover::after{
    opacity: 1;
    visibility: visible;
}

#button--library::after {
    content: 'Biblioteca';
}

#button--import::after {
    content: 'Subir';
}

#button--export::after {
    content: 'Descargar';
}

#button--print::after {
    content: 'Imprimir';
}

#input--bpm::after {
    content: 'BPM';
}

#button--sound::after {
    content: 'Sonido';
    right: unset;
    left: 0;
}

#button--scroll::after {
    content: 'Autodesplazamiento';
    right: unset;
    left: 0;
}

#input--bpm input {
    width: 28px;
    font-size: 16px;
    background: none;
    padding: 0;
    margin: 0;
    border: none;
    color: var(--purple);
    text-align: right;
}

#input--bpm:hover input {
    color: var(--lavender);
}

label.nav__controls__button input {
    display: none;
}

#button--scroll input:checked ~ svg.scroll--off,
#button--sound input:checked ~ svg.sound--off {
    display: none;
}

#button--scroll input ~ svg.scroll--on,
#button--sound input ~ svg.sound--on {
    display: none;
}

#button--scroll input:checked ~ svg.scroll--on,
#button--sound input:checked ~ svg.sound--on {
    display: block;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown__menu {
    border-radius: 4px;
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--white);
    filter: drop-shadow(6px 6px 12px rgba(108, 82, 82, 0.2));
    white-space: nowrap;
}

.dropdown.open .dropdown__menu {
    display: block;
}

.dropdown__item {
    padding: 8px 16px;
    cursor: pointer;
}

.dropdown__item:hover {
    background-color: var(--lilac);
}

.dropdown__item input {
    display: none;
}

.dropdown__item label {
    width: 100%;
    display: block;
}

.dropdown__item input:checked + label {
    color: var(--lavender);
}


/* === Sheet container === */

#sheet {
    width: 100%;
    height: calc(100vh - 60px);
    padding: 0 60px;
    display: flex;
    flex-direction: row;
    align-items: center;
    overflow-x: scroll;
    overflow-y: hidden;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--lavender-traslucent) transparent;
}

#sheet::-webkit-scrollbar {
    width: 8px;
}

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

#sheet::-webkit-scrollbar-thumb {
    background: var(--lavender-traslucent);
    border-radius: 4px;
}

#sheet::-webkit-scrollbar-thumb:hover {
    background: var(--lavender);
}

/* === Sheet notation === */

.sheet__measure {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 8px 0;
}

.sheet__measure.active {
    background-color: rgba(181, 129, 188, 0.2);
}

.sheet__measure::after {
    content: '';
    width: 2px;
    height: 48px;
    position: absolute;
    right: 0;
    top: 128px;
    background-color: var(--purple);
}

.sheet__measure__note {
    position: relative;
    width: 32px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

#clef.sheet__clef {
    flex-shrink: 0;
    width: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.note__clef {
    position: absolute;
    top: -10px;
    left: 10px;
}

#signature.sheet__signature {
    flex-shrink: 0;
    width: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.note__signature {
    position: absolute;
    top: 2px;
    display: flex;
    flex-direction: column;
}

.note__signature input {
    display: block;
    width: 40px;
    height: 28px;
    font-size: 32px;
    text-align: center;
    font-weight: 800;
    border: none;
    background: transparent;
    color: var(--black);
}

.sheet__measure__note.beat-marker::after {
    content: '';
    width: 2px;
    height: 48px;
    position: absolute;
    right: 0;
    top: 120px;
    background-color: var(--lavender-traslucent);
}

.note__image {
    height: 100px;
    opacity: 0;
    visibility: hidden;
    transition: .2s;
}

.sheet__measure__note.active .note__image {
    opacity: 1;
    visibility: visible;
}

.note__buttons {
    position: relative;
    width: 100%;
    height: 72px;
    background-image: url('assets/note-background.svg');
    background-repeat: repeat-x;
    background-size: auto 100%;
    background-position: 0px 0px;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
}

.note__options {
    position: absolute;
    bottom: 100%;
    display: flex;
    flex-direction: row;
    gap: 8px;
    z-index: 1000;
    opacity: 0;
    transition: .2s, opacity 0.3s ease-in-out;
}

.note__options__popup {
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: 100px;
    filter: drop-shadow(6px 6px 12px rgba(108, 82, 82, 0.2));
}

.note__options button {
    width: 36px;
    height: 36px;
    border: none;
    padding: 8px;
    margin: 0;
    cursor: pointer;
    border-radius: 100px;
    background: transparent;
    transition: .5s;
}

.note__options button.active,
.note__options button:hover {
    background-color: var(--lilac);
    transition: .2s;
}

.note__options button img {
    height: 100%;    
}

.note__symbol {
    position: relative;
    width: 16px;
    height: 8px;
    /* background-color: var(--lavender-traslucent); */
    opacity: 0;
    transition: .2s;
    cursor: pointer;
}

.note__symbol::after {
    content: '';
    width: 100%;
    height: 300%;
    position: absolute;
    left: 0;
    bottom: 0;
    background-image: url('assets/note-sixteenth.svg');
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: contain;
}

.note--whole .note__symbol::after {
    background-image: url('assets/note-whole.svg');
}
.note--dotted-half .note__symbol::after {
    background-image: url('assets/note-dotted-half.svg');
}
.note--half .note__symbol::after {
    background-image: url('assets/note-half.svg');
}
.note--dotted-quarter .note__symbol::after {
    background-image: url('assets/note-dotted-quarter.svg');
}
.note--quarter .note__symbol::after {
    background-image: url('assets/note-quarter.svg');
}
.note--eighth .note__symbol::after {
    background-image: url('assets/note-eighth.svg');
}
.note--sixteenth .note__symbol::after {
    background-image: url('assets/note-sixteenth.svg');
}
.note--sharp.note--whole .note__symbol::after {
    background-image: url('assets/note-whole-s.svg');
}
.note--sharp.note--dotted-half .note__symbol::after {
    background-image: url('assets/note-dotted-half-s.svg');
}
.note--sharp.note--half .note__symbol::after {
    background-image: url('assets/note-half-s.svg');
}
.note--sharp.note--dotted-quarter .note__symbol::after {
    background-image: url('assets/note-dotted-quarter-s.svg');
}
.note--sharp.note--quarter .note__symbol::after {
    background-image: url('assets/note-quarter-s.svg');
}
.note--sharp.note--eighth .note__symbol::after {
    background-image: url('assets/note-eighth-s.svg');
}
.note--sharp.note--sixteenth .note__symbol::after {
    background-image: url('assets/note-sixteenth-s.svg');
}

.note__buttons .note__symbol:hover {
    transform: scale(1.8);
    opacity: .6;
}

.note__buttons .note__symbol.active {
    transform: scale(1.8);
    opacity: 1;
}

.playing .note__buttons .note__symbol.active {
    opacity: .6;
}

.note__name {
    height: 20px;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
}

.playing .note__name {
    color: var(--lavender);
}

.button--sphere {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border: none;
    padding: 8px;
    border-radius: 100px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .2s;
}

#button--play.button--sphere {
    background-color: var(--lavender);
    transform: translateY(12px);
}

#button--play.button--sphere:hover {
    background-color: var(--purple);
}

#button--add.button--sphere {
    margin: 64px 0 0 20px;
}

#button--delete.button--sphere {
    position: absolute;
    bottom: 20px;
    left: calc(50% - 30px);
    z-index: 1000;
}

.button--sphere:hover {
    filter: drop-shadow(6px 6px 12px rgba(108, 82, 82, 0.2));
}

.button--sphere svg {
    color: var(--purple);
    transition: .2s;
}

.button--sphere:hover svg {
    color: var(--lavender);
}


/* === Media queries === */

@media (max-width: 600px) {
    nav {
        padding: 0 20px;
    }

    .nav__logo svg {
        width: 80px;
    }

    #sheet {
        padding: 0 20px;
    }
}


@media (max-width: 480px) {
    .nav__container {
        gap: 8px;
    }

    .nav__controls {
        gap: 2px;
    }

    .nav__logo svg {
        width: 70px;
        transform: translateY(20px);
    }
    
    #button--import,
    #button--export {
        display: none;
    }

    .button--sphere {
        width: 40px;
        height: 40px;
    }

    #button--play.button--sphere {
        transform: translateY(8px);
    }
}

@media (max-height: 450px) {

    .button--sphere {
        width: 40px;
        height: 40px;
    }

    #button--delete.button--sphere {
        left: 20px;
    }
}