:root {
  --primary-color: #8d0544;
  --secondary-color: #d9d9d9;
  --accent-color: #d08a38;
  --light-color: #ffffff;
  --dark-color: #000000;
}

body {
  margin: 0;
  background-color: var(--light-color);
  font-family: "DM Sans", sans-serif;
  overflow-x: hidden;
}

h1 {
  font-size: 32px;
  font-weight: 400;
}

p {
  font-size: 16px;
}

.tablet-mobile,
.mobile {
  display: none;
}

.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--light-color);
  color: var(--primary-color);
  z-index: 1;
}

.main-header section {
  border-bottom: 1px solid var(--dark-color);
  background-color: var(--light-color);
}

.main-header .middle,
.main-header .lower {
  padding: 0 100px;
}

.main-header .upper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.main-header .upper > a {
  width: 100px;
  text-align: center;
  cursor: default;
}

.main-header .upper .previous img {
  width: 11px;
  height: 21px;
  transition: opacity 0.3s ease;
}

.main-header .upper .previous img:hover {
  opacity: 0.5;
  cursor: pointer;
}

.main-header .upper .previous.disabled {
  opacity: 0.3;
  pointer-events: none;
  cursor: default;
}

.main-header .upper .title {
  flex: 1;
  display: flex;
  align-items: center;
  column-gap: 30px;
}

.main-header .upper .info-wrapper {
  height: 24px;
}

.main-header .upper .info-wrapper.disabled {
  display: none;
}

.main-header .upper .info-wrapper article {
  border: 1px solid var(--primary-color);
  position: absolute;
  display: none;
  margin-top: 10px;
  background-color: var(--light-color);
  width: 50%;
  min-width: 300px;
  max-width: 600px;
  padding: 15px;
  border-radius: 16px;
  line-height: 25px;
}

.main-header .upper .info-wrapper p {
  border: 1px solid var(--dark-color);
  border-radius: 100%;
  padding: 0;
  width: 24px;
  height: 24px;
  text-align: center;
  line-height: 24px;
  color: var(--dark-color);
  transition: all 0.3s ease;
  margin: 0;
}

.main-header .upper .info-wrapper p:hover {
  background-color: var(--accent-color);
  cursor: default;
  color: var(--light-color);
}

.main-header .upper .info-wrapper:hover article {
  display: block;
}

.main-header .middle {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.main-header .middle .metadata p {
  display: inline-block;
}

.main-header .middle .metadata p:not(:last-child) {
  margin-right: 30px;
}

.main-header .lower {
  display: flex;
  justify-content: space-between;
  padding-top: 15px;
  padding-bottom: 15px;
  gap: 15px;
}

.main-header .lower.disabled {
  display: none;
}

.main-header .lower .zoom {
  display: flex;
  column-gap: 10px;
}

.main-header .lower .zoom p {
  margin: 0;
}

.main-header .lower nav {
  display: flex;
  column-gap: 15px;
  width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
}

.main-header .lower button {
  background-color: var(--light-color);
  color: var(--primary-color);
  padding: 7px 15px;
  border: 1px solid var(--primary-color);
  border-radius: 32px;
  font-size: 16px;
  text-align: center;
  transition: all 0.3s ease;
  text-wrap: nowrap;
}

.main-header .lower button:hover {
  cursor: pointer;
  background-color: var(--accent-color);
}

.main-header .lower button.active {
  background-color: var(--accent-color);
  color: var(--light-color);
  border: 1px solid var(--accent-color);
}

.main-header .zoom {
  display: flex;
  column-gap: 10px;
  align-items: start;
}

.main-header .zoom p {
  margin: 0;
}

.main-header .zoom button {
  padding: 0;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 32px;
  transition: all 0.3s ease;
}

.main-header .zoom button:hover {
  cursor: pointer;
  background-color: var(--accent-color);
}

.main-header .zoom button img {
  width: 32px;
  height: 32px;
}

.main-header input {
  background-color: var(--light-color);
  color: var(--primary-color);
  padding: 7px 5px;
  border: 1px solid var(--primary-color);
  border-radius: 32px;
  font-size: 14px;
  width: 40px;
  text-align: center;
}

.main-header input:focus {
  outline: none;
  border-style: solid;
  border-color: inherit;
}

.content {
  position: relative;
  padding-top: 205px;
  padding-bottom: 53px;
  width: 100%;
  transition: all 0.5s ease-in-out;
}

.content .score {
  display: flex;
  justify-content: center;
}

.content .score:not(:first-child) {
  display: none;
}

.content .score canvas {
  box-shadow: #00000022 0px 7px 29px 0px;
}

.content .page-controls button {
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 100%;
  transition: all 0.5s ease-in-out;
  padding: 0;
}

.content .page-controls button:hover {
  background: var(--accent-color);
  cursor: pointer;
}

.content .page-controls button path {
  transition: all 0.3s ease;
}

.content .page-controls button:hover path {
  stroke: #ffffff;
}

.content .page-controls button.prev-page {
  left: 0;
}

.content .page-controls button.next-page {
  right: 0;
}

.content .page-controls button[disabled] {
  display: none;
}

.info-wrapper article button {
  display: none;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--light-color);
  display: flex;
}

footer #audio-tab {
  width: 20%;
  border-top: 1px solid var(--dark-color);
  border-right: 1px solid var(--dark-color);
  position: absolute;
  text-align: center;
  padding: 10px 5%;
  background-color: var(--light-color);
  transition: all 0.5s ease-in-out;
}

footer #audio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 10px;
  height: 32px;
  margin-bottom: 10px;
}

footer #audio-label button {
  padding: 0;
  background: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 100%;
  color: var(--primary-color);
  transition: all 0.3s ease;
}

footer #audio-label button.disabled {
  display: none;
}

footer button#audio-tab-button:hover {
  background-color: var(--accent-color);
  cursor: pointer;
}

footer #audio-label img {
  width: 32px;
  height: 32px;
}

footer #audio-label p {
  color: var(--primary-color);
}

footer #audio-label p.abbreviated {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

footer #audio-tracks {
  display: flex;
  flex-direction: column;
  row-gap: 10px;
}

footer #audio-tracks button {
  font-size: 14px;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  padding: 7px 15px;
  background: none;
  border-radius: 32px;
  transition: all 0.3s ease;
}

footer #audio-tracks button:hover {
  cursor: pointer;
  color: var(--light-color);
  background-color: var(--accent-color);
}

footer #audio-tracks button.active {
  border: 1px solid var(--accent-color);
  color: var(--light-color);
  background-color: var(--accent-color);
}

footer #AudioPanel {
  display: flex;
  column-gap: 30px;
  flex: 1;
  margin-left: 30%;
  padding: 10px 5%;
  border-top: 1px solid var(--dark-color);
}

footer #players {
  height: 0;
}

footer #audio_play_buttons {
  height: 32px;
}

footer #audio_player,
footer #audio_player_timings {
  display: flex;
}

footer #audio_player {
  align-items: center;
  column-gap: 20px;
}

footer #audio_player_timings {
  column-gap: 7px;
}

footer #audio_player,
footer #audio_player_timings,
footer #seekbar_div {
  flex: 1;
}

footer #audio_play_buttons input {
  border-radius: 100%;
  transition: all 0.3s ease;
}

footer #audio_play_buttons input:hover {
  background-color: var(--accent-color);
}

footer #seekbar_div,
footer #seekbar_div canvas {
  width: 100%;
  height: 16px;
}

footer #seekbar_div canvas {
  cursor: pointer;
}

footer #audio_tooltip {
  position: fixed;
  display: none;
  background-color: var(--light-color);
  color: var(--primary-color);
  padding: 5px;
  border: 1px solid var(--primary-color);
  border-radius: 32px;
  z-index: 999;
  font-size: 14px;
  min-width: 40px;
  text-align: center;
}

footer #audio_tooltip::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--light-color);
  border-bottom: none;
}

footer #audio_tooltip::before {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--primary-color);
  border-bottom: none;
}

footer #audio_play_buttons input {
  width: 32px;
}

footer #current_timing,
footer #total_timing {
  font-size: 14px;
  color: var(--primary-color);
  min-width: 42px;
}

footer #audio_volume {
  display: flex;
  align-items: center;
  gap: 5px;
}

footer #volume_button {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  height: 15px;
}

footer #volume_button img {
  width: 20px;
  height: auto;
}

#volume_slider {
  width: 91px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 1px solid var(--primary-color);
  cursor: pointer;
}

#volume_slider::-webkit-slider-runnable-track {
  background: transparent;
  height: 4px;
}

#volume_slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  border: none;
  height: 16px;
  width: 5px;
  background: var(--primary-color);
  margin-top: -6px;
  cursor: grab;
}

#volume_slider::-moz-range-track {
  background: transparent;
  height: 4px;
}

#volume_slider::-moz-range-thumb {
  border: none;
  height: 16px;
  width: 5px;
  background: var(--primary-color);
  cursor: grab;
}

footer #audio_speed {
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.5s ease;
}

footer #audio_speed #speed_display,
footer #audio_speed #speed_slider {
  transition: all 0.5s ease;
}

footer #audio_speed.disabled #speed_display {
  border-color: var(--light-color);
  background-color: var(--light-color);
  pointer-events: none;
}

footer #audio_speed.disabled #speed_slider {
  opacity: 0.3;
  pointer-events: none;
}

footer #speed_display {
  background-color: var(--light-color);
  color: var(--primary-color);
  padding: 5px;
  border: 1px solid var(--primary-color);
  border-radius: 32px;
  font-size: 14px;
  width: 35px;
  text-align: center;
}

footer #speed_display:focus {
  outline: none;
  border-style: solid;
  border-color: inherit;
}

#speed_slider {
  width: 91px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 1px solid var(--primary-color);
  cursor: pointer;
}

#speed_slider::-webkit-slider-runnable-track {
  background: transparent;
  height: 4px;
}

#speed_slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  border: none;
  height: 16px;
  width: 5px;
  background: var(--primary-color);
  margin-top: -6px;
  cursor: grab;
}

#speed_slider::-moz-range-track {
  background: transparent;
  height: 4px;
}

#speed_slider::-moz-range-thumb {
  border: none;
  height: 16px;
  width: 5px;
  background: var(--primary-color);
  cursor: grab;
}

main.viewer-error {
  position: relative;
  height: 60dvh;
  color: var(--primary-color);
}

main.viewer-error section {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

main.viewer-error section div {
  margin-bottom: 50px;
}

main.viewer-error h1 {
  margin: 0;
  margin-bottom: 5px;
}

main.viewer-error p {
  margin: 0;
}

main.viewer-error a {
  background-color: var(--light-color);
  color: var(--primary-color);
  padding: 7px 15px;
  border: 1px solid var(--primary-color);
  border-radius: 32px;
  font-size: 16px;
  text-align: center;
  transition: all 0.3s ease;
  text-wrap: nowrap;
  text-decoration: none;
}

main.viewer-error a:hover {
  cursor: pointer;
  background-color: var(--accent-color);
  color: var(--light-color);
  border-color: var(--accent-color);
}

/*Tablet and mobile viewport*/
@media (max-width: 1024px) {
  h1 {
    font-size: 28px;
  }

  p {
    font-size: 16px;
  }

  .desktop,
  .mobile {
    display: none !important;
  }

  .tablet-mobile {
    display: block;
  }

  .main-header .upper {
    padding: 10px 0;
  }

  .main-header .upper .title {
    justify-content: center;
    column-gap: 10px;
    flex-wrap: wrap;
  }

  .main-header .upper .title .metadata {
    flex-basis: 100%;
    width: 100%;
    text-align: center;
  }

  .main-header .upper .title .metadata p,
  .main-header .upper .title h1 {
    margin: 0;
  }

  .info-wrapper article button {
    display: block;
    background: none;
    color: var(--primary-color);
    border: none;
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 24px;
    font-weight: 300;
  }

  .main-header .upper .info-wrapper p {
    width: 18px;
    height: 18px;
    line-height: 18px;
  }

  .main-header .upper .info-wrapper p:hover {
    background-color: var(--light-color);
    cursor: default;
    color: var(--dark-color);
  }

  .main-header .upper .info-wrapper article {
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
  }

  #mobile-scores-label {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  #mobile-scores-label.hidden {
    display: none;
  }

  #mobile-scores-tab-button {
    padding: 0;
    background: none;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 100%;
    color: var(--primary-color);
    transition: all 0.3s ease;
  }

  #mobile-scores-tab-button.active {
    transform: rotate(180deg);
  }

  #mobile-scores-label img {
    width: 32px;
    height: 32px;
    transform: rotate(180deg);
  }

  #mobile-scores-label p {
    color: var(--primary-color);
  }

  .main-header .zoom {
    gap: 7px;
    align-items: center;
  }

  .main-header .zoom button:hover {
    background: none;
  }

  .main-header .zoom.disabled {
    display: none;
  }

  .main-header .middle > div {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  .main-header .page-controls {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .main-header .page-controls button {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 100%;
    transition: all 0.5s ease;
    padding: 0;
  }

  .main-header .page-controls button path {
    transition: all 0.3s ease;
  }

  .main-header .page-controls button.prev-page {
    left: 0;
  }

  .main-header .page-controls button.next-page {
    right: 0;
  }

  .main-header .page-controls button.disabled {
    opacity: 0.3;
  }

  .main-header .lower {
    transform: translatey(-100%);
    position: absolute;
    z-index: 0;
    transition: all 0.5s ease-in-out;
    width: 100%;
    box-sizing: border-box;
  }

  .main-header .lower nav {
    gap: 15px;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .main-header .lower.open {
    transform: translatey(0);
  }

  .main-header .lower button {
    padding: 7px 15px;
    font-size: 14px;
  }

  .content {
    overflow-y: hidden;
    overflow-x: scroll;
  }

  .score > div {
    overflow-x: scroll;
    min-height: 100vh;
    display: flex;
    align-items: center;
  }

  footer {
    transition: all 0.4s linear;
  }

  footer #AudioPanel {
    margin: 0;
    flex-wrap: wrap;
    padding: 10px 15px;
    z-index: 0;
  }

  footer #AudioPanel #volume_slider,
  footer #AudioPanel #speed_slider {
    width: 50px;
  }

  footer #audio_play_buttons input:hover {
    background: none;
  }

  footer #audio-tab-mobile {
    text-align: center;
    background-color: var(--light-color);
    transition: all 0.5s ease-in-out;
  }

  footer #audio-tab-mobile.tablet-hidden {
    display: none;
  }

  footer #audio-label-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    column-gap: 7px;
    height: 32px;
  }

  footer #audio-label-mobile button {
    padding: 0;
    background: none;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 100%;
    color: var(--primary-color);
    transition: all 0.3s ease;
  }

  footer #audio-label-mobile button.open {
    transform: rotate(180deg);
  }

  footer #audio-label-mobile button.disabled {
    display: none;
  }

  footer #audio-label-mobile img {
    width: 32px;
    height: 32px;
  }

  footer #audio-label-mobile p {
    color: var(--primary-color);
    margin: 0;
  }

  footer #audio-tracks-mobile.tablet-hidden {
    display: none;
  }

  footer #audio-tracks-mobile nav {
    display: flex;
    width: 100%;
    margin-top: 10px;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  footer #audio-tracks-mobile button {
    font-size: 14px;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 7px 15px;
    background: none;
    border-radius: 32px;
    transition: all 0.3s ease;
  }

  footer #audio-tracks-mobile button.active {
    border: 1px solid var(--accent-color);
    color: var(--light-color);
    background-color: var(--accent-color);
  }

  footer {
    transform: translatey(100%);
  }
}

/*Mobile viewport only overwrite*/
@media (max-width: 767px) {
  h1 {
    font-size: 24px;
  }

  p {
    font-size: 14px;
  }

  .desktop {
    display: none;
  }

  .tablet-mobile {
    display: block;
  }

  .mobile {
    display: block !important;
  }

  .mobile-hide {
    display: none !important;
  }

  .main-header .upper > a {
    width: 50px;
  }

  .main-header .middle {
    padding: 0 15px;
  }

  .main-header .page-controls {
    gap: 5px;
  }

  .main-header .zoom {
    gap: 5px;
  }

  .main-header .lower {
    padding: 10px 15px;
    justify-content: center;
  }

  .main-header .lower nav {
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    flex-wrap: nowrap;
  }

  footer #AudioPanel {
    padding: 7px 15px;
  }

  footer #audio_player {
    column-gap: 7px;
  }

  footer #current_timing,
  footer #total_timing,
  footer #audio_tooltip {
    font-size: 12px;
    min-width: 37px;
    text-align: center;
  }

  .mobile-audio-controls {
    display: flex !important;
    justify-content: space-between;
    width: 100%;
  }

  footer #audio-tab-mobile.tablet-hidden {
    display: block;
  }

  #audio-label-mobile p {
    display: none;
  }

  footer #audio-volume-mobile {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  footer #volume-button-mobile {
    border: none !important;
    background: none;
    cursor: pointer;
    padding: 0 !important;
    height: 15px;
  }

  footer #volume-button-mobile.active {
    background: none !important;
  }

  footer #volume-button-mobile img {
    width: 20px;
    height: auto;
  }

  #volume-slider-mobile {
    width: 91px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: 1px solid var(--primary-color);
    cursor: pointer;
  }

  #volume-slider-mobile::-webkit-slider-runnable-track {
    background: transparent;
    height: 4px;
  }

  #volume-slider-mobile::-webkit-slider-thumb {
    -webkit-appearance: none;
    border: none;
    height: 16px;
    width: 5px;
    background: var(--primary-color);
    margin-top: -6px;
    cursor: grab;
  }

  #volume-slider-mobile::-moz-range-track {
    background: transparent;
    height: 4px;
  }

  #volume-slider-mobile::-moz-range-thumb {
    border: none;
    height: 16px;
    width: 5px;
    background: var(--primary-color);
    cursor: grab;
  }

  footer #audio-speed-mobile {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  footer #speed-display-mobile {
    background-color: var(--light-color);
    color: var(--primary-color);
    padding: 5px;
    border: 1px solid var(--primary-color);
    border-radius: 32px;
    font-size: 12px;
    width: 30px;
    text-align: center;
  }

  footer #speed-display-mobile:focus {
    outline: none;
    border-style: solid;
    border-color: inherit;
  }

  #speed-slider-mobile {
    width: 91px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: 1px solid var(--primary-color);
    cursor: pointer;
  }

  #speed-slider-mobile::-webkit-slider-runnable-track {
    background: transparent;
    height: 4px;
  }

  #speed-slider-mobile::-webkit-slider-thumb {
    -webkit-appearance: none;
    border: none;
    height: 16px;
    width: 5px;
    background: var(--primary-color);
    margin-top: -6px;
    cursor: grab;
  }

  #speed-slider-mobile::-moz-range-track {
    background: transparent;
    height: 4px;
  }

  #speed-slider-mobile::-moz-range-thumb {
    border: none;
    height: 16px;
    width: 5px;
    background: var(--primary-color);
    cursor: grab;
  }

  footer #audio-tracks-mobile {
    display: flex;
    column-gap: 15px;
    width: 100%;
    margin-top: 6px;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  footer #audio-tracks-mobile.tablet-hidden {
    display: block;
  }

  footer #audio-tracks-mobile nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    gap: 7px;
    max-height: 110px;
    overflow-y: scroll;
    flex-wrap: nowrap;
  }

  footer #audio-tracks-mobile nav.mobile-hidden {
    display: none;
  }

  footer #audio-tracks-mobile button {
    font-size: 14px;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 7px 15px;
    background: none;
    border-radius: 32px;
    transition: all 0.3s ease;
    width: fit-content;
  }
}
