/**
 * Print Stylesheet voor Thuispakket.nl
 * 
 * Doel: Perfect printbaar op A4 (portrait)
 * - Noodplan + Checklist op 1-2 nette A4'tjes
 * - Geen navigatie/footer in print
 * - Goede leesbaarheid en paginabreaks
 */

/* ============================================================================
   ALGEMENE PRINT RESET
   ============================================================================ */

@media print {
  /* Basis reset */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* Verberg navigatie, footer, knoppen */
  header,
  footer,
  .nav,
  .footer,
  .tp-print-button,
  button:not(.tp-print-keep),
  .actions,
  .skip-link,
  #today-tips-modal,
  .modal {
    display: none !important;
  }

  /* Reset body styling voor print */
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Page setup voor A4 */
  @page {
    size: A4 portrait;
    margin: 1.5cm 1.5cm 1.5cm 1.5cm;
  }

  /* Voorkom page breaks op verkeerde plekken */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  /* Voorkom dat secties worden doorgesneden */
  section,
  .tp-print-section,
  .tp-checklist-section {
    page-break-inside: avoid;
  }

  /* Voorkom dat lijsten worden doorgesneden */
  ul, ol {
    page-break-inside: avoid;
  }

  /* Links zichtbaar maken in print */
  a {
    color: #000 !important;
    text-decoration: underline !important;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666;
  }

  /* Links binnen dezelfde site niet laten zien */
  a[href^="#"]:after,
  a[href^="."]:after {
    content: "";
  }
}

/* ============================================================================
   PRINT-OVERVIEW PAGINA
   ============================================================================ */

@media print {
  .tp-print-page {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: #fff !important;
  }

  .tp-print-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #000;
  }

  .tp-print-header h2 {
    font-size: 18pt !important;
    margin: 0 0 0.5rem 0 !important;
  }

  .tp-print-section {
    margin-top: 1.5rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid #ccc !important;
  }

  .tp-print-section:first-of-type {
    border-top: none !important;
    padding-top: 0 !important;
  }

  .tp-print-section h3 {
    font-size: 14pt !important;
    margin: 0 0 0.75rem 0 !important;
    font-weight: 700 !important;
  }

  .tp-print-meta {
    font-size: 9pt !important;
    color: #666 !important;
    margin-top: 0.5rem !important;
  }
}

/* ============================================================================
   CHECKLIST PRINT
   ============================================================================ */

@media print {
  .tp-checklist-container,
  #checklist-container {
    margin: 0 !important;
    padding: 0 !important;
  }

  .tp-checklist-section {
    margin-bottom: 1.25rem !important;
    page-break-inside: avoid;
  }

  .tp-checklist-section h3,
  .tp-checklist-section h4 {
    font-size: 13pt !important;
    margin: 0 0 0.75rem 0 !important;
    font-weight: 700 !important;
    page-break-after: avoid;
  }

  .tp-checklist-item {
    margin-bottom: 0.5rem !important;
    padding: 0.25rem 0 !important;
    page-break-inside: avoid;
  }

  .tp-checklist-item input[type="checkbox"] {
    margin-right: 0.5rem !important;
    width: 12pt !important;
    height: 12pt !important;
    -webkit-appearance: checkbox !important;
    appearance: checkbox !important;
    border: 1px solid #000 !important;
  }

  .tp-checklist-item label {
    font-size: 11pt !important;
    line-height: 1.4 !important;
    display: flex !important;
    align-items: flex-start !important;
  }

  .tp-checklist-item label strong {
    font-weight: 600 !important;
  }

  /* Hint tekst kleiner */
  .tp-checklist-item div[style*="font-size:0.875rem"] {
    font-size: 9pt !important;
    color: #666 !important;
    margin-top: 0.125rem !important;
    margin-left: 1.5rem !important;
  }
}

/* ============================================================================
   NOODPLAN PRINT
   ============================================================================ */

@media print {
  .tp-noodplan-form,
  #noodplan-section {
    margin: 0 !important;
    padding: 0 !important;
  }

  .tp-noodplan-form fieldset {
    margin-bottom: 1.25rem !important;
    page-break-inside: avoid;
    border: none !important;
    padding: 0 !important;
  }

  .tp-noodplan-form legend {
    font-size: 13pt !important;
    font-weight: 700 !important;
    margin-bottom: 0.75rem !important;
    page-break-after: avoid;
  }

  .tp-noodplan-form label {
    display: block !important;
    margin-bottom: 0.5rem !important;
    font-size: 11pt !important;
  }

  /* Verberg wizard knoppen */
  .tp-wizard-buttons {
    display: none !important;
  }
}

/* ============================================================================
   RISICO PAGINA PRINT
   ============================================================================ */

@media print {
  #risk-hero-section {
    display: none !important;
  }

  #risk-result {
    margin: 0 !important;
    padding: 0 !important;
  }

  #risk-map-section {
    display: none !important;
  }

  .card {
    page-break-inside: avoid;
    margin-bottom: 1rem !important;
    padding: 1rem !important;
    border: 1px solid #ccc !important;
    background: #fff !important;
  }

  .card__title {
    font-size: 13pt !important;
    margin: 0 0 0.5rem 0 !important;
  }

  /* Verberg actieknoppen */
  .actions,
  .button {
    display: none !important;
  }
}

/* ============================================================================
   ALGEMENE PAGINA ELEMENTEN
   ============================================================================ */

@media print {
  /* Verberg alerts in print (tenzij specifiek voor print bedoeld) */
  .alert:not(.tp-print-keep) {
    display: none !important;
  }

  /* Tabellen */
  table {
    border-collapse: collapse !important;
    width: 100% !important;
  }

  table th,
  table td {
    border: 1px solid #000 !important;
    padding: 0.5rem !important;
    font-size: 10pt !important;
  }

  /* Lijsten compacter */
  ul, ol {
    margin: 0.5rem 0 !important;
    padding-left: 1.5rem !important;
  }

  li {
    margin-bottom: 0.25rem !important;
  }

  /* Paragrafen */
  p {
    margin: 0.5rem 0 !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
  }

  /* Headings */
  h1 { font-size: 20pt !important; }
  h2 { font-size: 16pt !important; }
  h3 { font-size: 14pt !important; }
  h4 { font-size: 12pt !important; }
}

/* ============================================================================
   UTILITY CLASSES VOOR PRINT
   ============================================================================ */

@media print {
  /* Klasse om elementen te verbergen in print */
  .tp-print-hide {
    display: none !important;
  }

  /* Klasse om elementen te behouden in print */
  .tp-print-keep {
    display: block !important;
  }

  /* Klasse voor print-only content */
  .tp-print-only {
    display: block !important;
  }

  /* Verberg print-only content op scherm */
  .tp-print-only:not(:target) {
    display: none !important;
  }
}

/* ============================================================================
   PAGINA BREAKS VOOR GOEDE INDELING
   ============================================================================ */

@media print {
  /* Voorkom dat secties worden doorgesneden */
  .tp-print-section + .tp-print-section {
    page-break-before: auto;
  }

  /* Force page break voor grote secties (optioneel) */
  .tp-page-break-before {
    page-break-before: always !important;
  }

  .tp-page-break-after {
    page-break-after: always !important;
  }

  /* Voorkom breaks binnen belangrijke elementen */
  .tp-no-break {
    page-break-inside: avoid !important;
  }
}

