body {
  margin: 0;
  overflow: hidden;
  /* Hide scrollbars */
  background-color: #f0f0f0;
  font-family: sans-serif;
}

canvas {
  display: block;
  /* Removes tiny margin at bottom of canvas */
}

#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  color: #333;
  pointer-events: none;
}

.logo-top-left {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  opacity: 0.5;
  margin: 10px;
}

.logo-top-left img {
  width: 100px;
  height: auto;
}

/* #region CSS RELATED TO WELCOME INFOBOX */
.infobox-container {
  text-align: center;
  position: fixed;
  z-index: 1013;
  top: 0px;
  left: 0;
  height: 100vh;
  height: -webkit-fill-available;
  width: 360px;
  border-radius: 0 30px 30px 0;
  background-color: white;
  padding: 20px;
  box-sizing: border-box;
  transition-property: left top;
  transition-duration: 200ms;
  transition-timing-function: linear;
  box-shadow: 0 1px 2px rgb(60 64 67 / 30%), 0 2px 6px 2px rgb(60 64 67 / 15%);
}

.welcome-infobox {
  overflow: auto;
  height: 100%;
  scrollbar-width: none;
}

@media (max-width: 1200px) {
  .infobox-container {
    width: 100%;
    height: 40vh;
    border-radius: 0 0 30px 30px;
  }
}

.hide-welcome {
  left: -360px;
}

@media (max-width: 1200px) {
  .hide-welcome {
    left: auto;
    top: -40vh;
  }
}

.expand-button {
  width: 25px;
  height: 50px;
  top: calc(50% - 25px);
  position: absolute;
  right: -26px;
  border-radius: 0 10px 10px 0;
  opacity: 0.7;
  border: 0;
  box-shadow: -2px 2px 2px rgb(60 64 67 / 30%);
  cursor: pointer;
  border-right: 1px solid #4a4242;
  background: #ffffff 7px/7px 10px no-repeat;
  padding: 0;
}

.expand-button:hover {
  opacity: .95;
}

@media (max-width: 1200px) {
  .expand-button {
    width: 50px;
    height: 25px;
    left: calc(50% - 25px);
    position: absolute;
    top: 40vh;
    border-radius: 0 0 10px 10px;
  }
}

.arrow-image {
  vertical-align: middle;
}

.mirror-image {
  transform: scaleX(-1);
}

@media (max-width: 1200px) {
  .arrow-image {
    rotate: 90deg;
  }
}

.logo {
  width: 260px;
  margin: 25px 0;
}

/* Needed for SEO. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.welcome-infobox-heading {
  text-align: center;
  font-size: 25px;
  margin: 5px;
  font-weight: bold;
  color: #4DC3FA;
}

.welcome-infobox-text {
  text-align: left;
}

.shortcuts-table {
  margin: 0 auto;
}

.shortcuts-table thead tr {
  background-color: lightgray;
}

.shortcuts-table td {
  padding: 3px 5px;
}

/* .shortcuts-table td:nth-child(2) {
  text-align: left;
} */

.keyboard-button {
  padding: 0.1rem 0.4rem;
  box-shadow: 0 0 #d9d9d9, 0 0px #d9d9d9, 0 1px #d9d9d9, 0 2px #d9d9d9, 0 3px #d9d9d9, 0 4px #d9d9d9, 0 5px #d9d9d9, 2px 2.5px 4px #adb5bd, 0 -1px 2.5px #adb5bd;
  color: #343a40;
  border: 1px solid #e6e6e6;
  border-radius: 0.25rem;
  display: inline-block;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.welcome-infobox-links {
  width: fit-content;
  margin: 10px auto;
  display: flex;
  align-items: center;
  border: 2px solid;
  border-radius: 5px;
  padding: 5px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  text-align: left;
}

.github-link {
  border-color: black;
}

.welcome-infobox-links:hover {
  border: 2px solid #919191;
}

.thumbnails {
  width: 25px;
  margin-right: 7px;
}

.welcome-infobox-subheading {
  margin-top: 15px;
  margin-bottom: 5px;
  font-size: 20px;
}

.welcome-infobox-dont-show {
  text-align: left;
}

.reference-videos-table {
  margin: 10px auto;
}

.reference-videos-table tr {
  border-bottom: 1px solid black;
  text-align: left;
}

.reference-videos-table td {
padding: 0 5px;
}

.reference-videos-table td:nth-child(1) {
    border-right: 1px solid black;
}

/* #endregion */

/* #region CSS RELATED TO PLAYBACK CONTROLS AND SETTINGS BUTTON */

/* Container for all playback controls */
#controls-container {
  position: absolute;
  bottom: 20px;
  right: 15px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 10;
}

/* Progress slider */
.progress-slider {
  width: 100%;
  height: 30px;
  accent-color: #0067db;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.progress-slider.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Aligns all the buttons horizontally */
.controls-row {
  display: flex;
  align-items: center;
  gap: 15px;
  /* Horizontal space between the buttons */
}

/* Play/Pause Button */
#play-pause-btn {
  width: 50px;
  height: 50px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background-color: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

#play-pause-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Pause symbol - two vertical bars */
#play-pause-btn.pause {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

/* Both bars of the pause symbol */
#play-pause-btn.pause::before,
#play-pause-btn.pause::after {
  content: '';
  width: 6px;
  height: 20px;
  background-color: #ffffff;
  border-radius: 1px;
}

/* Play symbol - arrow pointing right */
#play-pause-btn.play {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* The arrow ▷ of the play button */
#play-pause-btn.play::before {
  content: '';
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid #ffffff;
  margin-left: 4px;
}

/* Step Forward and Backward Buttons */
.step-btn {
  width: 40px;
  height: 40px;
  border: none;
  background-color: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
  display: flex;
  justify-content: center;
  align-items: center;
}

.step-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.step-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

/* The arrow ▷ of the step forward button */
#step-forward-btn::before {
  content: '';
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #ffffff;
  margin-left: 2px;
}

/* The vertical | bar of the step forward button */
#step-forward-btn::after {
  content: '';
  width: 3px;
  height: 12px;
  background-color: #ffffff;
  margin-left: 3px;
  border-radius: 1px;
}

/* The arrow ◁ of the step backward button */
#step-backward-btn::before {
  content: '';
  width: 3px;
  height: 12px;
  background-color: #ffffff;
  margin-right: 3px;
  border-radius: 1px;
}

/* The vertical bar | of the step backward button */
#step-backward-btn::after {
  content: '';
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 10px solid #ffffff;
  margin-right: 2px;
}

/* Settings Button */
#settings-btn {
  width: 40px;
  height: 40px;
  border: none;
  background-color: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ffffff;
}

#settings-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

/* #endregion */

/* #region CSS RELATED TO SETTINGS MENU */

#settings-menu {
  position: absolute;
  bottom: 85px;
  right: 25px;
  width: 90%;
  max-width: 340px;
  background-color: rgba(45, 45, 45, 0.95);
  border-radius: 16px;
  padding: 20px;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 1001;
  /* Make sure that the settings menu is above all other elements, including the viewport gizmo (z-index=1000) */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform-origin: bottom center;
  box-sizing: border-box;
  box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.2);
}

/* Center the settings menu on small screens and make it full width with some margin on the sides for better usability on mobile devices */
@media (max-width: 450px) {
  #settings-menu {
    left: 0;
    right: 0;
    margin: 0 auto;
  }
}

#settings-menu.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Setting Rows */
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
}

.setting-label {
  display: flex;
  align-items: center;
  gap: 20px;
}

.setting-label svg {
  color: white;
}

/* Toggles (iOS style switch) */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: .4s;
}

/* The thumb of the switch */
.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: .4s;
  box-sizing: border-box;
}

input:checked+.slider {
  background-color: #0067db;
}

input:checked+.slider:before {
  transform: translateX(22px);
  border: none;
}

.slider.round {
  border-radius: 26px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Speed Display Text */
.speed-display {
  text-align: center;
  font-size: 1.4rem;
}

/* Range Slider Elements */
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-btn {
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: white;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s;
}

.slider-btn:active {
  background-color: rgba(255, 255, 255, 0.4);
}

#speed-slider {
  flex-grow: 1;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  height: 20px;
  /* Provides a better touch zone */
}

#speed-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 2px;
}

#speed-slider::-webkit-slider-thumb {
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -7px;
}

#speed-slider::-moz-range-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 2px;
}

#speed-slider::-moz-range-thumb {
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  border: none;
}

/* Preset Buttons */
.preset-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
}

.speed-preset {
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 20px;
  padding: 10px 0;
  flex: 1;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.speed-preset:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.speed-preset.active {
  background-color: rgba(255, 255, 255, 0.4);
}

.speed-label-normal {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 2px;
}

/* #endregion */