/* GlobalStats API - Print Stylesheet */
@media print {
  /* Hide non-essential elements */
  nav, footer, aside, .tawk-chat-widget, [role="complementary"],
  button, .no-print, iframe, video, audio, canvas,
  .skip-link, #tawk-widget-container {
    display: none !important;
  }

  /* Reset backgrounds and colors for print */
  * {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 12pt;
    line-height: 1.5;
    margin: 0;
    padding: 1cm;
  }

  /* Links */
  a, a:visited {
    text-decoration: underline;
    color: #000 !important;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 90%;
    color: #555 !important;
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  /* Headings */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
    font-family: 'Arial', 'Helvetica', sans-serif;
  }

  h1 { font-size: 24pt; }
  h2 { font-size: 18pt; }
  h3 { font-size: 14pt; }

  /* Images */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  /* Tables */
  table {
    border-collapse: collapse;
    width: 100%;
  }

  table, th, td {
    border: 1px solid #000;
  }

  th, td {
    padding: 4pt 8pt;
    text-align: left;
  }

  /* Code blocks */
  pre, code {
    font-family: 'Courier New', monospace;
    font-size: 10pt;
    border: 1px solid #ccc;
    padding: 4pt;
    white-space: pre-wrap;
    word-wrap: break-word;
    page-break-inside: avoid;
  }

  /* Page breaks */
  p, blockquote, ul, ol, dl, table, pre {
    orphans: 3;
    widows: 3;
  }

  blockquote {
    border-left: 2px solid #000;
    padding-left: 10pt;
    margin-left: 0;
  }

  /* Print header */
  body::before {
    content: "GlobalStats API — tools.globalstats.xyz — Printed on " attr(data-print-date);
    display: block;
    text-align: center;
    font-size: 10pt;
    color: #666 !important;
    border-bottom: 1px solid #ccc;
    padding-bottom: 8pt;
    margin-bottom: 16pt;
  }

  /* Print footer */
  @page {
    margin: 2cm;
    size: A4;

    @bottom-center {
      content: "Page " counter(page) " of " counter(pages);
      font-size: 9pt;
      color: #666;
    }
  }

  @page :first {
    margin-top: 3cm;
  }

  /* Ensure important content is visible */
  #root {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
  }
}
