/* ============================================================
   CAREER PULSE — GLOBAL DESIGN SYSTEM
   Inspired by: AgentAI Pinterest reference
   Theme: Pure black, crimson accent, cinematic typography
   ============================================================ */

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

/* ─────────────────────────────────────────────
   DESIGN TOKENS
───────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-primary:     #080808;
  --bg-card:        #111111;
  --bg-elevated:    #1a1a1a;
  --bg-hover:       #222222;
  --bg-input:       #141414;

  /* Borders */
  --border-subtle:  #222222;
  --border-default: #2a2a2a;
  --border-active:  #444444;

  /* Accent — Crimson */
  --accent:         #e8241a;
  --accent-hover:   #ff3d38;
  --accent-dim:     rgba(232, 36, 26, 0.15);
  --accent-glow:    rgba(232, 36, 26, 0.25);

  /* Text */
  --text-primary:   #ffffff;
  --text-secondary: #888888;
  --text-muted:     #444444;
  --text-accent:    #e8241a;

  /* Status */
  --success:        #22c55e;
  --warning:        #f59e0b;
  --danger:         #e8241a;
  --info:           #3b82f6;

  /* Demand tiers */
  --tier-high:      #22c55e;
  --tier-stable:    #f59e0b;
  --tier-declining: #e8241a;

  /* Radius */
  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --radius-pill:    999px;

  /* Shadows */
  --shadow-card:    0 0 0 1px var(--border-subtle);
  --shadow-glow:    0 0 30px var(--accent-glow);
  --shadow-elevated: 0 8px 32px rgba(0,0,0,0.6);

  /* Transitions */
  --ease:           cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast:  150ms;
  --duration-base:  250ms;
  --duration-slow:  400ms;

  /* Layout */
  --sidebar-width:  260px;
  --nav-height:     64px;
  --content-max:    1280px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, select, textarea { font-family: inherit; outline: none; }
ul, ol { list-style: none; }

/* ─────────────────────────────────────────────
   TYPOGRAPHY
───────────────────────────────────────────── */
.display-xl {
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.03em;
}
.display-lg {
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.display-md {
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.heading-xl  { font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.heading-lg  { font-size: 24px; font-weight: 700; line-height: 1.3; }
.heading-md  { font-size: 20px; font-weight: 600; line-height: 1.3; }
.heading-sm  { font-size: 16px; font-weight: 600; line-height: 1.4; }
.body-lg     { font-size: 18px; font-weight: 400; line-height: 1.7; }
.body-md     { font-size: 16px; font-weight: 400; line-height: 1.6; }
.body-sm     { font-size: 14px; font-weight: 400; line-height: 1.5; }
.label       { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.mono        { font-family: 'JetBrains Mono', monospace; }

.text-accent { color: var(--text-accent); }
.text-secondary { color: var(--text-secondary); }
.text-muted  { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

/* ─────────────────────────────────────────────
   LAYOUT HELPERS
───────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
}
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ─────────────────────────────────────────────
   CARDS
───────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--duration-base) var(--ease),
              transform var(--duration-base) var(--ease);
}
.card:hover {
  border-color: var(--border-active);
}
.card-elevated {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--duration-base) var(--ease);
}
.card-stat:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}
.card-stat .stat-number {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.card-stat .stat-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ─────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--duration-fast) var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-active);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-default);
  background: var(--bg-card);
}
.btn-sm { padding: 8px 16px; font-size: 12px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-icon {
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease);
}
.btn-icon:hover { color: var(--text-primary); border-color: var(--border-active); }

/* ─────────────────────────────────────────────
   BADGES & PILLS
───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-accent   { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(232,36,26,0.3); }
.badge-success  { background: rgba(34,197,94,0.12); color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.badge-warning  { background: rgba(245,158,11,0.12); color: var(--warning); border: 1px solid rgba(245,158,11,0.25); }
.badge-neutral  { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border-subtle); }
.badge-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ─────────────────────────────────────────────
   FORMS
───────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); letter-spacing: 0.02em; }
.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color var(--duration-fast) var(--ease);
  width: 100%;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }
.form-input-icon { position: relative; }
.form-input-icon .form-input { padding-left: 44px; }
.form-input-icon .input-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}

/* ─────────────────────────────────────────────
   PROGRESS BARS
───────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent);
  transition: width 0.8s var(--ease);
}
.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }

/* ─────────────────────────────────────────────
   SIDEBAR LAYOUT
───────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  padding: 32px;
  max-width: calc(100vw - var(--sidebar-width));
}

/* Sidebar logo */
.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 12px;
}
.logo-mark {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.logo-text {
  font-size: 16px; font-weight: 700; letter-spacing: -0.01em;
}
.logo-text span { color: var(--accent); }

/* Sidebar nav */
.sidebar-nav { padding: 16px 12px; flex: 1; }
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 8px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  text-decoration: none;
  margin-bottom: 2px;
}
.nav-item:hover { color: var(--text-primary); background: var(--bg-elevated); }
.nav-item.active { color: var(--text-primary); background: var(--accent-dim); }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-subtle);
}
.user-mini {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-md);
  cursor: pointer; transition: background var(--duration-fast) var(--ease);
}
.user-mini:hover { background: var(--bg-elevated); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--accent);
  flex-shrink: 0;
}
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }

/* ─────────────────────────────────────────────
   PAGE HEADER
───────────────────────────────────────────── */
.page-header {
  margin-bottom: 32px;
}
.page-header .breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 8px;
}
.page-header .breadcrumb span { color: var(--text-secondary); }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.page-subtitle { font-size: 15px; color: var(--text-secondary); margin-top: 4px; }

/* ─────────────────────────────────────────────
   DATA TABLE
───────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-elevated); color: var(--text-primary); }
.data-table td.primary { color: var(--text-primary); font-weight: 500; }

/* ─────────────────────────────────────────────
   SKILL GAP BARS
───────────────────────────────────────────── */
.skill-bar-wrap { margin-bottom: 16px; }
.skill-bar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.skill-bar-name { font-size: 13px; font-weight: 500; }
.skill-bar-scores { font-size: 12px; color: var(--text-secondary); }
.skill-bar-track {
  height: 8px; background: var(--bg-elevated); border-radius: 99px;
  position: relative; overflow: visible;
}
.skill-bar-user {
  height: 100%; border-radius: 99px;
  background: var(--info); position: absolute; top: 0; left: 0;
  transition: width 0.8s var(--ease);
}
.skill-bar-required {
  position: absolute; top: -3px;
  width: 3px; height: 14px;
  background: var(--accent); border-radius: 2px;
}

/* ─────────────────────────────────────────────
   DEMAND TIER INDICATORS
───────────────────────────────────────────── */
.tier-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.tier-high     { background: rgba(34,197,94,0.12);  color: var(--tier-high);     border: 1px solid rgba(34,197,94,0.25); }
.tier-stable   { background: rgba(245,158,11,0.12); color: var(--tier-stable);   border: 1px solid rgba(245,158,11,0.25); }
.tier-declining{ background: rgba(232,36,26,0.12);  color: var(--tier-declining);border: 1px solid rgba(232,36,26,0.25); }

/* ─────────────────────────────────────────────
   NOTIFICATIONS / TOASTS
───────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 12px;
  min-width: 280px; max-width: 400px;
  animation: slideInRight 0.3s var(--ease);
  box-shadow: var(--shadow-elevated);
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--accent); }
@keyframes slideInRight {
  from { transform: translateX(100px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* ─────────────────────────────────────────────
   LOADER / SKELETON
───────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────
   SCROLL ANIMATIONS
───────────────────────────────────────────── */
.fade-in {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ─────────────────────────────────────────────
   MODAL
───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--duration-base) var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%; max-width: 560px;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--duration-base) var(--ease);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

/* ─────────────────────────────────────────────
   TABS
───────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px;
  background: var(--bg-elevated);
  padding: 4px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}
.tab-item {
  padding: 8px 18px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}
.tab-item:hover { color: var(--text-primary); }
.tab-item.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

/* ─────────────────────────────────────────────
   SCROLLBAR
───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-active); }

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-width: 220px; }
  .main-content { padding: 24px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform var(--duration-base) var(--ease); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .display-xl { font-size: 40px; }
}
