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

:root {
  --primary: #1a56db;
  --primary-dark: #1340a8;
  --primary-light: #e8f0fe;
  --secondary: #f97316;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-alt: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-focus: #1a56db;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: 0.2s ease;
  --font: 'Sora', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --nav-height: 68px;
}

[data-theme="dark"] {
  --bg: #0b0f1a;
  --bg-card: #131929;
  --bg-alt: #1a2236;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #1e2d45;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  --primary-light: #1a2845;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden; /* Prevent horizontal scroll */
  max-width: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
  overflow-x: hidden; /* Prevent horizontal scroll */
  max-width: 100%;
  position: relative;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  height: var(--nav-height);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 8px;
  overflow: hidden;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--primary);
  white-space: nowrap;
}

.navbar-brand .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.2rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  overflow: hidden;
  flex-shrink: 1;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.8rem;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}

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

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  height: var(--nav-height);
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 8px;
  overflow: visible;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.navbar-brand .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.1rem;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  flex-shrink: 0;
}

.nav-links > li > a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.8rem;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
  display: block;
  text-decoration: none;
}

.nav-links > li > a:hover,
.nav-links > li > a.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ===== MORE DROPDOWN ===== */
.nav-more {
  position: relative;
  flex-shrink: 0;
}

.nav-more-btn {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  background: var(--primary-light);
  border: 1px solid rgba(26,86,219,0.15);
  font-family: var(--font);
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 3px;
}
.nav-more-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  list-style: none;
  min-width: 190px;
  z-index: 9999;
  padding: 6px 0;
}
.nav-dropdown.open {
  display: block;
  animation: dropIn 0.15s ease;
}
.nav-dropdown li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition);
  text-decoration: none;
}
.nav-dropdown li a:hover { background: var(--primary-light); color: var(--primary); }
.nav-dropdown li a.active { color: var(--primary); background: var(--primary-light); }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav-actions { display: flex; align-items: center; gap: 8px; }

.btn-icon {
  width: 38px; height: 38px;
  border: none; cursor: pointer;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  font-size: 1rem;
}
.btn-icon:hover { background: var(--primary-light); color: var(--primary); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,86,219,0.3); }

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ===== CONTAINER ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; width: 100%; box-sizing: border-box; }
.container-sm { max-width: 900px; margin: 0 auto; padding: 0 20px; width: 100%; box-sizing: border-box; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #0f1f4a 0%, #1a3a7a 40%, #0e3460 100%);
  padding: 60px 0 50px;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content { position: relative; text-align: center; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.1);
  color: #93c5fd;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 800;
  color: white;
  line-height: 1.2;
  margin-bottom: 16px;
}
.hero h1 span { color: #60a5fa; }

.hero-subtitle { color: rgba(255,255,255,0.7); font-size: 1.05rem; margin-bottom: 36px; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.hero-stat { text-align: center; color: white; }
.hero-stat .num { font-size: 1.8rem; font-weight: 800; color: #60a5fa; font-family: var(--font-mono); }
.hero-stat .label { font-size: 0.8rem; color: rgba(255,255,255,0.6); }

/* ===== SEARCH ===== */
.search-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 8px 8px 8px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 1rem;
  background: transparent;
  color: #0f172a;
}

.search-box input::placeholder { color: #94a3b8; }

.search-box select {
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 0.875rem;
  color: #475569;
  background: #f1f5f9;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ===== TICKER ===== */
.ticker-bar {
  background: var(--primary);
  color: white;
  padding: 10px 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  max-width: 100%;
  width: 100%;
}

.ticker-label {
  background: var(--secondary);
  padding: 2px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  margin-right: 20px;
  flex-shrink: 0;
}

.ticker-content {
  display: flex;
  animation: ticker 35s linear infinite;
  white-space: nowrap;
}

.ticker-item {
  padding: 0 30px;
  font-size: 0.85rem;
  border-right: 1px solid rgba(255,255,255,0.2);
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== SECTION ===== */
.section { padding: 48px 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  border-radius: 2px;
}

/* ===== JOB CARDS ===== */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.job-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.25s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.job-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  transform: scaleY(0);
  transition: transform 0.25s;
  transform-origin: top;
}

.job-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.job-card:hover::before { transform: scaleY(1); }

.job-card.featured {
  border-color: var(--warning);
  background: linear-gradient(135deg, var(--bg-card), rgba(245,158,11,0.03));
}

.job-card.featured::before { background: linear-gradient(to bottom, var(--warning), var(--secondary)); transform: scaleY(1); }

.job-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.job-org-logo {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.job-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-org {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.job-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.badge {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-govt { background: #dbeafe; color: #1d4ed8; }
.badge-bank { background: #d1fae5; color: #065f46; }
.badge-railway { background: #ede9fe; color: #5b21b6; }
.badge-defence { background: #fef3c7; color: #92400e; }
.badge-teaching { background: #fce7f3; color: #9d174d; }
.badge-police { background: #f0fdf4; color: #14532d; }
.badge-psu { background: #fff7ed; color: #9a3412; }
.badge-featured { background: linear-gradient(90deg, #fbbf24, #f97316); color: white; }

[data-theme="dark"] .badge-govt { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .badge-bank { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .badge-railway { background: #2e1065; color: #c4b5fd; }

.job-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.job-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.job-meta-item .icon { color: var(--primary); font-size: 0.85rem; }

.job-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.deadline {
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.deadline.urgent { color: var(--danger); }
.deadline.normal { color: var(--text-secondary); }

.save-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition);
}
.save-btn:hover, .save-btn.saved { color: var(--warning); }

/* ===== CATEGORY GRID ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  color: var(--text);
  display: block;
}

.category-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  color: var(--primary);
}

.category-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.category-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.category-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ===== SIDEBAR ===== */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.sidebar-card-header {
  padding: 14px 18px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-list { list-style: none; }

.sidebar-list li {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list li:hover { background: var(--bg-alt); }

.sidebar-list a {
  color: var(--text);
  font-size: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.sidebar-list a::before {
  content: '›';
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.sidebar-list .date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: var(--font-mono);
}

/* ===== TABLE (Results/Admit Cards) ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table thead {
  background: var(--primary);
  color: white;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 12px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.data-table tbody tr:hover { background: var(--bg-alt); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

.form-control::placeholder { color: var(--text-muted); }

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

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 32px;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title { font-size: 1.3rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-alt); color: var(--text); }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.page-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover, .page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== FILTERS ===== */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.filter-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
  max-width: 100%;
}

.filter-select:focus { border-color: var(--primary); }

/* ===== ALERT/TOAST ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 400px;
  animation: slideIn 0.3s ease;
  border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

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

/* ===== SPINNER ===== */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 14px;
  color: var(--text-muted);
}

/* ===== TABS ===== */
.tabs { border-bottom: 2px solid var(--border); display: flex; gap: 0; margin-bottom: 28px; overflow-x: auto; }

.tab-btn {
  padding: 12px 20px;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
}

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

/* ===== FOOTER ===== */
footer {
  background: #0b1429;
  color: rgba(255,255,255,0.75);
  padding: 48px 0 20px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

.footer-brand .navbar-brand { color: white; margin-bottom: 14px; }
.footer-brand p { font-size: 0.875rem; line-height: 1.7; max-width: 280px; }

.footer-col h4 {
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul a { color: rgba(255,255,255,0.6); font-size: 0.85rem; transition: color var(--transition); }
.footer-col ul a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  flex-wrap: wrap;
  gap: 10px;
}

/* ===== LAYOUT ===== */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, #0e3460 100%);
  color: white;
  padding: 36px 0;
  margin-bottom: 36px;
  width: 100%;
  overflow: hidden;
}

.page-header h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 6px; }
.page-header p { color: rgba(255,255,255,0.75); font-size: 0.9rem; }

/* ===== ADMIN ===== */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 250px;
  background: #0b1429;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
  flex-shrink: 0;
}

.admin-main { margin-left: 250px; padding: 28px; flex: 1; background: var(--bg); }

.admin-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-weight: 800;
  font-size: 1.1rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-nav { padding: 12px 0; list-style: none; }

.admin-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.65);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.admin-nav li a:hover, .admin-nav li a.active {
  background: rgba(255,255,255,0.08);
  color: white;
  border-right: 3px solid var(--primary);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-value { font-size: 1.8rem; font-weight: 800; font-family: var(--font-mono); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 8px; }

/* ===== RESPONSIVE ===== */

/* Prevent horizontal overflow globally */
section, header, footer, nav, main, aside { max-width: 100%; }

/* 1024px — Medium desktop */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .page-layout { grid-template-columns: 1fr !important; }
  .page-layout .sidebar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .jobs-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 900px — Tablet landscape */
@media (max-width: 900px) {
  .container { padding: 0 14px; }
  .nav-links a { font-size: 0.75rem; padding: 6px 7px; }
  .jobs-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

/* 860px — Hide extra nav links */
@media (max-width: 860px) {
  .nav-links li:nth-child(n+5) { display: none; }
}

/* 768px — Tablets portrait */
@media (max-width: 768px) {
  .nav-links { display: none !important; }
  .hamburger { display: flex !important; }

  .hero { padding: 32px 0 22px; }
  .hero h1 { font-size: 1.5rem; line-height: 1.25; }
  .hero-subtitle { font-size: 0.875rem; margin-bottom: 18px; }
  .hero-stats { gap: 14px; }
  .hero-stat .num { font-size: 1.3rem; }
  .hero-stat .label { font-size: 0.7rem; }

  .search-box { flex-direction: column; align-items: stretch; padding: 12px; gap: 8px; border-radius: var(--radius); }
  .search-box input { font-size: 16px; padding: 6px 0; }
  .search-box select { width: 100% !important; min-width: unset !important; font-size: 16px; }
  .search-box .btn { width: 100%; }

  .page-layout { grid-template-columns: 1fr !important; gap: 14px; }
  .page-layout .sidebar { display: flex; flex-direction: column; gap: 12px; }

  .jobs-grid { grid-template-columns: 1fr; gap: 10px; }
  .job-card { padding: 14px 12px; }
  .job-org-logo { width: 38px; height: 38px; font-size: 0.9rem; }
  .job-title { font-size: 0.88rem; }
  .job-meta { grid-template-columns: 1fr 1fr; gap: 5px; }
  .job-meta-item { font-size: 0.73rem; }
  .job-card-footer { flex-wrap: wrap; gap: 6px; padding-top: 10px; }

  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .category-card { padding: 12px 8px; }
  .category-icon { font-size: 1.4rem; margin-bottom: 5px; }
  .category-name { font-size: 0.75rem; }

  .section { padding: 22px 0; }
  .section-header { margin-bottom: 14px; }
  .section-title { font-size: 1.1rem; }

  .filter-bar { gap: 7px; padding: 10px 12px; }
  .filter-select { font-size: 16px; padding: 7px 8px; }

  .data-table { min-width: 500px; }
  .data-table th, .data-table td { padding: 9px 10px; font-size: 0.78rem; }

  .page-header { padding: 20px 0; margin-bottom: 18px; }
  .page-header h1 { font-size: 1.3rem; }
  .page-header p { font-size: 0.82rem; }

  .detail-header { padding: 16px; }
  .detail-title { font-size: 1.15rem; }
  .info-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .subscribe-banner { padding: 20px 16px; }
  .subscribe-banner h3 { font-size: 1.05rem; }
  .subscribe-input-row { flex-direction: column; gap: 8px; }
  .subscribe-input-row input, .subscribe-input-row .btn { width: 100%; }

  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-btn { padding: 10px 13px; font-size: 0.8rem; white-space: nowrap; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 16px; }

  .admin-sidebar { display: none !important; }
  .admin-main { margin-left: 0 !important; padding: 14px !important; }

  .ticker-label { padding: 2px 8px; font-size: 0.68rem; }
  .ticker-item { font-size: 0.75rem; padding: 0 14px; }

  #backToTop { bottom: 14px; right: 14px; width: 38px; height: 38px; font-size: 0.95rem; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-value { font-size: 1.3rem; }
  .stat-icon { width: 42px; height: 42px; }

  .modal { padding: 20px 16px; border-radius: var(--radius); }
  .modal-title { font-size: 1.1rem; }
}

/* 480px — Small phones */
@media (max-width: 480px) {
  :root { --nav-height: 58px; }
  body { font-size: 14px; }
  .container { padding: 0 10px; }
  .container-sm { padding: 0 10px; }

  .navbar-brand { font-size: 1.05rem; }
  .navbar-brand .logo-icon { width: 30px; height: 30px; font-size: 0.85rem; border-radius: 7px; }
  .nav-actions { gap: 4px; }
  .btn-icon { width: 32px; height: 32px; font-size: 0.85rem; }

  .hero { padding: 22px 0 16px; }
  .hero-badge { font-size: 0.68rem; padding: 4px 10px; margin-bottom: 10px; }
  .hero h1 { font-size: 1.2rem; }
  .hero-subtitle { font-size: 0.8rem; margin-bottom: 14px; }
  .hero-stats { gap: 8px; flex-wrap: wrap; justify-content: center; }
  .hero-stat .num { font-size: 1.1rem; }

  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .category-card { padding: 10px 6px; }
  .category-icon { font-size: 1.3rem; }
  .category-name { font-size: 0.72rem; }

  .job-card { padding: 12px 10px; }
  .job-meta { grid-template-columns: 1fr; gap: 4px; }
  .job-org-logo { width: 34px; height: 34px; font-size: 0.8rem; border-radius: 8px; }

  .badge { font-size: 0.65rem; padding: 2px 6px; }
  .posts-badge { font-size: 0.65rem; padding: 2px 6px; }

  .section { padding: 16px 0; }
  .section-title { font-size: 0.98rem; }

  .filter-bar { flex-direction: column; align-items: stretch; padding: 9px; }
  .filter-bar .filter-select, .filter-bar .btn { width: 100%; }

  .footer-grid { grid-template-columns: 1fr; gap: 14px; }
  footer { padding: 26px 0 14px; }

  .modal { padding: 16px 12px; }
  .modal-title { font-size: 0.98rem; }
  .page-btn { width: 32px; height: 32px; font-size: 0.75rem; }

  .info-grid { grid-template-columns: 1fr; }
  .detail-header { padding: 13px; }
  .detail-title { font-size: 1.05rem; }
  .page-header { padding: 16px 0; }
  .page-header h1 { font-size: 1.1rem; }

  .login-card { padding: 20px 14px; }
  .btn-lg { padding: 11px 18px; font-size: 0.88rem; }
}

/* 360px — Very small phones */
@media (max-width: 360px) {
  .container { padding: 0 8px; }
  .hero h1 { font-size: 1.1rem; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 5px; }
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; max-width: 220px; margin: 10px auto 0; gap: 8px; }
}

/* ===== TOUCH DEVICES ===== */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .job-card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .category-card:hover { transform: none; }
  .state-card:hover { transform: none; }
  .edu-card:hover { transform: none; }
}

/* Prevent iOS input zoom */
@media (max-width: 768px) {
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="tel"], input[type="url"],
  input[type="date"], select, textarea { font-size: 16px !important; }
}

/* ===== SCROLLBAR THIN on mobile ===== */
@media (max-width: 768px) {
  ::-webkit-scrollbar { width: 2px; height: 2px; }
}

/* ===== UTILITY ===== */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.fw-600 { font-weight: 600; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== BACK TO TOP ===== */
#backToTop {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px; height: 44px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 500;
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.3s;
  display: flex; align-items: center; justify-content: center;
}
#backToTop.show { opacity: 1; transform: translateY(0); }
#backToTop:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ===== DETAIL PAGE ===== */
.detail-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}

.detail-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.detail-org { color: var(--text-secondary); font-size: 1rem; margin-bottom: 16px; }

.detail-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}

.detail-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.info-item .label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; margin-bottom: 3px; }
.info-item .value { font-size: 0.9rem; font-weight: 600; color: var(--text); }

/* Subscribe Banner */
.subscribe-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #0e3460 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  color: white;
  text-align: center;
}
.subscribe-banner h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.subscribe-banner p { color: rgba(255,255,255,0.75); font-size: 0.9rem; margin-bottom: 20px; }
.subscribe-input-row { display: flex; gap: 8px; max-width: 400px; margin: 0 auto; }
.subscribe-input-row input { flex: 1; padding: 10px 14px; border: none; border-radius: var(--radius-sm); font-size: 0.9rem; outline: none; }

/* Mobile Menu */
.hamburger { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text); padding: 6px; }
@media (max-width: 768px) { .hamburger { display: flex; } }

.mobile-menu {
  position: fixed; inset: 0;
  background: var(--bg-card);
  z-index: 1500;
  transform: translateX(-100%);
  transition: transform 0.3s;
  padding: 20px;
  overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.mobile-nav-links { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.mobile-nav-links a { display: block; padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 600; color: var(--text); transition: all var(--transition); }
.mobile-nav-links a:hover { background: var(--primary-light); color: var(--primary); }

/* Highlight badge */
.posts-badge {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: white;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
}
