/* KatoSuite Print Styles - Production Ready
 * Ensures pixel-perfect A4 print output across all browsers
 * © KatoSuite - All rights reserved
 */

@media print {
  /* Reset shadows and text effects */
  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* A4 Page Setup */
  @page {
    size: A4;
    margin: 20mm 25mm;
  }

  /* Hide non-printable UI elements */
  .print\:hidden,
  [data-print-hidden],
  button:not([data-print-visible]),
  nav,
  aside,
  .sidebar,
  .notification-bell,
  .mobile-menu,
  .toast,
  .sonner-toast,
  .dialog-overlay,
  .popover,
  .dropdown-menu,
  .tooltip {
    display: none !important;
  }

  /* Show print-only elements */
  .print\:block {
    display: block !important;
  }

  /* Typography - Professional ECE Document Standards */
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 11pt;
    line-height: 1.5;
    color: #1a1a1a;
    background: white !important;
  }

  /* Prevent orphans and widows */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    break-after: avoid;
  }

  p, li {
    orphans: 3;
    widows: 3;
  }

  /* Tables - Compliance Checklists */
  table {
    border-collapse: collapse;
    width: 100%;
    page-break-inside: avoid;
  }

  th, td {
    border: 1px solid #d1d5db;
    padding: 8px 12px;
    text-align: left;
  }

  th {
    background-color: #f9fafb !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Document Header - Logo + Org Branding */
  .document-header {
    margin-bottom: 20mm;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10mm;
  }

  /* Document Footer - Page Numbers + Copyright */
  .document-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 9pt;
    color: #6b7280;
    padding-top: 5mm;
    border-top: 1px solid #e5e7eb;
  }

  /* Page Breaks */
  .page-break {
    page-break-before: always;
    break-before: always;
  }

  .avoid-break {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Links - No underlines in print */
  a {
    text-decoration: none;
    color: inherit;
  }

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

  /* Framework Badges - Preserve colors */
  .badge,
  .framework-badge {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Cards and sections */
  .card,
  .section {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Lesson/Observation content */
  .lesson-content,
  .observation-content,
  .compliance-content {
    page-break-inside: auto;
  }

  /* List items */
  li {
    page-break-inside: avoid;
  }

  /* Ensure white background for all content */
  .bg-background,
  .bg-card,
  .bg-white {
    background-color: white !important;
  }
}
