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

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #6366f1;
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --accent: #06b6d4;
  --accent-dark: #0891b2;
  --accent-light: #22d3ee;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.06);
  --shadow-md: 0 10px 25px -3px rgba(0,0,0,0.1), 0 4px 10px -4px rgba(0,0,0,0.06);
  --shadow-lg: 0 20px 40px -5px rgba(0,0,0,0.12), 0 8px 16px -6px rgba(0,0,0,0.06);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.2);
  --shadow-glow: 0 0 40px rgba(79,70,229,0.15);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%);
  background-attachment: fixed;
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(226,232,240,0.6);
  padding: 0 2rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.navbar .logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.5px;
}

.navbar .logo span { color: var(--gray-800); }

.nav-links { display: flex; align-items: center; gap: 8px; }

.nav-links a, .nav-links button {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: var(--transition);
  border: none;
  background: none;
  cursor: pointer;
}

.nav-links a:hover, .nav-links button:hover {
  color: var(--primary);
  background: var(--primary-50);
}

.nav-links .btn-logout {
  color: var(--danger);
}

.nav-links .btn-logout:hover {
  background: var(--danger-bg);
}

/* ===== Container ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.container-sm {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem;
}

/* ===== Hero Section ===== */
.hero {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #eef2ff 0%, #ffffff 30%, #f0f9ff 60%, #faf5ff 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79,70,229,0.12) 0%, rgba(99,102,241,0.04) 40%, transparent 70%);
  animation: float 10s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -25%;
  left: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,0.1) 0%, rgba(34,211,238,0.03) 40%, transparent 70%);
  animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  50% { transform: translateY(-30px) scale(1.08) rotate(2deg); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 4px 14px rgba(79,70,229,0.3); }
  50% { box-shadow: 0 8px 30px rgba(79,70,229,0.5); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 740px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  font-weight: 900;
  color: var(--gray-900);
  line-height: 1.12;
  margin-bottom: 1.5rem;
  letter-spacing: -2px;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 50%, var(--accent) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

.hero p {
  font-size: 1.2rem;
  color: var(--gray-500);
  margin-bottom: 2.5rem;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(79,70,229,0.35);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::after { left: 100%; }

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(79,70,229,0.45);
}

.btn-primary:active { transform: translateY(-1px); }

.btn-secondary {
  background: rgba(255,255,255,0.8);
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  border-color: var(--primary-200);
  color: var(--primary);
  background: var(--primary-50);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(6,182,212,0.35);
  position: relative;
  overflow: hidden;
}

.btn-accent:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(6,182,212,0.45);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}

.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(16,185,129,0.4); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(239,68,68,0.3);
}

.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(239,68,68,0.4); }

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

.btn-lg { padding: 18px 36px; font-size: 1.08rem; border-radius: var(--radius-lg); }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== Cards ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  padding: 1.75rem;
  transition: var(--transition-spring);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.card:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--primary-200);
  transform: translateY(-6px);
}

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

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--gray-400);
}

.card-body { margin-bottom: 1rem; }

.card-body p {
  color: var(--gray-600);
  font-size: 0.9rem;
  line-height: 1.6;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* ===== Job Grid ===== */
.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* ===== Badge / Status ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-pending {
  background: var(--warning-bg);
  color: #92400e;
}

.badge-approved {
  background: var(--success-bg);
  color: #065f46;
}

.badge-rejected {
  background: var(--danger-bg);
  color: #991b1b;
}

.badge-pay {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #065f46;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 14px;
}

.badge-safe {
  background: var(--success-bg);
  color: #065f46;
}

.badge-risky {
  background: var(--danger-bg);
  color: #991b1b;
}

/* ===== Forms ===== */
.form-card {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(226,232,240,0.6);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.form-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #7c3aed, var(--accent));
}

.form-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.form-subtitle {
  color: var(--gray-400);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--gray-800);
  background-color: var(--gray-50);
  transition: var(--transition);
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  background-color: var(--white);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.01), 0 0 0 4px rgba(79,70,229,0.1), 0 2px 8px rgba(79,70,229,0.08);
}

.form-group textarea { min-height: 120px; resize: vertical; }

.form-group select { 
  cursor: pointer; 
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 48px;
}

.form-group select:focus {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.form-group optgroup {
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-50);
}

.form-group option {
  font-weight: 500;
  color: var(--gray-800);
  background: var(--white);
  padding: 8px;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 1.5rem 0;
}

.form-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.form-check label {
  font-size: 0.9rem;
  color: var(--gray-600);
  cursor: pointer;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 1.5rem 0;
  color: var(--gray-400);
  font-size: 0.85rem;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ===== Role selector ===== */
.role-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 1.5rem;
}

.role-option {
  padding: 12px 8px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: var(--transition-spring);
  background: rgba(255,255,255,0.8);
}

.role-option:hover {
  border-color: var(--primary-200);
  background: var(--primary-50);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.role-option.active {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 0 0 4px rgba(79,70,229,0.12), var(--shadow-md);
  transform: translateY(-3px);
}

.role-option .role-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
  display: inline-block;
  transition: var(--transition);
}

.role-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}

.role-option:hover .role-icon,
.role-option.active .role-icon { transform: scale(1.15); }

.role-option .role-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}

/* ===== Map ===== */
.map-container {
  width: 100%;
  height: 500px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 4px solid var(--white);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.map-container-sm {
  height: 300px;
}

#map, #jobMap, #employerMap { width: 100%; height: 100%; z-index: 1; }

/* ===== Leaflet Popup Styling ===== */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 8px !important;
  border: 1px solid var(--gray-200);
}

.leaflet-popup-content {
  font-family: 'Inter', sans-serif !important;
  font-size: 0.9rem !important;
  color: var(--gray-800) !important;
  margin: 8px !important;
  line-height: 1.5 !important;
}

.leaflet-popup-content strong {
  font-size: 1.05rem !important;
  color: var(--gray-900) !important;
  display: block;
  margin-bottom: 8px;
}

.leaflet-popup-content a {
  display: inline-block;
  margin-top: 10px;
  background: var(--primary-50);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-fast);
}

.leaflet-popup-content a:hover {
  background: var(--primary);
  color: var(--white);
}

/* ===== Page Header ===== */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.5px;
  margin-bottom: 0.35rem;
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header p {
  color: var(--gray-400);
  font-size: 1rem;
}

/* ===== Section Title ===== */
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== Terms ===== */
.terms-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-height: 350px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.8;
}

.terms-box h3 {
  color: var(--gray-800);
  margin: 1rem 0 0.5rem;
  font-size: 1rem;
}

.terms-box h3:first-child { margin-top: 0; }

.terms-box ul {
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ===== AI Insight ===== */
.ai-card {
  background: linear-gradient(135deg, rgba(238,242,255,0.8) 0%, rgba(240,249,255,0.8) 100%);
  backdrop-filter: blur(8px);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1rem 0;
  position: relative;
  overflow: hidden;
}

.ai-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.ai-card .ai-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.ai-card p {
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.7;
}

/* ===== Application cards ===== */
.app-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ===== Loading ===== */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--gray-400);
  font-size: 0.9rem;
  gap: 10px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.35s ease;
  max-width: 380px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-400);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { color: var(--gray-600); margin-bottom: 0.5rem; }

/* ===== Features Grid (landing) ===== */
.features {
  padding: 6rem 2rem;
  background: var(--white);
  position: relative;
}

.features::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-200), transparent);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
  max-width: 1040px;
  margin: 0 auto;
}

.feature-card {
  text-align: center;
  padding: 2.25rem 1.75rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(248,250,252,0.8), rgba(255,255,255,0.9));
  border: 1px solid rgba(226,232,240,0.6);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: var(--transition);
}

.feature-card:hover::before { opacity: 1; }

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--primary-100);
  background: rgba(255,255,255,0.95);
}

.feature-card .feature-icon {
  font-size: 2.8rem;
  margin-bottom: 1.25rem;
  display: inline-block;
  animation: float 4s ease-in-out infinite;
}

.feature-card:nth-child(2) .feature-icon { animation-delay: -0.5s; }
.feature-card:nth-child(3) .feature-icon { animation-delay: -1s; }
.feature-card:nth-child(4) .feature-icon { animation-delay: -1.5s; }
.feature-card:nth-child(5) .feature-icon { animation-delay: -2s; }
.feature-card:nth-child(6) .feature-icon { animation-delay: -2.5s; }

.feature-card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.6rem;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--gray-500);
  line-height: 1.65;
}

/* ===== Tab switcher ===== */
.tab-bar {
  display: flex;
  gap: 4px;
  background: rgba(241,245,249,0.8);
  backdrop-filter: blur(8px);
  padding: 5px;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(226,232,240,0.5);
}

.tab-btn {
  flex: 1;
  padding: 11px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--transition);
}

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

.tab-btn.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(79,70,229,0.08);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .navbar { padding: 0.75rem 1rem; flex-wrap: wrap; height: auto; gap: 10px; }
  .nav-links { width: 100%; justify-content: space-between; overflow-x: auto; padding-bottom: 4px; }
  .nav-links::-webkit-scrollbar { display: none; }
  .container, .container-sm { padding: 1rem; margin-bottom: 80px; }
  .hero { padding: 2rem 1.25rem; min-height: auto; }
  .job-grid { grid-template-columns: 1fr; gap: 1rem; }
  .role-selector { grid-template-columns: 1fr; }
  .hero-buttons { flex-direction: column; align-items: stretch; width: 100%; }
  .hero-buttons .btn { width: 100%; text-align: center; }
  .form-card { padding: 1.25rem; margin: 0; border-radius: var(--radius); }
  .features-grid { grid-template-columns: 1fr; gap: 1rem; }
  .card-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
  .map-container { height: 350px; }
  
  /* Make Dashboard Headers stack */
  div[style*="display:flex"][style*="align-items:center"][style*="gap:1.5rem"][style*="backdrop-filter"] {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem !important;
  }

  /* Make Search & Filter stack */
  div[style*="display: flex; gap: 10px; max-width: 800px"] {
    flex-direction: column;
    border-radius: var(--radius-lg) !important;
  }
  div[style*="display: flex; gap: 10px; max-width: 800px"] input, 
  div[style*="display: flex; gap: 10px; max-width: 800px"] select {
    width: 100% !important;
    text-align: center;
  }
  div[style*="width:1px; background:var(--gray-200)"] {
    width: 100% !important;
    height: 1px !important;
    margin: 4px 0 !important;
  }

  /* Make Tab Bar horizontally scrollable */
  .tab-bar {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    padding-bottom: 6px;
    border-radius: var(--radius-lg);
  }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-btn { flex: 0 0 auto; white-space: nowrap; padding: 10px 16px; font-size: 0.85rem; }

  /* AI Chatbot Fullscreen on Mobile */
  #aiChatbotOverlay {
    width: 100% !important;
    height: 100vh !important;
    bottom: 0 !important;
    right: 0 !important;
    border-radius: 0 !important;
    z-index: 99999 !important;
  }

  /* Universal Notification Panel */
  #universalNotifPanel {
    width: calc(100vw - 20px) !important;
    right: -60px !important; /* adjust for nav padding */
    max-height: 80vh !important;
  }

  /* Chat UI adjustments */
  .chat-container {
    height: calc(100vh - 140px);
    border-radius: var(--radius-sm);
  }
  .chat-input-area { padding: 0.75rem; }
  .chat-input-area input { font-size: 1rem; } /* prevents iOS zoom */
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: 1rem; }
  .navbar .logo { font-size: 1.15rem; }
  .nav-links a, .nav-links button { font-size: 0.8rem; padding: 6px 12px; }
  #userEmail { display: none; }
  .page-header h1 { font-size: 1.8rem !important; }
}

/* ===== Fade in animation ===== */
.fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.card { animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.2s; }
.card:nth-child(6) { animation-delay: 0.25s; }

.feature-card { animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.15s; }
.feature-card:nth-child(3) { animation-delay: 0.2s; }
.feature-card:nth-child(4) { animation-delay: 0.25s; }
.feature-card:nth-child(5) { animation-delay: 0.3s; }
.feature-card:nth-child(6) { animation-delay: 0.35s; }

/* ===== Utility ===== */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 1rem; }
.hidden { display: none !important; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--gray-50); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ===== Selection ===== */
::selection { background: var(--primary-200); color: var(--primary-dark); }
