/* MANDALA DRAWING BOOK - PRINT ENGINE STYLESHEET */

#print-book-container {
  display: none;
}

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

  /* Hide interactive web UI during print */
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .app-header,
  .main-content,
  .app-footer,
  .modal-backdrop,
  .floating-zoom-controls {
    display: none !important;
  }

  #print-book-container {
    display: block !important;
    width: 100% !important;
  }

  /* --- PRINT PAGES (PAGINATION) --- */

  .print-page {
    page-break-before: always;
    page-break-after: always;
    break-after: page;
    width: 100%;
    height: 98vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 10px 0;
    position: relative;
    background: #FFFFFF !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-page:first-child {
    page-break-before: avoid;
  }

  /* FRONT & BACK COVERS */
  .print-cover-front,
  .print-cover-back {
    justify-content: center;
    align-items: center;
    padding: 0;
  }

  .print-cover-img {
    width: 100%;
    max-height: 95vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
  }

  /* TITLE & GUIDE INTRO PAGE */
  .print-intro-page {
    padding: 30px;
    border: 2px solid #1A1A1A;
    border-radius: 8px;
  }

  .print-intro-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .print-book-title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 2.2rem;
    letter-spacing: 0.1em;
    color: #000000;
    margin-top: 10px;
  }

  .print-book-subtitle {
    font-size: 1.05rem;
    color: #444444;
    font-weight: 600;
  }

  .print-ornament {
    font-size: 1.2rem;
    letter-spacing: 8px;
    color: #888888;
    margin: 6px 0;
  }

  .print-guide-box {
    text-align: left;
    background: #F9F9F9;
    border: 1px solid #DDDDDD;
    padding: 18px 24px;
    border-radius: 6px;
  }

  .print-guide-box h2 {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: #111111;
  }

  .print-guide-box p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333333;
    margin-bottom: 10px;
  }

  .print-guide-box h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: #111111;
  }

  .print-guide-box ul {
    padding-left: 20px;
    font-size: 0.88rem;
    line-height: 1.6;
    color: #333333;
  }

  .print-toc-preview {
    text-align: left;
    border-top: 1px solid #EEEEEE;
    padding-top: 14px;
  }

  .print-toc-preview h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }

  .print-toc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.84rem;
    color: #444444;
  }

  .print-dedication {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #CCCCCC;
    font-size: 0.88rem;
    color: #555555;
  }

  /* MANDALA COLORING PAGES (1 TO 50) */
  .print-mandala-page {
    padding: 10px 15px;
  }

  .print-mandala-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1.5px solid #111111;
    padding-bottom: 6px;
    margin-bottom: 6px;
  }

  .print-header-left, .print-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .print-page-num {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.85rem;
    font-weight: 800;
    color: #000000;
  }

  .print-chapter-tag {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #555555;
  }

  .print-difficulty {
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: #000000;
  }

  .print-age-badge {
    font-size: 0.75rem;
    font-weight: 600;
    background: #EEEEEE;
    padding: 2px 8px;
    border-radius: 4px;
  }

  .print-mandala-title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    margin: 4px 0 2px 0;
    color: #000000;
  }

  .print-mandala-prompt {
    font-size: 0.82rem;
    text-align: center;
    color: #444444;
    margin-bottom: 6px;
  }

  .print-svg-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 70vh;
    margin: 4px 0;
  }

  .print-svg-wrapper svg {
    width: 100%;
    height: 100%;
    max-height: 68vh;
  }

  /* MANDALA FOOTER & COLOR TEST SWATCHES */
  .print-mandala-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #DDDDDD;
    padding-top: 8px;
    margin-top: 4px;
  }

  .print-footer-quote {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.05rem;
    font-style: italic;
    color: #333333;
    max-width: 65%;
  }

  .print-swatch-box {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .print-swatch-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #666666;
    text-transform: uppercase;
  }

  .print-swatch-dots {
    display: flex;
    gap: 6px;
  }

  .swatch-circle {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid #111111;
    background: #FFFFFF;
  }

  /* BONUS ACTIVITY DRAWING PAGE */
  .print-activity-grid {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 70vh;
  }

  .activity-grid-svg {
    width: 100%;
    height: 100%;
    max-height: 68vh;
  }
}
