/* 
  This stylesheet is applied only when the user prints the page.
  It hides the application's navigation and layout elements to provide
  a clean, paper-friendly view of the main content.
*/

@media print {
  /* Hide all non-essential layout elements */
  .no-print,
  header,
  [data-sidebar='sidebar'],
  [data-sidebar='trigger'],
  [data-sidebar='rail'] {
    display: none !important;
  }

  /* Ensure the main content area takes up the full page */
  main {
    padding: 0 !important;
    margin: 0 !important;
  }

  /* 
    The print-exact utility class hints to the browser that it should try to
    render the content as it appears on screen, respecting colors and backgrounds.
  */
  .print-exact {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* Reset layout for the print section wrapper */
  #analysis-print-section {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    padding: 1rem;
    margin: 0;
  }

  /* Remove shadows and borders from cards for a cleaner look */
  .card {
    border: 1px solid #ddd;
    box-shadow: none;
    break-inside: avoid; /* Prevents cards from breaking across pages */
  }

  /* Ensure text colors are legible on a white background */
  body, .card, .card-foreground, .text-muted-foreground, h1, h2, h3, h4, p, span, div {
    color: #000 !important;
  }

  /* Ensure backgrounds are transparent or white */
  .card, .bg-background, .bg-muted {
    background-color: #fff !important;
  }

  /* General page setup for printing */
  @page {
    size: auto;
    margin: 0.5in;
  }

  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
