/* Print Styles - v7 (More aggressive border removal for printable card) */
@media print {
  /* Hide common non-printable elements */
  body > header,
  body > .row.mt-4, /* Common selector for Tips/Other Calcs sections */
  main > .row.mt-4, /* Common selector for Tips/Other Calcs sections */
  main > .row.mt-5, /* Common selector for Tips/Other Calcs sections */
  body > main > .card:not(.printable-section),
  body > main > form > .card:not(.printable-section),
  body > main > form > .form-group,
  body > main > form > .mb-3,
  .printable-section .row.mb-3, /* e.g., unit selectors inside results card (clothcalc) */
  #donationModal,
  .fixed-donate-btn,
  body > footer,
  .menu-toggle,
  .d-print-none, /* Generic class to hide elements from print */
  button#printButton /* Specifically hide the print button itself */
  {
    display: none !important;
    visibility: hidden !important;
  }

  /* Ensure the printable section (results card) is styled correctly for print */
  .card.printable-section,
  .printable-section {
    display: block !important;
    width: 100% !important;
    border: none !important; /* CRITICAL: Remove any border */
    box-shadow: none !important; /* CRITICAL: Remove any shadow */
    margin: 0 !important;
    padding: 0 !important; /* Remove padding to prevent visual artifacts around content */
    background-color: #ffffff !important; /* Ensure background is white */
    page-break-inside: avoid !important;
  }

  /* Ensure the inner card-body (if used) also has no border/padding */
  .printable-section .card-body {
    padding: 10px !important; /* Add some padding back for content within card-body */
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background-color: #ffffff !important;
  }

  /* General styling for text elements within the printable section */
  .printable-section h5,
  .printable-section p,
  .printable-section div,
  .printable-section span,
  .printable-section ul,
  .printable-section li,
  .printable-section a {
    display: block; /* Ensure proper layout */
    visibility: visible !important;
    color: #000000 !important; /* Black text for print */
    background-color: #ffffff !important; /* White background */
    font-size: 11pt !important;
    margin-bottom: 0.25em !important;
    line-height: 1.2 !important;
    page-break-inside: avoid !important;
    border: none !important; /* Ensure no borders on these elements */
    box-shadow: none !important; /* Ensure no shadows on these elements */
  }

  /* Larger, bold font for key result lines */
  .printable-section #resultPaint,
  .printable-section #resultConverter,
  .printable-section #resultReducer,
  .printable-section #mekpRecommended,
  .printable-section #mekpPercentage,
  .printable-section #mekpCcs,
  .printable-section #mekpDrops,
  .printable-section #resultBase,
  .printable-section #resultHardener,
  .printable-section #total-area,
  .printable-section #cloth-resin-ratio,
  .printable-section #resin-volume,
  .printable-section #resin-weight,
  .printable-section #hardener-amount,
  .printable-section #working-time,
  .printable-section #estimated-cost,
  .printable-section #mekp-percentage, /* For cloth calc */
  .printable-section #mekp-ccs, /* For cloth calc */
  .printable-section #mekp-drops /* For cloth calc */
  {
    font-weight: bold !important;
    font-size: 18pt !important; /* Adjusted for better readability, was 24pt */
    margin-bottom: 0.5em !important;
    line-height: 1.3 !important;
  }

  /* Hide affiliate links within the printable section */
  .printable-section #affiliateLinksContainer,
  .printable-section .affiliate-disclosure-inline {
    display: none !important;
    visibility: hidden !important;
  }

  /* Style the QR code container and image for print */
  #printQrCode {
    display: block !important;
    visibility: visible !important;
    page-break-before: auto;
    text-align: center;
    margin-top: 15px !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    border: none !important;
    background-color: #ffffff !important;
  }

  #printQrCode img {
    max-width: 120px !important; /* Adjusted size, was 160px */
    height: auto !important;
    margin: 0 auto !important;
    border: none !important;
  }

  /* General body settings for print */
  body {
    margin: 0.5cm !important;
    padding: 0 !important;
    background-color: #ffffff !important;
    overflow: hidden !important;
    font-size: 11pt !important;
  }

  /* Ensure links are black and not underlined in print */
  a, a:visited {
    color: #000000 !important;
    text-decoration: none !important;
  }
}

