/* Pure Black & White Print-Optimized Stylesheet for A4 Paper & PDF Output */

@page {
  size: A4;
  margin: 15mm 12mm 15mm 12mm;
}

@media print {
  /* Hide all interactive UI elements */
  body * {
    visibility: hidden;
  }

  .no-print,
  #app-header,
  #bottom-nav,
  #modal-container,
  .btn,
  header,
  nav,
  footer,
  #toast-container {
    display: none !important;
  }

  /* Make print container visible and occupy full page */
  #print-area,
  #print-area * {
    visibility: visible;
  }

  #print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
    font-size: 10.5pt;
    line-height: 1.5;
  }

  .page-break {
    page-break-before: always !important;
    break-before: page !important;
  }

  .print-question-item {
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 12pt;
    padding-bottom: 8pt;
    border-bottom: 1px solid #000000;
  }

  /* Enforce pure black & white, no ink-wasting colors */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    box-shadow: none !important;
    text-shadow: none !important;
    color: #000000 !important;
    background-color: transparent !important;
  }
}

/* Standalone Print Sheet Styles */
.print-sheet {
  background: #ffffff;
  color: #000000;
  max-width: 820px;
  margin: 0 auto;
}

.print-header-simple {
  border-bottom: 2px solid #000000;
  padding-bottom: 6px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.print-round-title {
  font-size: 18pt;
  font-weight: 800;
  color: #000000;
  letter-spacing: 0.05em;
}

.print-score-box-bw {
  border: 1.5px solid #000000;
  padding: 4px 14px;
  font-size: 10pt;
  font-weight: 700;
  text-align: center;
}

.print-question-item {
  page-break-inside: avoid;
  break-inside: avoid;
  margin-bottom: 10pt;
  padding-bottom: 8pt;
  border-bottom: 0.5px solid #cccccc;
}

.print-q-stem {
  font-size: 10.5pt;
  font-weight: 600;
  color: #000000;
  margin-bottom: 5px;
  line-height: 1.45;
}

.print-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px 14px;
  font-size: 10pt;
  color: #000000;
}

.print-opt-letter {
  font-weight: 800;
  margin-right: 4px;
}

/* Answers & Explanations Box */
.print-ans-box {
  border-left: 2.5px solid #000000;
  padding: 4px 8px;
  margin-top: 5px;
  font-size: 9.5pt;
  color: #000000;
}

.print-ans-badge-bw {
  display: inline-block;
  border: 1px solid #000000;
  padding: 1px 6px;
  font-weight: 800;
  font-size: 9pt;
  margin-bottom: 3px;
}

.print-exp-section {
  margin-top: 3px;
  line-height: 1.4;
}

.print-exp-label {
  font-weight: 700;
}
