/* Professional Print Styles for Quotes and Invoices */

@media print {
  /* Reset page margins for professional output */
  @page {
    size: A4;
    margin: 12mm 15mm 12mm 15mm;
  }

  /* Reset all elements */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* Hide all non-printable elements */
  body * {
    visibility: hidden;
  }

  /* Show only the print content */
  .print\:col-span-1,
  .print\:col-span-1 * {
    visibility: visible;
  }

  /* Ensure clean page breaks */
  .print\:break-inside-avoid {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Professional typography - more compact */
  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    color: #1a1a1a !important;
    line-height: 1.4 !important;
    background: white !important;
    font-size: 9pt !important;
  }

  /* Headers and titles - more compact */
  h1, h2, h3, h4, h5, h6 {
    color: #1a1a1a !important;
    font-weight: 600 !important;
    margin-top: 0 !important;
    page-break-after: avoid !important;
  }

  h1 {
    font-size: 20pt !important;
    margin-bottom: 6pt !important;
    letter-spacing: -0.3pt !important;
  }

  h2 {
    font-size: 16pt !important;
    margin-bottom: 5pt !important;
  }

  h3 {
    font-size: 12pt !important;
    margin-bottom: 4pt !important;
    font-weight: 600 !important;
  }

  /* Tables and data display */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 16pt 0 !important;
    page-break-inside: avoid !important;
  }

  thead {
    display: table-header-group !important;
  }

  th {
    background-color: #f8f9fa !important;
    color: #1a1a1a !important;
    font-weight: 600 !important;
    padding: 12pt 14pt !important;
    text-align: left !important;
    border-bottom: 2pt solid #2563eb !important;
    font-size: 11pt !important;
  }

  td {
    padding: 10pt 14pt !important;
    border-bottom: 1pt solid #e5e7eb !important;
    font-size: 10pt !important;
    vertical-align: top !important;
  }

  tr:last-child td {
    border-bottom: none !important;
  }

  /* Grid layouts for professional structure */
  .grid {
    display: grid !important;
  }

  /* Emphasis and totals */
  .font-bold, .font-semibold {
    font-weight: 600;
  }

  /* Spacing and sections */
  .space-y-4 > * + * {
    margin-top: 12pt !important;
  }

  .space-y-6 > * + * {
    margin-top: 18pt !important;
  }

  .space-y-8 > * + * {
    margin-top: 24pt !important;
  }

  /* Borders and separators */
  .border-t, .border-b {
    border-color: #e0e0e0 !important;
  }

  /* Background colors for sections */
  .bg-muted, .bg-muted\/30, .bg-muted\/50 {
    background-color: #f9fafb !important;
    border: 1pt solid #e5e7eb !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print\:bg-gray-50 {
    background-color: #f9fafb !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print\:bg-blue-50 {
    background-color: #eff6ff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print\:border-gray-200 {
    border: 1pt solid #e5e7eb !important;
  }

  .print\:border-blue-200 {
    border: 1pt solid #bfdbfe !important;
  }

  /* Text colors */
  .text-muted-foreground {
    color: #6b7280 !important;
  }

  .text-primary {
    color: #2563eb !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Icons and decorative elements */
  .lucide {
    display: inline-block;
    vertical-align: middle;
  }

  /* Remove shadows and effects */
  .shadow, .shadow-sm, .shadow-md, .shadow-lg, .shadow-xl {
    box-shadow: none !important;
  }

  /* Cards and containers */
  .rounded, .rounded-lg {
    border-radius: 4pt;
  }

  /* Ensure proper text wrapping */
  .whitespace-pre-wrap {
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  /* Contact information and details */
  .text-sm {
    font-size: 10pt;
    line-height: 1.4;
  }

  .text-xs {
    font-size: 9pt;
    line-height: 1.3;
  }

  .text-lg {
    font-size: 12pt;
    line-height: 1.5;
  }

  .text-xl {
    font-size: 14pt;
  }

  .text-2xl {
    font-size: 18pt;
  }

  /* Lists */
  ul {
    list-style-position: inside;
    margin: 6pt 0;
  }

  li {
    margin: 3pt 0;
  }

  /* Professional number formatting */
  .text-right {
    text-align: right;
  }

  .text-center {
    text-align: center;
  }

  /* Footer and legal text */
  footer, .text-muted-foreground.text-sm {
    font-size: 8pt;
    color: #888888 !important;
  }

  /* Ensure colors print */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Remove all input field styling for print */
  input, textarea, select {
    display: none !important;
  }

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

  .print\:inline {
    display: inline !important;
  }

  .print\:hidden {
    display: none !important;
  }

  /* Clean text display */
  .print\:text-gray-900 {
    color: #1a1a1a !important;
  }

  .print\:text-gray-800 {
    color: #2d2d2d !important;
  }

  .print\:text-gray-700 {
    color: #4a4a4a !important;
  }

  .print\:text-gray-600 {
    color: #6b7280 !important;
  }

  .print\:text-gray-500 {
    color: #9ca3af !important;
  }

  .print\:text-blue-600 {
    color: #2563eb !important;
  }

  .print\:text-blue-500 {
    color: #3b82f6 !important;
  }

  .print\:bg-blue-50 {
    background-color: #eff6ff !important;
  }

  .print\:border-blue-200 {
    border-color: #bfdbfe !important;
  }

  .print\:bg-blue-600 {
    background-color: #2563eb !important;
  }

  /* Compact spacing for single page fit */
  .space-y-8 > * + * {
    margin-top: 8pt !important;
  }

  .space-y-6 > * + * {
    margin-top: 6pt !important;
  }

  .space-y-4 > * + * {
    margin-top: 5pt !important;
  }

  .space-y-3 > * + * {
    margin-top: 3pt !important;
  }

  .space-y-2 > * + * {
    margin-top: 2pt !important;
  }

  /* Ensure proper link display */
  a {
    text-decoration: none;
    color: #2563eb !important;
  }

  /* Professional totals section */
  .totals-section {
    border-top: 2pt solid #1a1a1a !important;
    padding-top: 16pt !important;
    margin-top: 16pt !important;
    page-break-inside: avoid !important;
  }

  /* Enhanced spacing */
  .rounded-lg {
    border-radius: 6pt !important;
  }

  /* Professional shadows converted to borders */
  .shadow-lg, .shadow-xl {
    box-shadow: none !important;
    border: 1pt solid #e5e7eb !important;
  }

  /* Location details sections */
  .location-section {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 18pt;
  }

  /* Task lists */
  .task-list {
    margin-left: 12pt;
  }

  .task-list li {
    margin: 4pt 0;
  }
}
