/* Print Stylesheet for OverpayAlert */
@media print {
  /* Reset and base styles */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
    background: transparent !important;
    color: black !important;
  }

  /* Page layout */
  @page {
    margin: 1in;
    size: A4;
  }

  /* Hide non-essential elements */
  header,
  nav,
  .mobile-menu,
  footer,
  button,
  .theme-switcher,
  .analytics-events,
  .interactive-elements,
  .backdrop-blur,
  .shadow,
  .hover\:,
  .focus\:,
  .transition-,
  .animate-,
  .fixed,
  .sticky {
    display: none !important;
  }

  /* Hide decorative elements */
  .bg-gradient-to-r,
  .bg-gradient-to-br,
  .gradient-overlay,
  .decorative-dots,
  .animated-background,
  .glassmorphism,
  [class*='backdrop-blur'],
  [class*='shadow'] {
    display: none !important;
  }

  /* Typography optimizations */
  body {
    font-family: 'Times New Roman', serif !important;
    font-size: 12pt !important;
    line-height: 1.4 !important;
    color: black !important;
    background: white !important;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: black !important;
    font-weight: bold !important;
    page-break-after: avoid !important;
    margin-top: 1em !important;
    margin-bottom: 0.5em !important;
  }

  h1 {
    font-size: 18pt !important;
    border-bottom: 2pt solid black !important;
    padding-bottom: 0.2em !important;
  }

  h2 {
    font-size: 16pt !important;
  }

  h3 {
    font-size: 14pt !important;
  }

  /* Paragraph and text optimizations */
  p {
    font-size: 12pt !important;
    line-height: 1.4 !important;
    margin-bottom: 1em !important;
    orphans: 3 !important;
    widows: 3 !important;
  }

  /* List optimizations */
  ul,
  ol {
    margin-left: 1em !important;
    margin-bottom: 1em !important;
  }

  li {
    margin-bottom: 0.3em !important;
  }

  /* Link handling */
  a {
    color: black !important;
    text-decoration: underline !important;
  }

  /* Show URLs after links */
  a[href]:after {
    content: ' (' attr(href) ')';
    font-size: 10pt;
    color: #666;
  }

  /* Don't show URLs for anchor links */
  a[href^='#']:after {
    content: '';
  }

  /* Image optimizations */
  img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid !important;
    border: 1pt solid black !important;
    margin: 0.5em 0 !important;
  }

  /* Logo specific handling */
  .logo img,
  .company-logo {
    max-width: 2in !important;
    height: auto !important;
    border: none !important;
  }

  /* Table optimizations */
  table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin-bottom: 1em !important;
    page-break-inside: avoid !important;
  }

  th,
  td {
    border: 1pt solid black !important;
    padding: 0.3em !important;
    text-align: left !important;
    vertical-align: top !important;
  }

  th {
    font-weight: bold !important;
    background: #f0f0f0 !important;
  }

  /* Page break control */
  .page-break-before {
    page-break-before: always !important;
  }

  .page-break-after {
    page-break-after: always !important;
  }

  .no-page-break {
    page-break-inside: avoid !important;
  }

  /* Container optimizations */
  .container,
  .max-w-7xl,
  .max-w-6xl,
  .max-w-4xl {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Grid and flex handling */
  .grid,
  .flex {
    display: block !important;
  }

  .grid > *,
  .flex > * {
    margin-bottom: 1em !important;
  }

  /* Main content area */
  main {
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Hero section handling */
  .hero-section {
    text-align: center !important;
    margin-bottom: 2em !important;
    page-break-after: avoid !important;
  }

  .hero-section h1 {
    font-size: 20pt !important;
    margin-bottom: 1em !important;
  }

  .hero-section p {
    font-size: 14pt !important;
    margin-bottom: 1em !important;
  }

  /* Features section */
  .features-grid {
    display: block !important;
  }

  .feature-card {
    margin-bottom: 1.5em !important;
    padding: 1em !important;
    border: 1pt solid black !important;
    page-break-inside: avoid !important;
  }

  /* Contact information emphasis */
  .contact-info {
    border: 2pt solid black !important;
    padding: 1em !important;
    margin: 2em 0 !important;
    page-break-inside: avoid !important;
  }

  /* Company information */
  .company-info {
    text-align: center !important;
    margin-bottom: 2em !important;
  }

  /* Print-specific content */
  .print-only {
    display: block !important;
  }

  .screen-only {
    display: none !important;
  }

  /* Abbreviation expansion */
  abbr[title]:after {
    content: ' (' attr(title) ')';
  }

  /* Quote styling */
  blockquote {
    border-left: 4pt solid black !important;
    padding-left: 1em !important;
    margin: 1em 0 !important;
    font-style: italic !important;
  }

  /* Code styling */
  code,
  pre {
    font-family: 'Courier New', monospace !important;
    background: #f5f5f5 !important;
    border: 1pt solid #ccc !important;
    padding: 0.2em !important;
  }

  pre {
    padding: 0.5em !important;
    margin: 1em 0 !important;
    white-space: pre-wrap !important;
    page-break-inside: avoid !important;
  }

  /* Header for printed pages */
  body:before {
    content: 'OverpayAlert - AI-Powered Invoice Protection';
    display: block;
    text-align: center;
    font-size: 14pt;
    font-weight: bold;
    margin-bottom: 2em;
    padding-bottom: 0.5em;
    border-bottom: 2pt solid black;
  }

  /* Footer for printed pages */
  body:after {
    content: 'Visit overpayalert.com for more information';
    display: block;
    text-align: center;
    font-size: 10pt;
    margin-top: 2em;
    padding-top: 0.5em;
    border-top: 1pt solid black;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  * {
    background: white !important;
    color: black !important;
  }

  a {
    color: blue !important;
    text-decoration: underline !important;
  }

  button {
    background: white !important;
    color: black !important;
    border: 2px solid black !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
