/* css/style.css */

/* ==========================================
   RESET & GLOBAL STYLES
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f0f2f5;
  color: #333;
}

.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================
   PANEL KIRI: FORM INPUT (DESKTOP)
   ========================================== */
.form-panel {
  width: 40%;
  padding: 20px;
  background-color: #ffffff;
  border-right: 1px solid #ddd;
  overflow-y: auto;
}

.form-panel h2, .form-panel h3 {
  margin-bottom: 15px;
  color: #1a365d;
}

.form-group {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}

.form-group.checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}

.form-group input, .form-group select {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

hr {
  margin: 15px 0;
  border: 0;
  border-top: 1px solid #eee;
}

.btn-group {
  margin-top: 20px;
}

.btn {
  width: 100%;
  padding: 10px;
  background-color: #2b6cb0;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background-color: #2c5282;
}

/* ==========================================
   PANEL KANAN: LIVE PREVIEW A4 (DESKTOP)
   ========================================== */
.preview-panel {
  width: 60%;
  padding: 30px;
  background-color: #525659;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
}

/* Simulasi Lembar Kertas A4 */
.a4-paper {
  background: white;
  width: 210mm;
  min-height: 297mm;
  padding: 20mm 25mm; /* Margin standar surat dinas */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  
  /* Font Surat disesuaikan dengan template asli */
  font-family: Arial, Calibri, 'Helvetica Neue', sans-serif;
  font-size: 11pt;
  line-height: 1.4;
  color: #000;
}

/* Header & Judul Surat */
.surat-header {
  text-align: center;
  margin-bottom: 20px;
}

.surat-header h3 {
  font-size: 12pt;
  font-weight: bold;
  text-decoration: underline;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.surat-header p {
  font-size: 11pt;
  margin: 0;
}

.kop-container {
  position: relative;
  margin-bottom: 20px;
  padding-bottom: 10px;
}

.kop-logo {
  position: absolute;
  left: 0;
  top: 0;
  width: 75px;
}

.kop-logo img {
  max-width: 75px;
  height: auto;
  object-fit: contain;
  display: block;
}

.kop-text {
  text-align: center;
  padding: 0 80px;
}

.kop-text p {
  margin: 0;
  font-size: 11pt;
  text-transform: uppercase;
  line-height: 1.2;
}

.kop-text p:nth-child(1),
.kop-text p:nth-child(2),
.kop-text p:nth-child(3),
.kop-text p:nth-child(4) {
  font-weight: 700;
}

.kop-line {
  margin-top: 8px;
  border-bottom: 3px solid #000;
  border-top: 1px solid #000;
  height: 0;
}

/* Tabel Isian Data (Rata & Presisi) */
.table-surat {
  width: 100%;
  margin: 10px 0;
  border-collapse: collapse;
}

.table-surat td {
  padding: 2px 0;
  vertical-align: top;
  font-size: 11pt;
}

.table-surat td.col-label {
  width: 32%;
}

.table-surat td.col-titik {
  width: 3%;
  text-align: center;
}

/* Isi Paragraf Surat */
.surat-body p.text-isi {
  text-align: justify;
  margin-bottom: 10px;
  font-size: 11pt;
}

/* Area Tanda Tangan (Footer Rapi Presisi MS Word) */
.surat-footer {
  margin-top: 30px;
  width: 100%;
}

.surat-footer .tanggal-surat {
  text-align: center;
  width: 45%;
  margin-left: auto;
  margin-bottom: 10px;
  font-size: 11pt;
}

.ttd-container {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.ttd-col {
  width: 45%;
  text-align: center;
}

.ttd-col p {
  margin: 0;
  font-size: 11pt;
}

/* Jarak area Tanda Tangan */
.ttd-space {
  height: 65px; 
}

/* ==========================================
   MOBILE RESPONSIVE (HP & TABLET)
   ========================================== */
@media screen and (max-width: 768px) {
  /* Ubah layout utama jadi bertumpuk (ke bawah) */
  .app-container {
    flex-direction: column;
    height: auto;
    overflow-y: auto;
  }

  /* Form Panel memenuhi layar HP */
  .form-panel {
    width: 100%;
    border-right: none;
    border-bottom: 2px solid #ddd;
    padding: 15px;
  }

  /* Preview Panel di HP */
  .preview-panel {
    width: 100%;
    padding: 15px 10px;
    background-color: #718096;
  }

  /* Kertas A4 fleksibel mengikuti layar HP */
  .a4-paper {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    padding: 15px;
    font-size: 9.5pt;
    box-sizing: border-box;
  }

  /* Penyesuaian font elemen surat di HP */
  .surat-header h3 {
    font-size: 11pt;
  }

  .table-surat td {
    font-size: 9.5pt;
  }

  .table-surat td.col-label {
    width: 38%;
  }

  .surat-body p.text-isi {
    font-size: 9.5pt;
  }

  .ttd-col p, .surat-footer .tanggal-surat {
    font-size: 9.5pt;
  }

  /* Touch target lebih besar di HP (cegah iOS auto-zoom) */
  .form-group input, 
  .form-group select {
    padding: 12px 10px;
    font-size: 16px;
  }

  .btn {
    padding: 14px;
    font-size: 16px;
  }
}