:root {
  --animation-state: running; 
}

.flex {
  display: flex
}

.none {
  display: none !important
}

.hidden {
  opacity: 0;
  visibility: hidden;
}

.note-hint.hidden {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}

.window-container.hidden {
  opacity: 0;
  transform: scale(0.5);
  visibility: hidden;
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

/* TOOLTIP STYLING */
.tooltip {
  position: relative;
}

.tooltip-text {
  top: 120%;
  position: absolute;
  visibility: hidden;
  opacity: 0;

  width: max-content;
  padding: 0.1em 0.35em 0.2em 0.35em;
  border-radius: 0.3rem;

  font-size: 1em;
  color: black;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-weight: 500;
  background-color: rgb(216, 216, 216);
}

.tooltip .tooltip-text::after {
  content: "";
  display: inline-block;
  position: absolute;
  top: -25%;
  left: 40%;
  border-right: 0.5rem solid transparent;
  border-left: 0.5rem solid transparent;
  border-bottom: 0.6rem solid rgb(216, 216, 216);
}

/*  tooltip text positions from 1 to 5 */
.tooltip:nth-of-type(1) .tooltip-text {
  left: 45%;
}

/* third tooltip text position */
.tooltip:nth-of-type(2) .tooltip-text {
  left: -50%;
}

/* third tooltip text position */
.tooltip:nth-of-type(3) .tooltip-text {
  left: -50%;
}

/* third tooltip text position */
.tooltip:nth-of-type(4) .tooltip-text {
  left: -77%;
}

.tooltip:nth-of-type(5) .tooltip-text {
  left: -33%;
}


body {
  margin: 0px;
  height: 100vh;
  scroll-behavior: smooth;
}

.body-container {
  height: 100vh;
  display: grid;
  grid-template-areas:
    "header"
    "main"
    "footer";
  grid-template-rows: auto 1fr auto;
}

/* HEADER STYLING */
.header {
  grid-area: header;
  display: grid;
  grid-template-areas: "logo settings";
  grid-template-rows: 1fr;

  width: 100vw;
  height: 80px;
  margin: auto;
  background-color: #ebf0f1;
  box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}


#logo {
  grid-area: logo;
}

#logo h1 {
  font-family: "Limelight";
  text-align: end;
}

.settings {
  grid-area: settings;
}


#note-hints,
#note-sheets,
#information,
#interactive-mode,
#prepared-mode {
  display: none;
}

header label {
  position: relative;
  top: 18px;
  left: 20px;
  display: inline-block;
  width: 34px;
  height: 34px;
}

#note-hints:checked+label,
#note-sheets:checked+label,
#information:checked+label,
#interactive-mode:checked+label,
#prepared-mode:checked+label {
  border-radius: 100%;
  background-color: rgb(216, 216, 216);
}

#note-hints+label {
  padding: 0.3em 0.2em 0.3em 0.5em;
}

#note-sheets+label {
  padding: 0.3em 0.35em;
}

#information+label {
  padding: 0.3em 0em 0.3em 0.6em;
}

#interactive-mode+label {
  top: 14px;
  margin-left: 20px;
  padding: 0.3em 0.15em 0.3em 0.45em;
}

#prepared-mode+label {
  top: 15px;
  padding: 0.4em 0.25em 0.25em 0.55em;
}


/* MAIN STYLING */
.main {
  grid-area: main;
  display: grid;
  grid-template-areas:
    "piano-container";
}

.piano-container {
  grid-area: piano-container;
  display: grid;
  grid-template-areas: "piano-scroll";
  width: inherit;
  margin-bottom: 100px;
  margin-top: 50px;
}

.piano-scroll {
  grid-area: piano-scroll;
  display: grid;
  grid-template-areas: "piano";
  width: 80vw;
  max-width: 1440px;
  height: 20%;
  min-height: 200px;
  /* max-height: 300px; */
  margin: auto;
}

.piano-white-keys {
  grid-area: piano;
  display: grid;
  grid-template-areas: "white-key-1 white-key-2 white-key-3 white-key-4 white-key-5 white-key-6 white-key-7 white-key-8 white-key-9 white-key-10 white-key-11 white-key-12 white-key-13 white-key-14 white-key-15 white-key-16 white-key-17";
  grid-template-rows: 1fr;
  grid-template-columns: repeat(17, 1fr);
}

.white-key {
  background-color: #f7fdff;
  text-align: center;
  border: 0.05rem solid grey;
  border-radius: 0rem 0rem 0.4rem 0.4rem;
  box-shadow: 0px 9px 4px rgb(144, 144, 144);
  height: 100%;
  z-index: 1;
  position: relative;
}

.white-key a {
  position: absolute;
  left: 15%;
  bottom: 2%;
  font-size: 1.7em;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.5s, transform 0.5s, visibility 0.5s;
  user-select: none;
}

.white-key-1 {
  grid-area: white-key-1;
}

.white-key-2 {
  grid-area: white-key-2;
}

.white-key-3 {
  grid-area: white-key-3;
}

.white-key-4 {
  grid-area: white-key-4;
}

.white-key-5 {
  grid-area: white-key-5;
}

.white-key-6 {
  grid-area: white-key-6;
}

.white-key-7 {
  grid-area: white-key-7;
}

.white-key-8 {
  grid-area: white-key-8;
}

.white-key-9 {
  grid-area: white-key-9;
}

.white-key-10 {
  grid-area: white-key-10;
}

.white-key-11 {
  grid-area: white-key-11;
}

.white-key-12 {
  grid-area: white-key-12;
}

.white-key-13 {
  grid-area: white-key-13;
}

.white-key-14 {
  grid-area: white-key-14;
}

.white-key-15 {
  grid-area: white-key-15;
}

.white-key-16 {
  grid-area: white-key-16;
}

.white-key-17 {
  grid-area: white-key-17;
}

.white-key:active,
.active-white {
  background-color: #ebf0f1;
  box-shadow: none;
  transform: scaleY(103%);
  transform-origin: top;
}

.piano-black-keys {
  grid-area: piano;
  position: relative;
  width: 80vw;
  max-width: 1440px;
  height: 100%;
}

.black-key {
  display: inline-block;
  background-color: rgb(31, 29, 29);
  border-radius: 0rem 0rem 0.3rem 0.3rem;
  width: 4%;
  min-width: min-content;
  height: 60%;
  z-index: 2;
  box-shadow: 0px 7px 3px rgb(135, 135, 135);
  position: relative;
}

.black-key a {
  color: rgb(221, 221, 221);
  font-size: 1.7em;
  position: absolute;
  left: 10%;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.5s, transform 0.5s visibility 0.5s;
  user-select: none;

}

.black-key-1 {
  position: absolute;
  left: 3%;
}

.black-key-2 {
  position: absolute;
  left: 9%;
}

.black-key-3 {
  position: absolute;
  left: 20.8%;
}

.black-key-4 {
  position: absolute;
  left: 26.5%;
}

.black-key-5 {
  position: absolute;
  left: 32.5%;
}

.black-key-6 {
  position: absolute;
  left: 44.3%;
}

.black-key-7 {
  position: absolute;
  left: 50.2%;
}

.black-key-8 {
  position: absolute;
  left: 62%;
}

.black-key-9 {
  position: absolute;
  left: 68%;
}

.black-key-10 {
  position: absolute;
  left: 73.8%;
}

.black-key-11 {
  position: absolute;
  left: 85.5%;
}

.black-key-12 {
  position: absolute;
  left: 92%;
}

.black-key:active,
.active-black {
  box-shadow: none;
  transform: scaleY(104%);
  /* background-color: rgb(96, 96, 96); */
  transform-origin: top;
}

/* WINDOW STYLING */

.window-container,
.window-container-clone {
  position: absolute;
  z-index: 3;
  min-width: 250px;
  max-width: 400px;

  background-color: rgb(251, 251, 251);
  border: 0.05rem solid black;
  border-radius: 0.5rem;

  /* animation */
  opacity: 1;
  transform: scale(1);
  visibility: visible;
  transition: opacity 0.2s, transform 0.2s, visibiltiy 0.2s;

  font-size: 1.2em;
}

#white-table-1 {
  left: 10%;
  top: 10%;
}

#white-table-2 {
  left: 40%;
  top: 30%;
}

#black-table-1 {
  left: 60%;
  top: 24%;
}


.window-container-clone {
  left: -1000px;
}

.window-heading {
  height: 25px;
  border-bottom: 0.05rem solid black;
  border-radius: 0.5rem 0.5rem 0rem 0rem;
  background-color: #ebf0f1;
  display: flex;
  align-items: center;
}

.window-heading div {
  width: 12.5px;
  height: 50%;
  border-radius: 50%;
  margin-left: 5px;
}

.window-heading div:nth-of-type(1) {
  background-color: red;
}

.window-heading div:nth-of-type(1) img {
  display: none;
  padding-left: 0.7px;
  padding-top: 1.9px;
  margin: auto;
}

.window-heading div:nth-of-type(2) {
  background-color: rgb(253, 195, 49);
}

.window-heading div:nth-of-type(3) {
  background-color: rgb(51, 243, 51);
}

.window-heading div:nth-of-type(4) {
  flex-grow: 1;
  width: auto;
  height: 100%;
  text-align: center;

}

.window-heading a {
  font-size: 0.85em;
  font-weight: 500;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif
}

/* WINDOW SHEETS STYLING */
table {
  width: 12vw;
  min-width: 250px;
  margin: 0.4em;
  border-collapse: collapse;
}

tr {
  border-bottom: 0.05em solid black;
}

tr:last-child {
  border-bottom: none;
}

td {
  padding-left: 0.5em;
  padding-top: 0.3em;
  padding-bottom: 0.1em;
  font-family: "Limelight";
}


td:nth-of-type(2) {
  text-align: end;
  padding-right: 0.5em;
  width: 50%;
}


/* INFORMATION WINDOW STYLING */
#information-window {
  top: 20%;
  left: 20%;
}

.information-section {
  padding: 10px;
  padding-bottom: 20px;
  font-family: "Caveat Brush", cursive;
  background-image: url("../assets/information-background.jpg");
  border-radius: 0rem 0rem 0.5rem 0.5rem;
  background-position: right 10%;
}

.information-section h2 {
  margin: 0px;
}

.information-section h2+p {
  font-size: 1.2em;
  margin-top: 0.3em;
}

.information-section ol {
  padding-left: 20px;
  padding-right: 20px;
}

.information-section li {
  font-size: 1.2em;
}

.information-section li>p {
  margin-top: 0.3em;
  font-size: 1em;
}

/* PIANO MODE WINDOW STYLING */

#piano-mode-window {
  top: 62%;
  left: 35vw;
  height: max-content;
}

.interactive-section,
.prepared-section {
  padding: 1em;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

#upload-song-file {
  display: none;
}

.mode-button {
  margin: auto;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  position: relative;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.mode-button img {
  z-index: 1;
}

.record-button::after,
.play-record-button::after,
.playback-section .stop-record-button::after {
  content: "";
  position: absolute;
  width: inherit;
  height: inherit;
  border-radius: 50%;

  background-color: rgb(255, 59, 59);
  transform: scale(0);

  transition: transform 1s ease, background-color 0.5s ease;
  pointer-events: none;
}

.record-button,
.play-record-button,
.pause-record-button,
.playback-section .stop-record-button {
  background-color: rgb(255, 59, 59);
}

.stop-record-button::after {
  content: "";
  position: absolute;
  width: inherit;
  height: inherit;
  border-radius: 50%;
  background-color: rgb(255, 59, 59);
  animation: recording infinite 2.5s;
  animation-play-state: var(--animation-state);
}

@keyframes recording {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.7);
  }

  100% {
    transform: scale(1);
  }
}

.download-record-button,
.upload-record-button {
  background-color: rgba(34, 18, 255, 0.834);
}

.upload-record-button {
  margin-bottom: 10px;
}

.download-record-button::after,
.upload-record-button::after {
  content: "";
  position: absolute;
  width: inherit;
  height: inherit;
  border-radius: 50%;
  background-color: rgba(55, 41, 255, 0.834);
  transform: scale(0);

  transition: transform 1s ease, background-color 0.5s ease;
  pointer-events: none;
}


.playback-section {
  width: 90%;
  display: flex;
  flex-direction: column;
}

.playback-section .play-controls {
  display: flex;
  flex-direction: row;
  margin-bottom: 10px;
}

.playback-section .mode-button {
  width: 50px;
  height: 50px;
}

.playback-section .upload-record-button {
  margin: auto;
}

.playback-section .stop-record-button::after {
  animation: none;
}

.volume-control,
.speed-control {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 40px;
}

.volume-control label,
.speed-control label {
  height: 24px;
  width: 24px;
  background-color: rgb(255, 59, 59);
  padding: 0.2em;
  border-radius: 50%;
}

.speed-control label {
  padding: 0.2em 0.1em 0.1em 0.2em
}

.playback-section input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;

}

.playback-section input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border: 1px solid black;
  border-left: none;
  border-right: none;
  margin: 0px 5px;
}

/* Firefox range track styling */
.playback-section input[type="range"]::-moz-range-track {
  height: 10px;
  border: 1px solid black;
  border-left: none;
  border-right: none;
  margin: 0px 5px;
}

.playback-section input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 27px;
  height: 35px;
  background-image: url("../assets/icons/header/show-music-sheets.svg");
  position: relative;
  top: -14px;
}

/* Firefox range thumb styling */
.playback-section input[type="range"]::-moz-range-thumb {
  -webkit-appearance: none;
  width: 27px;
  height: 35px;
  background-image: url("../assets/icons/header/show-music-sheets.svg");
  position: relative;
  top: -14px;
}

#song-name-window {
  top: 60%;
  left: 15%;
}

.song-input-section {
  height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.song-input-section form {
  width: 75%;
}

.song-input-section input {
  width: 100%;
  height: 30px;
  border: none;
  outline: none;
  background-color: #ebf0f1;
  border-radius: 0.3rem;
  padding: 0.5em 0.7em;
  font-size: 0.75em;
  font-weight: 500;
  box-sizing: border-box;
}

.song-iput-section a {
  flex: 1;
}

.song-input-section div {
  display: flex;
  width: 75%;
}

.song-input-section button {
  height: 30px;
  flex-grow: 1;
  border-radius: 0.3em;
  font-weight: 500;
  border: none;
  cursor: pointer;
}

.song-input-section button:nth-of-type(1) {
  margin-right: 0.3em;
}

.song-input-section button:nth-of-type(2) {
  margin-left: 0.3em;
}

.error {
  margin-top: 10px;
  height: 30px;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: 0.92em;
  color: red;
}



.footer {
  grid-area: footer;
  margin-top: 50px;
  /* background-color: rgb(225, 223, 221); */
}

.footer p {
  text-align: center;
}

.footer p a {
  color: black;
}


/* HOVER STYLES */
@media only screen and (min-width: 600px) and (min-height: 400px) {

  #logo:hover {
    cursor: pointer;
  }

  header label:hover {
    cursor: pointer;
  }

  .tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease 0.3s;
  }

  #note-hints:hover+label,
  #note-sheets:hover+label,
  #information:hover+label,
  #interactive-mode:hover+label,
  #prepared-mode:hover:hover+label {
    display: inline-block;
    border-radius: 100%;
    background-color: rgb(216, 216, 216);
  }

  .window-heading div:nth-of-type(1):hover img {
    display: block;
  }

  .black-key:hover {
    cursor: pointer;
  }

  .white-key:hover {
    cursor: pointer;
    background-color: #e4efef;
  }

  .record-button:hover::after,
  .play-record-button:hover::after,
  .playback-section .stop-record-button:hover::after {
    background-color: rgb(234, 24, 24);
    transform: scale(1);
  }

  .download-record-button:hover::after,
  .upload-record-button:hover::after {
    background-color: rgba(55, 41, 255, 0.834);
    transform: scale(1);
  }

  .song-input-section button:hover {
    background-color: rgb(216, 216, 216);
    ;
  }

  .footer p a:hover {
    cursor: pointer;
    text-decoration: none;
  }
}

@media only screen and (max-width: 344px) {
  .body-container {
    display: none;
  }
}