/* 🏛️ PastExamModule Container Shell & Sub-module Stylesheet */
.pastexam-module-root {
  min-height: 100vh;
  background-color: var(--bg-primary, #060608);
  color: var(--text-primary, #ffffff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 12px;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, sans-serif;
  position: relative;
  overflow-x: hidden;
}

/* Container Shell Top Navigation Bar */
.pastexam-module-root .top-nav-bar {
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  background: var(--bg-card, #1c1c1e);
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid var(--border-color, #2c2c2e);
  box-shadow: var(--card-shadow, 0 4px 16px rgba(0,0,0,0.2));
  backdrop-filter: blur(12px);
  box-sizing: border-box;
}

.pastexam-module-root .top-row-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pastexam-module-root .nav-left-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pastexam-module-root #current-index-text {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-blue, #007aff);
  white-space: nowrap;
}

.pastexam-module-root .progress-bar-bg {
  flex: 1;
  min-width: 60px;
  height: 8px;
  background-color: var(--bg-secondary, #2c2c2e);
  border-radius: 4px;
  overflow: hidden;
}

.pastexam-module-root .progress-bar-fill {
  height: 100%;
  background-color: var(--accent-blue, #007aff);
  width: 0%;
  transition: width 0.3s ease;
}

.pastexam-module-root .nav-icon-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Row 2: Mode Tabs & Subject Selector & ZIP Button */
.pastexam-module-root .top-row-sub {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* Learning Mode Switcher Tabs */
.pastexam-module-root .mode-tab-group {
  display: flex;
  background: var(--bg-secondary, #2c2c2e);
  padding: 3px;
  border-radius: 12px;
  gap: 4px;
}

.pastexam-module-root .mode-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary, #8e8e93);
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.pastexam-module-root .mode-tab-btn.active {
  background: var(--accent-blue, #007aff);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0,122,255,0.3);
}

.pastexam-module-root .count-select,
.pastexam-module-root .subject-select {
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid var(--accent-blue, #007aff);
  background-color: var(--bg-primary, #060608);
  color: var(--text-primary, #ffffff);
  outline: none;
  cursor: pointer;
  white-space: nowrap;
}

.pastexam-module-root .count-select {
  border-color: #ff9500;
  color: #ff9500;
}

.pastexam-module-root .btn-capture-all {
  background: rgba(0, 122, 255, 0.12);
  border: 1px solid var(--accent-blue, #007aff);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-blue, #007aff);
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Card Container */
.pastexam-module-root .sub-module-viewport {
  width: 100%;
  max-width: 920px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pastexam-module-root .card-container {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
  padding-bottom: 24px;
  box-sizing: border-box;
}

.pastexam-module-root .capture-area-box {
  width: 100%;
  background: var(--bg-card, #1c1c1e);
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color, #2c2c2e);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Badges */
.pastexam-module-root .badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 8px;
}

.pastexam-module-root .badge-topic,
.pastexam-module-root .badge-source {
  background-color: rgba(0, 122, 255, 0.12);
  color: var(--accent-blue, #007aff);
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
}

.pastexam-module-root .badge-count,
.pastexam-module-root .badge-wrong-count {
  background-color: rgba(255, 59, 48, 0.12);
  color: #ff453a;
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
}

.pastexam-module-root .badge-review-wrong-count {
  background-color: rgba(175, 82, 222, 0.15);
  color: #bf5af2;
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
}

.pastexam-module-root .badge-result {
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
}
.pastexam-module-root .badge-result.correct { background: rgba(48, 209, 88, 0.15); color: #30d158; }
.pastexam-module-root .badge-result.wrong { background: rgba(255, 69, 58, 0.15); color: #ff453a; }

.pastexam-module-root .btn-show-result {
  background: var(--accent-blue, #007aff);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.pastexam-module-root .question-text {
  font-size: 1.1rem;
  line-height: 1.65;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  word-break: keep-all;
  margin-bottom: 16px;
}

/* O / X Large Interactive Choice Buttons */
.pastexam-module-root .ox-btn-container {
  display: flex;
  gap: 16px;
  width: 100%;
  margin-top: 14px;
  margin-bottom: 20px;
}

.pastexam-module-root .ox-choice-btn {
  flex: 1;
  padding: 24px 16px;
  border-radius: 18px;
  font-size: 28px;
  font-weight: 900;
  cursor: pointer;
  background: var(--bg-card, #1c1c1e);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pastexam-module-root .ox-btn-o {
  border: 2px solid var(--accent-blue, #007aff);
  color: var(--accent-blue, #007aff);
}

.pastexam-module-root .ox-btn-o:hover {
  background: rgba(0, 122, 255, 0.1);
}

.pastexam-module-root .ox-btn-o.selected {
  background: var(--accent-blue, #007aff);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.pastexam-module-root .ox-btn-x {
  border: 2px solid #ff453a;
  color: #ff453a;
}

.pastexam-module-root .ox-btn-x:hover {
  background: rgba(255, 69, 58, 0.1);
}

.pastexam-module-root .ox-btn-x.selected {
  background: #ff453a;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(255, 69, 58, 0.4);
}

.pastexam-module-root .ox-choice-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* u-wrong & u-correct Custom Underlines */
u-wrong {
  color: #ff453a;
  font-weight: 800;
  border-bottom: 2.5px dashed #ff453a;
  padding-bottom: 1px;
  display: inline !important;
}

u-correct {
  color: var(--accent-blue, #007aff);
  font-weight: 800;
  background-color: rgba(0, 122, 255, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
  display: inline !important;
}

.pastexam-module-root .material-box {
  background: var(--bg-secondary, #2c2c2e);
  border-left: 4px solid var(--accent-blue, #007aff);
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 16px;
  color: var(--text-primary, #ffffff);
}

/* Choices Items */
.pastexam-module-root .choices-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.pastexam-module-root .choice-item {
  background: var(--bg-secondary, #2c2c2e);
  border: 1px solid var(--border-color, #38383a);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pastexam-module-root .choice-item:hover {
  border-color: var(--accent-blue, #007aff);
}

.pastexam-module-root .choice-item.correct {
  background: rgba(48, 209, 88, 0.12);
  border-color: #30d158;
}

.pastexam-module-root .choice-item.wrong {
  background: rgba(255, 69, 58, 0.12);
  border-color: #ff453a;
}

.pastexam-module-root .choice-item.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.pastexam-module-root .choice-content {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.98rem;
  font-weight: 700;
}

.pastexam-module-root .choice-number {
  color: var(--accent-blue, #007aff);
  font-weight: 800;
}

.pastexam-module-root .choice-explanation {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary, #a1a1a6);
  background: rgba(0,0,0,0.2);
  padding: 10px 12px;
  border-radius: 10px;
  margin-top: 4px;
  border-left: 3px solid var(--accent-blue, #007aff);
}

/* Core Explain & Highlights */
.pastexam-module-root .core-explain-box {
  background: rgba(255, 149, 0, 0.08);
  border: 1px dashed #ff9500;
  padding: 16px 18px;
  border-radius: 14px;
  margin-top: 16px;
  font-size: 0.95rem;
}

/* O/X and Choice Explanation & Analogy <u> Tag Index Highlights */
.pastexam-module-root .explanation u,
.pastexam-module-root .choice-explanation u,
.pastexam-module-root #coreExplainContent u {
  color: var(--accent-blue, #007aff);
  font-weight: 800;
  text-decoration: none;
  background-color: rgba(0, 122, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block !important;
}

.pastexam-module-root .analogy-box u {
  color: #ff9500;
  font-weight: 800;
  text-decoration: underline;
  display: inline !important;
}

.hl-choice {
  color: #64d2ff;
  font-weight: 800;
  background: rgba(100, 210, 255, 0.15);
  padding: 1px 4px;
  border-radius: 4px;
}

.hl-explain {
  color: #ffd60a;
  font-weight: 800;
  background: rgba(255, 214, 10, 0.15);
  padding: 1px 4px;
  border-radius: 4px;
}

/* O/X Answer Section & Distinct Containers for Explanation and Analogy */
.pastexam-module-root .answer-section {
  display: none;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  margin-top: 16px;
  box-sizing: border-box;
}

.pastexam-module-root .answer-section.open {
  display: flex !important;
}

.pastexam-module-root .answer-title {
  width: 100% !important;
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pastexam-module-root .answer-title.correct { color: #30d158; }
.pastexam-module-root .answer-title.wrong { color: #ff453a; }

.pastexam-module-root .explanation {
  width: 100% !important;
  box-sizing: border-box !important;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text-primary, #ffffff);
  background: var(--bg-secondary, #2c2c2e);
  padding: 18px 20px;
  border-radius: 14px;
  border-left: 5px solid var(--accent-blue, #007aff);
  display: block !important;
  text-align: left !important;
  word-break: keep-all;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pastexam-module-root .analogy-box {
  width: 100% !important;
  box-sizing: border-box !important;
  background-color: rgba(255, 149, 0, 0.08);
  border: 1.5px dashed rgba(255, 149, 0, 0.6);
  padding: 18px 20px;
  border-radius: 14px;
  font-size: 0.98rem;
  color: #ff9500;
  line-height: 1.6;
  display: block !important;
  text-align: left !important;
  margin-top: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pastexam-module-root .analogy-title {
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: #ff9500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Reveal Button */
.pastexam-module-root .btn-reveal-answer {
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-secondary, #2c2c2e);
  border: 1.5px dashed var(--accent-blue, #007aff);
  color: var(--accent-blue, #007aff);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* LearnToRun Result Modal */
.pastexam-module-root .result-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(6, 6, 8, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
  box-sizing: border-box;
}

.pastexam-module-root .result-modal-content {
  width: 100%;
  max-width: 600px;
  background: var(--bg-card, #1c1c1e);
  border: 1px solid var(--border-color, #2c2c2e);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 90vh;
  overflow-y: auto;
}

.pastexam-module-root .result-header {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-blue, #007aff);
  text-align: center;
}

.pastexam-module-root .summary-details {
  display: flex;
  justify-content: space-around;
  background: var(--bg-secondary, #2c2c2e);
  padding: 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
}

.pastexam-module-root .status-grid-container {
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-primary, #060608);
  padding: 14px;
  border-radius: 14px;
}

.pastexam-module-root .status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 8px;
}

.pastexam-module-root .status-circle {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.pastexam-module-root .status-circle:hover { transform: scale(1.1); }
.pastexam-module-root .status-circle.correct { background: #30d158; color: #ffffff; }
.pastexam-module-root .status-circle.wrong { background: #ff453a; color: #ffffff; }
.pastexam-module-root .status-circle.unsolved { background: #38383a; color: #8e8e93; }

.pastexam-module-root .modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pastexam-module-root .btn-retry,
.pastexam-module-root .btn-save,
.pastexam-module-root .btn-close {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pastexam-module-root .btn-retry { background: rgba(255, 149, 0, 0.15); color: #ff9500; }
.pastexam-module-root .btn-save { background: var(--accent-blue, #007aff); color: #ffffff; }
.pastexam-module-root .btn-close { background: var(--bg-secondary, #2c2c2e); color: var(--text-primary, #ffffff); }

.pastexam-module-root .gesture-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary, #8e8e93);
  margin-top: 14px;
  font-style: italic;
}

.pastexam-module-root .flash-loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(6, 6, 8, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  font-weight: 700;
  color: var(--accent-blue, #007aff);
  gap: 12px;
}
