/* Print Styles for Sarılar Tavukçuluk */
/* A4 Format optimized for farm management reports */

@media print {
  /* Reset and base */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html, body {
    width: 210mm;
    height: 297mm;
    margin: 0;
    padding: 0;
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  /* Page setup */
  @page {
    size: A4;
    margin: 15mm 15mm 20mm 15mm;
  }

  /* Hide unnecessary elements */
  .print-hidden,
  nav,
  aside,
  header[role="banner"],
  .sidebar,
  button:not(.print-show),
  .no-print {
    display: none !important;
  }

  /* Main container */
  main {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Typography */
  h1 {
    font-size: 24pt;
    margin-bottom: 10mm;
    page-break-after: avoid;
  }

  h2 {
    font-size: 18pt;
    margin-top: 8mm;
    margin-bottom: 4mm;
    page-break-after: avoid;
  }

  h3 {
    font-size: 14pt;
    margin-top: 6mm;
    margin-bottom: 3mm;
    page-break-after: avoid;
  }

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

  /* Tables */
  table {
    width: 100%;
    border-collapse: collapse;
    page-break-inside: avoid;
    margin: 5mm 0;
  }

  thead {
    display: table-header-group;
  }

  tr {
    page-break-inside: avoid;
  }

  th, td {
    border: 1px solid #333;
    padding: 2mm 3mm;
    text-align: left;
  }

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

  /* Cards - convert to bordered sections */
  [class*="card"],
  [class*="Card"] {
    border: 1px solid #333 !important;
    page-break-inside: avoid;
    margin-bottom: 5mm;
    padding: 3mm !important;
    background: #fff !important;
  }

  /* Remove background colors for better printing */
  [class*="bg-"],
  [style*="background"] {
    background: transparent !important;
    background-color: transparent !important;
  }

  /* Badges and labels - simple border style */
  [class*="badge"],
  [class*="Badge"],
  [class*="label"] {
    border: 1px solid #333 !important;
    padding: 1mm 2mm !important;
    background: transparent !important;
    color: #000 !important;
  }

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

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

  a[href^="#"]:after,
  a[href^="javascript"]:after {
    content: "";
  }

  /* Grid layouts - stack for print */
  [class*="grid"],
  [class*="flex"] {
    display: block !important;
  }

  /* Spacing adjustments */
  .space-y-4 > * + *,
  .space-y-6 > * + * {
    margin-top: 4mm !important;
  }

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

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

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

  /* Header for each page */
  .print-header {
    display: block;
    text-align: center;
    margin-bottom: 5mm;
    padding-bottom: 3mm;
    border-bottom: 2px solid #000;
  }

  .print-header h1 {
    margin: 0;
    font-size: 20pt;
  }

  .print-header p {
    margin: 2mm 0 0 0;
    font-size: 10pt;
    color: #666;
  }

  /* Footer for each page */
  .print-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10pt;
    padding-top: 3mm;
    border-top: 1px solid #333;
  }

  /* Statistics/Metrics in print */
  .metric-value {
    font-size: 16pt;
    font-weight: bold;
  }

  .metric-label {
    font-size: 10pt;
    color: #666;
  }

  /* Status indicators */
  .status-success,
  .text-green-600 {
    color: #000 !important;
  }

  .status-success:before {
    content: "✓ ";
  }

  .status-error,
  .text-red-600,
  .text-destructive {
    color: #000 !important;
  }

  .status-error:before {
    content: "✗ ";
  }

  /* Icons - hide or replace with text */
  svg,
  [class*="icon"] {
    display: none;
  }

  /* Force black text for better readability */
  * {
    color: #000 !important;
  }

  .text-muted-foreground,
  .text-gray-500,
  .text-gray-600 {
    color: #333 !important;
  }

  /* Summary boxes */
  .summary-box {
    border: 2px solid #000;
    padding: 5mm;
    margin: 5mm 0;
    page-break-inside: avoid;
  }

  .summary-box h3 {
    margin-top: 0;
  }

  /* Performance charts - show data as table */
  canvas,
  .recharts-wrapper {
    display: none !important;
  }

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

  /* Ensure proper contrast */
  .border,
  [class*="border-"] {
    border-color: #333 !important;
  }

  /* Remove shadows and effects */
  .shadow,
  .shadow-lg,
  .shadow-md,
  [class*="shadow"] {
    box-shadow: none !important;
  }

  /* Optimize for monochrome printing */
  @media print and (monochrome) {
    * {
      color: #000 !important;
      background: #fff !important;
    }

    th {
      background-color: #e0e0e0 !important;
    }
  }
}
