/* Ensure colors and layout are preserved in PDF */
@media print {
  /* Force background colors to print */
  * {
    -webkit-print-color-adjust: exact !important;
    color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* PDF Container - Fixed A4 size */
  .pdf-container {
    max-width: 210mm !important;
    width: 210mm !important;
    height: 297mm !important;
    margin: 0 !important;
    padding: 5mm !important;
    background-color: #ffffff !important;
    page-break-after: always !important;
  }

  /* Confidential Label */
  .confidential-label {
    margin: 5mm 0 2mm 0 !important;
  }

  .confidential-text {
    color: #ff9f54 !important;
    background-color: transparent !important;
  }

  /* Header Container - Fixed dimensions for PDF */
  .header-container {
    max-width: 200mm !important;
    width: 200mm !important;
    margin: 5mm auto 0 auto !important;
  }

  /* Outer Frame - Fixed dimensions for PDF */
  .header-outer-frame {
    border: 1px solid #808080 !important;
    background-color: #ffffff !important;
    padding: 3mm !important;
    width: 100% !important;
  }

  /* Header Bar - Fixed dimensions for PDF */
  .header-bar {
    border: 2px solid #808080 !important;
    background-color: transparent !important;
    height: 15mm !important;
  }

  /* Header Sections - Fixed dimensions for PDF */
  .header-section {
    padding: 3mm 4mm !important;
  }

  .header-left {
    background-color: #ffffff !important;
    flex: 0 0 25mm !important;
  }

  .header-middle {
    background-color: #ffffff !important;
    flex: 1 !important;
  }

  .header-right {
    background-color: #c00000 !important;
    flex: 0 0 50mm !important;
  }

  /* Section Text */
  .header-left .section-text {
    color: #000033 !important;
  }

  .header-middle .section-text {
    color: #000033 !important;
  }

  .header-right .section-text {
    color: #ffffff !important;
  }

  /* Main Content - Fixed dimensions for PDF */
  .main-content {
    margin-top: 5mm !important;
    padding: 4mm !important;
    background-color: #ffffff !important;
    border: 1px solid #d0d0d0 !important;
    min-height: 120mm !important;
  }

  .main-content-title {
    color: #333333 !important;
    border-bottom: 1px solid #e0e0e0 !important;
  }

  .main-content-text {
    color: #555555 !important;
  }

  /* Hide action buttons in PDF */
  .action-button-container,
  .text-center.mt-5.p-5 {
    display: none !important;
  }

  /* Override responsive classes for PDF */
  .max-w-90,
  .w-90 {
    max-width: 200mm !important;
    width: 200mm !important;
  }

  .mx-auto {
    margin: 0 auto !important;
  }

  /* Override container scaling for PDF - reset to normal */
  .pdf-container {
    max-width: 210mm !important;
    width: 210mm !important;
    font-size: 1em !important; /* Reset font size */
  }

  /* Reset all padding and margins for PDF */
  .pdf-container .p-3 {
    padding: 12px !important;
  }

  .pdf-container .mt-5 {
    margin-top: 20px !important;
  }

  .pdf-container .mb-2 {
    margin-bottom: 8px !important;
  }

  .pdf-container .mb-6 {
    margin-bottom: 24px !important;
  }

  /* Reset text sizes for PDF */
  .pdf-container .text-sm {
    font-size: 12px !important;
  }

  .pdf-container .text-2xl {
    font-size: 20px !important;
  }

  .pdf-container .text-3xl {
    font-size: 24px !important;
  }

  .pdf-container table {
    font-size: 12px !important;
  }

  /* Ensure Nb. column maintains narrow width in PDF */
  .pdf-container table th[style*="width: 80px"] {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
  }

  /* Ensure "To have in proximity" column has fixed width in PDF */
  .pdf-container table th[style*="width: 200px"] {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
  }

  .pdf-container table td input[style*="width: 60px"] {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
  }

  /* Ensure long text inputs don't wrap in PDF */
  .pdf-container table td input[style*="white-space: nowrap"] {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-wrap: normal !important;
    word-break: keep-all !important;
    hyphens: none !important;
    line-height: 1.2 !important;
    max-height: 1.2em !important;
    height: 1.2em !important;
  }

  /* Hide all spinner icons and UI elements for input in PDF */
  .pdf-container table td input::-webkit-inner-spin-button,
  .pdf-container table td input::-webkit-outer-spin-button,
  .pdf-container table td input::-webkit-calendar-picker-indicator,
  .pdf-container table td input::-webkit-clear-button,
  .pdf-container table td input::-webkit-search-cancel-button {
    display: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }

  /* Special rule for equipment input fields in PDF */
  .pdf-container table td input[type="text"] {
    white-space: nowrap !important;
    line-height: 1.2 !important;
    text-align: center !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-height: 2.4em !important;
    height: 2.4em !important;
    max-height: 2.4em !important;
    display: block !important;
    padding: 4px 8px !important;
    font-family: inherit !important;
    font-size: inherit !important;
    color: inherit !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
    background: transparent !important;
  }

  /* Override responsive images for PDF - keep original size */
  .pdf-container img {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Override a2 scaling for PDF */
  .pdf-container img[src*="a2.PNG"] {
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
  }

  /* Override footer images for PDF - keep original size */
  .pdf-container .w-1\/5 img[src*="a3.PNG"] {
    width: 128px !important;
    height: 128px !important;
    max-width: 128px !important;
    max-height: 128px !important;
  }

  .pdf-container .w-1\/5 img[src*="logoSafran.PNG"] {
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
  }

  /* Page setup for PDF - Fixed A4 */
  @page {
    size: A4;
    margin: 0;
  }

  body {
    margin: 0;
    padding: 0;
    background-color: white;
  }
}
