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

:root {
  /* Color Tokens */
  --bg-dark: #0b0f19;
  --bg-card: rgba(18, 26, 43, 0.7);
  --bg-card-hover: rgba(26, 38, 64, 0.85);
  --bg-modal: rgba(13, 19, 33, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.3);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.2);
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(168, 85, 247, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, .font-heading {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

/* App Header & Navbar */
.app-header {
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 2rem;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-glow);
}

.logo-icon svg {
  width: 24px;
  height: 24px;
  color: #fff;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(90deg, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Layout Grid */
.main-wrapper {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

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

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

/* Card Styling */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  outline: none;
  white-space: nowrap;
}

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

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: var(--border-color);
}

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

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

.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-emerald:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

/* Floating AI Agent FAB Button */
.ai-agent-fab {
  position: fixed !important;
  bottom: 1.5rem !important;
  right: 1.5rem !important;
  left: auto !important;
  top: auto !important;
  z-index: 9999 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.6rem !important;
  padding: 0.75rem 1.3rem !important;
  border-radius: var(--radius-full) !important;
  background: linear-gradient(135deg, #6366f1, #a855f7) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4) !important;
  cursor: pointer !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  transition: var(--transition) !important;
}

.ai-agent-fab:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 12px 30px rgba(168, 85, 247, 0.6) !important;
}

/* AI Agent Chat Drawer */
.ai-agent-drawer {
  position: fixed !important;
  bottom: 5.5rem !important;
  right: 1.5rem !important;
  left: auto !important;
  top: auto !important;
  width: 420px !important;
  max-width: calc(100vw - 2rem) !important;
  height: 580px !important;
  max-height: calc(100vh - 7rem) !important;
  background: var(--bg-modal) !important;
  border: 1px solid var(--border-highlight) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7) !important;
  z-index: 10000 !important;
  display: none;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-agent-drawer.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

.agent-drawer-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.95);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.agent-messages-container {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.agent-msg {
  max-width: 88%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.agent-msg-bot {
  align-self: flex-start;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: #f3f4f6;
  border-bottom-left-radius: 2px;
}

.agent-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border-bottom-right-radius: 2px;
}

.agent-chips-row {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  overflow-x: auto;
  border-top: 1px solid var(--border-color);
  background: rgba(10, 14, 23, 0.5);
}

.agent-chip {
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.agent-chip:hover {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

.agent-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-modal);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

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

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: rgba(10, 14, 23, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

/* Range Slider */
.slider-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.slider-group input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
}

/* Skill Tags Input */
.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem;
  background: rgba(10, 14, 23, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-height: 48px;
}

.tag-container:focus-within {
  border-color: var(--primary);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
}

.tag-remove {
  cursor: pointer;
  opacity: 0.7;
}

.tag-remove:hover {
  opacity: 1;
}

.tag-input {
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  flex: 1;
  min-width: 100px;
}

/* Drag and Drop Zone */
.drop-zone {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: rgba(99, 102, 241, 0.03);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

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

.drop-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.file-input-hidden {
  display: none;
}

/* Star Rating System */
.star-rating {
  display: inline-flex;
  gap: 0.2rem;
  cursor: pointer;
}

.star-rating i {
  color: #4b5563;
  width: 16px;
  height: 16px;
  transition: color 0.15s ease;
}

.star-rating i.filled {
  color: #f59e0b;
  fill: #f59e0b;
}

/* Highlighted Text Tags */
mark.hl-matched {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-weight: 600;
}

mark.hl-missing {
  background: rgba(244, 63, 94, 0.25);
  color: #fb7185;
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  border: 1px solid rgba(244, 63, 94, 0.4);
  font-weight: 600;
}

/* Radar Chart Box */
.radar-box {
  width: 100%;
  max-width: 380px;
  height: 260px;
  margin: 0 auto;
}

/* Toolbar & Layout */
.toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-box svg {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  width: 18px;
  height: 18px;
}

.search-box input {
  padding-left: 2.5rem;
}

.view-modes {
  display: flex;
  background: rgba(10, 14, 23, 0.7);
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.view-btn {
  padding: 0.4rem 0.7rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.view-btn.active {
  background: var(--primary);
  color: #fff;
}

/* Table View */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

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

.candidate-table th {
  background: rgba(15, 23, 42, 0.9);
  padding: 0.9rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  user-select: none;
  cursor: pointer;
}

.candidate-table th:hover {
  color: #fff;
}

.candidate-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(18, 26, 43, 0.4);
  transition: var(--transition);
}

.candidate-table tr:hover td {
  background: rgba(30, 41, 59, 0.6);
}

/* Score Badge */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.score-high {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, rgba(6, 78, 59, 0.8) 100%);
  color: #34d399;
  border: 2px solid #10b981;
}

.score-mid {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, rgba(120, 53, 15, 0.8) 100%);
  color: #fbbf24;
  border: 2px solid #f59e0b;
}

.score-low {
  background: radial-gradient(circle, rgba(244, 63, 94, 0.25) 0%, rgba(136, 19, 55, 0.8) 100%);
  color: #fb7185;
  border: 2px solid #f43f5e;
}

/* Status Pill */
.status-pill {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: capitalize;
}

.status-shortlisted {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-review {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-rejected {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.status-interview {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Cards Grid View */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.candidate-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.candidate-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.candidate-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.candidate-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

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

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-modal);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  max-width: 950px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--bg-modal);
  z-index: 10;
}

.modal-body {
  padding: 1.5rem;
}

/* Tab View inside Modal */
.tab-row {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.tab-btn {
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.tab-btn.active {
  color: #fff;
  border-bottom-color: var(--primary);
}

/* Detail Metrics */
.metric-box {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 1px solid var(--border-color);
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-top: 0.2rem;
}

/* AI Insights Box */
.ai-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background: rgba(168, 85, 247, 0.2);
  color: #e9d5ff;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

/* Comparison Table */
.compare-table {
  width: 100%;
  border-collapse: collapse;
}

.compare-table th, .compare-table td {
  padding: 1rem;
  border: 1px solid var(--border-color);
  text-align: center;
}

.compare-table th:first-child, .compare-table td:first-child {
  text-align: left;
  font-weight: 600;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2000;
}

.toast {
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  color: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Print Stylesheet for PDF Executive Scorecard */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .app-header, .panel-header, .btn, .view-modes, .search-box, .tab-row, .ai-agent-fab, .ai-agent-drawer {
    display: none !important;
  }
  .glass-panel, .candidate-card, .modal-content, .metric-box, .ai-box {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    background: #fff !important;
    color: #000 !important;
  }
  .modal-overlay {
    position: static !important;
    opacity: 1 !important;
    background: transparent !important;
  }
  .modal-content {
    max-width: 100% !important;
    box-shadow: none !important;
  }
  h1, h2, h3, h4, strong, span, p, div {
    color: #000 !important;
  }
  .score-badge {
    border: 2px solid #000 !important;
    color: #000 !important;
  }
}
