/* Print Styles for Restaurant Directory */
@media print {
  /* Hide non-essential elements */
  .no-print,
  nav,
  .sidebar,
  button:not(.print-keep),
  .dropdown,
  .tabs-trigger,
  .export-controls {
    display: none !important;
  }

  /* Reset page styles for print */
  @page {
    margin: 0.5in;
    size: letter;
  }

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

  /* Print-specific table styles */
  .restaurant-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
  }

  .restaurant-table th,
  .restaurant-table td {
    border: 1px solid #000;
    padding: 4px 6px;
    text-align: left;
    page-break-inside: avoid;
  }

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

  /* Page break handling */
  .restaurant-row {
    page-break-inside: avoid;
  }

  /* Print header */
  .print-header {
    display: block !important;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
  }

  .print-title {
    font-size: 18pt;
    font-weight: bold;
    margin-bottom: 5px;
  }

  .print-date {
    font-size: 12pt;
    color: #666;
  }

  /* Summary cards for print */
  .summary-cards {
    display: flex !important;
    justify-content: space-between;
    margin: 20px 0;
    page-break-inside: avoid;
  }

  .summary-card {
    border: 1px solid #000;
    padding: 10px;
    text-align: center;
    width: 22%;
  }

  .summary-card-title {
    font-weight: bold;
    font-size: 10pt;
    margin-bottom: 5px;
  }

  .summary-card-value {
    font-size: 14pt;
    font-weight: bold;
  }

  /* Hide interactive elements */
  .interactive-element,
  .hover-trigger,
  .dropdown-menu,
  .popover,
  .tooltip {
    display: none !important;
  }

  /* Ensure links show their URLs */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #666;
  }

  /* Force table to fit page width */
  .table-container {
    width: 100% !important;
    overflow: visible !important;
  }

  /* Adjust font sizes for smaller content */
  .address-cell {
    font-size: 9pt;
    max-width: 150px;
    word-wrap: break-word;
  }

  .phone-cell {
    font-size: 10pt;
    white-space: nowrap;
  }

  /* Status badges for print */
  .status-badge {
    border: 1px solid #000 !important;
    background: white !important;
    color: black !important;
    padding: 2px 4px;
    font-size: 8pt;
  }

  /* Rebate-specific print styles */
  .rebate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
  }

  .rebate-table th,
  .rebate-table td {
    border: 1px solid #000;
    padding: 3px 5px;
    text-align: left;
    page-break-inside: avoid;
  }

  .rebate-table th {
    background-color: #f0f0f0 !important;
    font-weight: bold;
    font-size: 8pt;
  }

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

  .rebate-summary-cards {
    display: flex !important;
    justify-content: space-between;
    margin: 15px 0;
    page-break-inside: avoid;
  }

  .rebate-summary-card {
    border: 1px solid #000;
    padding: 8px;
    text-align: center;
    width: 30%;
  }

  .rebate-amount-cell {
    font-weight: bold;
    font-size: 9pt;
  }

  .rebate-status-cell {
    font-size: 8pt;
  }

  .rebate-print-header {
    display: block !important;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
  }

  .rebate-print-title {
    font-size: 18pt;
    font-weight: bold;
    margin-bottom: 5px;
  }

  .rebate-filters-print {
    display: block !important;
    margin: 15px 0;
    padding: 10px;
    border: 1px solid #000;
    background: #f9f9f9 !important;
  }

  .rebate-total-row {
    font-weight: bold !important;
    background-color: #e0e0e0 !important;
  }

  /* ISCC Declaration Print Styles */
  
  /* Bulk print container - each declaration on separate page */
  .print-iscc-page {
    page-break-after: always;
    page-break-inside: avoid;
    font-size: 8pt !important;
    line-height: 1.2 !important;
    display: block !important;
    visibility: visible !important;
    color: black !important;
    background: white !important;
  }
  
  .bulk-print-container .print-iscc-page:last-child {
    page-break-after: auto;
  }
  
  /* Hide dialog overlay and chrome when printing */
  [data-radix-dialog-overlay],
  [role="dialog"] > button,
  .no-print {
    display: none !important;
  }
  
  /* Make dialog content visible and full width */
  [data-radix-dialog-content] {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
    max-width: 100% !important;
    width: 100% !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: white !important;
  }
  
  /* Ensure all children are visible */
  .print-iscc-page * {
    visibility: visible !important;
    color: black !important;
  }
  
  /* Card styling for print */
  .print-iscc-page .card {
    border: 1px solid #333 !important;
    padding: 8px !important;
    margin-bottom: 4px !important;
    background: white !important;
    page-break-inside: avoid;
  }
  
  /* Typography */
  .print-iscc-page h1 {
    font-size: 14pt !important;
    font-weight: bold !important;
    text-align: center !important;
    margin-bottom: 4px !important;
  }
  
  .print-iscc-page h2,
  .print-iscc-page h3 {
    font-size: 10pt !important;
    font-weight: bold !important;
    margin-bottom: 4px !important;
  }
  
  .print-iscc-page p {
    font-size: 9pt !important;
    margin: 2px 0 !important;
    line-height: 1.3 !important;
  }
  
  /* Grid layouts */
  .print-iscc-page .grid {
    display: grid !important;
  }
  
  /* Hide buttons in print */
  .print-iscc-page button {
    display: none !important;
  }
  
  /* Icons should be visible */
  .print-iscc-page svg {
    display: inline-block !important;
  }
}