/* ============================================================
   PRO RESUME BUILDER — STYLE.CSS
   Design: Refined SaaS Dark with Warm Amber Accents
   ============================================================ */

/* ---- RESET & VARIABLES ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base:        #0d0e11;
  --bg-surface:     #14161b;
  --bg-card:        #1c1f27;
  --bg-input:       #21242e;
  --border:         #2a2e3d;
  --border-focus:   #f0a500;
  --accent:         #f0a500;
  --accent-dim:     #b87c00;
  --accent-glow:    rgba(240,165,0,0.15);
  --text-primary:   #f0f0f2;
  --text-secondary: #9399aa;
  --text-muted:     #5c6175;
  --danger:         #e05555;
  --success:        #3cb97a;
  --radius:         10px;
  --radius-lg:      16px;
  --shadow:         0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg:      0 12px 48px rgba(0,0,0,0.5);
  --font-ui:        'Syne', sans-serif;
  --font-body:      'Inter', sans-serif;
  --font-display:   'DM Serif Display', serif;
  --transition:     0.22s ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================================
   MODAL OVERLAY
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 90%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.35s ease;
  position: relative;
}

@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { color: var(--danger); border-color: var(--danger); }

/* ============================================================
   AUTH MODAL
   ============================================================ */
.auth-brand {
  text-align: center; margin-bottom: 24px;
}
.auth-brand .brand-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  background: var(--accent-glow); border: 1px solid var(--accent);
  border-radius: 14px; margin-bottom: 12px;
  font-size: 22px; color: var(--accent);
}
.auth-brand h1 {
  font-family: var(--font-ui); font-size: 1.6rem; font-weight: 800;
  letter-spacing: -0.5px;
}
.auth-brand p { color: var(--text-secondary); font-size: 0.85rem; margin-top: 4px; }

.auth-tabs {
  display: flex; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 24px;
}
.auth-tab {
  flex: 1; padding: 10px; background: none; border: none;
  color: var(--text-secondary); font-family: var(--font-ui);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: var(--transition);
}
.auth-tab.active { background: var(--accent); color: #000; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form.hidden { display: none; }
.auth-note { text-align: center; color: var(--text-muted); font-size: 0.75rem; margin-top: 8px; }

/* ============================================================
   PAYMENT MODAL
   ============================================================ */
.payment-box {
  max-width: 460px;
  /* Fix: constrain height so nothing is clipped off-screen */
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Compact the header so body buttons are always reachable */
.payment-box .payment-header { margin-bottom: 14px; }
.payment-box .lock-badge { width: 48px; height: 48px; font-size: 20px; margin-bottom: 8px; }
.payment-box .payment-header h2 { font-size: 1.2rem; }
.payment-box .payment-header p  { font-size: 0.8rem; margin-top: 4px; }
.payment-box .price-badge { font-size: 1.3rem; padding: 4px 18px; margin-top: 8px; }

.payment-header { text-align: center; margin-bottom: 24px; }
.lock-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  background: var(--accent-glow); border: 1px solid var(--accent);
  border-radius: 50%; font-size: 26px; color: var(--accent);
  margin-bottom: 12px;
}
.payment-header h2 { font-family: var(--font-ui); font-size: 1.4rem; }
.payment-header p { color: var(--text-secondary); font-size: 0.85rem; margin-top: 6px; }
.price-badge {
  display: inline-block; background: var(--accent);
  color: #000; font-family: var(--font-ui); font-weight: 800;
  font-size: 1.6rem; padding: 6px 24px; border-radius: 50px;
  margin-top: 12px;
}
.price-badge span { font-size: 0.85rem; font-weight: 500; }

.upi-section { margin-bottom: 14px; }
.upi-id-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 11px 14px; margin-bottom: 12px;
}
.upi-id-box i { font-size: 20px; color: var(--accent); }
.upi-id-box small { display: block; color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; }
.upi-id-box strong { font-family: var(--font-ui); font-size: 0.9rem; }
.copy-btn {
  margin-left: auto; background: none; border: 1px solid var(--border);
  color: var(--text-secondary); padding: 6px 10px; border-radius: 6px;
  cursor: pointer; transition: var(--transition);
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }

.qr-wrapper { text-align: center; }
.qr-code {
  display: inline-flex; align-items: center; justify-content: center;
  background: white; border-radius: 10px; padding: 6px;
  width: 136px; height: 136px;
}
.qr-code img { width: 124px; height: 124px; border-radius: 3px; }
.qr-fallback {
  flex-direction: column; gap: 8px;
  color: #333; font-size: 13px;
}
.qr-fallback i { font-size: 52px; color: #333; }
.qr-label { color: var(--text-muted); font-size: 0.75rem; margin-top: 6px; }

.payment-steps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.step {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.82rem; color: var(--text-secondary);
}
.step span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #000;
  font-weight: 700; font-size: 0.72rem; font-family: var(--font-ui);
}
.step a { color: var(--accent); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--success); color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 50px;
  font-family: var(--font-ui); font-size: 0.9rem; font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 9999;
  transition: all 0.4s ease;
}
.toast.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(16px); }

/* ============================================================
   POPUP MODALS (signup-required / payment-required)
   ============================================================ */
.popup-box {
  max-width: 380px;
  text-align: center;
  padding: 36px 32px;
}
.popup-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; border-radius: 50%;
  font-size: 24px; margin: 0 auto 16px;
}
.danger-icon  { background: rgba(224,85,85,0.15);  border: 1px solid var(--danger);  color: var(--danger); }
.warning-icon { background: rgba(240,165,0,0.15);   border: 1px solid var(--accent);  color: var(--accent); }
.popup-title {
  font-family: var(--font-ui); font-size: 1.15rem; font-weight: 700;
  margin-bottom: 10px;
}
.popup-msg {
  color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6;
  margin-bottom: 20px;
}
.popup-msg strong { color: var(--text-primary); }
.popup-actions { display: flex; flex-direction: column; gap: 0; }

/* AUTH error message shown inside form */
.auth-error {
  display: flex; align-items: center; gap: 8px;
  background: rgba(224,85,85,0.12); border: 1px solid var(--danger);
  color: var(--danger); border-radius: 8px;
  font-size: 0.8rem; padding: 9px 12px;
  font-family: var(--font-body);
  animation: slideUp 0.2s ease;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 22px;
  background: var(--accent); color: #000;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.9rem;
  border: none; border-radius: var(--radius); cursor: pointer;
  transition: var(--transition);
}
.btn-primary:hover { background: #ffc107; transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.btn-primary.full { width: 100%; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; background: none;
  border: 1px solid var(--border); color: var(--text-secondary);
  font-family: var(--font-ui); font-size: 0.85rem; font-weight: 600;
  border-radius: var(--radius); cursor: pointer; transition: var(--transition);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-download {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; background: var(--accent); color: #000;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.85rem;
  border: none; border-radius: var(--radius); cursor: pointer;
  transition: var(--transition);
}
.btn-download:hover { background: #ffc107; }
.btn-download.locked {
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: not-allowed;
  pointer-events: none;   /* CSS layer blocks all mouse events when locked */
  opacity: 0.6;
}

.btn-unlock {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; background: var(--accent-glow);
  border: 1px solid var(--accent); color: var(--accent);
  font-family: var(--font-ui); font-weight: 700; font-size: 0.82rem;
  border-radius: var(--radius); cursor: pointer; transition: var(--transition);
}
.btn-unlock:hover { background: var(--accent); color: #000; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: rgba(13,14,17,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-ui); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.3px;
}
.brand-icon-sm {
  color: var(--accent); font-size: 18px;
}
.nav-actions {
  display: flex; align-items: center; gap: 10px;
}
.template-switcher {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-ui); font-size: 0.8rem; color: var(--text-secondary);
}
.template-switcher select {
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); padding: 7px 10px; border-radius: 8px;
  font-family: var(--font-ui); font-size: 0.8rem; cursor: pointer;
}
.user-avatar {
  width: 34px; height: 34px; display: flex; align-items: center;
  justify-content: center; font-size: 22px; color: var(--accent);
  cursor: pointer;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-layout {
  display: grid; grid-template-columns: 400px 1fr;
  height: calc(100vh - 61px);
  overflow: hidden;
}

/* ============================================================
   FORM PANEL
   ============================================================ */
.form-panel {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden; /* prevent horizontal bleed from focus rings */
  padding: 24px 20px;
  display: flex; flex-direction: column; gap: 8px;
  /* Establish a proper stacking context so nothing bleeds out */
  position: relative;
}
.form-header { margin-bottom: 8px; }
.form-header h2 { font-family: var(--font-ui); font-size: 1.1rem; font-weight: 700; }
.form-header p { color: var(--text-secondary); font-size: 0.8rem; margin-top: 3px; }

/* Collapsible Sections */
.form-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
  /* overflow:hidden removed — was clipping expanded content and causing overlap */
}
.section-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; cursor: pointer;
  font-family: var(--font-ui); font-weight: 600; font-size: 0.88rem;
  user-select: none; transition: var(--transition);
  border-radius: var(--radius); /* keep corners rounded when body is closed */
}
.section-toggle:hover { background: rgba(240,165,0,0.06); }
.section-toggle span { display: flex; align-items: center; gap: 10px; }
.section-toggle i { color: var(--accent); }
.toggle-icon { color: var(--text-muted); transition: transform 0.25s ease; }
.toggle-icon.rotated { transform: rotate(-180deg); }

/* Accordion body — smooth max-height transition, no display:none flicker */
.section-body {
  padding: 0 16px;
  border-top: 0px solid var(--border);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.25s ease, border-top-width 0.25s ease;
  box-sizing: border-box;
}
.section-body.open {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
  /* 2000px covers any realistic content height without animation lag */
  max-height: 2000px;
  overflow: visible; /* allow focus rings / box-shadows to show outside */
}

/* Form Elements */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label {
  font-size: 0.78rem; font-weight: 600; font-family: var(--font-ui);
  color: var(--text-secondary); letter-spacing: 0.02em;
}
.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); padding: 9px 12px; border-radius: 8px;
  font-family: var(--font-body); font-size: 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none; border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.hint { color: var(--text-muted); font-size: 0.73rem; margin-top: 6px; display: block; }

/* Dynamic List Entries */
.entry-card {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 40px 14px 14px; /* right padding leaves room for ✕ button */
  margin-bottom: 10px;
  position: relative;
}
.entry-card .remove-btn {
  position: absolute; top: 10px; right: 10px;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.8rem; transition: var(--transition);
}
.entry-card .remove-btn:hover { color: var(--danger); }

.add-entry-btn {
  width: 100%; padding: 9px; background: none;
  border: 1px dashed var(--border); color: var(--text-secondary);
  border-radius: var(--radius); cursor: pointer; font-family: var(--font-ui);
  font-size: 0.83rem; font-weight: 600; display: flex; align-items: center;
  justify-content: center; gap: 8px; transition: var(--transition);
}
.add-entry-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

/* Skill Tags */
.skill-tag-input { display: flex; gap: 8px; }
.skill-tag-input input { flex: 1; }
.add-tag-btn {
  background: var(--accent); border: none; color: #000;
  width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
  font-size: 0.85rem; flex-shrink: 0; transition: var(--transition);
}
.add-tag-btn:hover { background: #ffc107; }
.tags-display { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.skill-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-glow); border: 1px solid var(--accent);
  color: var(--accent); padding: 4px 12px; border-radius: 50px;
  font-size: 0.78rem; font-family: var(--font-ui); font-weight: 600;
}
.skill-tag button {
  background: none; border: none; color: var(--accent);
  cursor: pointer; font-size: 0.72rem; line-height: 1; padding: 0;
}
.skill-tag button:hover { color: var(--danger); }

/* ============================================================
   PREVIEW PANEL
   ============================================================ */
.preview-panel {
  background: #1a1b20;
  overflow-y: auto; display: flex; flex-direction: column;
}
.preview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--border);
  background: var(--bg-surface); position: sticky; top: 0; z-index: 10;
}
.preview-header h2 { font-family: var(--font-ui); font-size: 1rem; font-weight: 700; }
.preview-controls { display: flex; align-items: center; gap: 10px; }
.lock-badge-sm {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-ui); font-size: 0.75rem; font-weight: 600;
  padding: 4px 12px; border-radius: 50px;
}
.lock-badge-sm.locked { background: rgba(224,85,85,0.15); color: var(--danger); border: 1px solid var(--danger); }
.lock-badge-sm.unlocked { background: rgba(60,185,122,0.15); color: var(--success); border: 1px solid var(--success); }

.preview-wrapper {
  flex: 1; padding: 32px 24px;
  display: flex; justify-content: center;
  position: relative;
}

/* Blur Overlay */
.blur-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13,14,17,0.65);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 5; border-radius: var(--radius);
  transition: all 0.4s ease;
}
.blur-overlay.hidden { opacity: 0; pointer-events: none; visibility: hidden; }
.blur-content {
  text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px 48px;
  box-shadow: var(--shadow-lg);
}
.blur-content i { font-size: 40px; color: var(--accent); }
.blur-content h3 { font-family: var(--font-ui); font-size: 1.3rem; }
.blur-content p { color: var(--text-secondary); font-size: 0.88rem; }

/* Resume Container */
.resume-container {
  width: 794px; /* A4 width at 96dpi */
  position: relative;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
  /* No min-height — let content dictate height so PDF stays 1 page */
}

.watermark {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-35deg);
  font-family: var(--font-ui); font-size: 56px; font-weight: 800;
  color: rgba(0,0,0,0.07); pointer-events: none; z-index: 10;
  white-space: nowrap; letter-spacing: 3px; user-select: none;
  width: 120%; text-align: center;
}
.watermark.hidden { display: none; }

/* ============================================================
   RESUME TEMPLATE: MODERN
   ============================================================ */
#resumeOutput.template-modern {
  font-family: 'Inter', sans-serif;
  background: #fff; color: #1a1a2e;
  /* No min-height — content determines page count */
}

.template-modern .resume-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  padding: 40px 48px;
  display: flex; align-items: center; gap: 28px;
  color: #fff;
}
.template-modern .resume-photo {
  width: 100px; height: 100px; border-radius: 50%;
  object-fit: cover; border: 3px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.template-modern .resume-photo-placeholder {
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 3px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: rgba(255,255,255,0.6); flex-shrink: 0;
}
.template-modern .header-info { flex: 1; }
.template-modern .resume-name {
  font-size: 28px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.5px;
}
.template-modern .resume-title {
  font-size: 14px; opacity: 0.8; margin-bottom: 16px; font-weight: 400;
}
.template-modern .contact-row {
  display: flex; flex-wrap: wrap; gap: 16px; font-size: 11px; opacity: 0.85;
}
.template-modern .contact-item {
  display: flex; align-items: center; gap: 5px;
}
.template-modern .contact-item i { opacity: 0.7; }

.template-modern .resume-body {
  display: grid; grid-template-columns: 220px 1fr;
  min-height: calc(1123px - 180px);
}

.template-modern .sidebar {
  background: #f7f8fc; padding: 28px 22px;
  border-right: 1px solid #e8eaef;
}
.template-modern .main-content { padding: 28px 32px; }

.template-modern .section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: #0f3460; margin-bottom: 14px; margin-top: 24px;
  padding-bottom: 6px; border-bottom: 2px solid #0f3460;
}
.template-modern .section-title:first-child { margin-top: 0; }

/* Skills sidebar */
.template-modern .skill-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; margin-bottom: 8px; color: #333;
}
.template-modern .skill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #0f3460; flex-shrink: 0;
}

/* Links sidebar */
.template-modern .link-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: #0f3460; margin-bottom: 8px;
  word-break: break-all;
}
.template-modern .link-item i { font-size: 12px; flex-shrink: 0; }

/* Hobbies */
.template-modern .hobby-text { font-size: 12px; color: #555; line-height: 1.6; }

/* About */
.template-modern .about-text { font-size: 13px; color: #444; line-height: 1.7; }

/* Entry (exp/edu/projects) */
.template-modern .entry { margin-bottom: 18px; }
.template-modern .entry-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 3px; }
.template-modern .entry-title { font-size: 14px; font-weight: 700; color: #1a1a2e; }
.template-modern .entry-subtitle { font-size: 12px; color: #0f3460; font-weight: 600; margin-bottom: 2px; }
.template-modern .entry-date { font-size: 11px; color: #888; white-space: nowrap; }
.template-modern .entry-desc { font-size: 12px; color: #555; line-height: 1.6; margin-top: 4px; }
.template-modern .entry-link { font-size: 11px; color: #0f3460; margin-top: 4px; display: block; }

/* Achievement / Cert items */
.template-modern .list-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; color: #444; margin-bottom: 8px; line-height: 1.5;
}
.template-modern .list-item::before {
  content: '▸'; color: #0f3460; font-size: 10px; margin-top: 2px; flex-shrink: 0;
}

/* ============================================================
   RESUME TEMPLATE: PROFESSIONAL
   ============================================================ */
#resumeOutput.template-professional {
  font-family: 'Inter', sans-serif;
  background: #fff; color: #1e1e2e;
  /* No min-height — content determines page count */
}

/* ============================================================
   RESUME TEMPLATE: PROFESSIONAL — Redesigned
   Clean two-tone sidebar layout, teal accent, modern typography
   ============================================================ */
#resumeOutput.template-professional {
  font-family: 'Inter', sans-serif;
  background: #fff; color: #1e1e2e;
}

/* ── Header ── */
.template-professional .resume-header {
  background: #1b2a4a;
  padding: 36px 40px;
  display: flex; align-items: center; gap: 24px;
  color: #fff;
}
.template-professional .resume-photo {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; border: 3px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
}
.template-professional .resume-photo-placeholder {
  width: 96px; height: 96px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 3px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; color: rgba(255,255,255,0.55); flex-shrink: 0;
}
.template-professional .header-info { flex: 1; }
.template-professional .resume-name {
  font-size: 26px; font-weight: 700; letter-spacing: -0.4px;
  margin-bottom: 3px; color: #fff;
}
.template-professional .resume-title {
  font-size: 13px; font-weight: 400; color: #7ec8c8;
  margin-bottom: 14px; letter-spacing: 0.5px;
}
.template-professional .contact-row {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 10.5px; color: rgba(255,255,255,0.75);
}
.template-professional .contact-item {
  display: flex; align-items: center; gap: 5px;
}
.template-professional .contact-item i {
  font-size: 10px; color: #7ec8c8; flex-shrink: 0;
}

/* ── Body: sidebar + main ── */
.template-professional .resume-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 600px; /* visual floor only, not forcing page break */
}

/* ── Sidebar ── */
.template-professional .prof-sidebar {
  background: #f0f4f8;
  padding: 24px 18px;
  border-right: 1px solid #dde3eb;
}

/* ── Main content ── */
.template-professional .prof-main {
  padding: 24px 28px;
}

/* ── Section titles ── */
.template-professional .section-title {
  font-size: 9.5px; font-weight: 700; letter-spacing: 1.8px;
  text-transform: uppercase; color: #1b2a4a;
  margin-bottom: 10px; margin-top: 20px;
  padding-bottom: 5px; border-bottom: 2px solid #1b2a4a;
}
.template-professional .section-title:first-child { margin-top: 0; }

/* Sidebar section titles are slightly muted */
.template-professional .prof-sidebar .section-title {
  color: #2d5a8e; border-bottom-color: #2d5a8e;
  font-size: 9px; letter-spacing: 1.5px;
}

/* ── Skill chips in sidebar ── */
.template-professional .skill-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: #333; margin-bottom: 7px; line-height: 1.3;
}
.template-professional .skill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #2d5a8e; flex-shrink: 0;
}

/* ── Links in sidebar ── */
.template-professional .link-item {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 10.5px; color: #1b2a4a; margin-bottom: 8px;
  word-break: break-all; line-height: 1.4;
}
.template-professional .link-item i { font-size: 10px; margin-top: 2px; flex-shrink: 0; color: #2d5a8e; }

/* ── Hobbies ── */
.template-professional .hobby-text {
  font-size: 11.5px; color: #555; line-height: 1.6;
}

/* ── About / Summary ── */
.template-professional .about-text {
  font-size: 12px; color: #444; line-height: 1.75;
}

/* ── Entries (experience / edu / projects) ── */
.template-professional .entry { margin-bottom: 14px; }
.template-professional .entry-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 2px;
}
.template-professional .entry-title {
  font-size: 13px; font-weight: 700; color: #1b2a4a;
}
.template-professional .entry-subtitle {
  font-size: 11.5px; color: #2d5a8e; font-weight: 600;
  margin-bottom: 3px;
}
.template-professional .entry-date {
  font-size: 10px; color: #888; white-space: nowrap;
  background: #eef2f7; padding: 2px 7px; border-radius: 20px;
}
.template-professional .entry-desc {
  font-size: 11.5px; color: #555; line-height: 1.65; margin-top: 4px;
}
.template-professional .entry-link {
  font-size: 10.5px; color: #2d5a8e; margin-top: 4px; display: block;
}

/* ── Achievement / Cert list items ── */
.template-professional .list-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 11.5px; color: #444; margin-bottom: 7px; line-height: 1.5;
}
.template-professional .list-item::before {
  content: '▸'; color: #2d5a8e; font-size: 9px; margin-top: 2px; flex-shrink: 0;
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}
.loading-overlay.hidden { display: none; }
.spinner-box { text-align: center; color: #fff; }
.spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%; margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-box p { font-family: var(--font-ui); font-size: 0.9rem; color: var(--text-secondary); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .app-layout { grid-template-columns: 360px 1fr; }
  .resume-container { width: 680px; }
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .form-panel { height: auto; overflow: visible; border-right: none; border-bottom: 1px solid var(--border); }
  .preview-panel { min-height: 600px; }
  .resume-container { width: 100%; }
  /* Modern template */
  .template-modern .resume-body { grid-template-columns: 1fr; }
  .template-modern .sidebar { border-right: none; border-bottom: 1px solid #e8eaef; }
  /* Professional template */
  .template-professional .resume-body { grid-template-columns: 1fr; }
  .template-professional .prof-sidebar { border-right: none; border-bottom: 1px solid #dde3eb; }
  .template-professional .resume-header { padding: 24px; }
  .nav-actions { flex-wrap: wrap; gap: 6px; }
  .template-switcher label { display: none; }
}

@media (max-width: 600px) {
  .navbar { padding: 12px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .modal-box { padding: 24px 20px; }
  .blur-content { padding: 28px 24px; }
  .preview-wrapper { padding: 16px 8px; }
}