/* ==========================================================================
   Marriage Biodata Maker - Production CSS System (No Emojis, Responsive Grid)
   ========================================================================== */

:root {
  /* Light Mode Defaults */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.92);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --accent-color: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  --accent-gold: #d97706;

  --border-color: #cbd5e1;
  --border-focus: #2563eb;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.12), 0 4px 8px -2px rgba(0, 0, 0, 0.06);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-pill: 9999px;

  --font-body: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  --preview-text-color: #0f172a;
}

[data-theme="dark"] {
  --bg-primary: #0b0f17;
  --bg-secondary: #161e2e;
  --bg-tertiary: #1f293d;
  --bg-card: #161e2e;
  --bg-glass: rgba(22, 30, 46, 0.92);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --accent-color: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: rgba(59, 130, 246, 0.15);
  --border-color: #334155;
  --border-focus: #60a5fa;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
}

/* Container */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

/* Sticky Navbar */
.sticky-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
  transition: all 0.3s ease;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.1rem;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--accent-light);
  color: var(--accent-color);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(59, 130, 246, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-right-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme Toggle Button */
.theme-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.theme-btn:hover {
  border-color: var(--accent-color);
  background: var(--bg-secondary);
}

.theme-svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.hamburger-btn {
  display: none;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  padding: 0.45rem;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.hamburger-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-color);
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  z-index: 2050;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-drawer.active {
  right: 0;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.mobile-nav-link:hover {
  background: var(--accent-light);
  color: var(--accent-color);
}

.mobile-nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  z-index: 2040;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Main Layout Grid - Form Panel Width Increased (60% Form / 40% Preview) */
.main-content {
  padding: 1.5rem 0 3.5rem;
  flex: 1;
}

.builder-grid {
  display: grid;
  grid-template-columns: 60% 40%;
  gap: 1.75rem;
  align-items: start;
}

/* Left Column: Form Panel */
.form-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0; /* Prevents flex overflow */
}

.form-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.card-title-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-title-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Form Groups & Inputs - Prominent & Visible */
.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 0.925rem;
  font-weight: 500;
  background-color: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3.5px var(--accent-light);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Photo Uploader Component */
.photo-upload-box {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  background-color: var(--bg-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.photo-upload-box:hover, .photo-upload-box.drag-over {
  border-color: var(--accent-color);
  background-color: var(--accent-light);
}

.upload-icon-svg {
  width: 36px;
  height: 36px;
  fill: var(--accent-color);
  margin-bottom: 0.4rem;
}

.upload-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.upload-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.file-input-hidden {
  display: none;
}

.photo-preview-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
}

.photo-thumb {
  width: 55px;
  height: 55px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.btn-danger-sm {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-danger-sm:hover {
  background: #ef4444;
  color: #ffffff;
}

/* God Selection Picker */
.god-picker-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.god-photo-preview {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  object-fit: contain;
  background: #ffffff;
  padding: 4px;
  cursor: pointer;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border: 1.5px solid var(--border-color);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-color);
}

/* Dynamic Field Item Row - Generous Layout for Clear Visibility */
.field-item-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background-color: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
}

.field-item-label {
  flex: 0 0 38%;
  min-width: 120px;
}

.field-item-value {
  flex: 1;
  min-width: 140px;
}

.field-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.btn-action-icon {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-action-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.btn-action-icon:hover {
  background: var(--accent-light);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.btn-action-icon.btn-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
}

.btn-add-field {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.6rem;
  border: 1.5px dashed var(--accent-color);
  background: var(--accent-light);
  color: var(--accent-color);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-add-field:hover {
  background: var(--accent-color);
  color: #ffffff;
}

/* Right Column: Preview Panel */
.preview-panel {
  position: sticky;
  top: 4.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.control-btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-success {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

/* Template Switcher Carousel */
.template-selector-box {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.5rem 0.2rem;
  scrollbar-width: thin;
}

.template-thumb-item {
  flex: 0 0 60px;
  height: 85px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  background-size: cover;
  background-position: center;
}

.template-thumb-item:hover, .template-thumb-item.active {
  border-color: var(--accent-color);
  transform: scale(1.04);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.template-thumb-item.active::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--accent-color);
  color: #fff;
  font-size: 0.65rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* A4 Preview Container Frame & Scaler Wrapper */
.preview-viewport {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 0.75rem;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.a4-page-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: visible;
  position: relative;
}

.biodata-a4-page {
  width: 794px;
  height: 1123px;
  background-color: #ffffff;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  padding: 45px 45px 40px 45px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  position: relative;
  color: var(--preview-text-color);
  box-sizing: border-box;
  transform-origin: top center;
  transition: transform 0.1s ease-out;
  flex-shrink: 0;
}

/* Inside A4 Structure */
.a4-header {
  text-align: center;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.a4-god-img {
  max-height: 70px;
  max-width: 140px;
  object-fit: contain;
}

.a4-god-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: inherit;
}

.a4-main-title {
  font-size: 25px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 4px;
  border-bottom: 2px solid currentColor;
  display: inline-block;
  padding-bottom: 4px;
}

.a4-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  padding: 0 45px;
    box-sizing: border-box;
}

.a4-hero-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.a4-candidate-details {
  flex: 1;
}

.a4-profile-photo-box {
  width: 135px;
  height: 165px;
  margin-right: 10px;
  border: 3px solid currentColor;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.a4-profile-photo-box.shape-circle {
  border-radius: 50%;
  width: 140px;
  height: 140px;
}

.a4-profile-photo-box.shape-oval {
  border-radius: 50% / 40%;
}

.a4-profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.a4-section {
  margin-bottom: 12px;
}

.a4-section-heading {
  font-size: 16.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  /* border-bottom: 1.5px solid currentColor; */
}

.a4-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.a4-table td {
  padding: 4px 0;
  font-size: 15.5px;
  vertical-align: top;
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: break-word;
}

.a4-table .label-col {
  width: 38%;
  min-width: 38%;
  max-width: 38%;
  font-weight: 600;
  padding-right: 8px;
  white-space: normal;
}

.a4-table .colon-col {
  width: 4%;
  min-width: 4%;
  max-width: 4%;
  text-align: center;
  font-weight: 600;
}

.a4-table .val-col {
  width: 58%;
  min-width: 58%;
  max-width: 58%;
  font-weight: 500;
  white-space: normal;
}

/* Mobile Sticky Bottom View Bar */
.mobile-view-bar {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background: var(--accent-gradient);
  color: #ffffff;
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.25rem;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-view-bar.hidden {
  display: none !important;
}

.mobile-view-btn {
  border: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.mobile-close-btn {
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: #ffffff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-close-btn svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* How to Use Section */
.how-to-section {
  padding: 3.5rem 0 2rem;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
}

.section-title {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.25rem;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.step-number {
  position: absolute;
  top: -12px;
  left: 18px;
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.step-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.step-icon svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.step-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.step-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* SEO Content Section */
.seo-content-section {
  padding: 2.5rem 0;
  background: var(--bg-primary);
}

.seo-content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.seo-heading {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.seo-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.seo-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.seo-feature-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem;
}

.seo-feature-item h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.seo-feature-item p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* FAQ Accordion Section */
.faq-section {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0;
  margin-top: 1rem;
}

.faq-title {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.faq-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.faq-accordion {
  max-width: 850px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item.active {
  border-color: var(--accent-color);
}

.faq-question {
  padding: 1.1rem 1.4rem;
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-icon-svg {
  width: 16px;
  height: 16px;
  fill: var(--accent-color);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-icon-svg {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1.4rem;
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 1.4rem 1.1rem 1.4rem;
}

/* Footer */
.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.75rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links-col h4 {
  color: var(--text-main);
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
}

.footer-links-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-links-col a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links-col a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Modal Popup System */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 550px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 1.4rem;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.modal-backdrop.active .modal-box {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.modal-close-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.god-grid-modal {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 0.65rem;
}

.god-grid-item {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  object-fit: contain;
  padding: 4px;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.2s ease;
}

.god-grid-item:hover, .god-grid-item.selected {
  border-color: var(--accent-color);
  transform: scale(1.05);
}

/* Add Field Modal Items */
.add-field-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.add-field-btn-option {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  text-align: left;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.add-field-btn-option:hover {
  background: var(--accent-light);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* ==========================================================================
   Mobile & Tablet Responsiveness (100% Horizontal-Scroll Free)
   ========================================================================== */

@media (max-width: 1100px) {
  .builder-grid {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }

  .mobile-view-bar {
    display: flex;
  }
}

@media (max-width: 850px) {
  .app-container {
    padding: 0 0.85rem;
  }

  .field-item-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }

  .field-item-label, .field-item-value {
    width: 100%;
    flex: none;
  }

  .field-actions {
    align-self: flex-end;
    margin-top: 0.2rem;
  }
}

@media (max-width: 768px) {
  .hamburger-btn {
    display: inline-flex;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .add-field-list {
    grid-template-columns: 1fr;
  }

  .theme-btn .theme-text-label {
    display: none; /* Icon only on mobile top header */
  }

  .theme-btn {
    padding: 0.45rem 0.5rem;
  }
}

/* Print Stylesheet */
@media print {
  @page {
    size: 210mm 297mm;
    margin: 0 !important;
  }

  html, body {
    width: 210mm !important;
    height: 297mm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .sticky-navbar,
  .form-panel,
  .controls-card,
  .how-to-section,
  .seo-content-section,
  .faq-section,
  .site-footer,
  .mobile-view-bar,
  .modal-backdrop {
    display: none !important;
  }

  .main-content,
  .builder-grid,
  .preview-panel,
  .preview-viewport,
  .a4-page-wrapper {
    display: block !important;
    width: 210mm !important;
    height: 297mm !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
  }

  .biodata-a4-page {
    width: 210mm !important;
    height: 297mm !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 45px 45px 40px 45px !important;
    box-shadow: none !important;
    transform: none !important;
    background-size: 100% 100% !important;
    box-sizing: border-box !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
  }
}
