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

:root {
  --primary-color: #2563eb; /* Corporate Blue */
  --primary-hover: #1d4ed8;
  --bg-color: #f8fafc; /* Clean modern slate-50 background */
  --card-bg: #ffffff;
  --text-main: #0f172a; /* Slate 900 for modern corporate look */
  --text-muted: #475569; /* Slate 600 */
  --border-color: #e2e8f0; /* Slate 200 thin border */
  --success-color: #16a34a; /* Subdued Green */
  --danger-color: #dc2626; /* Subdued Red */
  --warning-color: #ca8a04; /* Subdued Yellow */
  --info-color: #2563eb;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px 0 rgba(0,0,0,0.05), 0 1px 2px 0 rgba(0,0,0,0.03);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.03);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8fafc; /* Flat clean enterprise background */
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.light-app {
  background-color: transparent;
}

/* Typography & Links */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* Navbar */
.navbar {
  min-height: 64px;
  background: rgba(255, 255, 255, 0.8) !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 0 1.5rem !important;
  box-shadow: none !important;
}

.brand-logo {
  height: 24px;
  margin-right: 8px;
  object-fit: contain;
}

.navbar-brand {
  display: flex;
  align-items: center;
  padding: 0;
}

.navbar-brand .fw-bold {
  background: #0f172a;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700 !important;
  letter-spacing: -0.03em;
  font-size: 1.2rem;
}

.navbar-nav {
  gap: 6px;
}

.nav-link {
  font-weight: 500;
  color: #475569 !important;
  padding: 0.5rem 0.85rem !important;
  border-radius: 6px !important;
  font-size: 0.875rem !important;
  transition: all 0.15s ease !important;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: #0f172a !important;
  background-color: #f1f5f9 !important;
}

.nav-link.active {
  color: #2563eb !important;
  background-color: rgba(37, 99, 235, 0.06) !important;
  border-color: rgba(37, 99, 235, 0.08) !important;
  font-weight: 600 !important;
}

/* Cards */
.card, .stat-card, .chart-card {
  background: var(--card-bg);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover, .stat-card:hover, .chart-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 0, 0, 0.1);
}

.card-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
  padding: 1rem 1.25rem;
}

.card-body {
  padding: 1.25rem;
}

/* Buttons */
.btn {
  font-weight: 500;
  border-radius: 100px; /* Pill buttons for modern Gemini style */
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: #1e1f20; /* Sleek dark gray anthracite button */
  border: 1px solid #1e1f20;
  color: white;
  box-shadow: none;
}

.btn-primary:hover {
  background: #2d2e30;
  border-color: #2d2e30;
  color: white;
}

/* Forms */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: #dadce0;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.form-label {
  font-weight: 500;
  color: var(--text-main);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

/* Dashboard Stats */
.stat-title {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0.5rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* Charts */
.chart-box {
  position: relative;
  height: 320px;
}

@media (max-width: 991px) {
  .chart-box { height: 260px; }
}

/* Checkbox Grid (Custom) */
.checkbox-grid {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
  background: var(--bg-color);
}

.form-check {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  padding-left: 1.75rem;
}

.form-check-input {
  margin-top: 0;
  cursor: pointer;
}

.form-check-label {
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
  word-break: break-word;
  line-height: 1.3;
  margin-left: 0.35rem;
}

/* Badges */
.badge {
  font-weight: 500;
  padding: 0.35em 0.65em;
  border-radius: 6px;
}

.role-badge {
  margin-right: 0.2rem;
  margin-bottom: 0.2rem;
  font-size: 11px !important;
  font-weight: 600 !important;
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 100px !important;
  padding: 0.25em 0.65em !important;
}

.status-badge-SUCCESS { background: #dcfce7 !important; color: #15803d !important; border: 1px solid #bbf7d0 !important; font-weight: 600 !important; }
.status-badge-FAILED { background: #fee2e2 !important; color: #b91c1c !important; border: 1px solid #fca5a5 !important; font-weight: 600 !important; }
.status-badge-NOT_PROCESSED { background: #f1f5f9 !important; color: #475569 !important; border: 1px solid #cbd5e1 !important; font-weight: 600 !important; }

/* Table styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  margin-bottom: 0;
  border-collapse: collapse !important;
}

/* Force highly compact headers and cells */
.table thead th, #candidatesTable thead th, #screeningsTable thead th {
  background-color: #f8f9fa !important;
  color: #5f6368 !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  font-size: 11px !important;
  letter-spacing: 0.05em !important;
  padding: 8px 10px !important;
  border-bottom: 2px solid #e3e3e3 !important;
  white-space: nowrap;
}

.table tbody td, #candidatesTable tbody td, #screeningsTable tbody td {
  padding: 8px 10px !important; /* More breathing room for 2-line tags */
  vertical-align: middle !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
  color: var(--text-main);
  font-size: 13px !important;
}

.table tbody tr, #candidatesTable tbody tr, #screeningsTable tbody tr {
  height: auto !important; /* Let tight padding dictate compact height */
}

/* Custom cell compact width & line clamp styling */
.email-cell {
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

.phone-cell {
  white-space: nowrap;
}



.ai-eval-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.4;
  max-height: 2.8em; /* Exactly 2 lines */
  min-width: 280px;
  white-space: normal;
  cursor: help;
}

.evaluation-note-cell {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.4;
  max-height: 2.8em; /* Exactly 2 lines */
  min-width: 140px;
  max-width: 250px;
  white-space: normal;
  word-break: break-word;
  color: var(--text-muted);
  cursor: help;
}

.email-col {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-col {
  white-space: nowrap;
}

.table-hover tbody tr:hover, #candidatesTable tbody tr:hover, #screeningsTable tbody tr:hover {
  background-color: #f8fafc !important;
}

/* DataTables pagination tweaks */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.75rem;
  margin-left: 0.25rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary-color) !important;
  color: white !important;
  border-color: var(--primary-color) !important;
}

/* Login Page */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #eef2ff 0%, #c7d2fe 100%);
  display: flex;
  align-items: center;
}

.login-page .card {
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
}

.brand-logo-lg {
  height: 80px;
  object-fit: contain;
  margin-bottom: 1rem;
}

/* Import Console */
.import-console {
  height: 400px;
  overflow: auto;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  background: #1e293b;
  color: #f8fafc;
  padding: 1rem;
  border-radius: var(--radius-md);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.import-log-line { white-space: pre-wrap; word-break: break-word; margin-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 4px; }
.import-log-normal { color: #cbd5e1; }
.import-log-progress { color: #38bdf8; }
.import-log-warn { color: #fbbf24; }
.import-log-error { color: #f87171; }
.import-log-success { color: #34d399; font-weight: 600; }

/* DB Grid */
.db-grid-wrap {
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.db-grid {
  margin-bottom: 0;
  font-size: 0.85rem;
}

.db-grid thead th.db-th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-color);
  white-space: nowrap;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem;
}

.db-grid .db-td {
  vertical-align: top;
  min-width: 120px;
  max-width: 300px;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.db-cell-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.db-cell-hover {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 8px;
  min-width: 300px;
  max-width: 500px;
  max-height: 300px;
  overflow: auto;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  color: #f8fafc;
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  font-size: 0.85rem;
  line-height: 1.5;
}

.db-grid .db-action-th, .db-grid .db-action-td {
  position: sticky;
  right: 0;
  z-index: 1;
  background: #fff;
  min-width: 90px;
  text-align: center;
  border-left: 1px solid var(--border-color);
}

.db-grid thead .db-action-th {
  z-index: 3;
  background: var(--bg-color);
}

/* Progress Bar Styling with Gemini Aura Gradient */
.progress {
  background-color: #e8eaed !important;
  border-radius: 100px !important;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, #3b82f6, #2563eb) !important;
  border-radius: 100px !important;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Custom premium styles for Datatable column values to force strict identical row heights */
.name-cell {
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
  font-weight: 600;
}

.campaign-cell {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

.source-cell {
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

.role-cell {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.4;
  height: 48px; /* Safe fixed height for exactly 2 lines of text/tags */
  min-width: 180px;
  max-width: 260px;
  white-space: normal;
  cursor: help;
}

/* Sleek, professional buttons with standard moderate border-radius */
.btn {
  border-radius: var(--radius-sm) !important; /* 8px - matching input elements! */
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-outline-primary {
  border-color: rgba(37, 99, 235, 0.15) !important;
  background-color: rgba(37, 99, 235, 0.05) !important;
  color: #2563eb !important;
}
.btn-outline-primary:hover {
  background-color: #2563eb !important;
  border-color: #2563eb !important;
  color: white !important;
}

.btn-outline-secondary {
  border-color: rgba(71, 85, 105, 0.15) !important;
  background-color: rgba(71, 85, 105, 0.05) !important;
  color: #475569 !important;
}
.btn-outline-secondary:hover {
  background-color: #475569 !important;
  border-color: #475569 !important;
  color: white !important;
}

.btn-outline-warning {
  border-color: rgba(202, 138, 4, 0.15) !important;
  background-color: rgba(202, 138, 4, 0.05) !important;
  color: #ca8a04 !important;
}
.btn-outline-warning:hover {
  background-color: #ca8a04 !important;
  border-color: #ca8a04 !important;
  color: white !important;
}

.btn-outline-danger {
  border-color: rgba(220, 38, 38, 0.15) !important;
  background-color: rgba(220, 38, 38, 0.05) !important;
  color: #dc2626 !important;
}
.btn-outline-danger:hover {
  background-color: #dc2626 !important;
  border-color: #dc2626 !important;
  color: white !important;
}

/* Compact modern Datatables pagination layout overrides to fix large gaps */
.dataTables_wrapper .dataTables_paginate .pagination,
.dataTables_paginate .pagination {
  gap: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
}

.dataTables_wrapper .dataTables_paginate .page-item,
.dataTables_paginate .page-item {
  margin: 0 2px !important;
}

.dataTables_wrapper .dataTables_paginate .page-link,
.dataTables_paginate .page-link {
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  border-radius: 6px !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border-color) !important;
  background-color: var(--card-bg) !important;
  transition: all 0.15s ease;
  box-shadow: none !important;
}

.dataTables_wrapper .dataTables_paginate .page-link:hover,
.dataTables_paginate .page-link:hover {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: var(--text-main) !important;
}

.dataTables_wrapper .dataTables_paginate .page-item.active .page-link,
.dataTables_paginate .page-item.active .page-link {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: white !important;
}

/* Import Console Styles */
.import-console {
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  max-height: 250px;
  overflow-y: auto;
  line-height: 1.5;
  background-color: #0f172a !important; /* Premium dark slate background instead of generic dark */
  border-color: #334155 !important;
}

.import-log-line {
  padding: 2px 4px;
  border-radius: 4px;
}

.import-log-normal {
  color: #e2e8f0; /* Soft light gray text */
}

.import-log-progress {
  color: #3b82f6; /* Blue */
}

.import-log-success {
  color: #4ade80; /* Soft green */
  font-weight: 600;
}

.import-log-error {
  color: #f87171; /* Soft red */
  background-color: rgba(220, 38, 38, 0.1);
  font-weight: 600;
}

.import-log-warn {
  color: #fbbf24; /* Soft yellow/orange */
  background-color: rgba(202, 138, 4, 0.1);
}

.import-log-skip {
  color: #94a3b8; /* Slate-400 muted text for skipped rows */
  background-color: rgba(71, 85, 105, 0.1);
  font-style: italic;
}
