:root {
  --light-bg-color: #ffffff;
  --primary-color: #f0f0f0;
  --secondary-color: #a8a7a7;
  --font-color: #121212;
  --mono-font: "Fira Mono";
  --nav-height: 60px;

  /* Dark mode colors */
  --dark-bg-color: #121212;
  --dark-primary-color: #1e1e1e;
  --dark-secondary-color: #3a3a3a;
  --dark-font-color: #e0e0e0;

  --font-size: 16px;
}

body {
  background-color: var(--light-bg-color);
  color: var(--font-color);
  font-family: var(--mono-font), -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  margin: 0;
  font-size: var(--font-size);
  height: 100vh;
}

body.dark-mode {
  background-color: var(--dark-bg-color);
  color: var(--dark-font-color);
}

footer {
  background-color: var(--primary-color);
  text-align: center;
  font-size: 14px;
  color: var(--font-color);
  height: 40px;
  padding: 0 20px;
  position: relative;
  height: 50px;
  display: flex;
  justify-content: center;
}

.dark-mode footer {
  background-color: var(--dark-primary-color);
  color: var(--dark-font-color);
}

button {
  font-family: var(--mono-font);
}

nav.navbar {
  --height-unit: calc(var(--nav-height) / 3);
  background-color: var(--primary-color);
  position: sticky;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: var(--height-unit) 20px;
  height: var(--height-unit);
  width: calc(100% - 40px);
}

main {
  --padding: 20px;
  min-height: calc(100% - var(--nav-height) - 2 * var(--padding));
  padding: var(--padding) 0;
  margin-bottom: -50px;
}

nav button {
  background: none;
  border: none;
  font-family: var(--mono-font);
  font-size: 16px;
  cursor: pointer;
  color: var(--font-color);
}

footer span:nth-of-type(n)::before {
  content: " | ";
  padding: 0 8px;
}

footer span:nth-of-type(1)::before {
  content: none;
  padding: 0;
}

.dark-mode nav.navbar {
  background-color: var(--dark-primary-color);
}

.dark-mode nav button {
  color: var(--dark-font-color);
}

.site-name {
  text-decoration: none;
  font-family: var(--mono-font);
  font-weight: 700;
  color: var(--font-color);
}

.site-name#home-link {
  cursor: pointer;
}

.dark-mode .site-name {
  color: var(--dark-font-color);
}

.site-name .second {
  color: #ebb42a;
}

nav .site-name {
  font-size: 20px;
}

h1.site-name {
  font-size: 10vh;
}

section.site-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 5vh;
}

section.site-info h1 {
  margin-bottom: 2vh;
}

main.homepage {
  width: 100%;
  display: flex;
  justify-content: center;
}

main.homepage .homepage-container {
  width: 40%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3vh;
}

search.problem-search {
  display: flex;
  flex-direction: row;
  gap: 12px;
  width: 100%;
}

search.problem-search form.search-form {
  width: 100%;
}

search.problem-search input {
  flex-grow: 1;
  font-family: var(--mono-font);
  font-size: 16px;
  padding: 8px;
  border: 2px solid var(--secondary-color);
  border-radius: 4px;
  width: calc(100% - 90px);
}

search.problem-search button {
  font-size: 16px;
  padding: 8px 12px;
  border: 2px solid var(--secondary-color);
  background-color: var(--secondary-color);
  border-radius: 4px;
  cursor: pointer;
}

.dark-mode search.problem-search input {
  border: 2px solid var(--dark-secondary-color);
  background-color: var(--dark-primary-color);
  color: var(--dark-font-color);
}

.dark-mode search.problem-search button {
  border: 2px solid var(--dark-secondary-color);
  background-color: var(--dark-secondary-color);
  color: var(--dark-font-color);
}

main.homepage .view-solutions {
  font-size: 18px;
  padding: 10px 16px;
  border: 2px solid var(--secondary-color);
  background-color: var(--secondary-color);
  border-radius: 4px;
  cursor: pointer;
}

.dark-mode main.homepage .view-solutions {
  border: 2px solid var(--dark-secondary-color);
  background-color: var(--dark-secondary-color);
  color: var(--dark-font-color);
}

main.problem-page {
  width: 100%;
  display: flex;
  justify-content: center;
}

main.problem-page .problem-container {
  width: 60%;
}

.problem-container h2 {
  text-transform: capitalize;
}

.problem-container .solution-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 3vh 0 5vh 0;
}

.problem-container button.view-solutions {
  font-size: calc(var(--font-size) - 2px);
  padding: 10px 16px;
  border: 2px solid var(--secondary-color);
  background-color: var(--secondary-color);
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 5vh;
}

.problem-container .solution-container {
  margin: 1.5vh 0;
}

.solution-container summary {
  cursor: pointer;
}

main.problemset-page {
  width: 100%;
  display: flex;
  justify-content: center;
}

main.problemset-page .problemset {
  width: 60%;
}

.problemset .problem-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 3vh 0 5vh 0;
  align-items: center;
}

.problemset .problem-list .problem {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 8px;
  border: 1px solid var(--secondary-color);
  border-radius: 4px;
  width: 95%;
}

pre code.hljs {
  --code-size: var(--font-size) * 0.85;
  --code-gap: 5px;
  font-size: calc(--code-size);
  line-height: calc(var(--code-size) + var(--code-gap) * 2);
}
