/* ========== CSS RESET & IMPORTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --bg-primary: #06060f;
  --bg-secondary: #0d0d1f;
  --bg-card: rgba(16, 16, 40, 0.65);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-glow: rgba(108, 92, 231, 0.25);
  --text-primary: #eeeeff;
  --text-secondary: #9898b8;
  --text-muted: #5d5d88;
  --accent-1: #7c6cf0;
  --accent-2: #a29bfe;
  --accent-3: #00d2d3;
  --accent-4: #ff6b9d;
  --accent-5: #feca57;
  --accent-gradient: linear-gradient(135deg, #7c6cf0, #a29bfe, #00d2d3);
  --accent-gradient-warm: linear-gradient(135deg, #ff6b9d, #feca57);
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #e17055;
  --shadow-glow: 0 0 60px rgba(108, 92, 231, 0.12);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ========== ANIMATED BACKGROUND ========== */
.bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.22;
  animation: orbFloat 25s ease-in-out infinite;
}

.bg-orb:nth-child(1) {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #7c6cf0, transparent 70%);
  top: -15%; left: -10%;
}

.bg-orb:nth-child(2) {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #00d2d3, transparent 70%);
  top: 40%; right: -15%;
  animation-delay: -8s;
}

.bg-orb:nth-child(3) {
  width: 450px; height: 450px;
  background: radial-gradient(circle, #ff6b9d, transparent 70%);
  bottom: -15%; left: 25%;
  animation-delay: -16s;
}

.bg-orb:nth-child(4) {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #feca57, transparent 70%);
  top: 20%; left: 50%;
  animation-delay: -12s;
  opacity: 0.1;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(80px, -50px) scale(1.15); }
  50% { transform: translate(-40px, 70px) scale(0.85); }
  75% { transform: translate(50px, 40px) scale(1.08); }
}

/* ========== 3D GRID ========== */
.grid-3d {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  perspective: 500px;
  pointer-events: none;
  opacity: 0.06;
}

.grid-plane {
  position: absolute;
  bottom: 0; left: -50%;
  width: 200%; height: 200%;
  background-image:
    linear-gradient(rgba(124, 108, 240, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 108, 240, 0.5) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: rotateX(65deg);
  transform-origin: bottom center;
  animation: gridScroll 25s linear infinite;
}

@keyframes gridScroll {
  0% { background-position: 0 0; }
  100% { background-position: 0 60px; }
}

/* ========== PARTICLES ========== */
.particles-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: particleRise 10s ease-in-out infinite;
}

.particle.type-a { background: var(--accent-2); }
.particle.type-b { background: var(--accent-3); }
.particle.type-c { background: var(--accent-4); }

@keyframes particleRise {
  0% { opacity: 0; transform: translateY(100vh) scale(0) rotate(0deg); }
  15% { opacity: 0.7; }
  85% { opacity: 0.3; }
  100% { opacity: 0; transform: translateY(-15vh) scale(1.8) rotate(360deg); }
}

/* ========== NAVBAR ========== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(6, 6, 15, 0.75);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-glass);
  transition: var(--transition);
}

.navbar.scrolled {
  padding: 8px 32px;
  background: rgba(6, 6, 15, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

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

.logo-icon {
  width: 44px; height: 44px;
  background: var(--accent-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: white;
  transform: rotate(-5deg);
  animation: logoFloat 4s ease-in-out infinite;
  box-shadow: 0 4px 20px rgba(124, 108, 240, 0.3);
}

@keyframes logoFloat {
  0%, 100% { transform: rotate(-5deg) translateY(0); }
  50% { transform: rotate(-5deg) translateY(-4px); }
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 22px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-badge {
  font-size: 9px;
  padding: 3px 8px;
  background: rgba(0, 184, 148, 0.15);
  border: 1px solid rgba(0, 184, 148, 0.3);
  border-radius: 20px;
  color: var(--success);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ========== TAB NAV ========== */
.tab-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 4px;
}

.tab-btn {
  padding: 10px 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border-radius: 12px;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: white;
  background: var(--accent-1);
  box-shadow: 0 4px 20px rgba(124, 108, 240, 0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}

.tab-btn .tab-icon { margin-right: 6px; }

/* ========== MAIN CONTENT ========== */
.main-content {
  position: relative;
  z-index: 1;
  padding: 90px 32px 40px;
  max-width: 1480px;
  margin: 0 auto;
}

.tab-panel {
  display: none;
  animation: fadeSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-panel.active { display: block; }

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

/* ========== SECTION HEADERS ========== */
.section-header { margin-bottom: 28px; }

.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 34px;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 0%, var(--accent-2) 50%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 400;
  max-width: 600px;
}

/* ========== PROGRESS TRACKER ========== */
.progress-tracker {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
}

.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.progress-bar-container {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent-gradient);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-percent {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-2);
  min-width: 40px;
  text-align: right;
}

.word-count-badge {
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(0, 210, 211, 0.1);
  border: 1px solid rgba(0, 210, 211, 0.2);
  border-radius: 20px;
  color: var(--accent-3);
  font-weight: 600;
  white-space: nowrap;
  transition: var(--transition);
}

/* ========== PAGE MODE SELECTOR ========== */
.page-mode-selector {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 3px;
}

.page-mode-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.page-mode-btn:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.page-mode-btn.active {
  color: white;
  background: var(--accent-1);
  box-shadow: 0 2px 12px rgba(124, 108, 240, 0.35);
}

/* ========== GLASS CARDS ========== */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

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

.glass-card.glow-border {
  border-image: var(--accent-gradient) 1;
  border-image-slice: 1;
}

.card-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.card-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.card-header-title h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 16px;
}

.card-body { padding: 16px 24px 24px; }

/* ========== FORM ELEMENTS ========== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full-width { grid-column: 1 / -1; }

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.form-input,
.form-textarea,
.form-select {
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent-1);
  background: rgba(124, 108, 240, 0.05);
  box-shadow: 0 0 0 3px rgba(124, 108, 240, 0.08), 0 0 20px rgba(124, 108, 240, 0.06);
}

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

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

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239898b8' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ========== DYNAMIC ENTRIES ========== */
.dynamic-section { margin-top: 12px; }

.dynamic-entry {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  transition: var(--transition);
}

.dynamic-entry:hover { border-color: rgba(124, 108, 240, 0.12); }

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

.entry-number {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-2);
  background: rgba(124, 108, 240, 0.1);
  padding: 3px 12px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.btn-remove-entry {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(225, 112, 85, 0.25);
  background: rgba(225, 112, 85, 0.08);
  color: var(--danger);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-bounce);
}

.btn-remove-entry:hover {
  background: rgba(225, 112, 85, 0.2);
  transform: scale(1.15) rotate(90deg);
}

/* ========== BUTTONS ========== */
.btn {
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-bounce);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 20px rgba(124, 108, 240, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 35px rgba(124, 108, 240, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-1);
}

.btn-add {
  width: 100%;
  justify-content: center;
  padding: 12px;
  color: var(--accent-2);
  background: rgba(124, 108, 240, 0.04);
  border: 1px dashed rgba(124, 108, 240, 0.25);
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-top: 8px;
}

.btn-add:hover {
  background: rgba(124, 108, 240, 0.1);
  border-style: solid;
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(225, 112, 85, 0.12);
  color: var(--danger);
  border: 1px solid rgba(225, 112, 85, 0.2);
}

.btn-danger:hover { background: rgba(225, 112, 85, 0.22); }

.btn-success {
  background: linear-gradient(135deg, #00b894, #00d2d3);
  color: white;
  box-shadow: 0 4px 20px rgba(0, 184, 148, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 35px rgba(0, 184, 148, 0.45);
}

.btn-accent {
  background: var(--accent-gradient-warm);
  color: white;
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.3);
}

.btn-accent:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 35px rgba(255, 107, 157, 0.45);
}

/* ========== TEMPLATES GRID ========== */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.template-card {
  background: var(--bg-card);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-bounce);
  position: relative;
}

.template-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 24px 70px rgba(124, 108, 240, 0.15);
}

.template-card.selected {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(124, 108, 240, 0.15), 0 24px 70px rgba(124, 108, 240, 0.2);
}

.template-card.selected::after {
  content: '✓';
  position: absolute;
  top: 12px; right: 12px;
  width: 28px; height: 28px;
  background: var(--accent-1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  z-index: 2;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0) rotate(-180deg); }
  to { transform: scale(1) rotate(0); }
}

.template-preview {
  width: 100%;
  height: 320px;
  background: white;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 15px;
}

.template-preview-content {
  width: 100%;
  height: 100%;
  transform: scale(0.42);
  transform-origin: top center;
  pointer-events: none;
}

.template-info { padding: 16px 18px; }

.template-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.template-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.template-tags {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.template-tag {
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(124, 108, 240, 0.1);
  color: var(--accent-2);
  font-weight: 600;
}

/* ========== ATS CHECKER ========== */
.ats-checker-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.upload-zone {
  border: 2px dashed rgba(124, 108, 240, 0.25);
  border-radius: var(--radius-lg);
  padding: 48px 28px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(124, 108, 240, 0.02);
  position: relative;
  overflow: hidden;
}

.upload-zone::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at center, rgba(124, 108, 240, 0.03), transparent 50%);
  animation: uploadPulse 4s ease-in-out infinite;
}

@keyframes uploadPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent-1);
  background: rgba(124, 108, 240, 0.06);
  transform: scale(1.01);
}

.upload-icon {
  font-size: 52px;
  margin-bottom: 14px;
  display: block;
  animation: uploadBounce 2.5s ease-in-out infinite;
  position: relative;
}

@keyframes uploadBounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-10px) rotate(-3deg); }
  75% { transform: translateY(-5px) rotate(3deg); }
}

.upload-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
}

.upload-desc {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 16px;
  position: relative;
}

.upload-btn-inline {
  display: inline-block;
  padding: 10px 24px;
  background: var(--accent-gradient);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  position: relative;
  transition: var(--transition-bounce);
}

.upload-btn-inline:hover { transform: scale(1.05); }

/* ATS Results */
.ats-results { display: none; }

.ats-results.visible {
  display: block;
  animation: fadeSlideIn 0.6s ease;
}

.score-circle-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.score-circle {
  width: 170px; height: 170px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-circle svg {
  transform: rotate(-90deg);
  width: 170px; height: 170px;
  filter: drop-shadow(0 0 10px rgba(0, 184, 148, 0.2));
}

.score-circle .score-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 10;
}

.score-circle .score-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-value {
  position: absolute;
  font-family: 'Outfit', sans-serif;
  font-size: 44px;
  font-weight: 900;
}

.score-label {
  position: absolute;
  bottom: 28px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.ats-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.ats-metric-label {
  width: 130px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.ats-metric-bar {
  flex: 1;
  height: 7px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.ats-metric-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ats-metric-value {
  width: 38px;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.ats-suggestions { margin-top: 20px; }

.ats-suggestions h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  margin-bottom: 12px;
}

.suggestion-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  transition: var(--transition);
}

.suggestion-item:hover { background: rgba(255, 255, 255, 0.04); }

.suggestion-icon { flex-shrink: 0; font-size: 14px; }

/* ========== JD MATCHER ========== */
.jd-matcher-section {
  margin-top: 24px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.jd-matcher-section h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.keyword-match-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.keyword-chip {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  transition: var(--transition);
}

.keyword-chip.found {
  background: rgba(0, 184, 148, 0.12);
  color: var(--success);
  border: 1px solid rgba(0, 184, 148, 0.2);
}

.keyword-chip.missing {
  background: rgba(225, 112, 85, 0.1);
  color: var(--danger);
  border: 1px solid rgba(225, 112, 85, 0.2);
}

/* ========== BUILDER LAYOUT ========== */
.builder-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.form-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.preview-panel {
  position: sticky;
  top: 90px;
}

.preview-frame {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.05);
  min-height: 500px;
  transform: perspective(1400px) rotateY(-2deg);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.preview-frame:hover {
  transform: perspective(1400px) rotateY(0deg);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-glass);
}

.preview-dots {
  display: flex;
  gap: 6px;
}

.preview-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  transition: var(--transition);
}

.preview-dot:nth-child(1) { background: #ff5f57; }
.preview-dot:nth-child(2) { background: #febc2e; }
.preview-dot:nth-child(3) { background: #28c840; }

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

.preview-content {
  padding: 28px;
  color: #1a1a2e;
  font-size: 11px;
  line-height: 1.5;
  min-height: 700px;
  overflow-y: auto;
  max-height: 82vh;
}

.preview-content.dark-preview {
  background: #1a1a2e;
  color: #e0e0e0;
}

.preview-content.dark-preview h1,
.preview-content.dark-preview h2,
.preview-content.dark-preview h3 { color: #e0e0e0; }

.preview-content.dark-preview p,
.preview-content.dark-preview li { color: #bbb; }

.preview-content.dark-preview .contact-line { color: #888; }

.preview-content.dark-preview h2 { border-bottom-color: #444; }

/* ========== RESUME PREVIEW STYLES ========== */
.resume-preview h1 {
  font-size: 20px;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.resume-preview .contact-line {
  font-size: 10px;
  color: #555;
  margin-bottom: 16px;
  word-break: break-all;
}

.resume-preview h2 {
  font-size: 13px;
  color: #1a1a2e;
  border-bottom: 2px solid #1a1a2e;
  padding-bottom: 3px;
  margin: 14px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.resume-preview h3 {
  font-size: 12px;
  color: #333;
  margin-bottom: 2px;
}

.resume-preview p {
  font-size: 11px;
  color: #444;
  margin-bottom: 4px;
}

.resume-preview ul {
  padding-left: 18px;
  margin: 4px 0 10px;
}

.resume-preview li {
  font-size: 11px;
  color: #444;
  margin-bottom: 3px;
}

.resume-preview .job-date {
  font-size: 10px;
  color: #777;
  font-style: italic;
}

/* ========== TIPS PANEL ========== */
.tips-panel {
  margin-top: 20px;
}

.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(254, 202, 87, 0.04);
  border: 1px solid rgba(254, 202, 87, 0.12);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tip-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* ========== ACTION BAR ========== */
.action-bar {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 0;
  flex-wrap: wrap;
}

/* ========== TEMPLATE STYLE VARIANTS ========== */
.tpl-modern h2 {
  border-bottom: 2px solid #7c6cf0;
  color: #7c6cf0;
}

.tpl-modern h1 { color: #7c6cf0; }

.tpl-executive { font-family: 'Georgia', serif; }

.tpl-executive h1 {
  font-size: 22px;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  border-bottom: 3px double #333;
  padding-bottom: 10px;
}

.tpl-executive h2 {
  border-bottom: 1px solid #999;
  color: #333;
  font-variant: small-caps;
  letter-spacing: 1.5px;
}

.tpl-executive .contact-line { text-align: center; }

.tpl-minimal h1 {
  font-weight: 300;
  font-size: 26px;
  margin-bottom: 2px;
}

.tpl-minimal h2 {
  border-bottom: 1px solid #ddd;
  color: #888;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 2px;
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  background: rgba(13, 13, 31, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  backdrop-filter: blur(20px);
  color: var(--text-primary);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), fadeOut 0.4s ease 2.6s forwards;
  min-width: 260px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

@keyframes slideInRight {
  from { transform: translateX(120%) scale(0.8); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(60px) scale(0.9); }
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent-1); }

/* ========== SPINNER ========== */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top: 2px solid var(--accent-2);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ========== COLLAPSIBLE ========== */
.collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 16px;
}

.collapse-toggle .chevron {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 12px;
  color: var(--text-muted);
}

.collapse-toggle.open .chevron { transform: rotate(180deg); }

.collapse-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapse-body.open { max-height: 3000px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
  .builder-layout { grid-template-columns: 1fr; }
  .preview-panel { position: relative; top: 0; }
  .preview-frame { transform: none; }
}

@media (max-width: 768px) {
  .navbar {
    padding: 10px 14px;
    flex-direction: column;
    gap: 10px;
  }

  .tab-nav {
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
  }

  .main-content { padding: 130px 14px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .ats-checker-container { grid-template-columns: 1fr; }
  .templates-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 24px; }
  .progress-tracker { flex-wrap: wrap; }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124, 108, 240, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124, 108, 240, 0.45); }

/* ========== UTILITIES ========== */
.hidden { display: none !important; }
.text-center { text-align: center; }

/* ========== FEATURE CARDS GRID (for landing extras) ========== */
.features-strip {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.feature-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.feature-chip .fc-icon {
  font-size: 14px;
}

/* ========== AUTOPILOT (Auto-Build from resume) ========== */
.autopilot-card {
  position: relative;
  max-width: 1320px;
  margin: 0 auto 26px;
  padding: 24px 26px;
  background: linear-gradient(135deg, rgba(124,108,240,0.12), rgba(0,210,211,0.07));
  border: 1px solid rgba(124,108,240,0.28);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.autopilot-head h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 19px;
  margin: 8px 0 6px;
  color: var(--text-primary, #fff);
}
.autopilot-head p { font-size: 13px; color: var(--text-secondary); max-width: 760px; line-height: 1.55; }
.autopilot-head em { color: var(--accent-2); font-style: normal; font-weight: 600; }
.autopilot-badge {
  display: inline-block;
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--accent-gradient); color: #fff;
}
.autopilot-zone {
  margin-top: 16px;
  border: 2px dashed rgba(124,108,240,0.4);
  border-radius: var(--radius-md);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  background: rgba(255,255,255,0.02);
}
.autopilot-zone:hover, .autopilot-zone.drag-over {
  border-color: var(--accent-3);
  background: rgba(0,210,211,0.07);
  transform: translateY(-2px);
}
.autopilot-zone-icon { font-size: 34px; display: block; margin-bottom: 8px; }
.autopilot-zone-title { font-size: 15px; font-weight: 700; color: var(--text-primary, #fff); }
.autopilot-zone-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.autopilot-status { margin-top: 14px; font-size: 13px; color: var(--text-secondary); min-height: 18px; }
.autopilot-status .ap-ok { color: var(--success); font-weight: 700; }
.ap-spinner {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid rgba(124,108,240,0.3); border-top-color: var(--accent-1);
  border-radius: 50%; animation: ap-spin .7s linear infinite; vertical-align: -2px; margin-right: 4px;
}
@keyframes ap-spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .autopilot-card { margin: 0 12px 20px; padding: 18px; }
  .autopilot-head h3 { font-size: 16px; }
}

/* ========== ASSIST: buttons, modal, strength ========== */
.btn-assist {
  margin-top: 8px; padding: 7px 14px; font-size: 12px; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer;
  background: rgba(124,108,240,0.14); color: var(--accent-2);
  border: 1px solid rgba(124,108,240,0.3); transition: all .18s ease;
}
.btn-assist:hover { background: rgba(124,108,240,0.24); transform: translateY(-1px); }

.rf-modal-overlay {
  position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-start; justify-content: center;
  background: rgba(8,8,20,0.72); backdrop-filter: blur(6px); padding: 40px 16px; overflow-y: auto;
  animation: rf-fade .18s ease;
}
@keyframes rf-fade { from { opacity: 0; } to { opacity: 1; } }
.rf-modal {
  width: 100%; max-width: 560px; background: #15152a; border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg); box-shadow: 0 30px 80px rgba(0,0,0,0.5); overflow: hidden;
}
.rf-modal.wide { max-width: 760px; }
.rf-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border-glass); }
.rf-modal-head h3 { font-family: 'Outfit', sans-serif; font-size: 18px; }
.rf-modal-close { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; }
.rf-modal-close:hover { color: #fff; }
.rf-modal-body { padding: 22px; max-height: 70vh; overflow-y: auto; }
.rf-modal-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.rf-modal-foot { margin-top: 16px; font-size: 12px; color: var(--text-muted); }
.rf-modal-foot code, .muted { color: var(--accent-2); }
.muted { font-size: 11px; font-weight: 400; color: var(--text-muted); }

.assist-block { margin-bottom: 22px; }
.assist-block h4 { font-size: 14px; margin-bottom: 10px; }
.assist-bullet { background: rgba(255,255,255,0.03); border: 1px solid var(--border-glass); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; }
.assist-bullet-top { display: flex; gap: 10px; align-items: flex-start; }
.assist-bullet-text { font-size: 13px; color: var(--text-primary, #eee); }
.strength-pill { flex-shrink: 0; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 999px; letter-spacing: .5px; }
.strength-pill.strong { background: rgba(0,184,148,0.18); color: #00b894; }
.strength-pill.medium { background: rgba(254,202,87,0.18); color: #feca57; }
.strength-pill.weak   { background: rgba(225,112,85,0.18); color: #e17055; }
.strength-pill.empty  { background: rgba(120,120,140,0.18); color: #888; }
.assist-tips { margin: 8px 0 0; display: flex; flex-direction: column; gap: 3px; }
.assist-tips span { font-size: 11.5px; color: var(--text-muted); }
.assist-suggest { margin-top: 10px; font-size: 13px; color: #c8c2ff; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-mini { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 6px; cursor: pointer; background: var(--accent-gradient); color: #fff; border: none; }
.btn-mini:disabled { opacity: .6; cursor: default; }
.assist-ideas { display: flex; flex-direction: column; gap: 8px; }
.assist-idea { font-size: 12.5px; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; background: rgba(0,210,211,0.07); border: 1px solid rgba(0,210,211,0.2); color: var(--text-secondary); transition: all .15s ease; }
.assist-idea:hover { background: rgba(0,210,211,0.16); color: #fff; transform: translateX(3px); }

/* ========== POWER TOOLS ========== */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; max-width: 1100px; margin: 0 auto 28px; }
.tool-card { background: var(--bg-glass); border: 1px solid var(--border-glass); border-radius: var(--radius-lg); padding: 24px; cursor: pointer; transition: all .2s ease; }
.tool-card:hover { transform: translateY(-4px); border-color: rgba(124,108,240,0.4); background: rgba(124,108,240,0.07); }
.tool-icon { font-size: 30px; display: block; margin-bottom: 12px; }
.tool-name { font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.tool-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.tools-output { max-width: 900px; margin: 0 auto; }
.xray-text { white-space: pre-wrap; word-break: break-word; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; line-height: 1.6; color: #cfcfe6; background: #0d0d1c; border: 1px solid var(--border-glass); border-radius: var(--radius-sm); padding: 16px; max-height: 360px; overflow-y: auto; }
.xray-issues { margin-top: 18px; }
.xray-issues h4 { font-size: 14px; margin-bottom: 10px; }
.heatmap-wrap { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.heat-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.heat-row.hot  { background: linear-gradient(90deg, rgba(225,112,85,0.22), rgba(225,112,85,0.05)); border-left: 3px solid #e17055; }
.heat-row.warm { background: linear-gradient(90deg, rgba(254,202,87,0.18), rgba(254,202,87,0.04)); border-left: 3px solid #feca57; }
.heat-row.cool { background: linear-gradient(90deg, rgba(0,210,211,0.12), rgba(0,210,211,0.03)); border-left: 3px solid #00d2d3; }
.heat-tag { flex-shrink: 0; font-size: 11px; font-weight: 700; width: 110px; }
.qa-block { margin-bottom: 20px; }
.qa-block h4 { font-size: 14px; margin-bottom: 8px; }
.qa-list { padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
.qa-list li { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.share-row { display: flex; gap: 10px; }
.share-row .form-input { flex: 1; font-size: 12px; }
@media (max-width: 600px) { .heat-tag { width: 84px; } .share-row { flex-direction: column; } }

/* ========== INDIA FIELDS + PHOTO ========== */
.india-fields-head { font-size: 13px; font-weight: 700; color: var(--accent-2); padding: 6px 0 2px; border-top: 1px dashed var(--border-glass); margin-top: 4px; }
.photo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border-glass); }
.photo-placeholder { font-size: 12px; color: var(--text-muted); width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border-glass); border-radius: 8px; text-align: center; }
.photo-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); margin-top: 8px; cursor: pointer; }
.photo-warn { font-size: 11px; color: var(--warning); margin-top: 6px; line-height: 1.4; }

/* ========== SAVE BADGE ========== */
.save-badge { color: var(--success) !important; border-color: rgba(0,184,148,0.3) !important; background: rgba(0,184,148,0.08) !important; cursor: help; }

/* ========== ATS LIVE BADGE + OPTIMIZER ========== */
.ats-live-badge { cursor: pointer; font-weight: 700; transition: transform .15s ease; }
.ats-live-badge:hover { transform: scale(1.06); }

.opt-top { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 24px; }
.opt-before { text-align: center; color: var(--text-muted); }
.opt-before .opt-mini { font-size: 30px; font-weight: 800; font-family: 'Outfit', sans-serif; opacity: .6; }
.opt-before span { font-size: 11px; }
.opt-arrow { font-size: 26px; color: var(--text-muted); }
.opt-after { text-align: center; }
.opt-gauge { position: relative; width: 120px; height: 120px; margin: 0 auto; }
.opt-gauge svg { width: 100%; height: 100%; }
.opt-gauge-val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 800; font-family: 'Outfit', sans-serif; }
.opt-pct { font-size: 13px; font-weight: 700; margin-top: 6px; }
.opt-gain { font-size: 12px; color: var(--success); margin-top: 4px; font-weight: 700; }
.opt-section { margin-bottom: 22px; }
.opt-section h4 { font-size: 14px; margin-bottom: 10px; }
.opt-auto .suggestion-item { font-size: 12.5px; }
.opt-dim { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.opt-dim-label { flex: 0 0 175px; font-size: 12.5px; }
.opt-dim-bar { flex: 1; height: 7px; background: rgba(255,255,255,0.07); border-radius: 4px; overflow: hidden; }
.opt-dim-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
.opt-dim-val { flex: 0 0 28px; text-align: right; font-size: 12px; font-weight: 700; }
.opt-dim-detail { font-size: 11px; color: var(--text-muted); margin: 2px 0 4px 0; padding-left: 0; }
.opt-plan { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.opt-plan li { font-size: 13px; line-height: 1.5; padding-left: 6px; }
.opt-plan li.sev-high { color: #ffb4a2; }
.opt-plan li.sev-med { color: var(--text-secondary); }
.opt-plan li.sev-low { color: var(--text-muted); }
.opt-plan li.sev-high::marker { content: '🔴 '; }
.opt-plan li.sev-med::marker { content: '🟡 '; }
.opt-plan li.sev-low::marker { content: '⚪ '; }
.opt-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 600px) { .opt-dim-label { flex-basis: 120px; } }
