/* ============================================
   Quiz New Design — Apple-Inspired Minimal
   기존 quiz.css 뒤에 로드하여 specificity로 오버라이드
   ============================================ */

/* mobile-ux-improvements.css는 새 페이지에서 로드하지 않음 */
/* 별도 리셋 불필요 */

/* ── Header ── */
.fp-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(1.5rem, 5vw);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 300;
}

.fp-header a {
  text-decoration: none;
  color: inherit;
}

.fp-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fp-header__logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
}

.fp-header__name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
}

.fp-header__nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.fp-header__nav-link {
  font-size: 13px;
  font-weight: 500;
  color: #6e6e73;
  transition: color 0.2s;
}

.fp-header__nav-link:hover {
  color: #1d1d1f;
}

.fp-header__right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.fp-header__login {
  font-size: 13px;
  font-weight: 500;
  color: #6e6e73;
  padding: 5px 14px;
  border-radius: 9999px;
  border: 1px solid #d2d2d7;
  transition: all 0.2s ease;
}

.fp-header__login:hover {
  color: var(--penguin-navy, #1D2F4E);
  border-color: var(--penguin-navy, #1D2F4E);
}

.fp-header__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 20px;
  height: 16px;
  padding: 0;
  position: relative;
  flex-shrink: 0;
}

.fp-header__hamburger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: #1d1d1f;
  border-radius: 1px;
  position: absolute;
  left: 0;
  transition: all 0.25s ease;
}

.fp-header__hamburger span:nth-child(1) { top: 0; }
.fp-header__hamburger span:nth-child(2) { top: 7px; }
.fp-header__hamburger span:nth-child(3) { top: 14px; }

.fp-header__mobile-menu {
  display: none;
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 12px 24px 16px;
  z-index: 299;
  flex-direction: column;
  gap: 4px;
}

.fp-header__mobile-menu a {
  text-decoration: none;
}

.fp-header__mobile-menu.open {
  display: flex;
}

.fp-header__mobile-link {
  font-size: 15px;
  font-weight: 500;
  color: #1d1d1f;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: color 0.2s;
  display: block;
}

.fp-header__mobile-link:last-child {
  border-bottom: none;
}

.fp-header__mobile-link:hover {
  color: var(--penguin-navy, #1D2F4E);
}

@media (max-width: 768px) {
  .fp-header__nav { display: none; }
  .fp-header__login { display: none; }
  .fp-header__hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ── Page Title ── */
.page-title-section {
  padding: calc(48px + 40px) max(1.5rem, 5vw) 16px;
}

.page-title-section__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--penguin-navy, #1D2F4E);
  text-decoration: none;
  margin-bottom: 12px;
  transition: opacity 0.2s;
}

.page-title-section__back:hover {
  opacity: 0.7;
}

.page-title-section__text {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.022em;
  color: #1d1d1f;
  line-height: 1.1;
}

.page-title-section__meta {
  font-size: 14px;
  color: #86868b;
  margin-top: 6px;
}

@media (max-width: 768px) {
  .page-title-section {
    padding: calc(48px + 28px) 20px 12px;
  }
  .page-title-section__text {
    font-size: 24px;
  }
}

/* ── 기존 헤더/푸터 숨기기 ── */
.page-header {
  display: none;
}

/* ── 배경 흰색 ── */
body {
  background: #fff;
}

body .main-content {
  background: #fff;
}

/* ── Quiz Container ── */
body .quiz-container {
  background: var(--color-bg-elevated, #fff);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.04));
  border: 1px solid var(--color-separator, rgba(0,0,0,0.06));
  padding: 48px 32px 32px;
  margin-bottom: 24px;
  position: relative;
}

body .question-number {
  position: absolute;
  top: 16px;
  left: 24px;
  background: none;
  color: var(--color-text-tertiary, #86868b);
  padding: 0;
  border-radius: 0;
  font-weight: 600;
  font-size: var(--text-xs, 12px);
  box-shadow: none;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  body .quiz-container {
    padding: 40px 16px 20px;
    border-radius: var(--radius-md, 12px);
  }

  body .question-number {
    top: 12px;
    left: 16px;
    font-size: 11px;
  }
}

/* ── Option Buttons (선택지) — 미니멀 ── */
body .option-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

body .option-button {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #f5f5f7;
  border: 2px solid transparent;
  color: #1d1d1f;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body .option-button:hover {
  background: #e8e8ed;
  border-color: transparent;
  transform: none;
  box-shadow: none;
  color: #1d1d1f;
  outline: none;
}

body .option-button:focus,
body .option-button:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: transparent;
}

body .option-button.selected:focus,
body .option-button.selected:focus-visible {
  border-color: var(--penguin-navy, #1D2F4E);
}

/* 북마크 버튼 */
body .bookmark-btn.active {
  background: var(--penguin-navy, #1D2F4E);
}
body .bookmark-btn.active:hover {
  background: #1D2F4E;
}

body .option-button.selected {
  background: var(--penguin-navy, #1D2F4E);
  border-color: var(--penguin-navy, #1D2F4E);
  color: #fff;
  transform: none;
  box-shadow: none;
}

body .option-button.correct {
  background: #34c759;
  border-color: #34c759;
  color: #fff;
}

body .option-button.incorrect {
  background: #ff3b30;
  border-color: #ff3b30;
  color: #fff;
}

@media (max-width: 576px) {
  body .option-button {
    width: 50px;
    height: 50px;
    font-size: 1rem;
    border-radius: 12px;
  }
}

/* ── Navigation Buttons ── */

body .navigation-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 32px auto;
  max-width: 400px;
}

body .nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: var(--radius-full, 9999px);
  font-weight: 600;
  font-size: var(--text-sm, 14px);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  flex: 1;
}

body .prev-button,
body .next-button {
  background: transparent;
  color: var(--color-text-tertiary, #86868b);
  border: 1px solid var(--color-border, #d2d2d7);
}

body .prev-button:hover:not(.disabled):not(:disabled),
body .next-button:hover:not(.disabled):not(:disabled) {
  background: var(--color-text-primary, #1d1d1f);
  color: #fff;
  border-color: var(--color-text-primary, #1d1d1f);
}

body .check-button {
  background: var(--color-bg-secondary, #f5f5f7);
  color: var(--color-text-primary, #1d1d1f);
  border: 1px solid var(--color-border, #d2d2d7);
  box-shadow: none;
}

body .check-button:hover:not(.disabled) {
  background: var(--color-bg-elevated, #fff);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.04));
}

body .nav-button.disabled,
body .nav-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

body .nav-button:not(.disabled):not(:disabled) {
  pointer-events: auto;
  opacity: 1;
}

@media (max-width: 768px) {
  body .navigation-buttons {
    gap: 8px;
    margin: 24px 16px;
  }

  body .nav-button {
    padding: 11px 16px;
    font-size: var(--text-xs, 13px);
  }
}

/* ── Progress Container ── */
body .progress-container {
  background: var(--color-bg-elevated, #fff);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.04));
  padding: 16px 20px;
  margin: 0;
  z-index: 200;
}

body .progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0;
  border: none;
  background: none;
}

body .progress-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: var(--text-sm, 14px);
  color: var(--color-text-tertiary, #86868b);
  padding: 0;
}

body .progress-count {
  font-weight: 600;
  color: var(--color-text-primary, #1d1d1f);
  font-size: var(--text-sm, 14px);
}

body .timer-container {
  padding: 0;
  margin: 0;
}

body .timer {
  font-size: var(--text-sm, 14px);
  font-weight: 600;
  color: var(--color-text-primary, #1d1d1f);
  background: none;
  padding: 0;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

body .timer-icon {
  font-size: var(--text-sm, 14px);
}

/* Progress Bar */
body .progress-bar {
  height: 3px;
  background: var(--color-bg-secondary, #f5f5f7);
  border-radius: var(--radius-full, 9999px);
  overflow: hidden;
  margin-bottom: 16px;
}

body .progress-bar .progress,
body #progress-bar {
  height: 100%;
  background: var(--color-text-primary, #1d1d1f);
  border-radius: var(--radius-full, 9999px);
  transition: width 0.3s ease;
}

/* ── Question Indicators — Apple Style ── */
body .question-indicators-container {
  padding: 0;
  margin: 0;
  overflow: visible;
}

body .question-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* 기본: 숫자 없이 도트로 */
body .indicator {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full, 9999px);
  background: transparent;
  border: 1.5px solid var(--color-border-light, #e8e8ed);
  color: var(--color-text-quaternary, #aeaeb2);
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

body .indicator:hover:not(.current) {
  border-color: var(--color-text-quaternary, #aeaeb2);
  color: var(--color-text-tertiary, #86868b);
}

/* 현재 문제: 테두리 강조 */
body .indicator.current {
  background: transparent;
  border: 2px solid var(--penguin-navy, #1D2F4E);
  color: var(--penguin-navy, #1D2F4E);
  font-weight: 700;
  font-size: 12px;
}

/* 푼 문제: 배경 채움 */
body .indicator.answered:not(.correct):not(.incorrect) {
  background: rgba(43, 74, 120, 0.35);
  border-color: rgba(43, 74, 120, 0.35);
  color: #fff;
  font-weight: 600;
}

/* 현재 + 푼 문제 */
body .indicator.current.answered:not(.correct):not(.incorrect) {
  background: var(--penguin-navy, #1D2F4E);
  border: 2px solid var(--penguin-navy, #1D2F4E);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}

/* 정답 */
body .indicator.correct,
body .indicator.checked-correct {
  background: rgba(52, 199, 89, 0.15);
  border-color: rgba(52, 199, 89, 0.4);
  color: #2d9f4f;
  font-weight: 600;
}

/* 오답 */
body .indicator.incorrect,
body .indicator.checked-incorrect {
  background: rgba(255, 59, 48, 0.1);
  border-color: rgba(255, 59, 48, 0.3);
  color: #d64040;
  font-weight: 600;
}

@media (max-width: 576px) {
  body .indicator {
    width: 26px;
    height: 26px;
    font-size: 10px;
  }

  body .question-indicators {
    gap: 6px;
  }

  body .progress-container {
    padding: 12px 16px;
    border-radius: var(--radius-md, 12px);
  }
}

/* ── Results Summary ── */
body .results-summary:empty {
  display: none;
}

body .results-summary {
  background: var(--color-bg-elevated, #fff);
  border-radius: var(--radius-xl, 20px);
  box-shadow: none;
  border: 1px solid var(--color-separator, rgba(0,0,0,0.06));
  padding: 48px 40px;
  margin: 40px auto;
  max-width: 520px;
  text-align: center;
}

body .results-title {
  font-size: var(--text-xl, 24px);
  font-weight: 700;
  color: var(--color-text-primary, #1d1d1f);
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  background: none;
  -webkit-text-fill-color: unset;
}

body .score-display {
  margin-bottom: 24px;
}

body .score-card {
  background: var(--color-bg-secondary, #f5f5f7);
  border-radius: var(--radius-lg, 16px);
  padding: 32px;
  border: none;
  box-shadow: none;
}

body .score-card:hover {
  transform: none;
  box-shadow: none;
}

body .score-label {
  font-size: var(--text-xs, 12px);
  font-weight: 600;
  color: var(--color-text-tertiary, #86868b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

body .score-value {
  font-size: 56px;
  font-weight: 700;
  color: var(--color-text-primary, #1d1d1f);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
  background: none;
  -webkit-text-fill-color: unset;
}

body .score-subvalue {
  font-size: var(--text-sm, 14px);
  color: var(--color-text-tertiary, #86868b);
  font-weight: 400;
}

body .score-percent {
  font-size: var(--text-sm, 14px);
  color: var(--color-text-secondary, #6e6e73);
  font-weight: 600;
  margin-top: 8px;
}

body .time-taken {
  font-size: var(--text-sm, 14px);
  color: var(--color-text-tertiary, #86868b);
  margin-bottom: 20px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}

body .time-taken strong {
  color: var(--color-text-primary, #1d1d1f);
}

body .results-message {
  font-size: var(--text-base, 17px);
  color: var(--color-text-secondary, #6e6e73);
  line-height: 1.6;
  margin-bottom: 24px;
  padding: 0;
  background: none;
  border: none;
}

body .results-criteria {
  background: var(--color-bg-secondary, #f5f5f7);
  border-radius: var(--radius-md, 12px);
  padding: 20px 24px;
  margin-bottom: 32px;
  border: none;
  text-align: left;
}

body .results-criteria__title {
  font-size: var(--text-xs, 12px);
  font-weight: 600;
  color: var(--color-text-tertiary, #86868b);
  letter-spacing: 0.03em;
  margin-bottom: 12px;
  padding: 0;
  border: none;
  background: none;
}

body .results-criteria__item {
  font-size: var(--text-sm, 14px);
  color: var(--color-text-secondary, #6e6e73);
  padding: 4px 0;
  border: none;
}

body .results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

body .action-button {
  padding: 12px 28px;
  border-radius: var(--radius-full, 9999px);
  font-size: var(--text-sm, 14px);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

body .action-button:hover {
  transform: none;
  box-shadow: none;
}

body .action-button.review-button {
  background: var(--color-text-primary, #1d1d1f);
  color: #fff;
}

body .action-button.review-button:hover {
  background: #333;
}

body .action-button.home-button {
  background: transparent;
  color: var(--color-text-tertiary, #86868b);
  border: 1px solid var(--color-border, #d2d2d7);
}

body .action-button.home-button:hover {
  color: var(--color-text-primary, #1d1d1f);
  border-color: var(--color-text-primary, #1d1d1f);
}

@media (max-width: 768px) {
  body .results-summary {
    padding: 36px 24px;
    margin: 24px 16px;
  }

  body .score-value {
    font-size: 44px;
  }

  body .score-card {
    padding: 24px;
  }

  body .results-actions {
    flex-direction: column;
  }

  body .action-button {
    width: 100%;
  }
}

/* ── Feedback ── */
body .answer-feedback {
  border-radius: var(--radius-lg, 16px);
  padding: 20px;
  margin-top: 20px;
}

body .correct-feedback {
  background: rgba(52, 199, 89, 0.06);
  border: 1px solid rgba(52, 199, 89, 0.15);
}

body .incorrect-feedback {
  background: rgba(255, 59, 48, 0.06);
  border: 1px solid rgba(255, 59, 48, 0.15);
}

/* ── Footer ── */
.fp-footer {
  background: #1D2F4E;
  color: rgba(255, 255, 255, 0.56);
  padding: 48px 24px 36px;
}

.fp-footer a {
  text-decoration: none;
  color: inherit;
}

.fp-footer__inner {
  max-width: 980px;
  margin: 0 auto;
}

.fp-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fp-footer__link {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.56);
  transition: color 0.2s;
}

.fp-footer__link:hover {
  color: rgba(255, 255, 255, 0.92);
}

.fp-footer__divider {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.16);
  align-self: center;
}

.fp-footer__meta {
  font-size: 11px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.36);
  margin-bottom: 16px;
}

.fp-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.fp-footer__copyright {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.36);
}

.fp-footer__sns {
  display: flex;
  gap: 16px;
}

.fp-footer__sns-link {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.44);
  transition: color 0.2s;
}

.fp-footer__sns-link:hover {
  color: rgba(255, 255, 255, 0.92);
}

@media (max-width: 768px) {
  .fp-footer {
    padding: 36px 20px 28px;
  }
  .fp-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
