:root {
  --vid-ratio: calc(1080 / 1920);

  --vid-widget-padding: 20px;
  --vid-widget-size: 35px;
  --vid-widget-internal-padding: 10px;
}

html,
body {
  max-width: 100vw;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

body {
  display: flex;
}

.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 255, 255, 0);
  border-top: 3px solid #fff;
  border-bottom: 3px solid #fff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: centered-spin 1.2s linear infinite;
  display: none;
}

@keyframes centered-spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/*TOP NAV BUTTONS*/
.back-nav {
  position: absolute;
  left: 1rem;
  top: 1rem;
  font-size: 1.8rem;
  transition: all 100ms linear;
  z-index: 10;
  color: #fffb;
}

.back-nav > a {
  color: white;
}

.text-nav {
  position: absolute;
  right: 1rem;
  top: 1rem;
  font-size: 1.8rem;
  opacity: 0.5;
  transition: all 100ms linear;
  z-index: 10;
  margin: 0.5rem;
  cursor: pointer;
}

.back-nav > a:hover,
.text-nav:hover {
  transform: scale(1.1);
  opacity: 1;
}

/*Surrounding geometry*/
main {
  display: flex;
  align-items: center;
  width: 100%;
  height: calc(var(--vh, 1vh) * 100);
  justify-content: space-between;
  flex-direction: column;
  overflow: auto;
  scroll-snap-type: y mandatory;
}

/* Page geometry */
.page-card {
  position: relative;
  width: min(100%, calc(calc(var(--vh, 1vh) * 100) * var(--vid-ratio)));
  min-height: min(calc(var(--vh, 1vh) * 100), calc(100vmin / var(--vid-ratio)));
  scroll-snap-align: center;
}

.page-card > div {
  position: inherit;
  border-radius: 12px;
  overflow: clip;
  background: #564e8c;
  background: linear-gradient(to top left, #01383e, #564e8c);
  width: calc(100% - calc(24px * var(--vid-ratio)));
  height: calc(100% - 24px);
  margin: 12px 12px;
  filter: drop-shadow(0 0 0.75rem var(--panel-col));
}

:not(.end-screen) > .end-of-vid-screen {
  display: none;
}

.end-of-vid-screen > p {
}

.end-of-vid-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: #090909cc;
}

.end-of-vid-screen > button {
  color: white;
  filter: drop-shadow(2px 2px 2px rgba(27, 37, 47, 0.8));
  padding: 0.6rem;
  box-sizing: border-box;
  width: 5rem;
  height: 5rem;
  border-radius: 1.2rem;
  border: none;
  background: #0009;
  font-weight: 400;
  font-size: 1rem;
  font-family: "Inria Sans", sans-serif;
}
.end-of-vid-screen > button:hover {
  background: #fff3;
}
.end-of-vid-screen > button > i {
  font-size: 2rem;
}

@media (max-width: 600px) {
  html,
  body {
    background-color: black;
  }

  .back-nav,
  .text-nav {
    color: white;
  }

  .page-card {
    min-height: calc(var(--vh, 1vh) * 100);
  }

  .page-card > div {
    min-height: calc(var(--vh, 1vh) * 100);
    background: black;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border-radius: 0;
    filter: none;
  }
}

video {
  display: block;
  width: 100%;
  height: 100%;
}

/*Start control panels*/

.navigation {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;
  justify-content: end;
  z-index: 3;
  transition: all 150ms linear;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}

.lesson-count {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  padding: 5px;
}

.lesson-count > span {
  display: block;
  background: #fff2;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  margin: 2px;
}

.lesson-count > span.active {
  background: #fff8;
}
.lesson-count > span.seen {
  background: #fff4;
}

.navigation > * {
  pointer-events: auto;
}

.timer-current {
  text-align: center;
  margin: 12px 0;
  filter: drop-shadow(1px 2px #0005);
  line-height: 1;
}
.timer-timer-btn {
  position: absolute;
  bottom: 100%;
  left: 0;
  display: flex;
  flex-direction: row;
  opacity: 0;
}

.navigation.active .progressbar-wrapper .timer-timer-btn {
  opacity: 0.9;
}

.lesson-header {
  position: absolute;
  left: 0;
  height: 4rem;
  top: 0;
  width: 100%;
  background: linear-gradient(#0006 0%, #0000 100%);
}

.navigation h1 {
  color: white;
  font-size: 1.2rem;
  font-weight: 400;
  text-align: center;
  margin: 0;
  opacity: 0;
}
.navigation.active h1 {
  opacity: 1;
}

.lesson-title-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
}

.lesson-title-mobile a {
  padding: 6px;
  width: 20px;
  height: 20px;
  text-align: center;
  border-radius: 25px;
}
.lesson-title-mobile a:hover {
  background: #fff3;
}

.progressbar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  padding: 0.5rem 0.5rem;
  position: relative;
  background: linear-gradient(#0000 0%, #0005 100%);
}

.pause-icon {
  color: white;
  font-size: 1rem;
  transition: 100ms opacity linear;
  filter: drop-shadow(0px 0px 5px rgba(0, 0, 0, 1));
  margin: 12px;
  line-height: 1;
}

.pause-icon:hover {
  background: #fff2;
}
.end-screen > .pause-icon {
  display: none;
}

.progressbar-wrapper-inner {
  align-items: center;
  display: flex;
  flex-grow: 1;
  position: relative;
  margin-left: 2px;
  overflow: hidden;
  height: 1.8rem;
  cursor: pointer;
  width: 100%;
}
.progress-bar-span {
  display: block;
  flex-grow: 1;
  position: relative;
  height: fit-content;
  width: 100%;
  background: #fff2;
  border-radius: 2px;
  height: 2px;
  overflow: hidden;
  transition: 100ms height linear;
}

.navigation.active .progressbar-wrapper .progress-bar-span,
.progressbar-wrapper-inner:hover > .progress-bar-span {
  height: 1.8rem;
  border-radius: 6px;
}

.slider-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: #fff8;
}

.loading-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: #fff5;
}

.progressbar {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; /* Override default CSS styles */
  appearance: none;
  width: 0px;
  height: 0px;
  background: #4caf50;
}

input[type="range"]::-moz-range-thumb {
  width: 0px;
  height: 0px;
  background: #4caf50;
}

input[type="range"]::-ms-thumb {
  width: 0px;
  height: 0px;
  background: #4caf50;
}

.video-controls summary {
  display: block;
  list-style: none;
}
.video-controls summary::-webkit-details-marker {
  display: none; /* Hides the arrow */
}

.video-controls details .open-summary {
  display: none;
}
.video-controls details .closed-summary {
  display: block;
}
.video-controls details[open] .open-summary {
  display: block;
}
.video-controls details[open] .closed-summary {
  display: none;
}

.video-controls {
  display: flex;
  width: calc(100%-2rem);
  align-items: end;
  /*! padding: 1rem; */
  padding-right: 0.5rem;
  flex-wrap: wrap;
  flex-direction: column;
  pointer-events: none;
}

.video-controls * {
  pointer-events: auto; /* This re-enables pointer events for child divs */
}

.video-controls p {
  color: inherit;
  margin: 0;
}

.video-controls button,
.video-controls summary,
.video-controls a {
  width: 3rem;
  height: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  border: none;
  background: #0003;
  border-radius: 0.8rem;
  margin: 0.5rem 0;
  cursor: pointer;
}

.video-controls details:not([open]) summary {
  height: 2rem;
  background: #0000;
}

.video-controls button:hover,
.video-controls details:not([open]) summary:hover,
.video-controls summary:hover,
.video-controls a:hover {
  background: #fff2;
}

/*END CARD*/
.end-of-chapter-screen > div {
  display: flex;
  align-content: center;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(to top left, #01383e, #564e8c);
  color: white;
}

.end-of-chapter-screen > div h2 {
  color: white;
  font-weight: 900;
}

.end-of-chapter-screen > div p {
  color: white;
  font-size: 1.2rem;
  text-align: center;
  margin: 0.5rem 5rem;
}

.end-of-chapter-screen > div > a {
  color: white;
  font-size: 1.2rem;
  text-align: center;
  margin: 0.5rem 5rem;
  text-decoration: none;
  padding: 1rem;
  border-radius: 1rem;
  border: white solid 3px;
}

.end-of-chapter-screen > div > a:hover {
  background: white;
  color: black;
}

/*Question overlay*/
.full-overlay-wrapper {
  display: none;
  z-index: 5;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #00000070;
  align-items: center;
  justify-content: center;
}

.full-overlay-wrapper.opened {
  display: flex;
}

.questions-overlay {
  position: relative;
  background: var(--bg-col);
  border-radius: 1rem;
  box-shadow: 0 0 1.5rem 1.5rem #0005;
  border: 1px solid var(--panel-outline);

  height: 70vh;
  min-height: 240px;
  max-height: 720px;
  width: 100%;
  min-width: 200px;
  max-width: 550px;

  display: flex;
  flex-flow: column;
}

.questions-overlay .close-questions {
  color: var(--text-col);
  position: absolute;
  top: 1rem;
  right: 0.7rem;
  width: 3rem;
  height: 3rem;
  border-radius: 1.5rem;
  border: 0;
  background: none;
  cursor: pointer;
}

.questions-overlay .close-questions:hover {
  background-color: var(--overlay-col);
}

.questions-section-header {
  margin: 1.5rem;
}

.questions-section-header h2 {
  font-size: 1.4rem;
  margin: 0;
}
.questions-section-header p {
  font-size: 1rem;
  margin: 0;
  font-weight: 300;
  opacity: 0.5;
}

.questions-overlay form {
  display: flex;
  margin: 0 1.5rem;
  border-radius: 0.8rem;
  transition: all 150ms linear;
}

.questions-overlay form:focus-within {
  background-color: var(--panel-col);
  margin: -0.8rem 0.7rem;
  padding: 0.8rem 0.8rem;
}

.questions-overlay input[type="text"] {
  background: none;
  outline: none;
  border: none;
  border-bottom: gray solid 1px;
  flex-grow: 1;
  font-size: 1rem;
  transition: all 150ms linear;
}

.questions-overlay form:focus-within input[type="text"] {
  border: none;
}

.questions-overlay form button {
  transition: all 150ms linear;
  opacity: 0;
  margin-left: 0.4em;
  font-size: 1rem;
  color: white;
  background-color: rgb(50, 100, 255);
  border: none;
  border-radius: 0.4rem;
  padding: 0.2rem 0.4rem;
}

.questions-overlay form button:hover {
  background: rgb(80, 140, 255);
}

.questions-overlay form:focus-within button {
  opacity: 1;
}

.qo-field {
  margin: 0.8rem 1.5rem 0 1.5rem;
  overflow: auto;
  height: fit-content;
  padding: 0;
  padding-top: 1.5rem;
}

.qo-field li {
  display: block;
  margin: 1rem 0;
  font-size: 1.1rem;
  border-radius: 8px;
  background: var(--panel-col);
}

.qo-field li p {
  margin: 0;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
}

.qo-field .qo-answer {
  font-weight: 300;
  position: relative;
}

.qo-field .qo-answer::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 1px;
  background: var(--text-col);
  top: 0;
  left: 0;
  opacity: 0.3;
}

.qo-field .qo-unanswered-q {
  border: 2px solid crimson;
  border-radius: 8px;
  background: #f002;
}

.qo-field .qo-unanswered-q > p {
  border-top: 1px solid crimson;
  padding: 0.2rem 0.4rem;
  margin: 0;
}

.qo-field .qo-unanswered-q summary {
  cursor: pointer;
  font-family: "Inria sans", sans-serif;
  padding: 0.4rem 0.7rem;
}

.desktop-sidebar {
  padding: 10px;
  display: flex;
  flex-direction: column;
  opacity: 0.4;
  transition: all 100ms linear;
  position: absolute;
}

.desktop-sidebar:hover {
  opacity: 1;
}

.desktop-sidebar > a {
  display: flex;
  justify-content: center;
  align-items: center;
  background: none;
  padding: 0.7rem 0;
  width: 100%;
  text-decoration: none;
  color: var(--text-col);
  text-align: center;
  border-radius: 3rem;
  margin: 0.5rem 0;
  transition: 150ms all ease-in-out;
}
.desktop-sidebar > a:hover {
  background: var(--panel-outline);
}
.desktop-sidebar > a > i {
  padding: 0 12px;
}

.sidebar-menu {
  margin: 0;
  padding: 0;
  display: none;
  list-style: none;
  flex-direction: column;
  overflow-y: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  /*! flex-grow: 1; */
  scrollbar-color: transparent transparent;
  padding-bottom: 20px;
  height: auto;
  /*! width: 250px; */
}
.sidebar-menu:hover {
  scrollbar-color: var(--text-col, #888) transparent;
}

.sidebar-menu > li {
  position: relative;
  padding: 0.7rem 0;
  padding-left: 2rem;
  transition: 150ms all ease-in-out;
  cursor: pointer;
  position: relative;
  border: 1px solid var(--panel-outline);
  margin: 0.2rem;
  border-radius: 0.5rem;
}
.sidebar-menu > li:hover {
  background: var(--overlay-col);
}

.sidebar-menu > li::before {
  content: "01";
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-col);
  opacity: 0.5;
}

.sidebar-menu > li:nth-child(2)::before {
  content: "02";
}

.sidebar-menu > li:nth-child(3)::before {
  content: "03";
}

.sidebar-menu > li:nth-child(4)::before {
  content: "04";
}

.sidebar-menu > li:nth-child(5)::before {
  content: "05";
}

.sidebar-menu > li:nth-child(6)::before {
  content: "06";
}

.sidebar-menu > li:nth-child(7)::before {
  content: "07";
}

.sidebar-menu > li:nth-child(8)::before {
  content: "08";
}

.sidebar-menu > li:nth-child(9)::before {
  content: "09";
}

.sidebar-menu > li:nth-child(10)::before {
  content: "10";
}

.sidebar-menu > li:nth-child(11)::before {
  content: "11";
}

.sidebar-menu > li:nth-child(12)::before {
  content: "12";
}

.sidebar-menu > li:nth-child(13)::before {
  content: "13";
}

.sidebar-menu > li:nth-child(14)::before {
  content: "14";
}

.sidebar-menu > li:nth-child(15)::before {
  content: "15";
}

.sidebar-menu > li:nth-child(16)::before {
  content: "16";
}

.left-nav > a:hover,
.left-nav > button:hover,
.left-nav > ul > li:hover {
  background: var(--panel-outline);
}

.left-nav > ul > li.active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 1.5rem;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent-col);
}

/*Check if the screen is wider than 600px and the aspect ratio is higher than 1:1*/

p.sidebar-menu {
  padding: 0;
  /*! width: 50px; */
  text-align: left;
}

@media (min-width: 790px) {
  .sidebar-menu {
    display: flex;
  }

  .desktop-sidebar {
    position: relative;
    min-width: 250px;
  }
}

.questions-toside {
  max-width: 370px;
  right: 0;
  left: auto;
  align-items: start;
}

.questions-toside .questions-overlay {
  border-right: none;
  border-top: none;
  border-bottom: none;
  border-radius: 0;
  height: 100%;
  max-height: 100vh;
}

.sidebars-absolute .questions-overlay-wrapper {
  position: absolute;
  right: 0;
  left: auto;
  width: 350px;
}
.desktop-sidebar {
  position: relative;
} 
.sidebars-absolute .desktop-sidebar {
  position: absolute;
} 

.sidebars-keep .questions-overlay-wrapper {
  position: relative;
  left: auto;
  width: 350px;
}

.sidebars-absolute .questions-overlay,
.sidebars-keep .questions-overlay,
.sidebars-right .questions-overlay,
.sidebars-right-mini .questions-overlay {
  height: 100%;
  max-height: none;
  border-radius: 0;
  width: 100%;
}