/*
  print.css - Precision A4 Landscape Print & PDF Stylesheet
  Matches CenturyPly CPIL 301 A physical QC paper report format exactly
*/

@media print {
  /* Hide all screen UI components */
  body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 8pt !important;
  }

  .app-header,
  .toolbar-container,
  .app-main,
  .toast-container,
  .modal-overlay,
  button {
    display: none !important;
  }

  /* Display only print container */
  #printArea {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  @page {
    size: A4 landscape;
    margin: 5mm 7mm 5mm 7mm;
  }

  .print-page {
    width: 100%;
    box-sizing: border-box;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    color: #000000;
  }

  /* CPIL 301 A Paper Header Box */
  .cpil-print-wrapper {
    border: 1.5px solid #000000;
    padding: 2px;
    box-sizing: border-box;
    width: 100%;
  }

  .cpil-header-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1.5px solid #000000;
    padding: 4px 10px 4px 10px;
  }

  .cpil-code-tag {
    font-size: 11pt;
    font-weight: 900;
    letter-spacing: 0.5px;
  }

  .cpil-main-title {
    font-size: 13pt;
    font-weight: 900;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.5px;
  }

  .cpil-date-tag {
    font-size: 10pt;
    font-weight: bold;
    white-space: nowrap;
  }

  .cpil-meta-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 10px;
    font-size: 8.5pt;
    border-bottom: 1.5px solid #000000;
    background-color: #fafafa;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Print Table */
  .print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8pt;
    line-height: 1.1;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #000000 !important;
    padding: 2.2px 3px;
    text-align: center;
    vertical-align: middle;
  }

  .print-table thead tr th {
    font-weight: bold;
    background-color: #f2f2f2 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    text-transform: uppercase;
    font-size: 7.5pt;
  }

  /* Prevent table footers from repeating across continuation pages */
  tfoot, .print-table tfoot {
    display: table-row-group !important;
  }

  .pt-sub-tag {
    font-size: 6.5pt;
    font-weight: normal;
  }

  .pt-row-blank td {
    height: 18px;
  }

  .pt-sno {
    width: 4%;
    font-weight: bold;
  }

  .pt-mc {
    width: 10%;
    font-weight: 600;
    white-space: nowrap !important;
    text-align: center !important;
    font-size: 7.5pt;
  }

  .pt-species {
    width: 14%;
    text-align: left !important;
    padding-left: 5px !important;
  }

  .pt-len {
    width: 6%;
  }

  .pt-w {
    width: 6.5%;
  }

  .pt-d {
    width: 7%;
  }

  .pt-diff {
    width: 8%;
    font-weight: bold;
  }

  .pt-t {
    width: 6.5%;
  }

  .pt-avg {
    width: 7.5%;
    font-weight: bold;
    background-color: #f9f9f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Summary Row */
  .pt-summary-row td {
    font-weight: bold;
    background-color: #f5f5f5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 3px;
  }

  /* Signatures Footer */
  .print-footer-signatures {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 10px;
    padding: 4px 20px 6px 20px;
  }

  .sig-left,
  .sig-center,
  .sig-right {
    font-size: 9.5pt;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 150px;
  }

  .sig-left {
    align-items: flex-start;
  }

  .sig-center {
    align-items: center;
    text-align: center;
  }

  .sig-right {
    align-items: flex-end;
    text-align: right;
  }

  .print-sig-img {
    max-height: 40px;
    max-width: 160px;
    object-fit: contain;
    display: block;
    margin-bottom: 2px;
    filter: contrast(1.2);
  }

  .sig-label {
    border-top: 1px solid #333;
    padding-top: 2px;
    width: 100%;
    font-size: 9pt;
  }

  /* Dryer Report Print Adjustments */
  .pt-dryer-table th {
    font-size: 7pt;
    padding: 2.5px 1.5px;
  }

  .pt-dryer-table td {
    font-size: 7.5pt;
    padding: 2px 1.5px;
    text-align: center;
  }

  .condition-dot {
    display: none !important;
  }

  /* Moisture Checking Report Print Adjustments */
  .pt-moisture-table th {
    font-size: 6.5pt;
    padding: 2.5px 1.5px;
    line-height: 1.1;
  }

  .pt-moisture-table td {
    font-size: 7pt;
    padding: 2px 1.5px;
    text-align: center;
  }

  .pt-moisture-table th.th-core {
    background-color: #f1f5f9 !important;
  }

  .pt-moisture-table th.th-panel {
    background-color: #f8fafc !important;
  }
}
