/* ==========================================================================
   Smart AI Resume Screening & Candidate Ranking System - Luxury Design System
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-main: #0a0e17;
  --bg-surface: #111827;
  --bg-surface-raised: #182234;
  --bg-surface-translucent: rgba(17, 24, 39, 0.75);
  --bg-glass: rgba(24, 34, 52, 0.6);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(99, 102, 241, 0.4);
  --border-active: #6366f1;

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  /* Brand / Accent Gradients */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  --accent-cyan: #06b6d4;
  --accent-violet: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Tier Colors */
  --tier-elite-bg: rgba(16, 185, 129, 0.15);
  --tier-elite-border: rgba(16, 185, 129, 0.4);
  --tier-elite-text: #34d399;

  --tier-strong-bg: rgba(6, 182, 212, 0.15);
  --tier-strong-border: rgba(6, 182, 212, 0.4);
  --tier-strong-text: #38bdf8;

  --tier-mod-bg: rgba(245, 158, 11, 0.15);
  --tier-mod-border: rgba(245, 158, 11, 0.4);
  --tier-mod-text: #fbbf24;

  --tier-low-bg: rgba(244, 63, 94, 0.15);
  --tier-low-border: rgba(244, 63, 94, 0.4);
  --tier-low-text: #fb7185;

  /* Typography */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.3);

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Reset & Global Baseline
   ========================================================================== */

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

html {
  font-family: var(--font-family);
  font-size: 15px;
  background-color: var(--bg-main);
  color: var(--text-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 85% 80%, rgba(6, 182, 212, 0.07) 0%, transparent 45%),
              var(--bg-main);
  background-attachment: fixed;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-surface-raised);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-main);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ==========================================================================
   Header & Brand Navigation
   ========================================================================== */

.app-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-surface-translucent);
  border-bottom: 1px solid var(--border-glass);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  color: white;
  font-size: 1.3rem;
}

.brand-info h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.version-badge {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.brand-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==========================================================================
   Buttons & UI Elements
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent-violet));
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  border-color: var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.8rem 1.6rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-accent {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: white;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}

.btn-accent:hover {
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

/* Icon Buttons */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Layout Architecture: App Container
   ========================================================================== */

.app-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Top KPI Ribbon */
.kpi-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.kpi-card:hover {
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
}

.kpi-card.kpi-emerald::before { background: var(--accent-emerald); }
.kpi-card.kpi-cyan::before { background: var(--accent-cyan); }
.kpi-card.kpi-amber::before { background: var(--accent-amber); }
.kpi-card.kpi-violet::before { background: var(--accent-violet); }

.kpi-icon-box {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
}

.kpi-emerald .kpi-icon-box { color: var(--accent-emerald); background: rgba(16, 185, 129, 0.1); }
.kpi-cyan .kpi-icon-box { color: var(--accent-cyan); background: rgba(6, 182, 212, 0.1); }
.kpi-amber .kpi-icon-box { color: var(--accent-amber); background: rgba(245, 158, 11, 0.1); }
.kpi-violet .kpi-icon-box { color: var(--accent-violet); background: rgba(139, 92, 246, 0.1); }

.kpi-content {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-top: 2px;
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ==========================================================================
   Main Grid Layout: Left Studio (JD + Upload) & Right Workspace (Tabs + Visuals)
   ========================================================================== */

.main-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1.5rem;
  align-items: start;
}

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

/* Studio Sidebar (Glass Card) */
.studio-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 5rem;
}

.card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-normal);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-title svg {
  color: var(--primary);
}

/* Preset Pill Selector */
.preset-chips-wrapper {
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.preset-chip {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.preset-chip.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: #c7d2fe;
}

/* Textarea / Input Fields */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-textarea {
  width: 100%;
  min-height: 140px;
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.8rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.45;
  resize: vertical;
  transition: all var(--transition-fast);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.extracted-jd-skills {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-glass);
}

.skills-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.skill-tag.matched {
  background: var(--tier-elite-bg);
  border-color: var(--tier-elite-border);
  color: var(--tier-elite-text);
}

.skill-tag.missing {
  background: var(--tier-low-bg);
  border-color: var(--tier-low-border);
  color: var(--tier-low-text);
}

.skill-tag.neutral {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-glass);
  color: var(--text-secondary);
}

/* Upload Dropzone */
.dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.03);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem auto;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.dropzone-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.dropzone-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dropzone-sub span {
  color: var(--primary);
  text-decoration: underline;
}

.uploaded-files-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  max-height: 180px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.8rem;
  background: var(--bg-surface-raised);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  font-size: 0.8rem;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.file-size {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.file-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
}

.file-remove-btn:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

/* ==========================================================================
   Right Workspace: Tabs Navigation & Dynamic Panes
   ========================================================================== */

.workspace-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tabs-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-surface-raised);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.tab-badge {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
}

/* Tab Content Areas */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

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

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

/* ==========================================================================
   Tab 1: Visual Analytics Dashboard
   ========================================================================== */

.charts-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.chart-card {
  min-height: 380px;
  display: flex;
  flex-direction: column;
}

.chart-container-box {
  position: relative;
  flex-grow: 1;
  width: 100%;
  min-height: 300px;
}

.chart-legend-custom {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

/* Heatmap / Skill Matrix Box */
.skill-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.skill-freq-item {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.skill-freq-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.skill-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.skill-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Tab 2: Candidates Leaderboard & Table / Cards
   ========================================================================== */

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  background: var(--bg-surface-raised);
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.8rem;
  min-width: 240px;
}

.search-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  width: 100%;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.filter-select {
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.8rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
}

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

/* Candidate Table */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
}

.candidates-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.candidates-table th {
  background: var(--bg-surface-raised);
  padding: 0.9rem 1.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
}

.candidates-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border-glass);
  vertical-align: middle;
}

.candidates-table tbody tr {
  transition: background var(--transition-fast);
}

.candidates-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.05);
}

.rank-1 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}

.rank-2 {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: white;
}

.rank-3 {
  background: linear-gradient(135deg, #b45309, #78350f);
  color: white;
}

.candidate-cell {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.candidate-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.candidate-name-col h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.candidate-name-col p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Score Pill */
.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.2px;
}

.tier-elite {
  background: var(--tier-elite-bg);
  border: 1px solid var(--tier-elite-border);
  color: var(--tier-elite-text);
}

.tier-strong {
  background: var(--tier-strong-bg);
  border: 1px solid var(--tier-strong-border);
  color: var(--tier-strong-text);
}

.tier-moderate {
  background: var(--tier-mod-bg);
  border: 1px solid var(--tier-mod-border);
  color: var(--tier-mod-text);
}

.tier-low {
  background: var(--tier-low-bg);
  border: 1px solid var(--tier-low-border);
  color: var(--tier-low-text);
}

/* ==========================================================================
   Tab 3: Side-by-Side Candidate Comparison
   ========================================================================== */

.comparison-selection-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  background: var(--bg-surface-raised);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-glass);
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.compare-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  position: relative;
}

.compare-card.winner {
  border-color: var(--primary);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.2);
}

.winner-ribbon {
  position: absolute;
  top: -10px;
  right: 20px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 2px 10px;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.compare-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border-glass);
  font-size: 0.82rem;
}

.metric-name {
  color: var(--text-muted);
}

.metric-val {
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================================================
   Candidate Detail Modal / Inspector Drawer
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 900px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-raised);
}

.modal-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-footer {
  padding: 1rem 2rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-surface-raised);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  font-size: 1.2rem;
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.score-breakdown-bar-item {
  margin-bottom: 0.75rem;
}

.score-breakdown-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.recommendation-card {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.rec-impact-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  white-space: nowrap;
}

/* ==========================================================================
   ATS AI Coach & Chatbot System Styles
   ========================================================================== */

/* Floating Launcher Button */
.ats-chatbot-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  height: 60px;
  padding: 0 22px 0 16px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.45), 0 0 20px rgba(6, 182, 212, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  z-index: 999;
  transition: all var(--transition-normal);
  color: #ffffff;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 0.92rem;
  user-select: none;
}

.ats-chatbot-launcher:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 16px 36px rgba(99, 102, 241, 0.6), 0 0 25px rgba(6, 182, 212, 0.5);
}

.ats-chatbot-launcher:active {
  transform: translateY(-1px) scale(0.98);
}

.ats-chatbot-launcher.chat-open {
  background: var(--bg-surface-raised);
  border-color: var(--border-glass-hover);
  box-shadow: var(--shadow-md);
}

.chatbot-launcher-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  position: relative;
  animation: pulse-glow 2.5s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.chatbot-launcher-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-emerald);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-main);
}

/* Chatbot Floating Window Panel */
.ats-chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 440px;
  max-width: calc(100vw - 36px);
  height: 640px;
  max-height: calc(100vh - 130px);
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(99, 102, 241, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all var(--transition-smooth);
  overflow: hidden;
}

.ats-chatbot-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chatbot Header */
.chatbot-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, rgba(24, 34, 52, 0.95) 0%, rgba(17, 24, 39, 0.9) 100%);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chatbot-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.chatbot-header-brand .bot-logo {
  font-size: 1.35rem;
  background: rgba(99, 102, 241, 0.2);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.chatbot-header-brand h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chatbot-header-brand p {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin: 0;
}

.chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chatbot-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1rem;
}

.chatbot-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Candidate Context Bar in Chatbot */
.chatbot-context-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.chatbot-context-select {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.chatbot-context-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.chatbot-score-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* Message Stream Container */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05) 0%, transparent 60%);
}

.chat-message {
  display: flex;
  gap: 0.65rem;
  animation: fadeIn 0.25s ease-out;
  max-width: 92%;
}

.chat-message.user-message {
  align-self: flex-end;
  justify-content: flex-end;
}

.chat-message.bot-message {
  align-self: flex-start;
}

.chat-message .bot-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.message-bubble {
  padding: 0.8rem 1rem;
  border-radius: 16px;
  font-size: 0.83rem;
  line-height: 1.55;
  position: relative;
  word-break: break-word;
}

.user-message .message-bubble {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.bot-message .message-bubble {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.message-bubble h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #38bdf8;
  margin: 0.4rem 0 0.3rem 0;
}

.message-bubble h5 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #a5b4fc;
  margin: 0.4rem 0 0.2rem 0;
}

.message-bubble strong {
  color: #ffffff;
  font-weight: 700;
}

.message-bubble li {
  margin-left: 1.2rem;
  margin-bottom: 0.25rem;
}

.chat-code {
  background: rgba(99, 102, 241, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.chat-quote {
  border-left: 3px solid var(--primary);
  background: rgba(99, 102, 241, 0.08);
  padding: 0.5rem 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0.4rem 0;
  font-style: italic;
  color: #e2e8f0;
}

.message-meta-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.msg-copy-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.msg-copy-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.msg-copy-btn.copied {
  background: var(--accent-emerald);
  color: #ffffff;
  border-color: var(--accent-emerald);
}

/* Typing Indicator Animation */
.chatbot-typing {
  display: none;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.5rem;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface-raised);
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: typing-jump 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-jump {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Quick Action Suggestion Chips */
.chatbot-chips-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  overflow-x: auto;
  border-top: 1px solid var(--border-glass);
  background: rgba(17, 24, 39, 0.6);
  scrollbar-width: none;
}

.chatbot-chips-bar::-webkit-scrollbar {
  display: none;
}

.chatbot-chip {
  flex-shrink: 0;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.chatbot-chip:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Chat Input Bar */
.chatbot-input-bar {
  padding: 0.75rem 1rem;
  background: var(--bg-surface-raised);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chatbot-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.8rem;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.82rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.chatbot-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.chatbot-send-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--primary);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.chatbot-send-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.chatbot-send-btn:active {
  transform: scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .ats-chatbot-launcher {
    bottom: 16px;
    right: 16px;
    height: 50px;
    padding: 0 16px 0 12px;
    font-size: 0.82rem;
  }
  .ats-chatbot-window {
    bottom: 74px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    height: calc(100vh - 100px);
  }
}

/* ==========================================================================
   Print / PDF Export Styles
   ========================================================================== */

@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .app-navbar, .studio-panel, .tabs-navigation, .filter-bar, .modal-overlay, .btn, .ats-chatbot-launcher, .ats-chatbot-window {
    display: none !important;
  }
  .main-grid {
    grid-template-columns: 1fr !important;
  }
  .card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    background: white !important;
    color: black !important;
  }
  .candidates-table th {
    background: #f1f5f9 !important;
    color: black !important;
  }
  .candidates-table td {
    color: black !important;
  }
}
