.container {
  display: flex;
  height: 100vh;
}

.sidebar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  color: var(--font);
  backdrop-filter: blur(4px);
  background-color: #ffffff04;
  border-right: 2px solid #ffffff11;
  z-index: 1;
}

.sidebar a {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  padding-inline: 3rem;
  padding-block: 1rem;
  color: var(--font);
  text-decoration: none;
  transition: background-color 0.1s ease-in-out;
}

.nav-short {
  display: none;
}

.sidebar a.nav-home {
  background-color: #ffffff11;
}

.sidebar a.active {
  background-color: var(--accent);
}

.sidebar a:not(.active):hover {
  background-color: #ffffff22;
}

.app-content {
  position: absolute;
  left: 15rem;
  right: 0;
  bottom: 0;
  top: 0;
  text-align: left;
}

/* contest rules */

.contest-rules {
  padding-right: 30%;
  padding-bottom: 10rem;
  height: 100vh;
  overflow: auto;
}

.contest-rules h2 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid #ffffff22;
}

.contest-rules p,
ul,
li {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.contest-rules ul {
  padding-left: 1.5rem;
}

/* app-content */
h2.first {
  margin-top: 3.25rem;
}

h2 {
  font-size: 2.5rem;
}

h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
}

.difficulty {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #ffffff44;
  font-size: 1rem;
  font-weight: 700;
  background-color: #ffffff22;
  color: var(--text);
  margin-bottom: 1rem;
}

.difficulty.easy {
  background-color: #5dff3444;
  border-color: #5dff3488;
}
.difficulty.medium {
  background-color: #ffa20044;
  border-color: #ffa20088;
}
.difficulty.hard {
  background-color: #ff343444;
  border-color: #ff343488;
}
.input-area,
.output-area {
  /* size */
  display: block;
  width: 60%;
  height: 100%;
  resize: none;
  padding: 1rem;
  margin-top: 0.75rem;
  border-radius: 4px;
  /* color */
  background-color: #ffffff04;
  border: 1px solid #ffffff22;
  backdrop-filter: blur(4px);
  color: var(--text);
  font-family: "Space Mono", monospace;
  font-size: 1rem;
  outline: none;
  scrollbar-width: none;
}

.input-area:focus {
  border-color: var(--accent);
}

.output-area {
  border-color: #5dff3488;
  color: #b0ff8c;
}

.output-area.error {
  border-color: #ff343488;
  color: #ff8c8c;
}

.output-area.processing {
  border-color: #ffffff22;
  color: var(--text);
}

.problem button {
  margin-top: 1rem;
  border-radius: 4px;
}

.problem .btn-info {
  display: inline;
}

/* output area autosizing */
.output-area {
  white-space: pre-wrap; /* Allows multiline output */
  word-wrap: break-word; /* Prevents long words from overflowing */
  border-radius: 5px;
  min-height: 50px; /* Adjust the minimum height as necessary */
  overflow-y: auto; /* Ensures scroll if the content overflows */
  max-height: 300px; /* Optional: To limit the height and add scroll */
  transition: max-height 0.3s ease;
}

/* responsiveness */

@media (width <= 600px) {
  .nav-label {
    display: none; /* Hide full text */
  }

  .nav-short {
    display: block; /* Show short labels (P1, P2, etc.) */
  }

  .sidebar a {
    padding-inline: 2rem;
  }

  .input-area,
  .output-area {
    width: 100%;
  }

  .output-area {
    max-height: 180px;
  }

  .app-content {
    left: 8rem;
    padding-right: 2.5rem;
  }

  .contest-rules {
    padding-right: 0;
    scrollbar-width: none;
  }

  h2 {
    font-size: 1.75rem;
  }

  p {
    font-size: 0.875rem;
  }
}

@media (width <= 420px) {
  h2 {
    font-size: 1.5rem;
  }
  p {
    font-size: 0.75rem;
  }
  .app-content {
    left: 5rem;
    padding-right: 1rem;
  }
  .sidebar a {
    padding-inline: 1rem;
  }

  .contest-rules {
    padding-right: 0;
    scrollbar-width: none;
  }
}
