/* static/css/print.css */

@media print {
  /* First approach: Hide everything, then show only what we want */
  body * {
    display: none !important;
  }

  .report-container,
  .report-container * {
    display: block !important;
  }

  /* Special handling for table elements */
  .report-container table {
    display: table !important;
  }

  .report-container tr {
    display: table-row !important;
  }

  .report-container th,
  .report-container td {
    display: table-cell !important;
  }

  .report-container thead {
    display: table-header-group !important;
  }

  .report-container tbody {
    display: table-row-group !important;
  }

  /* Second approach: Use visibility instead of display for better compatibility */
  .sidebar,
  .header,
  .footer,
  .report-header,
  .main-content > *:not(.content),
  .content > *:not(.report-container) {
    visibility: hidden !important;
    display: none !important;
    height: 0 !important;
    position: absolute !important;
    left: -9999px !important;
  }

  .report-container {
    visibility: visible !important;
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Basic page setup */
  @page {
    margin: 1cm !important;
    size: portrait !important;
  }

  body {
    margin: 0 !important;
    padding: 0 !important;
    background-color: white !important;
    font-family: 'Poltawski Nowy', serif !important;
  }

  /* Table styling */
  table {
    border-collapse: collapse !important;
    width: 100% !important;
  }

  th, td {
    border-bottom: 1px solid #ddd !important;
    page-break-inside: avoid !important;
  }

  tr {
    page-break-inside: avoid !important;
  }

  /* Explicitly hide any date-related elements */
  .print-date,
  .document-footer,
  .document-timestamp {
    display: none !important;
    visibility: hidden !important;
  }

  /* Ensure no date is added when printing */
  .header-info::after,
  .header-info::before,
  .report-container::after,
  .report-container::before {
    content: none !important;
  }
}
