/* ============================================================
   CSS VARIABLES — edit these to change styles app-wide
   ============================================================ */
:root {
  --font-title:    32px;
  --font-heading:  22px;
  --font-body:     16px;
  --font-button:   16px;
  --font-label:    16px;
  --font-score:    24px;

  --weight-bold:   700;
  --weight-semi:   600;
  --weight-normal: 400;

  --line-height:   1.3;

  --color-green:      #52927F;
  --color-green-dark: #4A6C5E;
  --color-green-deep: #2E4C40;
  --color-bg:         #52927F;
  --color-card:       #F2F2F2;
  --color-red:        #F28C8C;
  --color-text:       #000000;
  --color-white:      #ffffff;

  --radius-card:   40px;
  --radius-button: 40px;
}

/* ============================================================
   BASE
   ============================================================ */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
  background: var(--color-bg);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

h1 {
  margin-top: 40px;
  color: var(--color-white);
  font-size: var(--font-title);
  font-weight: var(--weight-bold);
  text-align: center;
  width: 100%;
}

#page-title {
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--color-text);
  font-size: var(--font-title);
  font-weight: var(--weight-bold);
  text-align: left;
  width: 100%;
}

.title-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 40px;
  position: relative;
}

.title-bar #page-title {
  margin-top: 0;
}

/* Desktop: arrow + text top-left */
.back-arrow {
  position: absolute;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--color-white);
  font-size: 16px;
  font-weight: var(--weight-semi);
  opacity: 0.9;
}

.back-arrow:hover {
  opacity: 1;
}

.back-home-mobile {
  display: block;
  color: var(--color-white);
  font-size: 16px;
  font-weight: var(--weight-semi);
  text-decoration: underline;
  text-align: center;
  margin-top: 8px;
  margin-bottom: 24px;
  width: 100%;
}

#page-title.review-mode {
  text-align: left;
  padding-left: 20px;
}

/* ============================================================
   QUIZ & FEEDBACK CARDS
   ============================================================ */
#quiz-card,
#feedback-card {
  width: 480px;
  margin: 40px auto;
  padding: 50px;
  background: var(--color-card);
  border-radius: var(--radius-card);
  text-align: left;
  position: relative;
  box-sizing: border-box;
}

#feedback-card.review-mode {
  background: none;
  border-radius: 0;
  padding: 0;
  width: auto;
  box-shadow: none;
}

#question-counter {
  font-size: var(--font-label);
  font-weight: var(--weight-semi);
  margin-bottom: 10px;
}

#question {
  font-size: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--line-height);
  margin-bottom: 28px;
}

.answer-header {
  font-size: var(--font-label);
  font-weight: var(--weight-semi);
  text-decoration: underline;
  margin-top: 45px;
}

.answer-body {
  font-size: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--line-height);
  margin-bottom: 16px;
}

.answer-explanation {
  font-size: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--line-height);
  margin-bottom: 16px;
}

/* ============================================================
   ANSWER BUTTONS
   ============================================================ */
.answer-button {
  width: 100%;
  padding: 20px 18px;
  margin: 3px 0;
  border-radius: var(--radius-button);
  border: 3px solid transparent;
  background: var(--color-green);
  color: var(--color-white);
  font-size: var(--font-button);
  font-weight: var(--weight-semi);
  cursor: pointer;
  transition: all .2s ease;
}

.answer-button:hover {
  transform: scale(1.02);
}

.answer-button.selected {
  border: 4px solid var(--color-green-deep);
}

/* ============================================================
   SUBMIT BUTTON
   ============================================================ */
.submit-container {
  text-align: center;
}

#submit {
  margin-top: 20px;
  font-size: var(--font-button);
  font-weight: var(--weight-semi);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   NEXT / PRIMARY BUTTONS
   ============================================================ */
#next-question {
  display: block;
  padding: 16px 42px;
  border-radius: var(--radius-button);
  border: none;
  background: var(--color-green);
  color: var(--color-white);
  font-size: var(--font-button);
  font-weight: var(--weight-bold);
  margin: 35px auto 0 auto;
  cursor: pointer;
}

.primary-button {
  display: block;
  width: 220px;
  margin: 12px auto;
  padding: 16px;
  border-radius: var(--radius-button);
  border: none;
  background: var(--color-green);
  color: var(--color-white);
  font-size: var(--font-button);
  font-weight: var(--weight-semi);
  cursor: pointer;
}

/* ============================================================
   FEEDBACK ICON
   ============================================================ */
.feedback-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: 30px;
  top: 30px;
}

.feedback-icon-circle.correct  { background: var(--color-green); }
.feedback-icon-circle.incorrect { background: var(--color-red); }

.correct-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  position: absolute;
  right: 30px;
  top: 30px;
}
.correct   { background: var(--color-green); }
.incorrect { background: var(--color-red); }

/* ============================================================
   RESULTS SCREEN
   ============================================================ */
.quiz-complete-title {
  font-size: var(--font-title);
  font-weight: var(--weight-bold);
  text-align: center;
  margin-bottom: 30px;
}

.score-text {
  text-align: center;
  font-size: var(--font-score);
  font-weight: var(--weight-semi);
  margin-bottom: 30px;
}

.return-home {
  text-align: center;
  margin-top: 20px;
}

.return-home a {
  color: var(--color-text);
  font-size: var(--font-button);
  font-weight: var(--weight-bold);
  text-decoration: none;
}

.return-home a:hover {
  text-decoration: underline;
}

.score-ring {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 20px auto;
}

.score-ring svg {
  display: block;
  transform: rotate(-90deg);
  position: absolute;
  top: 0;
  left: 0;
}

.ring-track {
  fill: none;
  stroke: #D9D9D9;
  stroke-width: 14;
}

.ring-background {
  fill: none;
  stroke: #D9D9D9;
  stroke-width: 14;
}

.ring-progress {
  fill: none;
  stroke: var(--color-green);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  transition: stroke-dashoffset 1.2s ease;
}

.score-ring-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--font-score);
  font-weight: var(--weight-bold);
}

/* ============================================================
   REVIEW CARDS
   ============================================================ */
.review-card {
  background: var(--color-card);
  border-radius: var(--radius-card);
  padding: 28px 28px 20px 28px;
  margin: 24px auto;
  width: 520px;
  box-sizing: border-box;
}

.review-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.review-top-text {
  flex: 1;
}

.review-counter {
  font-size: var(--font-label);
  font-weight: var(--weight-semi);
  margin-bottom: 6px;
}

.review-question {
  font-size: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--line-height);
  margin: 0;
}

.review-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.review-icon-circle.correct   { background: var(--color-green); }
.review-icon-circle.incorrect { background: var(--color-red); }

.review-details {
  display: none;
  margin-top: 16px;
}

.review-label {
  font-size: var(--font-label);
  font-weight: var(--weight-bold);
  text-decoration: underline;
  margin-top: 14px;
  margin-bottom: 4px;
}

.review-answer {
  font-size: var(--font-heading);
  font-weight: var(--weight-bold);
  margin-bottom: 8px;
  line-height: var(--line-height);
}

.review-explanation {
  font-size: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--line-height);
}

.review-arrow {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
  cursor: pointer;
}

.chevron-svg {
  width: 28px;
  height: 28px;
  display: block;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */
.main-title {
  font-size: 72px;
  font-weight: var(--weight-bold);
  color: var(--color-card);
  margin-top: 120px;
  text-align: center;
}

.portal-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  margin-top: 60px;
}

.dropdown {
  width: 300px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--color-card);
  border-radius: 40px;
  box-shadow: 0 4px 4px rgba(0,0,0,0.25);
  overflow: hidden;
  letter-spacing: -0.5px;
}

.dropdown-button {
  width: 100%;
  padding: 22px 26px;
  border-radius: 0;
  border: none;
  background: transparent;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  color: var(--color-green);
  transition: opacity .2s ease;
  box-shadow: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.dropdown-button:hover {
  opacity: 0.85;
}

.arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease;
  transform: translateY(1px);
}

.arrow.open {
  transform: translateY(1px) rotate(180deg);
}

.dropdown-menu {
  display: none;
  width: 100%;
  background: transparent;
  border-radius: 0;
  padding: 4px 26px 22px 26px;
  margin-top: 0;
  box-shadow: none;
  box-sizing: border-box;
}

.dropdown-menu a {
  display: block;
  font-size: 18px;
  font-weight: 700;
  padding: 8px 0;
  margin: 0;
  color: var(--color-green);
  text-decoration: underline;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.5px;
}

#feedback-card p {
  margin: 6px 0 14px 0;
}

/* =========================
PORTAL HEADER
========================= */

.portal-title{
font-size:60px;
font-weight:700;
color:white;
text-align:center;
margin-top:120px;
line-height:1.05;
letter-spacing:-0.5px;
text-shadow:0 4px 4px rgba(0,0,0,0.25);
font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.portal-subtitle{
font-size:22px;
font-weight:700;
color:white;
text-align:center;
max-width:850px;
margin:20px auto 80px auto;
line-height:1.4;
letter-spacing:-0.5px;
text-shadow:none;
font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}


/* =========================
DROPDOWN MENU GRID
========================= */

.dropdown-menu{

display:none;

grid-template-columns:1fr 1fr;

gap:8px 22px;

width:300px;

background:var(--color-card);

border-radius:32px;

padding:26px;

margin-top:14px;

box-shadow:0 12px 28px rgba(0,0,0,0.25);

}

.dropdown-menu a{

font-size:20px;
font-weight:700;

color:var(--color-green);

text-decoration:underline;

}


/* =========================
BUTTON STYLE
========================= */

.dropdown-button{

width:300px;

padding:20px;

border-radius:40px;

border:none;

background:var(--color-card);

font-size:22px;
font-weight:700;

display:flex;
justify-content:center;
align-items:center;
gap:10px;

color:var(--color-green);

cursor:pointer;

box-shadow:0 10px 18px rgba(0,0,0,0.18);

transition:transform .2s ease;

}

.dropdown-button:hover{
transform:translateY(-2px);
}


/* =========================
MOBILE
========================= */

@media (max-width:480px){

.portal-title{
font-size:42px;
margin-top:80px;
}

.portal-subtitle{
font-size:20px;
margin-bottom:60px;
}

.dropdown-button{
width:100%;
}

.dropdown-menu{
width:100%;
grid-template-columns:1fr;
}

}

/* ============================================================
   RESPONSIVE — TABLET (iPad)
   ============================================================ */
@media (max-width: 768px) {

  #page-title,
  h1 {
    font-size: 26px;
    margin-top: 28px;
  }

  #quiz-card,
  #feedback-card {
    width: 90vw;
    padding: 36px 28px;
    margin: 24px auto;
    border-radius: 32px;
  }

  #question {
    font-size: 20px;
  }

  .answer-button {
    padding: 18px 16px;
    font-size: 16px;
  }

  .review-card {
    width: 90vw;
    padding: 24px 20px 16px 20px;
    border-radius: 32px;
  }

  .review-question {
    font-size: 18px;
  }

  .portal-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
  }

  .dropdown {
    width: 100%;
    max-width: 480px;
  }

  .main-title {
    font-size: 52px;
    margin-top: 80px;
  }

}

/* ============================================================
   RESPONSIVE — MOBILE (iPhone)
   ============================================================ */
@media (max-width: 480px) {

  body {
    padding: 0 16px;
    box-sizing: border-box;
  }

  #page-title,
  h1 {
    font-size: 22px;
    margin-top: 24px;
    padding: 0;
  }

  #quiz-card,
  #feedback-card {
    width: 100%;
    padding: 24px 20px;
    margin: 16px 0;
    border-radius: 28px;
    box-sizing: border-box;
  }

  #question {
    font-size: 17px;
    margin-bottom: 16px;
  }

  #question-counter {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .answer-button {
    padding: 16px 14px;
    font-size: 15px;
    margin: 4px 0;
    border-radius: 28px;
  }

  #submit {
    font-size: 15px;
    margin-top: 14px;
  }

  #next-question {
    padding: 16px;
    font-size: 15px;
    border-radius: 28px;
    width: 100%;
    box-sizing: border-box;
  }

  .primary-button {
    width: 100%;
    box-sizing: border-box;
    padding: 16px;
    font-size: 15px;
    border-radius: 28px;
  }

  .feedback-icon-circle {
    width: 36px;
    height: 36px;
    right: 16px;
    top: 16px;
  }

  .answer-body,
  .answer-explanation {
    font-size: 16px;
  }

  .answer-header {
    margin-top: 24px;
    font-size: 13px;
  }

  .review-card {
    width: 100%;
    padding: 18px 16px 12px 16px;
    border-radius: 24px;
    margin: 10px 0;
    box-sizing: border-box;
  }

  .review-question {
    font-size: 16px;
  }

  .review-counter {
    font-size: 13px;
  }

  .review-answer {
    font-size: 16px;
  }

  .review-explanation {
    font-size: 15px;
  }

  .review-icon-circle {
    width: 34px;
    height: 34px;
  }

  .quiz-complete-title {
    font-size: 24px;
  }

  .score-text {
    font-size: 17px;
  }

  .score-ring {
    width: 120px;
    height: 120px;
  }

  .score-ring svg {
    width: 120px;
    height: 120px;
  }

  .score-ring-inner {
    font-size: 20px;
  }

  .return-home a {
    font-size: 15px;
  }

  .main-title {
    font-size: 36px;
    margin-top: 48px;
    padding: 0;
  }

  .portal-container {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-top: 32px;
    padding: 0;
    width: 100%;
  }

  .dropdown {
    width: 100%;
  }

  .dropdown-button {
    font-size: 20px;
    padding: 18px;
    color: var(--color-text);
  }

  .dropdown-menu a {
    font-size: 18px;
    color: var(--color-text);
  }

   /* Hide desktop back arrow on mobile */
.back-arrow {
    display: none;
  }
}
