/* ===== Practice Problems (Topics + Questions) ===== */
:root {
  --problems_navy: #171749;
  --problems_orange: #FF6B35;
  --problems_text: #23233F;
  --problems_text_muted: #6A6A85;
  --problems_bg: #F7F6F2;
  --problems_card_bg: #FFFFFF;
  --problems_border: #E7E5DD;
}

.problems_wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px 24px;
  font-family: -apple-system, "Segoe UI", Roboto, "PT Sans", Arial, sans-serif;
  color: var(--problems_text);
}

.problems_title {
  font-size: 28px;
  font-weight: 800;
  color: var(--problems_navy);
  margin: 0 0 24px 0;
}

.problems_back_link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--problems_text_muted);
  text-decoration: none;
  font-size: 14px;
}
.problems_back_link:hover {
  color: var(--problems_navy);
}

.problems_empty {
  color: var(--problems_text_muted);
  font-style: italic;
}

/* ---------- Topic list ---------- */
/* Sections (SAT domains + Extra) — same look as the sections on the Lessons page */
.problems_section {
  margin-bottom: 32px;
}

.problems_section_title {
  font-size: 15px;
  font-weight: 800;
  color: var(--problems_navy);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-bottom: 10px;
  margin: 0 0 14px 0;
  border-bottom: 2px solid var(--problems_border);
}

.problems_topic_list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.problems_topic_card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--problems_card_bg);
  border: 1px solid var(--problems_border);
  border-radius: 12px;
  padding: 18px 22px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.problems_topic_card:hover {
  box-shadow: 0 6px 18px rgba(23, 23, 73, 0.08);
  transform: translateY(-2px);
}

.problems_topic_name {
  font-size: 16px;
  font-weight: 700;
  color: var(--problems_navy);
}

.problems_topic_meta {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--problems_text_muted);
}
.problems_topic_meta > * {
  margin-left: 10px;
}

.problems_scope_badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.problems_scope_sat { background: #E9F6EC; color: #2F8F4E; }
.problems_scope_extra { background: #FFF1E6; color: var(--problems_orange); }

/* ---------- Question card ---------- */
.problems_question {
  background: var(--problems_card_bg);
  border: 1px solid var(--problems_border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 18px;
}

.problems_question_header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.problems_question_id {
  font-weight: 800;
  color: var(--problems_navy);
  font-size: 15px;
}
.problems_question_id .problems_difficulty_badge {
  margin-left: 8px;
}

.problems_difficulty_badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.problems_difficulty_easy   { background: #E9F6EC; color: #2F8F4E; }
.problems_difficulty_medium { background: #FFF1E6; color: var(--problems_orange); }
.problems_difficulty_hard   { background: #FBEAEA; color: #C23B3B; }

.problems_lang_toggle_btn {
  background: none;
  border: 1.5px solid var(--problems_border);
  color: var(--problems_navy);
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.problems_lang_toggle_btn:hover {
  border-color: var(--problems_orange);
  color: var(--problems_orange);
}

.problems_prompt {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--problems_text);
}

/* Language visibility: default is English; .problems_ru_active flips it */
.problems_prompt.problems_lang_ru {
  display: none;
}
.problems_question.problems_ru_active .problems_prompt.problems_lang_en {
  display: none;
}
.problems_question.problems_ru_active .problems_prompt.problems_lang_ru {
  display: block;
}

/* ---------- Answer / Solution actions ---------- */
.problems_actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}

.problems_action_btn {
  padding: 8px 16px;
  background: #fff;
  border: 1.5px solid var(--problems_navy);
  color: var(--problems_navy);
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
}
.problems_action_btn:hover {
  background: var(--problems_navy);
  color: #fff;
}

.problems_answer_box,
.problems_solution_box {
  display: none;
  width: 100%;
  background: var(--problems_bg);
  border-left: 3px solid var(--problems_navy);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 14.5px;
  line-height: 1.6;
  margin-top: 4px;
}
.problems_answer_box.problems_open,
.problems_solution_box.problems_open {
  display: block;
}

/* Inside an open box, show only the language matching the card's current mode */
.problems_answer_box .problems_lang_ru,
.problems_solution_box .problems_lang_ru {
  display: none;
}
.problems_question.problems_ru_active .problems_answer_box .problems_lang_en,
.problems_question.problems_ru_active .problems_solution_box .problems_lang_en {
  display: none;
}
.problems_question.problems_ru_active .problems_answer_box .problems_lang_ru,
.problems_question.problems_ru_active .problems_solution_box .problems_lang_ru {
  display: block;
}

/* ---------- Mobile adaptation ---------- */
@media (max-width: 640px) {
  .problems_wrap {
    padding: 24px 16px 60px 16px;
  }
  .problems_topic_card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .problems_topic_meta > *:first-child {
    margin-left: 0;
  }
}
