/* Authentic Physical OMR Sheet Styling */
.omr-sheet-wrapper {
  display: flex;
  justify-content: center;
  padding: 20px 0;
  background-color: #cbd5e1;
  overflow-x: auto;
  min-height: 100vh;
}

[data-theme="dark"] .omr-sheet-wrapper {
  background-color: #0b1120;
}

.omr-sheet {
  width: 900px;
  background: #fdfcf8; /* authentic high quality OMR paper tint */
  color: #0f172a;
  border-radius: 4px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  position: relative;
  padding: 30px;
  margin: 0 auto;
  user-select: none;
  border: 1px solid #d1d5db;
}

/* 1. Fiducial Corner Alignment Markers (Solid 32x32px black squares) */
.fiducial {
  position: absolute;
  width: 28px;
  height: 28px;
  background-color: #000000;
  z-index: 10;
}
.fiducial-tl { top: 18px; left: 18px; }
.fiducial-tr { top: 18px; right: 18px; }
.fiducial-bl { bottom: 18px; left: 18px; }
.fiducial-br { bottom: 18px; right: 18px; }

/* 2. Top & Bottom Synchronization Timing Tracks */
.timing-track {
  display: flex;
  justify-content: space-between;
  margin: 0 45px;
  height: 12px;
}
.timing-track.top {
  margin-top: -6px;
  margin-bottom: 12px;
}
.timing-track.bottom {
  margin-top: 14px;
  margin-bottom: -6px;
}
.timing-block {
  width: 10px;
  height: 10px;
  background-color: #000000;
}
.timing-block.spacer {
  background-color: transparent;
}

/* 3. Header Section */
.omr-header {
  border: 2px solid #1e3a8a;
  margin-bottom: 14px;
  background-color: #ffffff;
}

.omr-header-banner {
  background-color: #1e3a8a;
  color: #ffffff;
  text-align: center;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.omr-header-sub {
  text-align: center;
  padding: 8px 12px;
}

.omr-header-board {
  color: #b91c1c;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.omr-header-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 3px;
}

.omr-header-exam-info {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e40af;
  margin-top: 4px;
}

.omr-header-marks-info {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #475569;
  margin-top: 3px;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
}

/* 4. Metadata Section: Name, Roll Number, Set & Instructions */
.omr-meta-section {
  display: grid;
  grid-template-columns: 1fr 240px 110px;
  gap: 12px;
  border: 1px solid #cbd5e1;
  padding: 12px;
  background: #ffffff;
  margin-bottom: 16px;
}

/* 4b. Authentic Candidate Information & Set Code Section */
.omr-meta-section-auth {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 14px;
  margin-bottom: 16px;
}

.candidate-info-box {
  border: 1.5px solid #1e293b;
  background: #ffffff;
}

.candidate-info-header {
  background: #f1f5f9;
  border-bottom: 1px solid #1e293b;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.03em;
}

.candidate-row {
  display: flex;
  border-bottom: 1px solid #cbd5e1;
}

.candidate-row:last-child {
  border-bottom: none;
}

.candidate-cell {
  flex: 1;
  padding: 6px 10px;
  border-right: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  min-height: 48px;
}

.candidate-cell:last-child {
  border-right: none;
}

.candidate-cell.w-class {
  flex: 0 0 110px;
}

.candidate-cell.w-phone {
  flex: 0 0 160px;
}

.candidate-cell.w-school {
  flex: 1;
}

.cell-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cell-value {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.04em;
  font-family: inherit;
  min-height: 20px;
}

.meta-right-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qr-verify-box {
  border: 1.5px solid #1e293b;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  height: 82px;
}

.simulated-qr {
  width: 58px;
  height: 58px;
  border: 1.5px solid #0f172a;
  position: relative;
  background: #ffffff;
  flex-shrink: 0;
}

.qr-marker {
  width: 15px;
  height: 15px;
  background: #0f172a;
  position: absolute;
}

.qr-tl { top: 3px; left: 3px; }
.qr-tr { top: 3px; right: 3px; }
.qr-bl { bottom: 3px; left: 3px; }

.qr-dot {
  width: 12px;
  height: 12px;
  background: #0f172a;
  position: absolute;
  top: 23px;
  left: 23px;
}

.qr-text {
  display: flex;
  flex-direction: column;
  font-size: 0.68rem;
  line-height: 1.25;
  color: #475569;
}

.qr-text strong {
  color: #0f172a;
  font-weight: 900;
}

.qr-text small {
  font-size: 0.58rem;
  color: #64748b;
}

.set-code-block {
  border: 1.5px solid #1e293b;
  background: #ffffff;
  text-align: center;
}

.set-code-header {
  background: #f1f5f9;
  border-bottom: 1px solid #1e293b;
  padding: 3px 6px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #0f172a;
}

.set-code-bubbles {
  display: flex;
  justify-content: space-around;
  padding: 10px 8px 6px;
}

.set-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.15s ease;
}

.set-circle.filled {
  background: #1e3a8a;
  border-color: #1e3a8a;
  color: #ffffff;
}

.set-code-footer {
  font-size: 0.58rem;
  color: #94a3b8;
  font-weight: 700;
  padding-bottom: 6px;
  text-transform: uppercase;
}

/* 20-Box Candidate Name */
.meta-block-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.name-boxes-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}

.letter-box {
  height: 26px;
  border: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #1e3a8a;
  background: #ffffff;
}

/* Instructions box */
.instructions-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.68rem;
  margin-top: 8px;
}

.instructions-diagram {
  display: flex;
  gap: 14px;
  margin: 6px 0;
  align-items: center;
}

.method-label {
  font-weight: 700;
  font-size: 0.68rem;
}

.method-correct { color: #15803d; }
.method-wrong { color: #dc2626; }

.mini-bubble {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  border: 1px solid #94a3b8;
  margin-right: 2px;
}
.mini-bubble.filled {
  background-color: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

/* 7-Digit Roll Number Grid */
.roll-grid-container {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.roll-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.roll-digit-box {
  width: 24px;
  height: 24px;
  border: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #1e3a8a;
  background: #ffffff;
}

.roll-bubble {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  background-color: #ffffff;
  transition: all 0.1s ease;
}

.roll-bubble.filled {
  background-color: #1e3a8a;
  border-color: #1e3a8a;
  color: #ffffff;
  font-weight: 800;
}

/* SET Code Box */
.set-box-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.set-display-box {
  width: 48px;
  height: 32px;
  border: 2px solid #1e3a8a;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #1e3a8a;
  margin-bottom: 8px;
}

.set-bubbles-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* 5. Questions Response Grid */
.omr-questions-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  border: 1px solid #cbd5e1;
  padding: 12px;
  background: #ffffff;
}

.q-column {
  border: 1px solid #e2e8f0;
}

.q-col-header {
  background-color: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  display: grid;
  grid-template-columns: 36px 1fr;
  padding: 6px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
}

.q-options-header {
  display: flex;
  justify-content: space-around;
  padding-right: 4px;
}

.q-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  padding: 4px;
  position: relative;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.72rem;
}

/* 5-question alternating band */
.q-row.band-shade {
  background-color: #f8fafc;
}

.q-row.divider-row {
  border-bottom: 2px solid #94a3b8;
}

/* Left Optical Timing Bar aligned to question row */
.optical-timing-tick {
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 8px;
  background-color: #000000;
}

.q-num {
  font-weight: 700;
  color: #1e293b;
  text-align: center;
}

.q-bubbles {
  display: flex;
  justify-content: space-around;
  padding-right: 4px;
}

.omr-bubble {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
  background-color: #ffffff;
  cursor: pointer;
  transition: all 0.12s ease;
}

/* Filled Bubble - Navy Ink */
.omr-bubble.filled-ink {
  background-color: #1e3a8a;
  border-color: #1e3a8a;
  color: #ffffff;
  font-weight: 800;
}

/* Evaluated Overlays */
/* Correct Answer marked by student - Emerald Green */
.omr-bubble.eval-correct {
  background-color: #059669 !important;
  border-color: #047857 !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 0 6px rgba(5, 150, 105, 0.5);
}

/* Incorrect Answer marked by student - Crimson Red */
.omr-bubble.eval-wrong {
  background-color: #dc2626 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 0 6px rgba(220, 38, 38, 0.5);
}

/* Actual correct bubble outlined in Light Green */
.omr-bubble.eval-correct-outline {
  border: 2px solid #16a34a !important;
  color: #15803d !important;
  background-color: #f0fdf4 !important;
  font-weight: 800;
}

/* Interactive mode hover */
.interactive-mode .omr-bubble:hover {
  border-color: #1e3a8a;
  transform: scale(1.1);
  box-shadow: 0 0 4px rgba(30, 58, 138, 0.3);
}

/* 6. Footer Section: Signatures & Barcode */
.omr-footer {
  margin-top: 16px;
  border: 1px solid #cbd5e1;
  padding: 12px 16px;
  background: #ffffff;
  display: grid;
  grid-template-columns: 1fr 1fr 200px;
  gap: 16px;
  align-items: center;
}

.signature-box {
  height: 60px;
  border: 1px dashed #94a3b8;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #fdfdfd;
}

.sig-title {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.sig-content {
  font-family: cursive, sans-serif;
  font-size: 0.95rem;
  color: #1e3a8a;
  text-align: center;
}

.sig-verified {
  font-size: 0.72rem;
  font-weight: 700;
  color: #059669;
  text-align: center;
}

.barcode-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.barcode-bars {
  display: flex;
  align-items: flex-end;
  height: 38px;
  gap: 2px;
}

.b-bar {
  background-color: #0f172a;
  height: 100%;
}
.b-bar.thin { width: 1.5px; }
.b-bar.thick { width: 3.5px; }
.b-bar.space { width: 2px; background: transparent; }

.barcode-text {
  font-size: 0.65rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.1em;
  margin-top: 3px;
}
