.problems-explorer {
  display: flex;
  flex-direction: row;
  justify-content: center;
  column-gap: 24px;
}

.problem-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
  max-width: 800px;
  background-color: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  border: 1px solid var(--color-gray200);
}

.problem {
  position: relative;
  max-width: 640px;
}

.problem p {
  margin: 0;
}

.problem .tags {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  row-gap: 8px;
  column-gap: 8px;
  padding: 0px 0px 20px 0px;
}

.problem .tags span {
  display: flex;
  padding: 6px 12px;
  justify-content: center;
  align-items: center;
  height: 30px;
  border-radius: 16px;
  color: var(--color-gray800);
  background: transparent;
  border: 1.5px solid var(--color-gray200);
  font-size: 12px;
  font-weight: 400;
  line-height: 150%;
}

.problem .question,
.problem .passage {
  padding: 20px 0px;
  color: var(--black);
  font-size: 20px;
  font-style: normal;
  font-weight: 600;
  line-height: 30px;
}

.problem .question img,
.problem .passage img {
  max-width: 100%;
}

.problem .answer.multipleChoice {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  row-gap: 16px;
}

.problem .answer.multipleChoice .choiceItem {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  column-gap: 16px;
  cursor: pointer;
}

.problem .answer.multipleChoice .choiceItem .number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  border: 1px solid var(--color-gray200);
  background: var(--color-white);
  color: var(--color-black);
  flex-shrink: 0;
  font-weight: 600;
  font-size: 14px;
}

.problem .answer.multipleChoice .choiceItem .number.correct {
  border: 1px solid var(--color-accent);
  background: var(--color-accent);
  color: var(--color-white);
}

.problem .answer.multipleChoice .choiceItem .choiceImage img {
  max-width: 100%;
  max-height: 100px;
}

.problem .answer.multipleChoice .choiceItem .choiceContent {
  color: var(--color-gray900);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: -0.032px;
}

.problem .answer.multipleChoice .choiceItem .choiceContent.correct {
  font-weight: 600;
}

.problem .answer.multipleChoice .choiceItem.user-wrong .number {
  color: var(--color-red200);
  border: 1px solid var(--color-red100);
  background: var(--color-red100);
}

.problem .answer.multipleChoice .choiceItem.user-wrong .choiceContent {
  color: var(--color-red200);
}

.problem .answer.multipleChoice .choiceItem.user-correct .choiceContent {
  color: var(--color-accent);
}

.problem .feedback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
}

.problem .feedback.show {
  visibility: visible;
}

.problem .feedback img {
  width: 100px;
  height: 100px;
  transform: scale(0);
  transition:
    visibility 0.2s,
    transform 0.2s ease;
}

.problem .feedback.show img {
  transform: scale(1);
  transition:
    visibility 0s,
    transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.problems-list-container {
  width: 450px;
  flex-shrink: 0;
  background-color: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  border: 1px solid var(--color-gray200);
}

.problems-list-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 30px;
  border-bottom: 1.5px solid var(--color-black);
}

.problems-list-header .title {
  color: var(--black);
  font-size: 20px;
  font-style: normal;
  font-weight: 500;
  line-height: 30px;
}

.problems-list-header .pagination {
  display: flex;
  flex-direction: row;
  align-items: center;
  column-gap: 10px;
}

.problems-list-header .pagination button {
  width: 34px;
  height: 34px;
  background: var(--color-white);
  border: 1px solid var(--color-gray200);
  border-radius: 9px;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: center;
}

.problems-list-header .pagination button:disabled {
  background-color: var(--color-gray50);
  cursor: unset;
}

.problems-list-header .pagination button.button-prev {
  background-image: url("/icons/ic_previous_page.svg");
}

.problems-list-header .pagination button.button-prev:disabled {
  background-image: url("/icons/ic_previous_page_gray.svg");
}

.problems-list-header .pagination button.button-next {
  background-image: url("/icons/ic_next_page.svg");
}

.problems-list-header .pagination button.button-next:disabled {
  background-image: url("/icons/ic_next_page_gray.svg");
}

.problems-list-header .pagination .page-indicator {
  display: flex;
  flex-direction: row;
  font-size: 15px;
  font-weight: 400;
  color: var(--color-grayout1);
}

.problems-list-header .pagination .page-indicator .current-page {
  color: var(--color-black);
  font-weight: 600;
}

.problems-list {
  margin-top: 4px;
}

.problems-list .page {
  display: none;
}

.problems-list .page.show {
  display: flex;
  flex-direction: column;
}

.problems-list .item {
  display: flex;
  flex-direction: row;
  align-items: center;
  column-gap: 12px;
  padding: 12px 10px;
  text-decoration: none;
  height: 50px;
  border: 1px solid #fff;
}

.problems-list .item.selected {
  background-color: #eefaf9;
  border: 1px solid #ccebeb;
}

.problems-list .item .number {
  color: var(--color-gray900);
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: -0.032px;
  background-color: var(--color-grayout4);
  border: 1px solid var(--color-gray200);
  border-radius: 12px;
  padding: 0px 8px;
}

.problems-list .item .contents {
  flex-grow: 1;
  color: var(--color-gray900);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: -0.032px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.problems-list .item .result {
  flex-grow: 0;
  flex-shrink: 0;
  background-size: 26px;
  background-repeat: no-repeat;
  background-position: center;
}

.problems-list .item .result.correct {
  width: 24px;
  height: 24px;
  background-image: url("/icons/ic_result_o.svg");
}

.problems-list .item .result.wrong {
  width: 24px;
  height: 24px;
  background-image: url("/icons/ic_result_x.svg");
}

.shortcuts {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  column-gap: 20px;
  padding-top: 20px;
  margin-top: 28px;
  font-size: 14px;
  border-top: 1px solid var(--color-gray200);
}

.shortcuts .title {
  display: flex;
  flex-direction: row;
  align-items: center;
  column-gap: 12px;
  font-weight: 600;
}

.shortcuts .title:before {
  content: "";
  width: 28px;
  height: 28px;
  background-image: url("/icons/ic_keyboard.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.shortcuts .description {
  display: flex;
  flex-direction: row;
  align-items: center;
  column-gap: 10px;
  font-weight: 300;
}

.shortcuts .description button {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 26px;
  font-size: 16px;
  font-weight: 400;
  padding: 0 8px;
  background-color: var(--color-white);
  border: 1px solid var(--color-black);
  border-radius: 4px;
  cursor: pointer;
}

.shortcuts .description.mobile {
  display: none;
}

/* Problem Selection Dialog */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.dialog-container {
  background-color: white;
  border-radius: 18px;
  max-width: 780px;
  width: 100%;
  max-height: 90vh; 
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 16px 24px;
  flex-shrink: 0;
}

.dialog-header .title {
  font-size: 1.4rem;
  font-weight: 500;
}

.dialog-close-btn {
  background: none;
  border: none;
  cursor: pointer;
}

.dialog-close-btn img {
  width: 24px;
  height: 24px;
}

.dialog-content {
  flex-grow: 1;
  overflow: hidden;
  padding: 0 24px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.problems-list-container.in-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: none;
  padding: 0;
  background-color: transparent;
}

.problems-list-container.in-dialog .problems-list-header {
  padding: 16px 16px 8px 16px;
  border-bottom: 1px solid var(--color-gray200);
}

.problems-list-container.in-dialog .problems-list {
  flex-grow: 1;
  overflow-y: auto;
  border: none;
  border-radius: 0;
  margin-top: 0;
}

.problems-list-container.in-dialog .problems-list .item {
  padding: 12px 16px;
}

.dialog-description {
  font-size: 14px;
  color: var(--color-gray600);
  text-align: center;
  flex-shrink: 0;
}

.dialog-description strong {
  font-weight: 600;
  color: var(--color-black);
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(56px, 20% - 10px), 1fr));
  gap: 12px;
  overflow-y: auto;
  flex-grow: 1;
  align-content: flex-start;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.problem-grid::-webkit-scrollbar {
  display: none;
}

.problem-grid-item {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  text-decoration: none;
  font-size: clamp(10px, 3.8vw, 16px);
  font-weight: 400;
  background-color: var(--color-white);
  border: 1px solid var(--color-gray200);
  color: var(--color-black);
}

.problem-grid-item.correct {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-white);
}

.problem-grid-item.wrong {
  background-color: var(--color-red100);
  border-color: var(--color-red100);
  color: var(--color-red200);
}

body.is-mobile .shortcuts {
  display: none;
}

@media (max-width: 1180px) {
  .problems-list-container {
    display: none;
  }
}

@media (max-width: 700px) {
  .problem {
    max-width: 100%;
  }

  .shortcuts .description.mobile {
    display: flex;
  }

  .shortcuts .description.desktop {
    display: none;
  }
}

@media screen and (max-width: 352px) {
  .dialog-container {
    width: 100%;
  }
}