/* ===================================================
   WooaGosa – 모의고사
   Global Stylesheet
   =================================================== */

:root {
  --navy:     #1a3a5c;
  --navy-dark:#0f2440;
  --navy-mid: #1e4a74;
  --blue:     #2563eb;
  --blue-lt:  #3b82f6;
  --amber:    #f59e0b;
  --amber-lt: #fcd34d;
  --red:      #ef4444;
  --green:    #22c55e;
  --bg:       #f1f5f9;
  --card-bg:  #ffffff;
  --text:     #1e293b;
  --text-mid: #475569;
  --text-lt:  #94a3b8;
  --border:   #e2e8f0;
  --shadow:   0 2px 8px rgba(0,0,0,.08);
  --radius:   12px;
  --radius-sm:8px;
  --trans:    all .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; }

/* ── WooaHouse Family Bar ───────────────────────── */
.our-sites-bar {
  background: #111827;
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.our-sites-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 7px 20px 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.our-sites-label {
  color: rgba(255,255,255,.6);
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
  text-align: center;
  width: 100%;
}
.our-sites-links {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.our-sites-links a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.our-sites-links a:hover { background: rgba(255,255,255,.12); color: #fff; }
.our-sites-links a.active { background: rgba(255,255,255,.18); color: #fff; }
.sites-break { flex-basis: 100%; height: 0; }

/* ── Header ─────────────────────────────────────── */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.logo .logo-icon { font-size: 1.4rem; }
.logo span { color: var(--amber); }
.header-nav { margin-left: auto; display: flex; gap: .25rem; }
.header-nav a {
  padding: .4rem .75rem;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 500;
  color: rgba(255,255,255,.8);
  transition: var(--trans);
}
.header-nav a:hover, .header-nav a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

/* ── Main / Container ───────────────────────────── */
main { flex: 1; }
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}
.container-narrow {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

/* ── Hero (index) ───────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: #fff;
  padding: 4rem 1.25rem 3.5rem;
  text-align: center;
}
.hero h1 { font-size: clamp(1.7rem,4vw,2.5rem); font-weight: 800; margin-bottom: .75rem; }
.hero h1 .accent { color: var(--amber-lt); }
.hero p { font-size: 1.05rem; color: rgba(255,255,255,.75); max-width: 500px; margin: 0 auto; }
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.badge {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
  padding: .3rem .8rem;
  border-radius: 99px;
  font-size: .82rem;
  font-weight: 500;
}

/* ── Section headings ───────────────────────────── */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.3rem;
  background: var(--blue);
  border-radius: 2px;
}

/* ── Exam Type Cards ────────────────────────────── */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.exam-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  cursor: pointer;
  transition: var(--trans);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
  position: relative;
  overflow: hidden;
}
.exam-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--blue);
  opacity: 0;
  transition: var(--trans);
}
.exam-card:hover {
  border-color: var(--blue);
  box-shadow: 0 6px 24px rgba(37,99,235,.15);
  transform: translateY(-3px);
}
.exam-card:hover::before { opacity: 1; }
.exam-card .card-icon { font-size: 2.4rem; }
.exam-card .card-title { font-size: 1rem; font-weight: 700; color: var(--navy); }
.exam-card .card-sub {
  font-size: .78rem;
  color: var(--text-mid);
  background: var(--bg);
  padding: .25rem .65rem;
  border-radius: 99px;
}
.exam-card .card-count {
  font-size: .78rem;
  color: var(--text-lt);
}

/* ── Ad Placeholder ─────────────────────────────── */
.ad-box {
  background: var(--card-bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-lt);
  font-size: .8rem;
  margin: 1.5rem 0;
}

/* ── FAQ ────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: .75rem; }
.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--text);
  transition: var(--trans);
}
.faq-question:hover { background: var(--bg); }
.faq-question .faq-icon {
  font-size: 1.1rem;
  color: var(--blue);
  transition: transform .25s;
  flex-shrink: 0;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
}
.faq-item.open .faq-answer { max-height: 400px; }
.faq-answer-inner {
  padding: 0 1.25rem 1rem;
  font-size: .9rem;
  color: var(--text-mid);
  border-top: 1px solid var(--border);
  padding-top: .75rem;
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--trans);
  text-decoration: none;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-lg { padding: .8rem 1.75rem; font-size: 1rem; border-radius: var(--radius); }

/* ── Modal / Overlay ────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal h2 { font-size: 1.2rem; margin-bottom: 1rem; color: var(--navy); }
.modal p { font-size: .95rem; color: var(--text-mid); margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; }

/* ── Exam Page ──────────────────────────────────── */
.exam-header {
  background: var(--navy);
  color: #fff;
  padding: 1rem 1.25rem;
}
.exam-header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.exam-title { font-size: 1rem; font-weight: 700; flex: 1; min-width: 150px; }
.exam-progress-text { font-size: .9rem; color: rgba(255,255,255,.75); white-space: nowrap; }
.timer {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  padding: .35rem .9rem;
  border-radius: 99px;
  font-size: .95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 70px;
  text-align: center;
}
.timer.warning { background: rgba(245,158,11,.25); border-color: var(--amber); color: var(--amber-lt); }
.timer.danger { background: rgba(239,68,68,.25); border-color: var(--red); color: #fca5a5; animation: pulse .8s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

.progress-bar-wrap {
  height: 4px;
  background: rgba(255,255,255,.15);
}
.progress-bar {
  height: 100%;
  background: var(--amber);
  transition: width .4s ease;
}

.exam-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.question-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.question-meta {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.q-num {
  background: var(--navy);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: .25rem .65rem;
  border-radius: 99px;
}
.q-tag {
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 99px;
}
.q-tag.multi { background: #dbeafe; color: #1d4ed8; }
.q-tag.video { background: #fef3c7; color: #92400e; }

.question-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
  line-height: 1.7;
}
.situation-box {
  background: #f0f9ff;
  border-left: 3px solid var(--blue-lt);
  padding: .75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1.25rem;
  font-size: .9rem;
  color: #0369a1;
}

.choices-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.choice-btn {
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  text-align: left;
  cursor: pointer;
  font-size: .95rem;
  color: var(--text);
  transition: var(--trans);
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.choice-btn:hover:not(:disabled) {
  border-color: var(--blue-lt);
  background: #eff6ff;
}
.choice-btn.selected {
  border-color: var(--blue);
  background: #dbeafe;
  color: var(--navy);
  font-weight: 600;
}
.choice-btn.correct {
  border-color: var(--green);
  background: #f0fdf4;
  color: #166534;
}
.choice-btn.wrong {
  border-color: var(--red);
  background: #fef2f2;
  color: #991b1b;
}
.choice-btn.correct-mark {
  border-color: var(--green);
  background: #dcfce7;
}
.choice-num {
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: .05rem;
}
.choice-btn.selected .choice-num { background: var(--blue); color: #fff; }
.choice-btn.correct .choice-num { background: var(--green); color: #fff; }
.choice-btn.wrong .choice-num { background: var(--red); color: #fff; }
.choice-btn.correct-mark .choice-num { background: var(--green); color: #fff; }

.explain-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  font-size: .88rem;
  color: #78350f;
  display: none;
}
.explain-box.visible { display: block; }
.explain-box strong { display: block; margin-bottom: .35rem; font-size: .9rem; }

.exam-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.exam-nav .btn { min-width: 120px; justify-content: center; }

/* ── Result Page ────────────────────────────────── */
.result-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: #fff;
  text-align: center;
  padding: 3rem 1.25rem;
}
.score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 6px solid rgba(255,255,255,.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}
.score-number { font-size: 2.5rem; font-weight: 800; line-height: 1; }
.score-label { font-size: .8rem; color: rgba(255,255,255,.7); }
.pass-badge {
  display: inline-block;
  padding: .4rem 1.2rem;
  border-radius: 99px;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.pass-badge.pass { background: var(--green); color: #fff; }
.pass-badge.fail { background: var(--red); color: #fff; }

.result-stats {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.stat-item {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  padding: .75rem 1.25rem;
  border-radius: var(--radius-sm);
  text-align: center;
  min-width: 100px;
}
.stat-num { font-size: 1.5rem; font-weight: 800; }
.stat-lbl { font-size: .78rem; color: rgba(255,255,255,.7); margin-top: .1rem; }

.wrong-review-list { display: flex; flex-direction: column; gap: 1rem; }
.review-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}
.review-card .q-text { font-weight: 600; margin-bottom: .75rem; font-size: .95rem; }
.review-choice { font-size: .88rem; padding: .35rem .5rem; border-radius: 4px; margin-bottom: .25rem; }
.review-choice.correct { background: #dcfce7; color: #166534; }
.review-choice.user-wrong { background: #fee2e2; color: #991b1b; }
.review-explain { font-size: .82rem; color: var(--text-mid); margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }

/* ── Wrong Notes Page ───────────────────────────── */
.wrong-filter {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.filter-btn {
  padding: .4rem 1rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 500;
  transition: var(--trans);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* ── Footer ─────────────────────────────────────── */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,.55);
  text-align: center;
  padding: 1.75rem 1.25rem;
  font-size: .82rem;
  margin-top: auto;
}
.site-footer a { color: rgba(255,255,255,.7); }
.site-footer a:hover { color: #fff; }

/* ── Sidebar Layout ─────────────────────────────── */
.page-with-sidebar {
  max-width: 1160px;
  margin: 36px auto 80px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
.gosa-main { min-width: 0; }
.tool-sidebar { position: sticky; top: 68px; }
.ad-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1.5px dashed var(--border);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 280px;
  overflow: hidden;
}
.ad-card + .ad-card { margin-top: 16px; }
.mobile-top-ad {
  display: none;
  padding: 8px 16px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.mobile-inline-ad {
  display: none;
  margin: 1.25rem 0;
  text-align: center;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 8px;
  min-height: 100px;
}

/* ── Category Label ─────────────────────────────── */
.category-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
  padding-bottom: .65rem;
  border-bottom: 2px solid var(--navy);
}
.category-label .cat-emoji { font-size: 1.2rem; }
.category-label .cat-name { font-size: 1rem; font-weight: 800; color: var(--navy); }
.category-label .cat-tag {
  font-size: .72rem;
  background: var(--navy);
  color: #fff;
  padding: .2rem .55rem;
  border-radius: 99px;
  font-weight: 600;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 1024px) {
  .page-with-sidebar {
    grid-template-columns: 1fr;
    margin: 20px auto 60px;
    gap: 0;
  }
  .tool-sidebar { display: none; }
  .mobile-top-ad { display: block; }
  .mobile-inline-ad { display: block; }
}

@media (max-width: 600px) {
  .exam-grid { grid-template-columns: repeat(2, 1fr); }
  .exam-card { padding: 1.1rem .9rem; }
  .exam-card .card-icon { font-size: 1.8rem; }
  .question-card { padding: 1.25rem; }
  .question-text { font-size: 1rem; }
  .result-stats { gap: .6rem; }
  .stat-item { min-width: 80px; padding: .5rem .75rem; }
  .score-circle { width: 110px; height: 110px; }
  .score-number { font-size: 2rem; }
  .exam-nav .btn { min-width: 100px; }
}
@media (max-width: 380px) {
  .exam-grid { grid-template-columns: 1fr 1fr; }
}
