@import url("./utils/css/scrollbar.css");
@import url("./utils/css/root.css");

body {
  font-family: Atkin;
  color: var(--text);
  background-color: var(--bg-dark);
}

.disabled {
  display: none !important;
}

svg {
  width: 1.5rem;
  height: 1.5rem;
}

.no-file-selected svg {
  --hw: min(60vw, 60vh);
  width: var(--hw);
  height: var(--hw);
  aspect-ratio: 1/1;
}

button {
  transition:
    background 0.1s ease-in-out,
    color 0.1s ease-in-out;
  -webkit-tap-highlight-color: transparent;
}

button:active {
  transform: scale(0.98);
  transition: transform 0.05s ease-in-out;
}

button:disabled {
  transform: none !important;
}

.svg-button {
  background-color: transparent;
  border: none;
  display: grid;
  place-content: center;
}

.svg-button:active {
  transform: scale(0.9);
}

button:not(.svg-button) {
  font-weight: bold;
  font-family: Inter;
}

nav {
  width: fit-content;
  max-width: 100vw;
  background-color: var(--bg);
  height: 100dvh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  font-family: Atkin;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  box-sizing: border-box;
}

body.nav-open nav {
  transform: translateX(0);
}

.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  margin: 1rem;
  border-radius: 100vw;
  background-color: var(--bg-light);
  padding: 1rem;
}

.add-setting-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.nav-collapse {
  transform: rotate(-90deg);
}

.nav-collapse:active {
  transform: rotate(-90deg) scale(0.9);
}

.nav-header .text {
  font-size: 1.25rem;
  font-weight: bold;
  text-transform: uppercase;
  cursor: default;
}

.about-link {
  font-size: 1.125rem;
  font-weight: bold;
  padding-inline: 0.55rem;
  color: var(--text);
  text-transform: uppercase;
  font-size: 1rem;
  color: var(--primary);
  transition: color 0.1s ease-in-out;
}

.about-link:hover {
  color: var(--secondary);
}

main {
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-block: 1rem;
  position: relative;
  box-sizing: border-box;
}

.directory-display {
  padding-inline: 1.25rem;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--text);
  background-color: var(--bg-dark);

  text-align: right;
  display: flex;
  justify-content: space-between;
  overflow: hidden;
  flex-shrink: 0;
  gap: 2rem;
  z-index: 1;
}

.directory-display span {
  white-space: nowrap;
}

.directory-display .title {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  font-family: Atkin;
}

.directory-display .path {
  font-family: Cou;
  direction: rtl;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.file-content {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-inline: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-content .file-view {
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.no-file-content {
  width: 100%;
  height: 95%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  max-width: 80ch;
  gap: 1rem;
  margin-inline: auto;
}

.no-file-content-info {
  align-self: flex-start;
}

pre {
  overflow-x: auto;
}

.json-instruction {
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.content-textarea {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
}

.code-block {
  position: relative;
  background-color: var(--bg);
  padding: 2.25rem 1rem 1rem 1rem;
  border-radius: 0.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 1rem;
  overflow-y: auto;
  width: 100%;
}

.code-block h2 {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.code-block p {
  line-height: 1.5;
}

.code-block ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.code-block li {
  margin-bottom: 0.5rem;
}

.code-block hr {
  border: none;
  border-top: 1px solid var(--border);
  margin-block: 1rem;
}

.code-block code {
  background-color: var(--bg-light);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-family: Cou;
}

.copy-container {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.copy-button {
  transition: transform 0.1s ease-in-out;
}

.copy-button:active {
  transform: scale(0.8);
}

.json-example {
  font-family: Cou, monospace;
  color: var(--primary);
}

.ph-warn {
  color: var(--danger);
}

.filetree {
  --height-width: 1.25rem;
  --gap: 0.5rem;
  flex-grow: 1;
  overflow: auto;
  font-family: Inter;
}

.filetree svg {
  height: var(--height-width);
  width: var(--height-width);
  flex-shrink: 0;
}

button.three-dot-button {
  margin-left: 1rem;
  margin-right: var(--gap);
}

.dir {
  min-width: 100%;
}

.current-dir,
.file-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.25rem;
  padding-inline: 0.5rem;
  margin: 0.5rem 0.25rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease-in-out;
}

.file-folder-info {
  display: flex;
  align-items: center;
  gap: var(--gap);
  user-select: none;
}

.file-container {
  padding-left: calc(var(--height-width) + var(--gap));
}

.current-dir .file-folder-name,
.file-container .file-folder-name {
  white-space: nowrap;
}

.current-dir .file-folder-name {
  font-size: 1rem;
  margin-left: 0.2rem;
}

.current-dir.highlighted,
.file-container.highlighted {
  background-color: var(--highlight);
}

.child-dir {
  padding-left: 0.75rem;
}

.child-dir.collapsed {
  display: none;
}

.exp-icon {
  transition: transform 0.2s ease-in-out;
}

.exp-icon.collapsed {
  transform: rotate(90deg);
}

.three-dot-button {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

.current-dir.highlighted .three-dot-button,
.file-container.highlighted .three-dot-button {
  opacity: 1;
  pointer-events: auto;
}

.nav-backdrop.disabled {
  display: none;
}

.nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 98;
  box-sizing: border-box;
}

.popup-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  min-height: 100dvh;
  background-color: rgba(0, 0, 0, 0.1);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 100;
  box-sizing: border-box;
}

.popup-menu {
  position: absolute;
  background-color: var(--bg);
  border-radius: 0.75rem;
  z-index: 101;
  display: none;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 14ch;
}

.popup-menu.visible {
  display: block;
}

.popup-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.popup-menu li {
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text);
  font-family: Inter;
}

.popup-menu li:hover {
  background-color: var(--highlight);
}

.popup-menu .delete-item:not(:only-child) {
  color: var(--danger);
  border-top: 1px solid var(--border);
}

.creation-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
  background-color: var(--bg);
  padding: 2rem;
  border-radius: 0.75rem;
  z-index: 101;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow);
  width: min(35ch, 70vw);
  transition: all 0.2s ease-in-out;
  font-family: Inter;
}

.creation-popup input {
  background-color: var(--bg-light);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem;
  border-radius: 0.25rem;
  font-family: Inter;
}

.creation-popup .button-container {
  justify-content: flex-end;
  gap: 1rem;
}

.delete-confirmation-popup.creation-popup .button-container {
  justify-content: center;
}

.button-container {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.action-container {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
  margin-top: 0.5rem;
}

.input-action-container {
  width: 100%;
}

.button-container button {
  background-color: var(--bg-light);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  cursor: pointer;
}

.error-container {
  color: var(--danger);
  height: 1rem;
}

.file-folder-icon.active {
  --icon-fill: var(--text);
}

.no-file-selected {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100%;
  gap: 3rem;
}

.no-file-selected span {
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: bold;
}

.question-container {
  font-family: Atkin;
  line-height: 2.5ch;
  margin-block: 2rem;
}

.question-container p {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.answers-container {
  margin-left: 2rem;
}

.answer-wrapper {
  margin-bottom: 0.5rem;
}

.test-pagination-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
}

.pagination-controls {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.filter-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background-color: var(--bg);
  color: var(--text);
}

.pagination-display {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
}

.page-numbers {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  flex-grow: 1;
}

.page-number {
  border: none;
  padding: 0.5rem;
  border-radius: 0.25rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-content: center;
  background-color: transparent;
  color: var(--text);
}

.page-number.active {
  background-color: var(--primary);
  color: var(--bg-light);
}

.page-number.correct-page {
  background-color: transparent;
  color: var(--success);
}

.page-number.incorrect-page {
  background-color: transparent;
  color: var(--danger);
}

.page-arrow {
  border-radius: 0.25rem;
}

.page-arrow:disabled {
  cursor: default;
  opacity: 0.4;
}

.score-reset-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: min(75ch, 90vw);
  margin-top: 1rem;
  padding: 1rem;
  background-color: var(--bg);
  border-radius: 1.25rem;
}

.total-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--primary);
}

.total-score span {
  font-size: 2rem;
  text-transform: uppercase;
}

.total-score .score-text {
  color: var(--text);
  font-family: Atkin;
}

.test-nav-content {
  width: min(75ch, 90vw);
  background-color: var(--bg);
  border-radius: 1.25rem;
  padding: 1rem;
  margin: 0 auto;
}

.filter-test-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.test-navigation {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.prev-btn,
.next-btn,
.reset-btn {
  padding: 0.75em 2.25em;
  border-radius: 0.5rem;
  display: grid;
  place-content: center;
  background-color: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  display: grid;
  place-content: center;
}

.prev-btn:disabled,
.next-btn:disabled,
.reset-btn:disabled {
  background-color: transparent;
  cursor: default;
  opacity: 0.4;
}

.reset-btn {
  color: var(--danger);
}

.explanation-text {
  margin-top: 1rem;
  padding: 1rem;
  background-color: var(--bg-light);
  border-radius: 1.5rem;
  font-family: Cou;
  color: var(--info);
  text-align: justify;
  line-height: 3ch;
}

.filter-popup {
  position: absolute;
  background-color: var(--bg);
  border-radius: 0.75rem;
  z-index: 100;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 0.25rem;
}

.filter-popup ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.filter-popup li {
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text);
  font-family: Inter;
}

.filter-popup li.selected {
  background-color: var(--primary);
  color: var(--bg-light);
}

.config-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--bg);
  padding: 2rem;
  border-radius: 0.75rem;
  z-index: 101;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow);
  font-family: Inter;
}

.config-label {
  font-weight: bold;
}

.config-label.save-load {
  margin-top: 1rem;
}

.close-popup-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.config-popup {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(22rem, 90vw);
}

.theme-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-left: 0.5rem;
  margin-bottom: 1rem;
}

.theme-option input[type="radio"]:checked {
  background-color: var(--primary);
  outline: 0.1rem solid var(--primary);
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.config-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-left: 0.5rem;
}

.config-buttons button {
  flex-grow: 1;
  padding: 0.5rem;
  background-color: var(--bg-light);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 0.5rem;
  cursor: pointer;
}

input[type="radio"] {
  --hw: 1rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: var(--hw);
  height: var(--hw);
  border: 1px solid var(--bg-dark);
  outline: 0.1rem solid var(--text);
  background: var(--bg-dark);
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.correct-answer input[type="radio"]:checked {
  background-color: var(--success);
  outline-color: var(--success);
  outline: 0.2rem solid var(--success);
}

.wrong-answer input[type="radio"]:checked {
  background-color: var(--danger);
  outline: 0.2rem solid var(--danger);
}

.was-correct input[type="radio"] {
  outline: 0.2rem solid var(--success);
}

.answers-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.answer-wrapper {
  display: flex;
  align-items: center;
  width: fit-content;
}

.answer-wrapper label {
  font-size: 1rem;
  padding-left: 1rem;
}

.question-text-container {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.question-number {
  margin-right: 8px;
}

.question-text {
  flex-grow: 1;
}

.question-display p {
  margin-top: 2rem;
  padding: 0.5rem;
  border-radius: 0.75rem;
  background-color: var(--bg-light);
  color: var(--warning);
  width: fit-content;
}

.custom-popup-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 101;
}

.custom-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--bg);
  padding: 2rem;
  border-radius: 0.75rem;
  z-index: 102;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow);
  width: min(50ch, 90vw);
}

.custom-popup p {
  text-align: center;
  font-family: Inter;
  line-height: 2.5ch;
}

.custom-popup .button-container {
  gap: 1rem;
}

.warning-text {
  color: var(--warning);
  text-align: justify;
}

.creation-popup p,
.custom-popup p {
  text-wrap: auto;
}

.button-container .danger-button {
  color: var(--danger);
}

.text-center {
  text-align: center;
}

.loading-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: grid;
  place-content: center;
  z-index: 102;
}

.loading-text {
  color: white;
  font-size: 2rem;
  font-family: Atkin;
}

@media (hover: none) {
  button:not(.svg-button):active {
    background-color: var(--highlight);
    color: var(--text);
  }

  .current-dir:active,
  .file-container:active {
    background-color: var(--highlight);
  }

  .popup-menu li:active {
    background-color: var(--bg-light);
  }

  .page-number.active:active {
    background-color: var(--primary);
    color: var(--bg-light);
  }

  .filter-popup li:active {
    background-color: var(--highlight);
  }

  .page-arrow:active svg {
    stroke: var(--primary);
  }
}

@media (hover: hover) {
  button:not(.svg-button):hover {
    background-color: var(--highlight);
    color: var(--text);
  }

  button:disabled:hover {
    background-color: transparent;
  }

  .page-arrow:hover {
    background-color: var(--highlight);
  }

  .page-arrow:hover svg {
    stroke: var(--primary);
  }

  .current-dir:hover,
  .file-container:hover {
    background-color: var(--highlight);
  }

  .popup-menu li:hover {
    background-color: var(--highlight);
  }

  .page-number.active:hover {
    background-color: var(--primary);
    color: var(--bg-light);
  }

  .filter-popup li:hover {
    background-color: var(--highlight);
  }

  .answer-wrapper label:hover {
    cursor: pointer;
  }

  .current-dir .file-folder-name:hover,
  .file-container .file-folder-name:hover {
    cursor: default;
  }

  .current-dir:hover .three-dot-button,
  .file-container:hover .three-dot-button {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 720px) {
  nav {
    width: 100vw;
  }

  .three-dot-button {
    opacity: 1;
    pointer-events: auto;
  }

  .total-score span {
    font-size: 1.5rem;
  }

  .prev-btn,
  .next-btn,
  .reset-btn,
  .filter-button {
    font-size: 0.8rem;
    padding: 0.5em 1.5em;
  }

  .score-reset-container {
    margin-top: 3rem;
  }

  .no-file-content {
    margin-top: 2rem;
    justify-content: flex-start;
    align-items: center;
  }
}

.text-center {
  text-align: center;
}

.copy-feedback {
  color: var(--primary);
}

.dragging {
  opacity: 0.5;
}

.drag-over {
  background-color: var(--highlight);
}
