:root {
  --primary: #1a365d;
  --primary-hover: #152c4d;
  --accent: #2b6cb0;
  --bg-page: #f7fafc;
  --bg-card: #ffffff;
  --text-main: #2d3748;
  --text-muted: #718096;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 32px;
}

.logo-text h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.tagline {
  font-size: 13px;
  color: var(--text-muted);
}

.nav-badges {
  display: flex;
  gap: 8px;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-live {
  background-color: #e6fffa;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

.badge-cf {
  background-color: #fffaf0;
  color: #c05621;
  border: 1px solid #feebc8;
}

.badge-ats {
  background-color: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #bee3f8;
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  margin-bottom: 24px;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.card-header-row h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.text-muted {
  font-size: 14px;
  color: var(--text-muted);
}

.helper-guide {
  background-color: #ebf8ff;
  border: 1px solid #bee3f8;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  color: #2b6cb0;
}

/* ============================================================= */
/* DRAG & DROP ZONE STYLING (APPROACH 1)                         */
/* ============================================================= */

.drop-zone {
  border: 2px dashed #93c5fd;
  border-radius: 12px;
  background-color: #f8fafc;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  position: relative;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: #2563eb;
  background-color: #eff6ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.drop-icon {
  font-size: 42px;
  display: block;
  margin-bottom: 8px;
}

.drop-zone h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.link-btn {
  background: none;
  border: none;
  color: #2563eb;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}

.link-btn:hover {
  color: #1d4ed8;
}

.file-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Alternate Options & Chips */
.alt-options {
  margin-top: 18px;
}

.samples-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.samples-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.chip {
  background-color: #edf2f7;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  background-color: #e2e8f0;
  border-color: #cbd5e0;
}

.chip-verified {
  background-color: #ebf8ff;
  border-color: #bee3f8;
  color: #2b6cb0;
  font-weight: 600;
}

.chip-verified:hover {
  background-color: #bee3f8;
}

.chip-manual {
  background-color: #fffaf0;
  border: 1px dashed #dd6b20;
  color: #c05621;
  font-weight: 600;
}

.chip-manual:hover {
  background-color: #feebc8;
}

/* Manual Paste Box */
.manual-paste-box {
  margin-top: 14px;
  padding: 16px 20px;
  background-color: #f8fafc;
  border: 1.5px solid #cbd5e0;
  border-radius: 8px;
}

.manual-paste-box h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.raw-textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 13px;
  background-color: #fff;
  color: var(--text-main);
  margin-top: 8px;
  resize: vertical;
  outline: none;
  font-family: inherit;
}

.raw-textarea:focus {
  border-color: var(--accent);
}

/* Template Style Selector */
.options-grid {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.option-box label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: block;
  margin-bottom: 12px;
}

.style-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.style-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background-color: #fff;
}

.style-card input[type="radio"] {
  display: none;
}

.style-card.selected {
  border-color: var(--accent);
  background-color: #ebf8ff;
  box-shadow: 0 0 0 2px rgba(43, 108, 176, 0.2);
}

.style-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

.swatch-executive { background-color: #1a365d; }
.swatch-modern { background-color: #0f766e; }
.swatch-classic { background-color: #111827; }

.style-info strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
}

.style-info span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

/* Processing Indicator */
.processing-indicator {
  margin-top: 18px;
  padding: 14px 18px;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #1e40af;
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-secondary {
  background-color: #edf2f7;
  color: #2d3748;
  border: 1px solid #cbd5e0;
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-sm {
  font-size: 12px;
  padding: 6px 14px;
}

.btn-docx {
  background-color: #2b6cb0;
  color: #ffffff;
}

.btn-docx:hover {
  background-color: #2c5282;
}

.btn-pdf {
  background-color: #c53030;
  color: #ffffff;
}

.btn-pdf:hover {
  background-color: #9b2c2c;
}

/* Download Card */
.download-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(to right, #ffffff, #f7fafc);
}

.candidate-summary h3 {
  font-size: 18px;
  color: var(--primary);
  font-weight: 700;
}

.download-actions {
  display: flex;
  gap: 12px;
}

/* ============================================================= */
/* THEME FORMATTING SYSTEM FOR DOCUMENT PREVIEW & PDF            */
/* ============================================================= */

/* Executive Navy Theme */
.paper-sheet.theme-executive {
  --doc-primary: #1a365d;
  --doc-secondary: #4a5568;
  --doc-text: #2d3748;
  --doc-font: 'Calibri', 'Inter', -apple-system, sans-serif;
  --doc-border: #1a365d;
}

/* Modern Teal Theme */
.paper-sheet.theme-modern {
  --doc-primary: #0f766e;
  --doc-secondary: #4b5563;
  --doc-text: #1f2937;
  --doc-font: 'Arial', 'Helvetica Neue', sans-serif;
  --doc-border: #0f766e;
}

/* Classic Monochrome Theme */
.paper-sheet.theme-classic {
  --doc-primary: #111827;
  --doc-secondary: #374151;
  --doc-text: #111827;
  --doc-font: 'Georgia', 'Cambria', serif;
  --doc-border: #111827;
}

.paper-sheet {
  background-color: #ffffff;
  border-radius: 4px;
  padding: 48px 56px;
  box-shadow: var(--shadow-lg);
  border: 1px solid #d2d6dc;
  font-family: var(--doc-font, 'Calibri', sans-serif);
  color: var(--doc-text, #2d3748);
  transition: all 0.25s ease;
}

.paper-header {
  text-align: center;
  margin-bottom: 24px;
}

.paper-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--doc-primary, #1a365d) !important;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  font-family: var(--doc-font, sans-serif);
}

.paper-headline {
  font-size: 14px;
  font-weight: 600;
  color: var(--doc-secondary, #4a5568) !important;
  margin-bottom: 8px;
}

.paper-contact {
  font-size: 12px;
  color: #718096;
}

.paper-section {
  margin-top: 20px;
  page-break-inside: avoid;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--doc-primary, #1a365d) !important;
  letter-spacing: 0.5px;
  font-family: var(--doc-font, sans-serif);
}

.section-divider {
  height: 2px;
  background-color: var(--doc-border, #1a365d) !important;
  margin: 4px 0 10px;
}

.paper-body {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--doc-text, #2d3748);
}

/* Experience */
.experience-entry, .education-entry {
  margin-bottom: 14px;
  page-break-inside: avoid;
}


.entry-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.entry-role, .entry-company {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

.entry-date, .entry-location {
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: right;
}


.entry-role, .entry-company {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

.entry-date, .entry-location {
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: right;
}

.entry-role {
  font-size: 13px;
  font-weight: 700;
  color: var(--doc-primary, #1a365d) !important;
  font-family: var(--doc-font, sans-serif);
}

.entry-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--doc-secondary, #718096) !important;
}

.entry-company {
  font-size: 12.5px;
  font-style: italic;
  color: var(--doc-secondary, #4a5568) !important;
}

.entry-location {
  font-size: 11.5px;
  color: #718096;
}

.entry-bullets {
  margin-top: 6px;
  padding-left: 20px;
}

.entry-bullets li {
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 4px;
  color: var(--doc-text, #2d3748);
}

/* Skills */
.skill-row {
  font-size: 12px;
  margin-bottom: 6px;
}

.skill-row strong {
  color: var(--doc-primary, #1a365d) !important;
}

/* Certifications */
.cert-item {
  font-size: 12px;
  margin-bottom: 4px;
}

/* Tabs */
.preview-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  background: none;
  border: 1px solid transparent;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
}

.tab-btn.active {
  background-color: #fff;
  border-color: var(--border);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* JSON view */
.json-code {
  background-color: #1a202c;
  color: #cbd5e0;
  padding: 20px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 12px;
  max-height: 500px;
  overflow: auto;
}

/* Footer */
.footer {
  margin-top: 48px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #93c5fd;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Print-to-PDF Formatting (Vector A4 Output matching selected theme) */
@media print {
  @page {
    size: A4;
    margin: 14mm 16mm;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .navbar,
  .input-card,
  .download-card,
  .preview-tabs,
  .footer,
  .json-code {
    display: none !important;
  }
  .app-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .paper-sheet {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .section-divider {
    border-bottom: 2pt solid var(--doc-border, #1a365d) !important;
    background-color: transparent !important;
    height: 0 !important;
  }
  .experience-entry, .education-entry {
    page-break-inside: avoid;
  }
}
