@import url("https://fonts.cdnfonts.com/css/latin-modern-sans");
@import url("header.css");
@font-face {
  font-family: HYWenHei;
  src: url(zhcn.ttf);
}
@font-face {
  font-family: KurierCondHeavy;
  src: url(KurierCondHeavy-Regular.otf);
}

:root {
  interpolate-size: allow-keywords;

  --text-color: #000;
  --bg-color: #fff;
  --first-color: #69b7d9;
  --second-color: #ffc410;
  --third-color: #013880;
  --sidebar-text-1: #fffefc;
  --sidebar-text-2: #292929;

  --submenu-color: #01224d;
  --contoh-color: #2e1657;
  --latihan-color: darkslategray;
  --submit-bg: rgba(0, 0, 0, 0.2);
}

.dark-mode {
  --text-color: #dbdbdb;
  --bg-color: #292929;

  --contoh-color: #6e50a1;
  --latihan-color: seagreen;
  --submit-bg: rgba(255, 255, 255, 0.2);
}

@view-transition {
  navigation: auto;
}

::-webkit-scrollbar {
  width: 0px;
}

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

.katex {
  font-size: 25px !important;
}

b,
strong {
  -webkit-text-fill-color: var(--second-color);
  -webkit-text-stroke-width: 0.5px;
  -webkit-text-stroke-color: red;
}

* {
  margin: 0;
  padding: 0;
}

html {
  line-height: 1.5rem;
  text-align: justify;
  font-size: 25px;
}

body {
  font-family: "LMSansDemiCond10", sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: grid;
  grid-template-columns: auto 1fr;
}

#menu > li > ol > div > li::marker {
  content: counters(list-item, ".") " ";
}
#menu > li > ol > div > li {
  margin-left: 25px;
}

#menu > li:nth-child(8) > ol > div > li::marker {
  content: "A." counter(list-item);
}

#menu > li:nth-child(9) > ol > div > li::marker {
  content: "B." counter(list-item);
}

main {
  padding: min(35px, 8%);
}

main p {
  margin-top: 5px;
  margin-bottom: 15px;
}

.sidebar {
  color: #000;
  box-sizing: border-box;
  font-family: HYWenHei;
  height: 100vh;
  width: fit-content;
  background-color: var(--third-color);
  border-right: var(--second-color) 2px solid;
  color: var(--sidebar-text-1);
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow: hidden;
  text-wrap: nowrap;
  transition: 0.5s linear;
  overflow-y: auto;
  z-index: 10;
  anchor-name: --open-close;
}

.logo {
  padding: 1em;
  font-size: 1.2em;
}

#sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar.hidden-nav {
  width: 0px;
  #toggle-btn svg {
    transform: rotate(180deg);
  }
  #toggle-btn {
    left: 0;
  }
}

.sidebar a,
.sidebar .dropdown-btn {
  padding: 0.3em;
  text-decoration: none;
  color: black;
  display: flex;
  align-items: center;
  gap: 0.3em;
  color: var(--sidebar-text-1);
}

.dropdown-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

.sidebar a span,
.sidebar .dropdown-btn span {
  flex-grow: 1;
}

.sidebar .active > a:hover {
  .link-text {
    color: var(--sidebar-text-2);
  }
  background-color: var(--second-color);
}

.active {
  border-top: 2px solid;
  border-bottom: 2px solid;
  border-color: var(--second-color);
}

.sidebar a:has(.dropdown-btn) {
  background-color: var(--third-color);
  border-radius: 0;
}

.sub-menu {
  font-size: 12px;
  background-color: var(--submenu-color);
  color: var(--sidebar-text-1);
  a {
    color: var(--sidebar-text-1);
  }
  div li:hover {
    color: var(--second-color);
  }
  div a:hover {
    color: var(--second-color);
  }
}

.sub-menu li:hover {
  color: var(--bg-color);
}

.sidebar .sub-menu {
  display: grid;
  grid-template-rows: 0fr;
  transition: 0.3s ease-in-out;

  > div {
    overflow: hidden;
  }
}

.sidebar .sub-menu.show {
  grid-template-rows: 1fr;
}

.progress-container {
  position: fixed;
  z-index: 1;
  right: 0;
  bottom: 0;
  height: 94.5%;
  width: 8px;
  background: #ccc;
}

.progress-bar {
  width: 8px;
  background: var(--second-color);
  height: 0%;
}

.progress-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--scroll-progress, 0%);
  background: var(--second-color);
  filter: blur(10px);
}

#toggle-btn {
  position: fixed;
  position-anchor: --open-close;
  position-area: inline-end;
  width: 30px;
  height: 100px;
  background: none;
  border: none;
  cursor: pointer;
  align-items: center;
  transition: 0.5s ease-in-out;
  background-color: var(--second-color);
  clip-path: polygon(0 0, 100% 20%, 100% 80%, 0 100%);
}

#toggle-btn-inner {
  background-color: var(--third-color);
  display: flex;
  align-items: center;
  width: 28px;
  height: 96px;
  position: absolute;
  top: 2px;
  left: 0px;
  svg {
    transition: rotate 0.5s linear;
    fill: var(--sidebar-text-1);
  }
  clip-path: polygon(0 2px, 100% 20%, 100% 80%, 0 94px);
}

#toggle-btn:hover {
  svg {
    fill: var(--second-color);
    transform: scale(1.2);
  }
}

.judul-bab-container::after {
  content: "";
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text-color);
}

.judul-bab-container {
  margin-bottom: 0.3em;
}

.judul-bab {
  font-family: KurierCondHeavy;
}

.no-subbab {
  background-color: var(--text-color);
  color: var(--bg-color);
  padding: 0.3em;
  font-size: 2em;
  font-family: KurierCondHeavy;
  display: inline-block;
}

.dfn-box {
  margin-top: 2.75em;
  margin-bottom: 1.5em;
  border: 2px solid var(--text-color);
  background-color: var(--bg-color);
  padding: 10px;
  border-radius: 10px;
  color: var(--text-color);
}

.dfn-header {
  background-color: var(--text-color);
  color: white;
  font-weight: bold;
  font-size: larger;
  padding: 4px 10px;
  border: 2px solid var(--text-color);
  border-radius: 5px;
  margin-top: -1.75em;
  margin-left: -0.25em;
  margin-bottom: 0.25em;
  display: table;
  padding: 0.25em;
}

.dfn-content {
  line-height: 1.6;
  color: black;
}

.definisi {
  background-color: #cee9fd;
  border-color: #7c96aa;
  .dfn-header {
    background-color: #51abf0;
    border-color: #0630bc96;
  }
}

.teorema {
  background-color: #fddecb;
  border-color: #5f4c41;
  .dfn-header {
    background-color: #fa7d35;
    border-color: #c07f00;
  }
}

.contoh {
  border-radius: 0px;
  border-top: 0px;
  border-right: 0px;
  border-color: var(--contoh-color);
  .dfn-header {
    background-color: var(--contoh-color);
    border-color: var(--contoh-color);
    border-radius: 0px;
    margin-left: -0.5em;
  }
  .dfn-content {
    color: var(--text-color);
  }
}

details {
  max-height: fit-content;
  color: black;
}

details::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.5s linear;
  content-visibility: visible;
  transition-behavior: allow-discrete;
}

details.solution::details-content {
  color: black;
  background-color: #ddd;
  border: none;
  padding: 1rem;
  padding-block: 0;
  box-shadow: 3px 3px 4px 0px var(--text-color);
}

details[open]::details-content {
  block-size: auto;
}

summary {
  cursor: pointer;
  width: fit-content;
  &::marker {
    content: "";
  }
  &::before {
    content: "";
    background: url(../images/plus_times.svg);
    background-size: cover;
    width: 0.8rem;
    aspect-ratio: 1;
    display: inline-block;
    transform: rotate(90deg);
    transition: transform 0.3s ease;
    transform-origin: 50% 50%;
    margin-right: 0.5rem;
  }
  [open] &::before {
    transform: rotate(225deg);
  }
}

.solution-step {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* .proof{
  color: black;
  margin-top: 10px;
} */

.solution {
  margin-top: 1rem;
  summary {
    padding: 2px 6px;
    background-color: #ddd;
    border: none;
    box-shadow: 3px 3px 4px var(--text-color);
    font-weight: bold;

    &:hover {
      background-color: #ccc;
    }
  }
}

.itemaze {
  padding-left: 28px;
  li {
    margin-bottom: 10px;
  }
}

.alpha {
  list-style-type: none;
  li:before {
    margin-left: -21px;
    content: "(" counter(list-item, lower-alpha) ") ";
  }
}

.roman {
  list-style-type: none;
  li:before {
    margin-left: -21px;
    content: "(" counter(list-item, lower-roman) ") ";
  }
}

.latihan {
  border-color: var(--latihan-color);
  border-width: 5px;
  .dfn-header {
    margin-left: 1.5em;
    font-style: italic;
    font-size: xx-large;
    margin-top: -1.2em;
    background-color: var(--bg-color);
    border: none;
    border-radius: 0px;
    color: var(--text-color);
  }
}

.latihan-box {
  margin: 1rem;
  background-color: lightyellow;
  padding: 10px;
  border: 2px solid var(--text-color);
  border-top: 0px;
  border-left: 0px;
  border-radius: 1rem;
}

.evaluation-label {
  background: linear-gradient(
    160deg,
    #a54e07,
    #b47e11,
    #fef1a2,
    #bc881b,
    #a54e07
  );
  width: fit-content;
  padding: 0.5em;
  padding-right: 2.7rem;
  padding-left: 1.8rem;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(110, 80, 20, 0.4),
    inset 0 -2px 5px 1px rgba(139, 66, 8, 1),
    inset 0 -1px 1px 3px rgba(250, 227, 133, 1);
  clip-path: polygon(0 50%, 15% 0, 100% 0, 80% 50%, 100% 100%, 15% 100%);
}

#submitAnswer {
  margin: 1rem;
  background-color: var(--second-color);
  color: black;
  font-weight: bold;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 4px 4px 0px var(--bg-color), 6px 6px 0px var(--submit-bg);
  transition: all 0.2s ease-in-out;
  margin-top: 1em;
  margin-right: 0;
}

#submitAnswer:hover {
  box-shadow: 2px 2px 0px var(--bg-color), 4px 4px 0px rgba(0, 0, 0, 0.3);
  transform: translateY(2px);
}

#submitAnswer:active {
  box-shadow: 0px 0px 0px var(--bg-color), 2px 2px 0px rgba(0, 0, 0, 0.4);
  transform: translateY(4px);
}

math-field {
  background-color: rgba(240, 240, 151, 0.5);
  border: 2px solid var(--second-color);
  min-width: 5rem;
  min-height: 3.4rem;
  align-content: center;
  anchor-name: var(--math-field);
  .ML__virtual-keyboard-toggle,
  .ML__menu-toggle {
    min-width: 0px !important;
    justify-content: end;
    width: auto !important;
  }
}

.answer-container {
  max-width: fit-content;
  anchor-name: var(--hint);
}

.soal-latihan {
  padding-top: 5px;
  padding-bottom: 5px;
}

.hint {
  border: 2px solid var(--second-color);
  margin-left: -0.1em;
  float: right;
}

.hint-content {
  background-color: rgba(240, 240, 151);
  border: none;
  border-radius: 10px;
  border-left: 5px solid var(--second-color);
  padding: 10px;
  position-anchor: var(--hint);
  position-area: right;
  transform: translateY(calc(50%));
}

.hint-button {
  background-color: rgba(240, 240, 151, 0.5);
  height: 68px;
  border: none;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  /* svg path {
    transition: ease-in 0.5s;
  } */
}

.hint-button:hover {
  .path_1 {
    fill: var(--second-color) !important;
  }
  .path_2 {
    fill: cyan !important;
  }
  .path_3 {
    fill: gray !important;
  }
}

.hidden {
  display: none !important;
}

#loading {
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 1em;
  vertical-align: middle;
  display: inline-block;
}

.jawaban-latihan {
  margin-left: -0.5em;
  padding: 5px 10px;
  display: block;
  margin: 0 auto;
  text-align: center;
  summary {
    transition: ease-in-out 0.5s;
    &::before {
      content: none;
    }
    background-color: #e9d700;
    border-radius: 0.5rem;
    padding-top: 0.5em;
    padding-bottom: 0.5em;
    margin-top: 1em;
    display: inline-block;
    width: 100%;
    box-shadow: 3px 0px 3px 2px #5c5049;
  }
  .solution-step {
    text-align: left;
  }
}

.jawaban-latihan[open] summary {
  border-bottom-right-radius: 0rem;
  border-bottom-left-radius: 0rem;
}

details.jawaban-latihan::details-content {
  background-color: #fff6a3;
  border-bottom-right-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
  padding: 1rem;
  padding-block: 0;
  box-shadow: 3px 3px 4px 0px #5c5049;
}

.tutup-style {
  color: red;
  background-color: #a98600;
  font-size: 0.8em;
  transition: color 0.5s ease, font-size 0.5s ease;
}

.illust {
  display: block;
  margin-left: auto;
  margin-right: auto;
  padding-top: 2rem;
  padding-bottom: 2rem;
  width: max(25%, 300px);
}

.illust-outer {
  width: max(30%, 400px);
  background-color: white;
  padding: 10px;
}

.illust-table {
  background: var(--sidebar-text-1);
  display: block;
  padding-top: 2rem;
  padding-bottom: 2rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.illust-table-4 {
  background: var(--sidebar-text-1);
  display: block;
  padding-top: 1rem;
  padding-bottom: 1rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

dialog {
  --timing: 0.5s;
  transition: all var(--timing) ease, display var(--timing) ease allow-discrete;
  opacity: 0;
  width: 70%;
  overflow: visible;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);

  &[open] {
    opacity: 1;
  }
}

::backdrop {
  background-color: rgba(255, 255, 255, 0.301);
}

main.content {
  z-index: 0;
  margin-top: 30px;
  overflow: auto;
}

table {
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  left: 50%;
  margin-top: 1rem;
  margin-bottom: 1rem;
}
table,
th,
td {
  border: 1px solid var(--text-color);
}
th,
td {
  padding: 10px;
  text-align: center;
}

td img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.grid-container {
  width: 100%;
  border: 1px solid var(--text-color);
  justify-content: center;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-card {
  display: block;
  width: auto;
  border: 1px solid var(--text-color);
  padding: 10px;
  margin: 2px;
  img {
    width: 90%;
  }
  b {
    display: block;
    text-align: center;
  }
}

.option input[type="radio"] {
  border: 0 !important;
  clip: rect(1px 1px 1px 1x);
  height: 1px;
  overflow: hidden;
  padding: 0 !important;
  position: absolute !important;
  width: 1px !important;
}

.option input[type="checkbox"] {
  border: 0 !important;
  clip: rect(1px 1px 1px 1x);
  height: 1px;
  overflow: hidden;
  padding: 0 !important;
  position: absolute !important;
  width: 1px !important;
}

.option {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.option:hover {
  &::before {
    border-width: 2px;
  }
}

label.option::before {
  margin-right: 0.5em;
  background-color: var(--second-color);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.25em;
  width: 1.25em;
  border: solid 1px var(--sidebar-text-2);
  transition: border ease-in 150ms;
}

.radio-option::before {
  content: var(--choice);
  font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
}
.check-option::before {
  display: block;
  content: "";
  background-image: url(../images/check.svg);
  background-size: 1.25em 1.25em;
  background-repeat: no-repeat;
}

label.option:has(input[type="radio"]:checked) {
  &::before {
    color: var(--second-color);
    background-color: var(--sidebar-text-2);
    border-color: var(--second-color);
  }
}
label.option:has(input[type="checkbox"]:checked) {
  &::before {
    color: var(--second-color);
    background-color: var(--sidebar-text-2);
    border-color: var(--second-color);
  }
}

.multiple-choice {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5em;
}

header {
  z-index: 2;
  padding: 10px 21px;
  justify-content: right;
  background-color: var(--third-color);
}

header .navbar ul li a {
  color: var(--sidebar-text-1);
}

header .navbar ul li a:hover {
  color: var(--second-color);
}

.navbar ul li a::after {
  background-color: var(--second-color);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes sweep {
  from {
    opacity: 0;
    transform: translateY(100px);
  }
  to {
    opacity: 1;
    transform: translateY(0px);
  }
}

@media (max-width: 768px) {
  html {
    font-size: 16px;
  }
  header .fa-bars {
    font-size: larger;
    color: var(--sidebar-text-1);
    margin-left: 15px;
  }
  .progress-container {
    height: 96%;
  }
  .katex {
    font-size: 16px !important;
  }
}
