/**
 * A4 Resmi Belge Formatı & Baskı Stilleri (Word Çıktısıyla %100 Birebir)
 */

/* Canlı Önizleme ve Baskı Belge Çerçevesi */
.a4-document-container {
  width: 210mm;
  /* Grows past one page for long content; html2pdf pagebreak splits it (pdf.js). */
  min-height: 297mm;
  padding: 14mm 26.5mm;
  margin: 0 auto;
  background-color: #ffffff;
  color: #000000;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  font-family: "Calibri", "Carlito", "Arial", sans-serif;
  position: relative;
  display: flex;
  flex-direction: column;
  transform-origin: top center;
  transition: transform 0.2s ease;
}

.official-doc-table-wrapper {
  width: 157mm;
  max-width: 157mm;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

/* Resmi Tablo Yapısı - Sayfayı Tam Doldurur */
.official-doc-table {
  width: 100%;
  flex: 1 0 auto;
  border-collapse: collapse;
  border: 1.5px solid #000000;
  table-layout: fixed;
  font-family: "Calibri", "Carlito", "Arial", sans-serif;
  font-size: 9pt;
  line-height: 1.35;
  color: #000000;
}

.official-doc-table th,
.official-doc-table td {
  border: 1px solid #000000;
  padding: 3.5px 7px;
  vertical-align: middle;
  font-family: "Calibri", "Carlito", "Arial", sans-serif;
}

/* Başlıklar */
.doc-main-title {
  text-align: center;
  font-size: 9pt;
  font-weight: bold;
  letter-spacing: 0.5px;
  padding: 3px 4px !important;
  background-color: transparent;
  font-family: "Calibri", "Carlito", "Arial", sans-serif;
}

.doc-sub-title {
  text-align: center;
  font-size: 9pt;
  font-weight: bold;
  padding: 2.5px 4px !important;
  background-color: transparent;
  font-family: "Calibri", "Carlito", "Arial", sans-serif;
}

.doc-section-title {
  text-align: center;
  font-size: 9pt;
  font-weight: bold;
  padding: 2.5px 4px !important;
  background-color: transparent;
  font-family: "Calibri", "Carlito", "Arial", sans-serif;
}

/* Satır ve İçerik Kutuları (Tek Hücre - Sıfır Dikey Çizgi) */
.doc-content-cell {
  padding: 4px 8px !important;
  vertical-align: top !important;
  line-height: 1.35;
}

.doc-line {
  display: block;
  padding: 1.5px 0;
  line-height: 1.35;
  font-size: 9pt;
  font-family: "Calibri", "Carlito", "Arial", sans-serif;
}

.doc-label {
  display: inline;
  font-weight: bold;
  color: #000000;
  font-size: 9pt;
  line-height: 1.35;
  margin-right: 6px;
  white-space: normal;
}

.doc-val {
  display: inline;
  font-weight: bold;
  color: #002060;
  font-size: 9pt;
  line-height: 1.35;
  word-break: break-word;
}

.doc-val.bold {
  font-weight: bold;
}

/* Boş Alan Belirteci */
.empty-field {
  color: #002060;
  font-style: italic;
  opacity: 0.65;
}

/* Taahhüt ve Beyan Metni & İmza Alanı (Dikey Olarak Kalan Boşluğu Tamamlar) */
.content-declaration-row {
  height: 100%;
}

.declaration-cell {
  padding: 8px 10px 4px 10px !important;
  vertical-align: top !important;
  height: 100%;
}

.declaration-inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  min-height: 120px;
}

.declaration-text {
  text-align: justify;
  text-justify: inter-word;
  font-size: 9pt;
  line-height: 1.35;
  margin-bottom: 0;
  color: #000000;
}

.decl-p {
  margin: 0 0 4px 0;
  text-indent: 18px;
  line-height: 1.35;
}

/* Tarih ve İmza Bloğu (Son paragrafın hemen altında) */
.sign-and-date-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 14px;
  padding: 2px 12px 2px 12px;
}

.doc-date-block {
  font-size: 9pt;
  font-weight: bold;
  color: #002060;
  padding-top: 1px;
}

.doc-signatory-block {
  text-align: center;
  min-width: 180px;
  font-size: 9pt;
  line-height: 1.35;
}

.sign-title {
  font-weight: bold;
  margin-bottom: 1px;
  color: #000000;
  font-size: 9pt;
}

.sign-name {
  font-weight: bold;
  text-transform: uppercase;
  color: #002060;
  font-size: 9pt;
}

.sign-unvan {
  font-style: normal;
  font-weight: bold;
  color: #002060;
  font-size: 9pt;
}

.sign-line {
  font-size: 9pt;
  font-weight: bold;
  color: #002060;
}

.sign-caption {
  font-weight: bold;
  color: #000000;
  margin-top: 2px;
  font-size: 9pt;
}

.sign-image-wrapper {
  margin-top: 2px;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 0;
}

.doc-signature-img {
  object-fit: contain;
  mix-blend-mode: multiply; /* Beyaz arkaplanları şeffaflaştırır */
  display: block;
  margin: 0 auto;
}

/* Alt Hukuki Uyarı / Dipnot Kutusu */
.footer-warning-row {
  height: auto;
}

.warning-cell {
  font-size: 9pt !important;
  line-height: 1.35;
  text-align: justify;
  text-justify: inter-word;
  padding: 4px 8px !important;
  color: #000000;
}

/* ==============================================
   TARAYICI YAZDIRMA (CTRL+P / COMMAND+P) MODU
   ============================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 8mm 8mm 8mm;
  }

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

  /* Tüm UI bileşenlerini gizle */
  header,
  .app-header,
  .app-navigation,
  .editor-form-col,
  .preview-actions-bar,
  .toast-container,
  #pdfLoadingOverlay,
  #view_archive,
  #view_profile,
  #view_templates_info,
  .drag-hint-badge {
    display: none !important;
  }

  .draggable-signature-container {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    cursor: default !important;
  }

  .app-main-container,
  .app-view,
  .editor-split-layout,
  .editor-preview-col {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  .a4-document-container {
    width: 100% !important;
    min-height: auto !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    page-break-inside: avoid;
  }

  .official-doc-table-wrapper {
    width: 157mm !important;
    max-width: 157mm !important;
    margin: 0 auto !important;
  }

  .official-doc-table {
    page-break-inside: avoid;
  }

  .empty-field {
    color: #000000 !important;
    font-style: normal;
  }
}
