/* Print Styles for Restaurant Directory */
@media print {
  /* Hide non-essential elements for directory print */
  .no-print,
  nav,
  .sidebar,
  aside,
  footer,
  button:not(.print-keep),
  .dropdown,
  .dropdown-menu,
  [data-radix-popper-content-wrapper],
  .tabs-list,
  .export-controls,
  .print-hide,
  /* Hide summary cards */
  .directory-summary-cards,
  /* Hide filter controls */
  .directory-filters,
  /* Hide print dialog message */
  .print-dialog-message,
  /* Hide dashboard/breadcrumb links */
  a[href*="/hauler/welcome"],
  a[href*="/dashboard"],
  .breadcrumb,
  /* Hide page title area (we use print header instead) */
  .page-header-hide,
  /* Hide non-essential table columns by class */
  .col-website,
  .col-install-date,
  .col-lock-key,
  .col-last-pickup,
  .col-actions,
  .col-volume,
  .col-certification,
  .col-selection,
  .col-operator,
  .col-container,
  .col-contact,
  /* Hide all links in print */
  .rounded-md.border a,
  /* Hide Lovable branding */
  [data-lovable-badge],
  .lovable-badge,
  a[href*="lovable.dev"] {
    display: none !important;
  }

  /* Show visible columns for directory print */
  .col-name,
  .col-address,
  .col-status {
    display: table-cell !important;
  }

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

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

  /* Print header - show only when printing */
  .print-directory-header {
    display: block !important;
    margin-bottom: 8px;
    text-align: center;
    border-bottom: 1px solid #000;
    padding-bottom: 6px;
  }

  .print-directory-header h1 {
    font-size: 14pt;
    font-weight: bold;
    margin: 0 0 2px 0;
  }

  .print-directory-header p {
    font-size: 9pt;
    color: #333;
    margin: 0;
  }

  /* Compact table styles for directory */
  .directory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8pt;
  }

  .directory-table th {
    background-color: #e5e5e5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-weight: bold;
    font-size: 7pt;
    padding: 3px 4px;
    border: 1px solid #333;
    text-align: left;
  }

  .directory-table td {
    border: 1px solid #999;
    padding: 2px 4px;
    text-align: left;
    page-break-inside: avoid;
    vertical-align: top;
    font-size: 8pt;
    line-height: 1.15;
  }

  .directory-table tr {
    page-break-inside: avoid;
  }

  /* Alternating row colors for readability */
  .directory-table tbody tr:nth-child(even) {
    background-color: #f5f5f5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Status badges compact */
  .directory-table .badge,
  .directory-table [class*="Badge"] {
    font-size: 6pt !important;
    padding: 1px 3px !important;
    border: 1px solid #666 !important;
    background: white !important;
    color: black !important;
  }

  /* Remove link URL printing for cleaner look */
  a[href]:after {
    content: none !important;
  }

  /* Hide icons in print */
  .directory-table svg {
    display: none !important;
  }

  /* Force table to fit page width */
  .rounded-md.border {
    border: none !important;
    border-radius: 0 !important;
  }

  /* Remove shadows and effects */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Compact address display */
  .directory-table td .text-muted-foreground {
    color: #333 !important;
    font-size: 7pt;
  }

  /* Phone formatting */
  .directory-table td .flex.items-center.gap-1 {
    gap: 0 !important;
  }

  /* Container number formatting */
  .directory-table .font-mono {
    font-size: 7pt !important;
    padding: 0 !important;
    background: none !important;
  }

  /* 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;
  }
}