/* Baseline Reset & Fluent Design Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

body {
  background-color: #f3f2f1;
  color: #323130;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header Navbar Fluent */
.fluent-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e1dfdd;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  width: 32px;
  height: 32px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.app-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #0078d4;
}

.app-subtitle {
  font-size: 0.75rem;
  color: #605e5c;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Language Selector */
.lang-selector-container {
  display: flex;
  align-items: center;
  background: #f3f2f1;
  border: 1px solid #8a8886;
  border-radius: 4px;
  padding: 2px 8px;
}

.lang-icon {
  font-size: 1rem;
  margin-right: 4px;
}

.lang-select {
  border: none !important;
  background: transparent !important;
  outline: none;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Fluent Buttons */
.fluent-btn {
  padding: 6px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.fluent-btn.primary {
  background-color: #0078d4;
  color: #ffffff;
}

.fluent-btn.primary:hover {
  background-color: #106ebe;
}

.fluent-btn.secondary {
  background-color: #ffffff;
  color: #323130;
  border-color: #8a8886;
}

.fluent-btn.secondary:hover {
  background-color: #f3f2f1;
}

/* Main Layout Grid */
.main-container {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

/* Cards */
.fluent-card {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e1dfdd;
  padding: 20px;
  box-shadow: 0 1.6px 3.6px rgba(0, 0, 0, 0.13);
}

.form-section h2 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.8rem;
  color: #605e5c;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.825rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #323130;
}

.fluent-input, .fluent-select {
  padding: 8px 12px;
  font-size: 0.875rem;
  border: 1px solid #8a8886;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s;
}

.fluent-input:focus, .fluent-select:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

.form-divider {
  border: none;
  border-top: 1px solid #e1dfdd;
  margin: 16px 0;
}

/* Toolbar Preview */
.toolbar-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar-title {
  font-weight: 600;
  font-size: 1rem;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

/* A4 Paper Styling */
.paper-wrapper {
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.paper-document {
  background: #ffffff;
  width: 210mm;
  min-height: 297mm;
  padding: 20mm;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  box-sizing: border-box;
  color: #000000;
  line-height: 1.4;
  transition: font-family 0.2s ease;
}

/* Memastikan seluruh teks di dalam kertas mewarisi font yang diset dari JS */
.paper-document,
.paper-document * {
  font-family: inherit;
}

.kop-surat {
  text-align: center;
}

.kop-surat h3 {
  font-size: 14pt;
  font-weight: bold;
  text-transform: uppercase;
}

.kop-surat h4 {
  font-size: 12pt;
  font-weight: bold;
  text-transform: uppercase;
}

.kop-surat p {
  font-size: 10pt;
  font-style: italic;
}

.line-double {
  border: none;
  border-top: 3px solid #000;
  border-bottom: 1px solid #000;
  height: 2px;
  margin: 8px 0 16px 0;
}

.surat-header {
  text-align: center;
  margin-bottom: 20px;
}

.surat-header h2 {
  font-size: 14pt;
  text-decoration: underline;
  font-weight: bold;
}

.surat-header p {
  font-size: 11pt;
}

.surat-body {
  font-size: 11pt;
  text-align: justify;
}

.data-table {
  width: 100%;
  margin: 12px 0 12px 20px;
  border-collapse: collapse;
}

.data-table td {
  padding: 3px 0;
  vertical-align: top;
}

.col-label { width: 140px; }
.col-sep { width: 15px; }

.paragraph-keperluan {
  margin: 12px 0;
}

.surat-footer {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
}

.ttd-box {
  text-align: center;
  width: 200px;
  font-size: 11pt;
}

.space-ttd {
  height: 60px;
}

/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 16px;
  box-sizing: border-box;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e1dfdd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.2rem;
  color: #323130;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #605e5c;
}

.close-btn:hover { color: #a4262c; }

.modal-body {
  padding: 20px;
  font-size: 0.925rem;
  line-height: 1.6;
  color: #323130;
}

.developer-profile {
  background: #f3f2f1;
  padding: 12px 16px;
  border-radius: 6px;
  margin: 12px 0;
  border-left: 3px solid #0078d4;
}

.developer-profile p { margin: 3px 0; }

.feature-list {
  padding-left: 20px;
  margin: 8px 0;
}

.feature-list li { margin-bottom: 4px; }

.donation-box {
  background: #eff6fc;
  border-left: 4px solid #0078d4;
  padding: 14px 16px;
  border-radius: 4px;
  margin-top: 16px;
}

.donation-box h3 {
  margin-bottom: 6px;
  color: #0078d4;
  font-size: 1.05rem;
}

.donation-detail {
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 4px;
  border: 1px solid #c7e0f4;
  margin-top: 8px;
}

.donation-detail p { margin: 2px 0; }

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #e1dfdd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #faf9f8;
}

.tagline {
  font-size: 0.8rem;
  color: #605e5c;
}

.fluent-footer {
  text-align: center;
  padding: 16px;
  font-size: 0.8rem;
  color: #605e5c;
  background: #ffffff;
  border-top: 1px solid #e1dfdd;
  margin-top: auto;
}

/* Responsif Layar Kecil */
@media (max-width: 992px) {
  .main-container {
    grid-template-columns: 1fr;
  }
}