/* ==========================================================================
   GAUTAM BUDDHA UNIVERSITY - UGC CAS PROMOTION FORM
   High-Fidelity Printable PDF Stylesheet (Uncongested Multi-Page Pagination)
   ========================================================================== */

@media print,
screen {
  .pdf-document {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    background: #ffffff;
    padding: 15mm 15mm 15mm 15mm;
    box-sizing: border-box;
    font-family: 'Times New Roman', Times, serif;
    font-size: 10.5pt;
    line-height: 1.4;
    color: #000000;
  }

  /* Page Sections & Multi-Page Flow */
  .pdf-section {
    position: relative;
    page-break-after: auto;
    page-break-inside: auto;
    margin-bottom: 22px;
  }

  .pdf-page-break {
    page-break-before: always !important;
    break-before: page !important;
  }

  /* Document Official Header */
  .doc-header {
    text-align: center;
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid #000000;
    page-break-after: avoid;
    break-after: avoid;
  }

  .doc-header-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 6px;
  }

  .doc-header-logo {
    height: 65px;
    width: auto;
  }

  .doc-header h1 {
    font-size: 14pt;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
  }

  .doc-header h2 {
    font-size: 11pt;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: underline;
    margin-bottom: 6px;
    line-height: 1.35;
  }

  .doc-meta-line {
    margin-bottom: 8px;
    font-size: 10.5pt;
  }

  .doc-meta-line .field-inline {
    display: inline-block;
    border-bottom: 1px solid #000;
    min-width: 100px;
    padding: 0 4px;
    font-weight: bold;
  }

  .part-title {
    font-weight: bold;
    font-size: 11pt;
    text-align: center;
    text-transform: uppercase;
    text-decoration: underline;
    margin: 16px 0 10px 0;
    background: #f8fafc;
    padding: 4px 0;
    page-break-after: avoid;
    break-after: avoid;
  }

  .sub-part-title {
    font-weight: bold;
    font-size: 10.5pt;
    margin: 12px 0 6px 0;
    text-decoration: underline;
    page-break-after: avoid;
    break-after: avoid;
  }

  /* Key-Value Details List */
  .doc-field-row {
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    page-break-inside: avoid;
  }

  .doc-field-num {
    font-weight: bold;
    width: 25px;
    flex-shrink: 0;
  }

  .doc-field-label {
    font-weight: bold;
    margin-right: 6px;
  }

  .doc-field-value {
    border-bottom: 1px solid #000;
    flex-grow: 1;
    font-weight: bold;
    padding-left: 6px;
    min-height: 1.2em;
  }

  /* Uncongested Tables with Auto Pagination */
  .doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 14px 0;
    font-size: 9.5pt;
    page-break-inside: auto;
  }

  .doc-table thead {
    display: table-header-group;
    /* Repeat headers across page splits */
  }

  .doc-table tr {
    page-break-inside: avoid;
    /* Prevent row splitting across pages */
    break-inside: avoid;
  }

  .doc-table th,
  .doc-table td {
    border: 1px solid #000000;
    padding: 5px 6px;
    vertical-align: top;
    text-align: left;
    word-wrap: break-word;
  }

  .doc-table th {
    font-weight: bold;
    background-color: #f1f5f9 !important;
    text-align: center;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .doc-table-centered td {
    text-align: center;
  }

  .doc-note-box {
    font-size: 9pt;
    font-style: italic;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 6px 10px;
    margin: 8px 0;
    page-break-inside: avoid;
  }

  /* Signatures section */
  .sig-section {
    margin-top: 25px;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .sig-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 35px;
  }

  .sig-box {
    text-align: left;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 12mm 12mm 12mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-header,
  .wizard-progress-card,
  .form-card,
  .wizard-footer-nav,
  .preview-toolbar,
  .toast-container,
  .admin-stats-grid,
  .admin-controls-bar {
    display: none !important;
  }

  #preview-container {
    display: block !important;
    background: #ffffff !important;
    padding: 0 !important;
  }

  .pdf-document {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    box-shadow: none !important;
  }
}