/* ===========================================
   PRINT STYLES
   Clean layout for paper-based revision
   =========================================== */

@media print {
  /* Hide interactive elements */
  .site-header,
  .wave-divider,
  .sidebar,
  .hamburger,
  .topic-nav,
  .flashcard-controls,
  .quiz-buttons,
  .diagram-controls,
  .mindmap-controls,
  .mark-complete,
  .btn,
  .reveal-btn,
  .progress-bar,
  .progress-text,
  .sidebar-progress,
  .quick-links,
  .section-links,
  .site-footer {
    display: none !important;
  }

  /* Reset layout */
  body {
    font-size: 11pt;
    color: #000;
    background: white;
    line-height: 1.5;
  }

  .page-layout {
    display: block;
  }

  .content {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  /* Remove decorative transforms */
  .key-facts,
  .tip-box,
  .warning-box,
  .topic-card,
  .mock-exam-intro {
    transform: none !important;
    box-shadow: none !important;
  }

  /* Post-it notes print as bordered boxes */
  .key-facts,
  .tip-box,
  .warning-box {
    border: 2px solid #333;
    background: white !important;
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
    page-break-inside: avoid;
  }

  /* Show quiz questions, hide answers */
  .quiz-answer,
  .model-answer {
    display: none !important;
  }

  .quiz-score {
    display: none !important;
  }

  .quiz-question {
    border-left: 3px solid #333;
    box-shadow: none;
    page-break-inside: avoid;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
  }

  /* Short answer: show blank lines */
  .quiz-short-answer {
    border: none;
    border-bottom: 1px solid #333;
    display: block;
    width: 100%;
    min-height: 2rem;
  }

  /* Mock exam questions */
  .mock-exam-question {
    box-shadow: none;
    border: 1px solid #ccc;
    border-top: 3px solid #333;
    page-break-inside: avoid;
  }

  .exam-part {
    page-break-inside: avoid;
  }

  /* Answer lines for mock exam */
  .exam-part::after {
    content: '';
    display: block;
    margin-top: 1rem;
    border-bottom: 1px dotted #999;
    padding-top: 1.5rem;
  }

  /* Diagrams */
  .diagram-wrapper {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  /* Hide diagram labels for fill-in-the-blank */
  .diagram-label text {
    fill: transparent !important;
  }

  .diagram-label rect {
    stroke: #333;
    stroke-dasharray: 4 2;
    fill: white;
  }

  /* Mind maps */
  .mindmap-container {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  /* Flashcards print as a term list */
  .flashcard-deck {
    display: none;
  }

  .flashcards-print-list {
    display: block !important;
  }

  .flashcards-print-list dt {
    font-weight: bold;
    margin-top: 0.5rem;
  }

  .flashcards-print-list dd {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: transparent; /* Hide definitions for paper revision */
    border-bottom: 1px dotted #999;
    min-height: 1.5rem;
  }

  /* Page breaks */
  .subtopic-section {
    page-break-before: auto;
  }

  .quiz-section,
  .mock-exam-section,
  .flashcards-section,
  .mindmap-section {
    page-break-before: always;
  }

  h2, h3 {
    page-break-after: avoid;
  }

  /* Links show URL */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  a[href^="#"]::after,
  a[href^="javascript"]::after {
    content: "";
  }

  /* Tables */
  .data-table th {
    background: #eee !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Hidden print-only elements */
.flashcards-print-list {
  display: none;
}
