/* public/css/ptu-exam-view.css
 * MAGIC ENGLISH Phase 2 — 능동 인출형 0~3단계 PTU 뷰어 · 오답 보관함 · 미니 어휘 퀴즈 · 태블릿 2단 실전 시험지 뷰 스타일시트
 */

/* 1. 0~3단계 PTU 활성 버튼 시각 강조 (aria-pressed="true") */
.stage-btn[aria-pressed="true"],
.me-card-stage-btn[aria-pressed="true"] {
  background-color: #4f46e5 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.28);
}

.me-step-next-btn {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #3730a3;
  border: 1px solid #a5b4fc;
  font-weight: 800;
  transition: all 0.16s ease;
}
.me-step-next-btn:hover {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

/* 2. 오답 보관함 북마크 & 좌측 전용 필터 버튼 */
.me-vault-toggle-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-weight: 700;
  transition: all 0.16s ease;
}
.me-vault-toggle-btn:hover {
  border-color: #f59e0b;
  color: #b45309;
  background: #fffbeb;
}
.me-vault-toggle-btn[aria-pressed="true"] {
  border-color: #f59e0b !important;
  background: #fef3c7 !important;
  color: #92400e !important;
  font-weight: 800 !important;
}

#wrongVaultFilterBtn[aria-pressed="true"] {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  color: #ffffff !important;
  border-color: #b45309 !important;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

/* 3. 고난도 문항 매력적 오답 함정 체크포인트 아코디언 */
.me-trap-accordion {
  background: #fffaf5;
  border: 1px solid #fed7aa;
  border-radius: 0.65rem;
}
.me-trap-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #fdba74;
  background: #ffffff;
  color: #9a3412;
  cursor: pointer;
  transition: all 0.15s ease;
}
.me-trap-chip:hover {
  background: #ffedd5;
}
.me-trap-chip[aria-pressed="true"] {
  background: #ea580c !important;
  color: #ffffff !important;
  border-color: #c2410c !important;
}

/* 4. 구문 래퍼 스팬(빨간 소괄호 / 파란 대괄호) 가독성 및 여닫는 기호 외톨이 줄바꿈 방지 */
.ptu-to,
.ptu-clause {
  padding: 0 2px;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.ptu-to {
  background-color: rgba(254, 226, 226, 0.35);
}
.ptu-clause {
  background-color: rgba(219, 234, 254, 0.35);
}

/* 5. 모바일 세로 화면 (767px 이하) PTU 괄호·색상 줄바꿈 최적화 */
@media (max-width: 767px) {
  .passage-justify {
    line-height: 1.98 !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
    text-align: left !important;
    letter-spacing: -0.005em;
  }
  .ptu-to,
  .ptu-clause {
    padding: 1px 3px;
  }
  .me-stage-bar-wrap {
    width: 100%;
    overflow-x: auto;
  }
}

/* 6. 태블릿 가로 화면 이상 (768px+) '실전 시험지 2단 뷰' 모드 */
#examPaperViewBtn[aria-pressed="true"] {
  background: #fbbf24 !important;
  color: #0f172a !important;
  border-color: #f59e0b !important;
  font-weight: 900 !important;
}

.me-exam-sheet-banner {
  display: none;
}

@media (min-width: 768px) {
  body.me-exam-paper-mode {
    background-color: #e2e8f0 !important;
  }
  body.me-exam-paper-mode #twoTrackHeroBar,
  body.me-exam-paper-mode #learningToolsSection,
  body.me-exam-paper-mode #leftFilterPanel,
  body.me-exam-paper-mode #rightVocabAside {
    display: none !important;
  }
  body.me-exam-paper-mode main {
    display: block !important;
    max-width: 1280px !important;
    margin: 1.25rem auto !important;
    background: #fdfdfb;
    border: 1px solid #94a3b8;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
    border-radius: 6px;
    padding: 2.25rem 2.75rem !important;
  }
  body.me-exam-paper-mode .me-exam-sheet-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 3px solid #0f172a;
    border-bottom: 1.5px solid #0f172a;
    padding: 0.65rem 0.25rem;
    margin-bottom: 1.5rem;
    font-family: "Noto Serif KR", "Batang", " KoPubBatang", Georgia, "Times New Roman", serif;
    color: #0f172a;
  }
  body.me-exam-paper-mode #passageContainer {
    column-count: 2;
    column-gap: 2.5rem;
    column-rule: 1px solid #cbd5e1;
    margin-top: 1rem;
  }
  body.me-exam-paper-mode #passageContainer > article {
    break-inside: avoid-column;
    page-break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin-bottom: 1.5rem !important;
    border-radius: 4px !important;
    border-color: #cbd5e1 !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }
  body.me-exam-paper-mode .passage-justify {
    font-family: Georgia, "Times New Roman", "Noto Serif KR", "Batang", serif !important;
    font-size: 15.5px !important;
    line-height: 1.88 !important;
    color: #111827 !important;
  }
  body.me-exam-paper-mode .bibliographic-badge-panel {
    display: none !important;
  }
  /* 실전 시험지 뷰 우측 상단 고정 페이싱 타이머 */
  body.me-exam-paper-mode #headerTimerWidget {
    position: fixed !important;
    top: 0.65rem;
    right: 1rem;
    z-index: 90;
    background: rgba(15, 23, 42, 0.96) !important;
    border: 1.5px solid #fbbf24 !important;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.35);
  }
}

/* 7. 토스트 알림 & 30초 미니 어휘 퀴즈 모달 */
#meToastContainer {
  position: fixed;
  bottom: 1.35rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.me-toast-item {
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: 999px;
  padding: 0.6rem 1.15rem;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.3);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.me-quiz-opt-btn {
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-radius: 0.75rem;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.84rem;
  font-weight: 700;
  transition: all 0.14s ease;
  cursor: pointer;
}
.me-quiz-opt-btn:hover:not(:disabled) {
  border-color: #6366f1;
  background: #eef2ff;
}
.me-quiz-opt-btn.is-correct {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
  color: #065f46 !important;
}
.me-quiz-opt-btn.is-wrong {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  color: #991b1b !important;
}

/* 미니 학습지 인쇄 시 오답 노트 요약 박스 표시 */
@media print {
  .me-print-vault-note {
    display: block !important;
    border: 1px dashed #64748b;
    padding: 8px 10px;
    margin-top: 8px;
    font-size: 11px;
    color: #1e293b;
  }
  .me-choices-zone.is-locked {
    display: none !important;
  }
}

/* 8. [Phase 4] Safe GEO 능동 인출 가이드 & PIN 인증 실전 5지선다 채점 UI */
.me-choices-zone {
  margin: 0.85rem 0 1rem 0;
}

.me-choices-zone.is-locked {
  padding: 0.78rem 0.95rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.7rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.me-locked-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.me-recall-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 0.55rem;
  padding: 0.42rem 0.75rem;
  font-size: 0.79rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.me-recall-toggle-btn:hover,
.me-recall-toggle-btn[aria-expanded="true"] {
  border-color: #6366f1;
  color: #4338ca;
  background: #eef2ff;
}

.me-unlock-choices-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #4f46e5;
  color: #ffffff;
  border: 1px solid #4338ca;
  border-radius: 0.55rem;
  padding: 0.44rem 0.85rem;
  font-size: 0.79rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.22);
}
.me-unlock-choices-btn:hover {
  background: #4338ca;
}

.me-recall-drawer {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #cbd5e1;
}

.me-choices-zone.is-hydrated {
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.me-kice-box {
  border: 1.5px solid #334155;
  padding: 0.65rem 0.85rem;
  border-radius: 0.4rem;
  background: #f8fafc;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
  line-height: 1.68;
  text-align: justify;
  color: #0f172a;
}

.me-kice-footnotes {
  text-align: right !important;
  font-size: 0.8rem;
  color: #475569;
  margin-bottom: 0.65rem;
  line-height: 1.5;
  font-weight: 500;
}

.me-subq-block + .me-subq-block {
  margin-top: 0.95rem;
  padding-top: 0.8rem;
  border-top: 1px dashed #cbd5e1;
}

.me-subq-stem {
  font-size: 0.87rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.5rem;
}
.me-subq-stem u {
  text-decoration: underline;
  text-decoration-color: #dc2626;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  color: #b91c1c;
}

.me-choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.me-choice-opt-btn {
  width: 100%;
  text-align: left;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.5rem 0.78rem;
  font-size: 0.91rem;
  line-height: 1.52;
  color: #0f172a;
  cursor: pointer;
  transition: all 0.14s ease;
}
.me-choice-opt-btn:hover {
  border-color: #6366f1;
  background: #f8fafc;
}
.me-choice-opt-btn.is-correct {
  background: #ecfdf5 !important;
  border-color: #10b981 !important;
  color: #065f46 !important;
  font-weight: 700;
}
.me-choice-opt-btn.is-wrong {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
  color: #991b1b !important;
  font-weight: 700;
}
.me-choice-opt-btn.is-answer-hint {
  border-color: #10b981 !important;
  border-width: 1.5px !important;
  background: #f0fdf4 !important;
}

.me-grade-feedback {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.55;
}

@media (min-width: 768px) {
  body.me-exam-paper-mode .me-choice-opt-btn,
  body.me-exam-paper-mode .me-subq-stem,
  body.me-exam-paper-mode .me-kice-footnotes {
    font-family: Georgia, "Times New Roman", "Noto Serif KR", "Batang", serif;
  }
  body.me-exam-paper-mode .me-choice-opt-btn {
    border-radius: 0.28rem;
    padding: 0.38rem 0.65rem;
    font-size: 0.89rem;
  }
}
