/* Print Styles for Recipe Pages */
@media print {
  /* Hide navigation and non-essential elements */
  nav,
  .navigation,
  .header,
  .footer,
  .fab,
  button,
  .share-button,
  .actions,
  .rating-form,
  .comments,
  .related-recipes {
    display: none !important;
  }

  /* Reset page margins */
  @page {
    margin: 1cm;
    size: A4;
  }

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

  /* Recipe title */
  h1, h2, h3 {
    color: black !important;
    page-break-after: avoid;
    margin-top: 0.5cm;
    margin-bottom: 0.3cm;
  }

  h1 {
    font-size: 18pt !important;
    font-weight: bold;
    border-bottom: 2px solid black;
    padding-bottom: 0.2cm;
  }

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

  h3, h4, h5, h6 {
    font-size: 14pt !important;
    font-weight: bold;
  }

  /* Recipe image */
  .recipe-image img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
    margin-bottom: 0.5cm;
  }

  /* Recipe metadata (time, servings, difficulty) */
  .recipe-stats {
    border: 1px solid black;
    padding: 0.3cm;
    margin: 0.5cm 0;
    background: #f5f5f5 !important;
    page-break-inside: avoid;
  }

  .recipe-stats strong {
    font-weight: bold;
  }

  /* Ingredients section */
  .recipe-ingredients {
    page-break-inside: avoid;
    margin-bottom: 1cm;
  }

  .recipe-ingredients h2 {
    margin-top: 0.7cm;
    margin-bottom: 0.3cm;
  }

  .recipe-ingredients ul,
  .recipe-ingredients ol {
    margin: 0;
    padding-right: 1cm; /* RTL adjustment */
    list-style-position: inside;
  }

  .recipe-ingredients li {
    margin-bottom: 0.2cm;
    line-height: 1.3;
    page-break-inside: avoid;
  }

  /* Instructions section */
  .recipe-instructions {
    page-break-before: auto;
  }

  .recipe-instructions h2 {
    margin-top: 0.7cm;
    margin-bottom: 0.3cm;
  }

  .recipe-instructions ol {
    margin: 0;
    padding-right: 1cm; /* RTL adjustment */
    counter-reset: step-counter;
  }

  .recipe-instructions li {
    margin-bottom: 0.4cm;
    line-height: 1.3;
    page-break-inside: avoid;
    position: relative;
    counter-increment: step-counter;
  }

  .recipe-instructions li::marker {
    font-weight: bold;
    color: black;
  }

  /* Nutrition info */
  .nutrition-info {
    border: 1px solid black;
    padding: 0.3cm;
    margin: 0.5cm 0;
    page-break-inside: avoid;
  }

  /* General improvements */
  p {
    margin: 0.3cm 0;
    line-height: 1.3;
    text-align: justify;
  }

  /* Hide scrollbars */
  * {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  *::-webkit-scrollbar {
    display: none;
  }

  /* RTL support */
  .rtl,
  [dir="rtl"] {
    direction: rtl !important;
    text-align: right !important;
  }

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

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

  /* Cards and containers */
  .card,
  .paper,
  .container {
    box-shadow: none !important;
    border: none !important;
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Servings scaler - hide in print */
  .servings-scaler,
  .recipe-actions,
  .favorite-button {
    display: none !important;
  }

  /* Page breaks */
  .recipe-section {
    page-break-inside: avoid;
  }

  .recipe-header {
    page-break-after: avoid;
  }

  /* Print header with site info */
  .print-header::before {
    content: "Coach Shlomo - מתכוני תזונה בריאה";
    display: block;
    text-align: center;
    font-size: 10pt;
    color: #666;
    border-bottom: 1px solid #ccc;
    padding-bottom: 0.2cm;
    margin-bottom: 0.5cm;
  }

  /* Print footer with URL */
  .print-footer::after {
    content: "המתכון המלא זמין באתר: www.coachshlomo.com";
    display: block;
    text-align: center;
    font-size: 9pt;
    color: #666;
    border-top: 1px solid #ccc;
    padding-top: 0.2cm;
    margin-top: 1cm;
    position: fixed;
    bottom: 0;
    width: 100%;
  }
}

/* Print-specific utility classes */
@media print {
  .print-only {
    display: block !important;
  }
  
  .no-print {
    display: none !important;
  }
}