/* ============================================
   CareerIQ v3 — Complete Design System
   ============================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
  /* Colors */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-pink: #ec4899;

  --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-accent: linear-gradient(135deg, #06b6d4, #3b82f6);
  --gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444);
  --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
  --gradient-faang: linear-gradient(135deg, #8b5cf6, #ec4899);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(59, 130, 246, 0.4);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.3);
  --shadow-glow-purple: 0 0 20px rgba(139, 92, 246, 0.3);

  /* Spacing */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --topbar-height: 60px;
  --page-padding: 32px;
  --card-radius: 16px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.15s var(--ease-out);
  --transition-normal: 0.3s var(--ease-out);
  --transition-slow: 0.5s var(--ease-out);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, textarea { font-family: inherit; }
::selection { background: rgba(59, 130, 246, 0.3); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* --- Animated Background --- */
.bg-animation {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
  animation: bgShift 20s ease infinite alternate;
}
@keyframes bgShift {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.grid-bg {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ============================================
   APP SHELL — Sidebar + Main Layout
   ============================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border-color);
}
.brand-icon { font-size: 24px; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.brand-version {
  font-size: 10px; font-weight: 700;
  background: var(--gradient-primary);
  color: white;
  padding: 2px 8px; border-radius: 20px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}
.nav-item:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}
.nav-item.active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 24px;
  background: var(--gradient-primary);
  border-radius: 0 4px 4px 0;
}
.nav-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-badge {
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  background: var(--gradient-warm);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nav-badge.gemini {
  background: var(--gradient-accent);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex; flex-direction: column; gap: 8px;
}
.api-status, .sidebar-storage {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-red);
  flex-shrink: 0;
}
.status-dot.online { background: var(--accent-green); box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.storage-icon { font-size: 14px; }

/* --- Mobile Topbar --- */
.mobile-topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 101;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}
.menu-toggle {
  font-size: 24px; color: var(--text-primary);
  padding: 4px;
}
.mobile-brand {
  font-size: 18px; font-weight: 800;
  flex: 1;
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  height: 100vh;
  overflow-y: auto;
  position: relative;
  scrollbar-gutter: stable; /* Reserves space so page doesn't jump */
}

/* HIGHLY VISIBLE scrollbar for main content */
.main-content::-webkit-scrollbar { 
  width: 14px; 
  display: block;
}
.main-content::-webkit-scrollbar-track { 
  background: rgba(255, 255, 255, 0.05); 
  border-left: 1px solid var(--border-color);
}
.main-content::-webkit-scrollbar-thumb {
  background: #3b82f6; /* Bright Blue */
  border-radius: 10px;
  border: 3px solid #0a0e1a; /* Creates a gap around the thumb */
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}
.main-content::-webkit-scrollbar-thumb:hover {
  background: #60a5fa; /* Even brighter on hover */
}

/* --- Pages --- */
.page {
  display: none;
  padding: var(--page-padding);
  animation: pageIn 0.4s var(--ease-out);
  min-height: 100vh;
  position: relative;
  overflow-y: auto;
}

/* Background Image Layer for Pages */
.page::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* Moderate brightness reduction so background images stay visible */
  filter: brightness(0.65) contrast(1.05);
  opacity: 0.65;
  pointer-events: none;
  transition: all 0.5s ease;
}

/* Page Specific Backgrounds - Perfectly balanced image visibility & text contrast */
#page-home::before { background-image: linear-gradient(rgba(10, 14, 26, 0.45), rgba(10, 14, 26, 0.65)), url('hero-bg.png'); }
#page-resume::before { background-image: linear-gradient(rgba(10, 14, 26, 0.45), rgba(10, 14, 26, 0.65)), url('image_resume_analysis.jpg'); }
#page-resume-builder::before { background-image: linear-gradient(rgba(10, 14, 26, 0.45), rgba(10, 14, 26, 0.65)), url('image_13.jpg'); }
#page-skills::before { background-image: linear-gradient(rgba(10, 14, 26, 0.45), rgba(10, 14, 26, 0.65)), url('image_skill_gap.jpg'); }
#page-roles::before { background-image: linear-gradient(rgba(10, 14, 26, 0.45), rgba(10, 14, 26, 0.65)), url('image_131.jpg'); }
#page-jobs::before { background-image: linear-gradient(rgba(10, 14, 26, 0.45), rgba(10, 14, 26, 0.65)), url('hero-bg.png'); }
#page-opportunities::before { background-image: linear-gradient(rgba(10, 14, 26, 0.45), rgba(10, 14, 26, 0.65)), url('image12.jpg'); }
#page-detector::before { background-image: linear-gradient(rgba(10, 14, 26, 0.45), rgba(10, 14, 26, 0.65)), url('image_15_scam.jpg'); }
#page-chat::before { background-image: linear-gradient(rgba(10, 14, 26, 0.45), rgba(10, 14, 26, 0.65)), url('image_14.jpg'); }

.page.active { display: block; }

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

.page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}
.page-title {
  font-size: 28px; font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.page-subtitle {
  font-size: 14px; color: var(--text-secondary);
}

/* --- Glass Card --- */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 24px;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 {
  font-size: 20px; font-weight: 700;
  margin-bottom: 8px;
}
.empty-state p { color: var(--text-secondary); font-size: 14px; }
.empty-state a {
  color: var(--accent-blue);
  text-decoration: underline;
}

/* ============================================
   HOME DASHBOARD
   ============================================ */
.dash-upload-zone { margin-bottom: 24px; }
.upload-card {
  padding: 32px;
  text-align: center;
}
.upload-area {
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.05);
}
.upload-icon svg {
  width: 48px; height: 48px;
  color: var(--accent-blue);
  margin-bottom: 16px;
}
.upload-text h3 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.upload-text p { color: var(--text-secondary); font-size: 14px; }
.browse-link { color: var(--accent-blue); text-decoration: underline; cursor: pointer; }
.file-info {
  display: none;
  align-items: center; gap: 12px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 16px;
}
.file-info.visible { display: flex; }
.file-icon { font-size: 24px; }
.file-details { flex: 1; text-align: left; }
.file-name { font-weight: 600; font-size: 14px; }
.file-size { font-size: 12px; color: var(--text-muted); }
.remove-file {
  font-size: 16px; color: var(--text-muted);
  padding: 4px 8px; border-radius: 6px;
  transition: all var(--transition-fast);
}
.remove-file:hover { color: var(--accent-red); background: rgba(239, 68, 68, 0.1); }

.analyze-btn {
  margin-top: 20px;
  padding: 16px 40px;
  font-size: 16px; font-weight: 700;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}
.analyze-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-blue);
}
.btn-glow {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
}
.analyze-btn:hover .btn-glow { transform: translateX(100%); transition: 0.6s; }

/* Loading */
.loading-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10, 14, 26, 0.9);
  backdrop-filter: blur(10px);
  z-index: 200;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
}
.loading-overlay.visible { display: flex; }
.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 18px; font-weight: 600; }
.loading-subtext { color: var(--text-secondary); font-size: 14px; }
.loading-progress {
  width: 240px; height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.loading-progress-bar {
  width: 0; height: 100%;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Dashboard Grid */
.dash-grid {
  display: grid;
  grid-template-columns: 280px 1fr 1fr;
  gap: 20px;
}
.dash-card {
  padding: 24px;
}
.dash-card-title {
  font-size: 15px; font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

/* Fitness Gauge */
.dash-fitness {
  display: flex; flex-direction: column;
  align-items: center;
  grid-row: span 2;
}
.fitness-gauge { position: relative; width: 200px; height: 200px; }
.gauge-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 10;
}
.gauge-fill {
  fill: none;
  stroke: var(--accent-blue);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 534;
  stroke-dashoffset: 534;
  transition: stroke-dashoffset 1.5s var(--ease-out), stroke 0.5s;
  filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.4));
}
.gauge-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.gauge-score {
  font-size: 48px; font-weight: 900;
  letter-spacing: -2px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gauge-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.fitness-verdict {
  font-size: 13px; color: var(--text-secondary);
  text-align: center; margin-top: 12px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat-box {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}
.stat-value {
  font-size: 24px; font-weight: 800;
  color: var(--accent-blue);
  margin-bottom: 4px;
}
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* AI Tip */
.ai-tip-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.ai-tip-icon { font-size: 20px; }
.ai-tip-title { font-weight: 700; font-size: 14px; flex: 1; }
.ai-tip-badge {
  font-size: 9px; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
  background: var(--gradient-accent);
  color: white;
  text-transform: uppercase;
}
.ai-tip-text {
  font-size: 14px; color: var(--text-secondary);
  line-height: 1.6;
  font-style: italic;
}

/* Trending Chips */
.trending-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.trend-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px; font-weight: 500;
}
.trend-chip .trend-growth {
  color: var(--accent-green);
  font-weight: 700; font-size: 12px;
}

/* Activity List */
.activity-list { display: flex; flex-direction: column; gap: 8px; }
.activity-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.activity-icon { font-size: 16px; }
.activity-text { flex: 1; color: var(--text-secondary); }
.activity-time { font-size: 11px; color: var(--text-muted); }
.activity-empty { color: var(--text-muted); font-size: 13px; text-align: center; padding: 20px; }

/* Section Cards Grid */
.section-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.section-card {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 20px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
}
.section-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-active);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.sc-icon { font-size: 28px; margin-bottom: 8px; }
.sc-name { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.sc-desc { font-size: 11px; color: var(--text-muted); }

/* ============================================
   FAANG RESUME BUILDER
   ============================================ */
.faang-score-section {
  text-align: center;
  margin-bottom: 24px;
}
.faang-gauge {
  display: inline-block;
  width: 180px; height: 180px;
  position: relative;
  margin-bottom: 16px;
}
.faang-gauge-fill {
  stroke: var(--accent-purple);
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}
.faang-score-num {
  background: var(--gradient-faang) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
}
.faang-verdict {
  font-size: 16px; font-weight: 700;
  margin-bottom: 24px;
}
.faang-verdict.excellent { color: var(--accent-green); }
.faang-verdict.good { color: var(--accent-blue); }
.faang-verdict.fair { color: var(--accent-orange); }
.faang-verdict.poor { color: var(--accent-red); }

.faang-criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  text-align: left;
}
.faang-criteria-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.criteria-status { font-size: 18px; flex-shrink: 0; }
.criteria-info { flex: 1; }
.criteria-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.criteria-detail { font-size: 11px; color: var(--text-muted); }
.criteria-score { font-size: 14px; font-weight: 800; color: var(--accent-blue); }

/* Generated Resume */
.generated-resume-section {
  margin-top: 24px;
}
.gen-resume-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap; gap: 12px;
}
.gen-resume-header h3 { font-size: 18px; font-weight: 700; }
.gen-resume-actions { display: flex; gap: 10px; }
.gen-btn {
  padding: 10px 20px;
  font-size: 13px; font-weight: 600;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.gen-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow-blue); }
.gen-btn.secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
}
.gen-btn.secondary:hover { border-color: var(--border-active); }

.gen-resume-preview {
  background: #ffffff;
  color: #1a1a1a;
  border-radius: var(--radius-md);
  padding: 40px;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  max-height: 800px;
  overflow-y: auto;
}
.gen-resume-preview h1 {
  font-size: 24px; font-weight: 800;
  color: #111; margin-bottom: 4px;
  border-bottom: 2px solid #333;
  padding-bottom: 8px;
}
.gen-resume-preview .resume-contact {
  font-size: 12px; color: #555;
  margin-bottom: 16px;
}
.gen-resume-preview h2.resume-section-title {
  font-size: 14px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #222;
  border-bottom: 1px solid #ddd;
  padding-bottom: 4px;
  margin: 20px 0 10px;
}
.gen-resume-preview p, .gen-resume-preview li {
  font-size: 13px; color: #333;
}
.gen-resume-preview ul { padding-left: 20px; }
.gen-resume-preview li { margin-bottom: 4px; }
.gen-resume-preview .resume-skill-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 6px;
}
.gen-resume-preview .resume-skill-tag {
  display: inline-block;
  padding: 2px 10px;
  background: #f0f0f0;
  border-radius: 4px;
  font-size: 12px; font-weight: 500;
}

/* ============================================
   CHAT PAGE
   ============================================ */
.chat-page-body { height: calc(100vh - 120px); display: flex; }
.chat-container {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.chat-welcome {
  text-align: center;
  padding: 40px 20px;
}
.chat-welcome-icon { font-size: 48px; margin-bottom: 12px; }
.chat-welcome h3 {
  font-size: 22px; font-weight: 800;
  margin-bottom: 8px;
}
.chat-welcome p {
  color: var(--text-secondary); font-size: 14px;
  max-width: 500px; margin: 0 auto 20px;
  line-height: 1.6;
}
.chat-suggestions {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
}
.chat-suggestion {
  padding: 10px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px; font-weight: 500;
  transition: all var(--transition-fast);
}
.chat-suggestion:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-active);
  transform: translateY(-1px);
}

.chat-msg {
  display: flex; gap: 12px;
  max-width: 85%;
  animation: msgIn 0.3s var(--ease-out);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg.user { margin-left: auto; flex-direction: row-reverse; }
.chat-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.chat-msg.user .chat-avatar { background: var(--gradient-primary); }
.chat-msg.ai .chat-avatar { background: var(--gradient-accent); }
.chat-bubble {
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
}
.chat-msg.user .chat-bubble {
  background: var(--gradient-primary);
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-msg.ai .chat-bubble {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}
.chat-msg.ai .chat-bubble strong { color: var(--accent-blue); }
.chat-msg.ai .chat-bubble code {
  background: rgba(0,0,0,0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.chat-typing {
  display: flex; gap: 4px; padding: 8px 0;
}
.chat-typing span {
  width: 8px; height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingDot 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 80% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

.chat-input-area {
  display: flex; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-glass);
}
.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  resize: none;
  outline: none;
  transition: border-color var(--transition-fast);
}
.chat-input:focus { border-color: var(--accent-blue); }
.chat-send {
  width: 44px; height: 44px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.chat-send:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-glow-blue);
}

/* ============================================
   EXISTING SECTIONS (refactored for pages)
   ============================================ */
/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.skill-category {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}
.category-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
  font-weight: 600; font-size: 13px;
}
.category-icon { font-size: 18px; }
.category-name { flex: 1; }
.category-count {
  font-size: 11px;
  background: var(--gradient-primary);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}
.skill-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 6px;
  font-size: 12px;
  margin: 3px;
  color: var(--accent-blue);
  font-weight: 500;
}
.skill-tag.missing {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

/* Chart */
.chart-container {
  margin: 24px auto;
  max-width: 500px;
  max-height: 350px;
}

/* Strengths / Weaknesses */
.sw-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.sw-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}
.sw-card-header {
  font-weight: 700; font-size: 14px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.sw-list { list-style: none; }
.sw-list li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}
.sw-list li:last-child { border-bottom: none; }

/* Skill Gap */
.gap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.gap-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}
.gap-card-header {
  font-weight: 700; font-size: 14px;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.gap-progress {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}
.gap-progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 3px;
  transition: width 1s var(--ease-out);
}
.gap-skills-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* Learning Resources */
.learning-header { font-weight: 700; font-size: 16px; margin-bottom: 16px; }
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.resource-card {
  display: flex; align-items: center; gap: 10px;
  padding: 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
}
.resource-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-active);
}
.resource-icon { font-size: 24px; }
.resource-name { font-size: 13px; font-weight: 600; }
.resource-type { font-size: 11px; color: var(--text-muted); }

/* Roles Grid */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.role-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.role-card:hover {
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.role-match-ring {
  width: 64px; height: 64px;
  margin: 0 auto 12px;
  position: relative;
}
.role-match-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.role-match-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 4;
}
.role-match-fill {
  fill: none;
  stroke: var(--accent-blue);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 188;
  transition: stroke-dashoffset 1s var(--ease-out);
}
.role-match-pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
}
.role-title {
  font-size: 16px; font-weight: 700;
  text-align: center; margin-bottom: 6px;
}
.role-desc {
  font-size: 12px; color: var(--text-secondary);
  text-align: center; margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.role-salary {
  font-size: 13px; font-weight: 600;
  text-align: center;
  color: var(--accent-green);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 300;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.visible { display: flex; }
.modal-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  max-width: 700px; width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  font-size: 20px; color: var(--text-muted);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
}
.modal-close:hover {
  background: var(--bg-glass); color: var(--text-primary);
}

/* Live Jobs */
.live-jobs-grid, .listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.job-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition-fast);
}
.job-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}
.job-company {
  font-size: 12px; color: var(--accent-blue);
  font-weight: 600; margin-bottom: 4px;
}
.job-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.job-location { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.job-salary { font-size: 13px; color: var(--accent-green); font-weight: 600; margin-bottom: 10px; }
.job-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.job-tag {
  padding: 2px 8px;
  background: rgba(59, 130, 246, 0.08);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}
.job-apply {
  display: inline-block;
  padding: 8px 20px;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  transition: all var(--transition-fast);
}
.job-apply:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow-blue); }
.live-indicator {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Portal Links */
.portal-links {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 12px;
}
.portal-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500;
  transition: all var(--transition-fast);
}
.portal-link:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-active);
}

/* Opportunities Tabs */
.opp-tabs {
  display: flex; gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  padding: 4px;
}
.opp-tab {
  flex: 1;
  padding: 12px 16px;
  font-size: 13px; font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}
.opp-tab.active {
  background: var(--gradient-primary);
  color: white;
}
.opp-tab:hover:not(.active) {
  background: var(--bg-glass-hover);
}
.opp-tab-content { display: none; }
.opp-tab-content.active { display: block; }
.opp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.opp-portals { margin-top: 24px; }
.opp-portals-title {
  font-weight: 700; font-size: 15px;
  margin-bottom: 12px;
}
.opp-portals-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
}

/* Opportunity Loading */
.opp-loading {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 14px;
}
.opp-spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Fake Job Detector */
.fake-job-card { max-width: 800px; }
.fjd-input-area { display: flex; flex-direction: column; gap: 16px; }
.fjd-tabs { display: flex; gap: 8px; }
.fjd-tab {
  flex: 1;
  padding: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600;
  transition: all var(--transition-fast);
}
.fjd-tab.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}
.fjd-tab-content { display: none; }
.fjd-tab-content.active { display: block; }
.fjd-input, .fjd-textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition-fast);
}
.fjd-input:focus, .fjd-textarea:focus { border-color: var(--accent-blue); }
.fjd-textarea { resize: vertical; min-height: 120px; }
.fjd-analyze-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px;
  background: var(--gradient-warm);
  color: white;
  border-radius: var(--radius-md);
  font-size: 15px; font-weight: 700;
  transition: all var(--transition-fast);
}
.fjd-analyze-btn:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(245, 158, 11, 0.3); }

.fjd-results { margin-top: 24px; }
.fjd-score-card {
  text-align: center;
  padding: 24px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.fjd-score-card.safe { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); }
.fjd-score-card.warning { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); }
.fjd-score-card.danger { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); }
.fjd-score-value { font-size: 48px; font-weight: 900; }
.fjd-score-card.safe .fjd-score-value { color: var(--accent-green); }
.fjd-score-card.warning .fjd-score-value { color: var(--accent-orange); }
.fjd-score-card.danger .fjd-score-value { color: var(--accent-red); }
.fjd-score-label { font-size: 18px; font-weight: 700; margin-top: 4px; }
.fjd-score-sublabel { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.fjd-domain-info {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.fjd-domain-badge {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px; font-weight: 800;
  text-transform: uppercase;
}
.fjd-domain-badge.trusted { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.fjd-domain-badge.suspicious { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.fjd-domain-badge.unknown { background: rgba(245, 158, 11, 0.15); color: var(--accent-orange); }
.fjd-domain-name { font-weight: 700; font-size: 14px; }
.fjd-domain-desc { font-size: 12px; color: var(--text-muted); }

.fjd-flags { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.fjd-flag-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.fjd-flag-item.red { background: rgba(239, 68, 68, 0.08); }
.fjd-flag-item.yellow { background: rgba(245, 158, 11, 0.08); }
.fjd-flag-item.green { background: rgba(16, 185, 129, 0.08); }
.fjd-flag-icon { font-size: 16px; flex-shrink: 0; }
.fjd-flag-text { flex: 1; line-height: 1.5; }

.fjd-tips {
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  padding: 20px;
}
.fjd-tips-title { font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.fjd-tips-list { padding-left: 20px; }
.fjd-tips-list li {
  font-size: 13px; color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.5;
}

/* Advice Card */
.advice-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 32px;
  line-height: 1.8;
  font-size: 15px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dash-fitness { grid-row: span 1; }
  .section-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-topbar { display: flex; }
  .main-content {
    margin-left: 0;
    padding-top: var(--topbar-height);
  }
  .page { padding: 16px; }
  .page-title { font-size: 22px; }

  .dash-grid { grid-template-columns: 1fr; }
  .section-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .sw-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .roles-grid { grid-template-columns: 1fr; }
  .live-jobs-grid, .listings-grid { grid-template-columns: 1fr; }
  .opp-tabs { flex-direction: column; }
  .faang-criteria-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .gen-resume-preview { padding: 20px; }
}

@media (max-width: 480px) {
  .section-cards-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* --- Professional Abey George LaTeX Template Styles --- */
.latex-template {
  background: white !important;
  color: #000 !important;
  font-family: 'Times New Roman', Times, serif !important;
  padding: 40px !important;
  line-height: 1.2 !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border-radius: 4px;
}

.latex-header { text-align: center; margin-bottom: 12px; }
.latex-header h1 {
  font-size: 26pt;
  font-weight: normal;
  font-variant: small-caps;
  margin-bottom: 2pt;
  color: #000 !important;
}
.latex-header .contact-info { font-size: 10pt; color: #333; }
.latex-header .contact-info a { color: #000; text-decoration: underline; }

.latex-section { margin-bottom: 12pt; text-align: left; }
.latex-section-title {
  font-size: 12pt;
  font-weight: bold;
  font-variant: small-caps;
  border-bottom: 1px solid #000;
  margin-bottom: 5pt;
  padding-bottom: 1pt;
  color: #000 !important;
}

.latex-row { display: flex; justify-content: space-between; margin-bottom: 2pt; font-size: 11pt; }
.latex-row .bold { font-weight: bold; }
.latex-row .italic { font-style: italic; font-size: 10.5pt; }
.latex-row .right { font-weight: bold; font-size: 10pt; }

.latex-skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5pt;
  font-size: 10pt;
}

.latex-list { padding-left: 18pt; margin-top: 3pt; list-style-type: disc; }
.latex-list li { font-size: 10.5pt; margin-bottom: 2pt; color: #222; }

.latex-tech-row { font-size: 11pt; margin-bottom: 3pt; }
.latex-tech-row b { font-size: 11pt; }

/* Overriding preview container for white background */
#gen-resume-preview {
  padding: 0;
  background: transparent;
}

/* --- PRINT STYLES --- */
@media print {
  .sidebar, .mobile-topbar, .bg-animation, .grid-bg, .particles,
  .analyze-btn, .nav-item, .chat-input-area, .gen-resume-actions,
  .fjd-analyze-btn, .format-suggestion-banner { display: none !important; }
  .main-content { margin-left: 0 !important; margin: 0 !important; padding: 0 !important; height: auto !important; overflow: visible !important; }
  .page { padding: 0 !important; margin: 0 !important; }
  .latex-template { box-shadow: none !important; padding: 0 !important; width: 100% !important; margin: 0 !important; }
  body { background: white !important; color: black !important; }
}
