/* Print Styles for MacroMeals */

@media print {
  /* Hide navigation and non-essential elements */
  nav,
  header button,
  .no-print,
  [role="navigation"],
  footer nav {
    display: none !important;
  }

  /* Optimize page layout for printing */
  body {
    margin: 0;
    padding: 1cm;
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  /* Ensure content fits on page */
  .container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Better table printing */
  table {
    page-break-inside: avoid;
    border-collapse: collapse;
  }

  /* Avoid breaking inside these elements */
  h1, h2, h3, h4, h5, h6,
  .recipe-card,
  .meal-card,
  .nutrition-facts {
    page-break-inside: avoid;
    page-break-after: avoid;
  }

  /* Show URLs for links */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 90%;
    color: #666;
  }

  /* Don't show URLs for internal links or buttons */
  a[href^="/"]:after,
  a[href^="#"]:after,
  button[href]:after {
    content: "";
  }

  /* Optimize images for print */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  /* Print-friendly colors */
  .bg-blue-500,
  .bg-green-500,
  .bg-amber-500,
  .bg-purple-500 {
    background-color: #f0f0f0 !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
  }

  /* Ensure text is readable */
  * {
    color: #000 !important;
    text-shadow: none !important;
    box-shadow: none !important;
  }
}
