/**
 * Print-friendly styles for calculator results
 * Optimized for clean, professional printouts
 */

@media print {
  /* Hide non-essential elements */
  header,
  nav,
  footer,
  .no-print {
    display: none !important;
  }

  /* Hide navigation buttons and interactive elements */
  button:not(.print-show),
  .currency-format-selector,
  .dark-mode-toggle,
  input[type="button"],
  input[type="submit"] {
    display: none !important;
  }

  /* Page setup */
  @page {
    margin: 1.5cm;
    size: A4 portrait;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: white !important;
    color: black !important;
    font-size: 11pt;
    line-height: 1.4;
  }

  /* Prevent page breaks inside important elements */
  .print-keep-together,
  table,
  .calculation-result,
  .tax-breakdown,
  .results-card {
    page-break-inside: avoid;
  }

  /* Add page breaks before major sections */
  .print-page-break {
    page-break-before: always;
  }

  /* Ensure proper margins after page breaks */
  .print-page-break-after {
    page-break-after: always;
  }

  /* Typography adjustments for print */
  h1 {
    font-size: 20pt;
    margin-bottom: 0.5cm;
    color: #1a1a1a;
  }

  h2 {
    font-size: 16pt;
    margin-top: 0.5cm;
    margin-bottom: 0.3cm;
    color: #2a2a2a;
  }

  h3 {
    font-size: 13pt;
    margin-top: 0.4cm;
    margin-bottom: 0.2cm;
    color: #3a3a3a;
  }

  /* Clean up tables */
  table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.3cm 0;
  }

  th,
  td {
    border: 1px solid #ddd;
    padding: 6pt;
    text-align: left;
  }

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

  /* Ensure links are visible */
  a {
    color: black;
    text-decoration: none;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }

  /* Internal links should not show URL */
  a[href^="#"]::after,
  a[href^="/"]::after {
    content: "";
  }

  /* Remove shadows and rounded corners for cleaner print */
  * {
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  /* Simplify cards and containers */
  .card,
  .results-card,
  .bg-white,
  .bg-gray-50 {
    background: white !important;
    border: 1px solid #ddd;
    padding: 0.3cm;
    margin: 0.2cm 0;
  }

  /* Remove background colors */
  .bg-primary,
  .bg-secondary,
  .bg-accent,
  .bg-purple-100,
  .bg-blue-50,
  .bg-green-50,
  .bg-yellow-50 {
    background: white !important;
    border: 1px solid #ddd;
  }

  /* Make important numbers stand out */
  .text-3xl,
  .text-4xl,
  .text-5xl {
    font-size: 18pt !important;
    font-weight: bold;
  }

  /* Add print header */
  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 0.5cm;
    padding-bottom: 0.3cm;
    border-bottom: 2px solid #333;
  }

  /* Add print footer with page numbers */
  .print-footer {
    display: block !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 9pt;
    color: #666;
    padding: 0.2cm 0;
    border-top: 1px solid #ddd;
  }

  /* Disclaimer text should be smaller but visible */
  .disclaimer,
  .educational-notice {
    font-size: 8pt;
    color: #666;
    border-top: 1px solid #ddd;
    padding-top: 0.2cm;
    margin-top: 0.5cm;
  }

  /* Charts and images */
  img,
  svg,
  canvas {
    max-width: 100%;
    page-break-inside: avoid;
  }

  /* Hide decorative icons */
  .icon-decorative,
  .hero-icon {
    display: none !important;
  }

  /* Simplify forms for print */
  input,
  select,
  textarea {
    border: none !important;
    border-bottom: 1px solid #999 !important;
    background: transparent !important;
    font-size: 10pt;
  }

  /* Show input values clearly */
  input[type="number"],
  input[type="text"] {
    font-weight: bold;
  }

  /* Grid layouts should be simpler */
  .grid {
    display: block !important;
  }

  .grid > * {
    margin-bottom: 0.3cm;
  }

  /* Ensure proper spacing */
  section {
    margin-bottom: 0.5cm;
  }

  /* Add print date */
  .print-date::after {
    content: "Printed: " attr(data-date);
    display: block;
    font-size: 9pt;
    color: #666;
    margin-top: 0.2cm;
  }
}
