/* ============================================================
   CV / Resume Builder — Global Design System
   Version: 2.0
   Author: Antigravity AI
   ============================================================ */

/* ── Google Fonts Import ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Custom Properties (Design Tokens) ── */
:root {
  /* Primary Palette */
  --primary:       #6366f1;   /* Indigo */
  --primary-light: #818cf8;
  --primary-dark:  #4f46e5;
  --primary-glow:  rgba(99, 102, 241, 0.35);
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);

  /* Secondary */
  --accent:        #06b6d4;   /* Cyan */
  --accent-light:  #67e8f9;
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;

  /* Dark Background System */
  --bg-base:       #0a0a0f;
  --bg-surface:    #111118;
  --bg-elevated:   #1a1a27;
  --bg-card:       #1e1e2e;
  --bg-hover:      #252535;
  --bg-glass:      rgba(30, 30, 46, 0.7);

  /* Text */
  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;
  --text-inverse:  #0a0a0f;

  /* Borders */
  --border:        rgba(255,255,255,0.08);
  --border-active: rgba(99,102,241,0.5);
  --border-glow:   rgba(99,102,241,0.3);

  /* Shadows */
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:     0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg:     0 20px 60px rgba(0,0,0,0.6);
  --shadow-primary:0 8px 32px rgba(99,102,241,0.25);

  /* Typography */
  --font-sans:     'Inter', system-ui, -apple-system, sans-serif;
  --font-serif:    'Playfair Display', Georgia, serif;
  --font-mono:     'JetBrains Mono', monospace;

  /* Spacing */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-full:9999px;

  /* Transitions */
  --transition-fast:  0.15s cubic-bezier(0.4,0,0.2,1);
  --transition-base:  0.25s cubic-bezier(0.4,0,0.2,1);
  --transition-slow:  0.4s cubic-bezier(0.4,0,0.2,1);
  --transition-spring:0.5s cubic-bezier(0.34,1.56,0.64,1);

  /* Z-index Scale */
  --z-below:   -1;
  --z-base:     0;
  --z-above:    10;
  --z-dropdown: 100;
  --z-modal:    1000;
  --z-toast:    9999;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Animated Background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -5%, rgba(99,102,241,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(6,182,212,0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: var(--z-below);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ── Selection ── */
::selection { background: var(--primary); color: white; }

/* ========================================
   LAYOUT
   ======================================== */

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-dropdown);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: box-shadow var(--transition-base), background var(--transition-base);
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.97);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  border-bottom-color: rgba(99, 102, 241, 0.15);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.navbar-brand .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
  flex-shrink: 0;
}

.navbar-brand .logo-text {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.navbar-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.navbar-nav a:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

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

/* ── Hamburger ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

/* ── Hero Section ── */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 28px;
  animation: fadeInDown 0.6s ease both;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  animation: fadeInUp 0.7s ease 0.1s both;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.7;
  animation: fadeInUp 0.7s ease 0.2s both;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeInUp 0.7s ease 0.3s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 64px;
  animation: fadeInUp 0.7s ease 0.4s both;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}

.btn:hover::before { background: rgba(255,255,255,0.05); }
.btn:active { transform: scale(0.97); }

/* Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 8px 30px rgba(99,102,241,0.45);
  transform: translateY(-2px);
}

/* Secondary */
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

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

/* Accent */
.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, #0891b2 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(6,182,212,0.3);
}

.btn-accent:hover {
  box-shadow: 0 8px 30px rgba(6,182,212,0.45);
  transform: translateY(-2px);
}

/* Danger */
.btn-danger {
  background: var(--danger);
  color: white;
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

/* Sizes */
.btn-sm  { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg  { padding: 16px 32px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-xl  { padding: 18px 40px; font-size: 17px; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }
.btn-icon { padding: 10px; border-radius: var(--radius-sm); aspect-ratio: 1; }

/* Loading state */
.btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
}

/* ========================================
   CARDS & GLASS
   ======================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-primary);
}

.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-xl);
  padding: 24px;
}

/* ========================================
   MAIN BUILDER LAYOUT
   ======================================== */

.builder-section {
  padding: 40px 0 80px;
}

.builder-grid {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 28px;
  align-items: start;
}

.builder-grid > * {
  min-width: 0;
}

/* ── Left Panel: Form ── */
.form-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
}

.form-panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elevated);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 12px;
}

.form-panel-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.form-panel-body {
  overflow-y: auto;
  flex: 1;
  padding: 20px;
}

/* ── Right Panel: Preview ── */
.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.preview-controls {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
}

.preview-controls-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

/* Template Picker */
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.template-card {
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border);
  transition: all var(--transition-base);
  position: relative;
}

.template-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.template-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}

.template-card .template-thumb {
  width: 100%;
  aspect-ratio: 0.707;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-base);
}

.template-card:hover .template-thumb {
  transform: scale(1.03);
}

.template-card .template-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: white;
}

.template-card.active .template-check {
  display: flex;
}

.template-card .template-name {
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-card.active .template-name {
  color: var(--primary-light);
}

/* Color Picker */
.color-picker-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.color-picker-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--transition-fast);
  border: 2px solid transparent;
}

.swatch:hover { transform: scale(1.2); }
.swatch.active { border-color: white; transform: scale(1.15); }

/* Preview Frame */
.preview-frame-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  overflow: hidden;
}

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

.preview-toolbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16,185,129,0.1);
  color: var(--success);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16,185,129,0.3);
}

.preview-live-badge .dot {
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

.preview-zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.zoom-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.zoom-level {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
}

/* CV Preview Scroll Container */
.preview-scroll {
  overflow: auto;
  border-radius: var(--radius-md);
  background: #cbd5e1;
  padding: 16px;
  max-height: 900px;
}

.preview-scroll::-webkit-scrollbar { width: 4px; height: 4px; }
.preview-scroll::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 2px; }

#cv-preview {
  width: 794px; /* A4 width in px at 96dpi */
  min-height: 1123px; /* A4 height */
  background: white;
  margin: 0 auto;
  transform-origin: top left;
  box-shadow: 0 4px 32px rgba(0,0,0,0.3);
  border-radius: 2px;
  transition: transform var(--transition-base);
}

/* Export Actions */
.export-actions {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.export-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.export-row {
  display: flex;
  gap: 12px;
}

/* ========================================
   FORM STYLES
   ======================================== */

/* Section Tabs */
.form-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.form-tabs::-webkit-scrollbar {
  height: 4px;
}
.form-tabs::-webkit-scrollbar-track {
  background: transparent;
}
.form-tabs::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 2px;
}

.form-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-elevated);
}

.form-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.form-tab .tab-icon { font-size: 14px; }

/* Form Section Panels */
.form-section {
  display: none;
  animation: fadeInUp 0.3s ease;
}

.form-section.active { display: block; }

/* Form Groups */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: all var(--transition-fast);
  outline: none;
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.form-error {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-helper {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Repeatable List Items ── */
.repeatable-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.repeatable-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  animation: slideInLeft 0.3s ease;
}

.repeatable-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  cursor: pointer;
}

.repeatable-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.repeatable-item-actions {
  display: flex;
  gap: 6px;
}

.repeatable-item-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.repeatable-item-btn.remove {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
}

.repeatable-item-btn.remove:hover {
  background: var(--danger);
  color: white;
}

.repeatable-item-btn.drag {
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: grab;
}

.add-item-btn {
  width: 100%;
  padding: 10px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.add-item-btn:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(99,102,241,0.05);
}

/* ── Skills Tags ── */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  color: var(--primary-light);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  animation: scaleIn 0.2s var(--transition-spring);
}

.skill-tag button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  margin-left: 2px;
}

.skill-tag button:hover { opacity: 1; }

.skill-input-row {
  display: flex;
  gap: 8px;
}

.skill-input-row .form-input {
  flex: 1;
}

/* ── Range Slider ── */
.skill-level {
  margin-top: 6px;
}

.range-input {
  width: 100%;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-hover);
  outline: none;
  transition: background var(--transition-fast);
}

.range-input::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 8px var(--primary-glow);
  transition: transform var(--transition-fast);
}

.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* ========================================
   UPLOAD ZONE
   ======================================== */

.upload-section {
  padding: 60px 0;
  border-top: 1px solid var(--border);
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(99,102,241,0.05) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(99,102,241,0.03);
}

.upload-zone:hover::before,
.upload-zone.drag-over::before {
  opacity: 1;
}

.upload-zone.drag-over {
  transform: scale(1.01);
}

.upload-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: rgba(99,102,241,0.1);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--primary-light);
  transition: transform var(--transition-spring);
}

.upload-zone:hover .upload-icon {
  transform: translateY(-4px) scale(1.1);
}

.upload-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.upload-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.upload-formats {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.format-badge {
  padding: 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ── Upload Progress ── */
.upload-progress-wrapper {
  display: none;
  padding: 32px;
  text-align: center;
}

.upload-progress-wrapper.visible { display: block; }

.progress-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  text-align: left;
}

.progress-file-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.progress-file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-file-size {
  font-size: 12px;
  color: var(--text-muted);
}

.progress-bar-container {
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}

.progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.progress-percent {
  font-weight: 700;
  color: var(--primary-light);
}

/* ── Processing Spinner ── */
.processing-wrapper {
  display: none;
  padding: 40px;
  text-align: center;
}

.processing-wrapper.visible { display: block; }

.processing-spinner-container {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
}

.processing-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}

.processing-ring-1 {
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

.processing-ring-2 {
  border-right-color: var(--accent);
  animation: spin 1.5s linear infinite reverse;
  inset: 8px;
}

.processing-ring-3 {
  border-bottom-color: rgba(99,102,241,0.4);
  animation: spin 2s linear infinite;
  inset: 16px;
}

.processing-center-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.processing-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.processing-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.processing-steps {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.processing-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-muted);
  animation: none;
}

.processing-step.done { color: var(--success); }
.processing-step.active {
  color: var(--text-primary);
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.2);
}

.step-icon { font-size: 14px; }

/* ========================================
   FEATURES SECTION
   ======================================== */

.features-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  transition: all var(--transition-base);
  cursor: default;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-primary);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
  position: relative;
}

.feature-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.15;
}

.feature-card:nth-child(1) .feature-icon { background: rgba(99,102,241,0.1); }
.feature-card:nth-child(2) .feature-icon { background: rgba(6,182,212,0.1); }
.feature-card:nth-child(3) .feature-icon { background: rgba(16,185,129,0.1); }
.feature-card:nth-child(4) .feature-icon { background: rgba(245,158,11,0.1); }
.feature-card:nth-child(5) .feature-icon { background: rgba(239,68,68,0.1); }
.feature-card:nth-child(6) .feature-icon { background: rgba(168,85,247,0.1); }

.feature-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.feature-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========================================
   BLOG SECTION
   ======================================== */

.blog-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.blog-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: default;
  display: flex;
  flex-direction: column;
}

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

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

.blog-card:hover::before {
  opacity: 1;
}

.blog-card-body {
  padding: 30px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-light);
  margin-bottom: 10px;
}

.blog-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.blog-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ========================================
   ADS ZONES
   ======================================== */

.ad-zone {
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  position: relative;
  overflow: hidden;
}

.ad-zone-label {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.5;
}

.ad-banner {
  width: 100%;
  height: 90px;
  margin: 20px 0;
}

.ad-sidebar {
  width: 100%;
  min-height: 250px;
}

.ad-inline {
  width: 100%;
  height: 100px;
  margin: 24px 0;
}

/* ── Rewarded Ad Modal ── */
.rewarded-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

.rewarded-modal.visible {
  display: flex;
}

.rewarded-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  animation: scaleIn 0.3s var(--transition-spring);
}

.rewarded-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--warning), #f97316);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(245,158,11,0.3);
}

.rewarded-countdown {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto;
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-light);
  animation: spin 1s linear infinite;
  position: relative;
}

.rewarded-countdown-num {
  position: absolute;
  animation: none !important;
}

/* ========================================
   NOTIFICATIONS / TOAST
   ======================================== */

.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(20, 20, 25, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
  max-width: 360px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: all;
  color: #fff;
}

.toast.success { border-bottom: 2px solid var(--success); background: linear-gradient(180deg, rgba(20, 20, 25, 0.8) 0%, rgba(16, 185, 129, 0.1) 100%); }
.toast.error   { border-bottom: 2px solid var(--danger); background: linear-gradient(180deg, rgba(20, 20, 25, 0.8) 0%, rgba(239, 68, 68, 0.1) 100%); }
.toast.warning { border-bottom: 2px solid var(--warning); background: linear-gradient(180deg, rgba(20, 20, 25, 0.8) 0%, rgba(245, 158, 11, 0.1) 100%); }
.toast.info    { border-bottom: 2px solid var(--primary); background: linear-gradient(180deg, rgba(20, 20, 25, 0.8) 0%, rgba(99, 102, 241, 0.1) 100%); }

.toast-message { font-size: 14px; font-weight: 500; flex: 1; letter-spacing: 0.3px; }
.toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  line-height: 1;
  border-radius: 50%;
  transition: all 0.2s;
}
.toast-close:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

.toast.fade-out {
  animation: slideOutRight 0.3s ease forwards;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 60px 0 32px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: 12px;
  max-width: 280px;
}

.footer-col-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-links a:hover { color: var(--primary-light); }

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

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

.footer-bottom-links {
  display: flex;
  gap: 20px;
}

.footer-bottom-links a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-bottom-links a:hover { color: var(--text-secondary); }

/* ========================================
   KEYFRAME ANIMATIONS
   ======================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

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

@keyframes shimmer {
  from { left: -100%; }
  to   { left: 100%; }
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.5); opacity: 0.6; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ========================================
   RESPONSIVE — TABLET
   ======================================== */

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

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 1000px) {
  .builder-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .preview-panel {
    display: contents;
  }

  .preview-controls {
    order: -1;
  }

  .form-panel,
  .preview-controls,
  .preview-frame-wrapper,
  .ad-zone,
  .export-actions {
    min-width: 0;
    max-width: 100%;
  }

  .form-panel {
    position: static;
    max-height: none;
  }

  .template-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-stats {
    gap: 32px;
  }

  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .navbar-nav { display: none; }
  .hamburger { display: flex; }
}

/* ========================================
   RESPONSIVE — MOBILE
   ======================================== */

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

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

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

  .hero-stats {
    gap: 24px;
    flex-wrap: wrap;
  }

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

  .template-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .export-row {
    flex-direction: column;
  }

  .hero {
    padding: 60px 20px;
    min-height: 70vh;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #cv-preview {
    /* Kept at original scale and handled by zoom wrapper to prevent A4 ratio breakage */
  }

  .preview-scroll {
    display: flex;
    justify-content: center;
  }
}

/* ========================================
   MOBILE MENU
   ======================================== */

.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  inset-inline: 0;
  background: rgba(10,10,15,0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 20px;
  z-index: var(--z-dropdown);
  flex-direction: column;
  gap: 8px;
  animation: fadeInDown 0.2s ease;
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.mobile-menu a:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-gradient {
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hidden { display: none !important; }
.visible { display: block !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-3 { margin-bottom: 12px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
