/* ===== PRINT.CSS =====
   Certificate print styles for Shri Chhatrapati Shivaji High School
   Covers: screen preview + @media print
   ===================================== */

/* ---- Shared certificate wrapper ---- */
.certificate-wrapper,
.certificate {
  font-family: 'Times New Roman', Times, serif;
  font-size: 13px;
  color: #111;
  background: #fff;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  position: relative;
  box-sizing: border-box;
}

/* ===== WATERMARK LOGO ===== */
.watermark-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 340px;
  height: 340px;
  object-fit: contain;
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}

/* ===== CERTIFICATE HEADER ===== */
.cert-header {
  position: relative;
  border: 2px solid #8B0000;
  border-bottom: none;
  padding: 14px 16px 0;
  background: #fff;
}

.cert-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
  padding-bottom: 12px;
}

/* ---- Header Left ---- */
.cert-header-left {
  flex: 0 0 200px;
  font-size: 11px;
  line-height: 1.7;
}

/* ---- Header Center (logo + school name) ---- */
.cert-header-center {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.header-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px;
}

.cert-school-name {
  font-size: 17px;
  font-weight: 700;
  color: #8B0000;
  line-height: 1.2;
  letter-spacing: 0.3px;
}

.cert-school-name-marathi {
  font-size: 14px;
  font-weight: 600;
  color: #8B0000;
  line-height: 1.3;
}

.cert-school-addr {
  font-size: 11.5px;
  color: #333;
  margin-top: 2px;
}

/* ---- Header Right ---- */
.cert-header-right {
  flex: 0 0 200px;
  font-size: 11px;
  line-height: 1.7;
  text-align: right;
}

.cert-info-line {
  font-size: 11px;
  line-height: 1.6;
}

.cert-regnoline {
  font-size: 9.5px;
  color: #444;
  line-height: 1.4;
}

.cert-label {
  font-weight: 700;
  color: #222;
}

/* ---- Title Bar ---- */
.cert-title-bar {
  background: #8B0000;
  color: #fff;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 7px 0;
  margin: 0 -16px;
  position: relative;
  z-index: 1;
}

/* ===== CERTIFICATE CONTENT ===== */
.certificate-content {
  border: 2px solid #8B0000;
  border-top: none;
  padding: 16px;
  position: relative;
  z-index: 1;
  background: #fff;
}

/* ---- IDs row (GR / SR / Aadhaar) ---- */
.cert-ids {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #ccc;
}

.cert-id-row {
  font-size: 12px;
  margin-bottom: 4px;
}

.cert-id-boxes {
  font-weight: 700;
  border-bottom: 1px solid #333;
  padding: 0 6px;
  min-width: 60px;
  display: inline-block;
}

/* ---- LC Table ---- */
.cert-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 12.5px;
}

.cert-table tr {
  border-bottom: 1px solid #ddd;
}

.cert-table tr:last-child {
  border-bottom: none;
}

.cert-field-no {
  width: 28px;
  padding: 5px 6px;
  font-weight: 700;
  color: #8B0000;
  vertical-align: top;
  white-space: nowrap;
}

.cert-field-label {
  width: 240px;
  padding: 5px 8px;
  font-weight: 600;
  color: #333;
  vertical-align: top;
}

.cert-field-label::after {
  content: ' :';
}

.cert-field-value {
  padding: 5px 8px;
  color: #111;
  vertical-align: top;
}

/* ---- Body text (Bonafide / Character) ---- */
.cert-body-text {
  padding: 8px 0;
}

.cert-ref-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 16px;
  color: #444;
}

.cert-para {
  line-height: 1.9;
}

.cert-para p {
  margin-bottom: 14px;
  text-align: justify;
  font-size: 13px;
}

/* ---- Date row ---- */
.cert-date-row {
  font-size: 12px;
  margin: 12px 0 8px;
  font-weight: 600;
}

/* ===== FOOTER ===== */
.cert-footer {
  margin-top: 20px;
  border-top: 1px solid #ccc;
  padding-top: 12px;
}

.cert-footer-note {
  font-size: 11px;
  color: #555;
  font-style: italic;
  margin-bottom: 24px;
  text-align: center;
}

.cert-signatories {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cert-signatory {
  text-align: center;
  flex: 1;
}

.cert-sign-line {
  border-top: 1px solid #333;
  width: 120px;
  margin: 0 auto 6px;
}

.cert-sign-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #333;
}

.cert-legal-note {
  font-size: 10px;
  color: #888;
  text-align: center;
  font-style: italic;
  margin-top: 8px;
}

/* ===== SCREEN PREVIEW WRAPPER ===== */
.cert-preview-box {
  padding: 20px;
  background: #f5f5f5;
}

/* ===== @MEDIA PRINT ===== */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  body { background: white; margin: 0; padding: 0; }

  .certificate-wrapper,
  .certificate {
    max-width: 100%;
    width: 100%;
    page-break-after: always;
  }

  .cert-header {
    border-color: #8B0000;
  }

  .cert-title-bar {
    background: #8B0000 !important;
    color: #fff !important;
  }

  .watermark-logo {
    opacity: 0.06 !important;
  }

  .header-logo {
    width: 75px;
    height: 75px;
  }

  /* Hide app chrome */
  .sidebar,
  .main-wrapper > .topbar,
  .page-header,
  .filter-bar,
  .cert-layout,
  .cert-form-panel,
  .cert-preview-panel > .preview-label,
  .form-actions,
  .toast,
  .modal-overlay {
    display: none !important;
  }

  #printArea {
    display: block !important;
    padding: 10mm;
  }
}