/* ============================================================
   UPGRADE.CSS — Premium redesign: no emojis, smooth, pro
   ============================================================ */

/* ── MEGA MENU ─────────────────────────────────────────────── */
.has-mega { position: relative; }
.has-mega:hover .mega-menu,
.mega-menu:hover { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.mega-menu {
  position: absolute; top: calc(100% + 14px); left: 50%;
  transform: translateX(-50%) translateY(-10px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  background: #fff; border: 1px solid #e8e8e8; border-radius: 18px;
  box-shadow: 0 24px 72px rgba(0,0,0,.13), 0 4px 16px rgba(0,0,0,.06);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  padding: 10px; min-width: 800px; z-index: 1000;
}
.mega-col { padding: 18px 16px; }
.mega-col:not(:last-child) { border-right: 1px solid #f2f2f2; }
.mega-col-title {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-muted); margin-bottom: 10px;
  padding-bottom: 10px; border-bottom: 1px solid #f2f2f2;
}
.mega-link {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  border-radius: 9px; cursor: pointer;
  transition: background 0.12s, color 0.12s; text-decoration: none; white-space: nowrap;
}
.mega-link:hover { background: var(--accent-subtle); color: var(--accent); }
.mega-trending { background: #fafaf9; border-radius: 12px; }
.mega-trending .mega-col-title { color: var(--accent); }

/* ── ADVANCED HERO SEARCH BOX ─────────────────────────────── */
.hero-search-box-adv {
  display: flex; align-items: center;
  background: #fff; border-radius: 16px;
  border: 1.5px solid var(--border-light);
  box-shadow: 0 12px 40px rgba(0,0,0,.09);
  overflow: hidden; max-width: 800px; margin: 0 auto;
  transition: box-shadow .25s, border-color .25s;
}
.hero-search-box-adv:focus-within {
  border-color: var(--accent); box-shadow: 0 12px 40px rgba(245,96,10,.18);
}
.hsb-field { display: flex; align-items: center; gap: 10px; padding: 19px 20px; flex: 1; }
.hsb-sep { width: 1px; height: 32px; background: var(--border-light); flex-shrink: 0; }
.hero-search-input {
  border: none; outline: none; background: transparent;
  font-family: var(--font-primary); font-size: 14px; color: var(--text-primary);
  font-weight: 500; width: 100%;
}
.hero-search-input::placeholder { color: var(--text-muted); font-weight: 400; }
.hero-search-box-adv .btn-accent { border-radius: 0 14px 14px 0; padding: 19px 28px; flex-shrink: 0; }

/* ── LIVE TICKER ───────────────────────────────────────────── */
.live-ticker-bar {
  background: #0d0d0d; display: flex; align-items: center;
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.06);
  contain: layout style;
}
.ticker-label-pill {
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 800;
  letter-spacing: .07em; padding: 11px 20px; flex-shrink: 0; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.ticker-scroll-wrap { overflow: hidden; flex: 1; contain: layout; }
.ticker-scroll {
  display: flex; gap: 40px; align-items: center; white-space: nowrap;
  animation: ticker-move 38s linear infinite;
  padding: 11px 32px; font-size: 13px; color: rgba(255,255,255,.6); font-weight: 500;
  will-change: transform;
  backface-visibility: hidden;
}
.ticker-scroll .sep { color: rgba(255,255,255,.2); }
.ticker-scroll:hover { animation-play-state: paused; }

/* ── CATEGORIES GRID ──────────────────────────────────────── */
.categories-section { padding: var(--section-pad) 0; background: var(--bg-secondary); }
.categories-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-card {
  background: #fff; border-radius: 16px; padding: 24px 22px;
  border: 1.5px solid var(--border-light); cursor: pointer;
  transition: box-shadow 0.25s ease,
              border-color 0.2s,
              transform 0.2s ease;
  position: relative; overflow: hidden;
}
.cat-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent-subtle) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}
.cat-card::after {
  content: '';
  position: absolute; right: 18px; bottom: 18px;
  width: 24px; height: 24px;
  background: var(--accent-subtle);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
  transform: translate3d(-6px, 6px, 0);
}
.cat-card:hover { box-shadow: 0 12px 40px rgba(0,0,0,.1); border-color: var(--accent-border); transform: translateY(-3px); }
.cat-card:hover::before { opacity: 1; }
.cat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent-subtle); border: 1px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; transition: transform 0.2s ease;
  color: var(--accent);
}
.cat-card:hover .cat-icon { transform: scale(1.08); }
.cat-name { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; line-height: 1.3; }
.cat-count { font-size: 12px; color: var(--accent); font-weight: 700; margin-bottom: 12px; }
.cat-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.cat-tags span {
  font-size: 11px; color: var(--text-muted); background: var(--bg-secondary);
  border-radius: 100px; padding: 3px 9px; font-weight: 500;
}
@media (max-width: 900px) { .categories-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .categories-grid { grid-template-columns: 1fr 1fr; } }

/* ── COMPANIES STRIP ──────────────────────────────────────── */
.companies-strip-section { padding: var(--section-pad) 0; background: #fff; }
.companies-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 8px; }
.company-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 18px 8px 8px; border-radius: 100px;
  border: 1.5px solid var(--border-light); background: #fff;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.15s ease;
}
.company-chip:hover { border-color: var(--accent); box-shadow: 0 4px 18px rgba(245,96,10,.12); transform: translate3d(0,-2px,0); }
.chip-av {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff; flex-shrink: 0;
}

/* ── JOBS PAGE: FULL LAYOUT FIX ───────────────────────────── */
/* Remove the top gap so sidebar + grid start right below header */
.jobs-body {
  display: flex !important;
  flex-direction: row;
  min-height: calc(100vh - var(--nav-height) - 170px);
  align-items: stretch;
}

.sidebar-filters {
  width: 272px;
  flex-shrink: 0;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-light);
  padding: 0; /* remove old padding — handled internally */
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) transparent;
}

.sidebar-filters::-webkit-scrollbar { width: 4px; }
.sidebar-filters::-webkit-scrollbar-track { background: transparent; }
.sidebar-filters::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 4px; }

/* Sidebar inner padding wrapper */
.sidebar-inner { padding: 20px 18px; }

/* Sidebar filter header */
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1.5px solid var(--border-light);
}
.sidebar-title {
  font-size: 14px; font-weight: 800; color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 8px;
}
.sidebar-title svg { color: var(--accent); }
.clear-all-btn {
  font-size: 12px; font-weight: 700; color: var(--accent);
  cursor: pointer; background: none; border: none; padding: 4px 8px;
  border-radius: 6px; transition: background 0.15s, color 0.15s;
}
.clear-all-btn:hover { background: var(--accent-subtle); }

.sidebar-section {
  margin-bottom: 24px; padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.sidebar-section-title {
  font-size: 11px; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 12px;
}

/* Checkbox items — premium style */
.checkbox-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 9px; cursor: pointer;
  transition: background 0.12s;
  margin-bottom: 2px;
}
.checkbox-item:hover { background: var(--bg-secondary); }
.checkbox-item input[type="checkbox"] {
  width: 16px; height: 16px; border-radius: 4px; accent-color: var(--accent);
  cursor: pointer; flex-shrink: 0;
}
.checkbox-label {
  flex: 1; font-size: 13px; font-weight: 500; color: var(--text-secondary);
}
.checkbox-count {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  background: var(--bg-secondary); padding: 2px 7px; border-radius: 100px;
  min-width: 28px; text-align: center;
}
.checkbox-item:has(input:checked) .checkbox-label { color: var(--text-primary); font-weight: 700; }
.checkbox-item:has(input:checked) .checkbox-count { background: var(--accent-subtle); color: var(--accent); }

/* Salary range slider */
.range-slider {
  width: 100%; appearance: none; height: 4px;
  background: var(--border-medium); border-radius: 4px; outline: none;
  cursor: pointer; margin: 10px 0 8px;
}
.range-slider::-webkit-slider-thumb {
  appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  box-shadow: 0 2px 8px rgba(245,96,10,0.35);
  transition: transform 0.15s;
}
.range-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.range-labels { display: flex; justify-content: space-between; }
.range-label { font-size: 11px; font-weight: 600; color: var(--text-muted); }
#salary-max-label { color: var(--accent); font-weight: 700; }

/* Skill chips in sidebar */
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.filter-chips .badge {
  cursor: pointer; font-size: 12px; padding: 5px 11px;
  transition: color 0.15 s, background 0.15 s, border-color 0.15 s, box-shadow 0.15 s, transform 0.15 s, opacity 0.15 s;
}
.filter-chips .badge:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── JOBS GRID ────────────────────────────────────────────── */
.jobs-grid {
  flex: 1;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
  align-content: start;
  background: var(--bg-secondary);
}

/* ── JOBS CATEGORY TABS ───────────────────────────────────── */
.jobs-cat-tabs {
  display: flex; align-items: center; gap: 6px; overflow-x: auto;
  padding: 12px 0 0; scrollbar-width: none;
}
.jobs-cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 100px;
  border: 1.5px solid var(--border-light); background: #fff;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease; white-space: nowrap;
}
.cat-tab svg { flex-shrink: 0; }
.cat-tab:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }
.cat-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.cat-tab.active svg { stroke: #fff; }

/* ── JOB CARD — FAST & PREMIUM ────────────────────────────── */
.job-card {
  background: var(--bg-primary);
  border: 1.5px solid var(--border-light);
  border-radius: 16px;
  padding: 20px 22px;
  cursor: pointer;
  /* Only compositor-friendly properties */
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  position: relative;
  overflow: hidden;
  contain: layout style;
}
.job-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), #ff8c42);
  opacity: 0;
  transition: opacity 0.15s ease;
  will-change: opacity;
}
.job-card:hover { border-color: rgba(245,96,10,0.3); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.09); }
.job-card:hover::before { opacity: 1; }
.job-card.featured { border-color: var(--accent-border); }
.job-card.featured::before { opacity: 1; }

/* Company logo upgrade */
.company-logo {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--bg-secondary); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-primary); font-size: 16px; font-weight: 800;
  color: var(--text-primary); flex-shrink: 0;
  border: 1.5px solid var(--border-light); letter-spacing: -0.02em;
  transition: box-shadow 0.15s;
}
.job-card:hover .company-logo { box-shadow: 0 4px 12px rgba(0,0,0,.1); }

/* Apply button on card hover */
.job-card-apply-btn {
  position: absolute; top: 16px; right: 16px;
  padding: 6px 14px; background: var(--accent); color: #fff;
  border: none; border-radius: 8px; font-size: 12px; font-weight: 700;
  cursor: pointer; opacity: 0; transform: translate3d(8px, 0, 0);
  transition: opacity 0.2s, transform 0.2s ease;
  letter-spacing: -0.01em;
}
.job-card:hover .job-card-apply-btn { opacity: 1; transform: translate3d(0,0,0); }
.job-card .bookmark-btn { position: absolute; top: 16px; right: 16px; }
.job-card:hover .bookmark-btn { opacity: 0; }

/* Skill tag upgrade */
.skill-tag {
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  background: var(--bg-secondary); padding: 3px 10px;
  border-radius: var(--radius-xs); border: 1px solid var(--border-light);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.job-card:hover .skill-tag { border-color: var(--accent-border); color: var(--accent); background: var(--accent-subtle); }

/* ── EMPTY STATE UPGRADE ──────────────────────────────────── */
.no-jobs-state {
  grid-column: 1 / -1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 80px 24px;
  text-align: center;
}
.no-jobs-icon {
  width: 72px; height: 72px; border-radius: 18px;
  background: var(--bg-secondary); border: 1.5px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; color: var(--text-muted);
}

/* ── SECTION HEADER ROW ───────────────────────────────────── */
.section-header-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 40px; flex-wrap: wrap;
}

/* ── SALARY INSIGHTS ──────────────────────────────────────── */
.salary-section-home { padding: var(--section-pad) 0; background: #0d0d0d; color: #fff; }
.salary-table { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; }
.sal-row { display: flex; align-items: center; gap: 16px; }
.sal-role { font-size: 14px; font-weight: 600; color: rgba(255,255,255,.8); min-width: 180px; }
.sal-bar-wrap { flex: 1; background: rgba(255,255,255,.08); border-radius: 100px; height: 6px; overflow: hidden; }
.sal-bar { height: 100%; background: linear-gradient(90deg, var(--accent), #ff8c42); border-radius: 100px; transition: width 0.8s cubic-bezier(.4,0,.2,1); }
.sal-amount { font-size: 13px; font-weight: 700; color: var(--accent); min-width: 110px; text-align: right; }

/* ── NAV ─────────────────────────────────────────────────── */
.navbar.scrolled { box-shadow: 0 2px 24px rgba(0,0,0,.09); }

/* ── FOOTER ──────────────────────────────────────────────── */
.footer-nav-btn { cursor: pointer; }
.footer-nav-btn:hover { color: var(--accent); border-color: rgba(245,96,10,.3); }

/* ── BADGE FILTER ROW ─────────────────────────────────────── */
.jobs-filters-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 10px; }
.jobs-filters-row .badge { display: inline-flex; align-items: center; gap: 6px; }

/* Active filter count bubble */
.filter-count {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 800;
}

/* ── RESULTS COUNT ────────────────────────────────────────── */
.results-count { font-size: 13px; color: var(--text-muted); }
.results-count strong { color: var(--text-primary); font-weight: 800; }

/* ── STATS 4-column ──────────────────────────────────────── */
.stats-grid { grid-template-columns: repeat(4, 1fr) !important; }
@media (max-width: 700px) { .stats-grid { grid-template-columns: repeat(2,1fr) !important; } }

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .jobs-body { flex-direction: column; }
  .sidebar-filters { width: 100%; position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border-light); }
  .jobs-grid { padding: 16px; }
}
@media (max-width: 768px) {
  .hero-search-box-adv { flex-direction: column; border-radius: 14px; }
  .hsb-sep { width: 100%; height: 1px; }
  .hsb-field { padding: 14px 16px; width: 100%; }
  .hero-search-box-adv .btn-accent { border-radius: 0 0 12px 12px; width: 100%; justify-content: center; }
  .mega-menu { display: none; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-card { padding: 16px 14px; }
  .section-header-row { flex-direction: column; align-items: flex-start; }
}

/* ── PERFORMANCE: CSS containment ─────────────────────────── */
.jobs-grid { contain: layout; }
.sidebar-filters { contain: layout style; }
.navbar { contain: layout style; }
.live-ticker-bar { contain: layout; }

/* ── Hero tags: no animation, just static ─────────────────── */
.hero-tag-item { will-change: auto; }
/* REMOVED: float animation (was running 12 concurrent animations) */

/* ── Reduce motion for accessibility + perf ──────────────────*/
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Ensure all transitions stay fast ────────────────────── */
.cat-card { transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; }
.company-chip { transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; }
.badge { transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease; }
.btn { transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, transform 0.1s ease, color 0.12s ease; }
.nav-link { transition: color 0.12s ease, background 0.12s ease; }
.cat-tab { transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease; }

/* ── Job card apply button - simple opacity only ──────────── */
.job-card-apply-btn {
  position: absolute; top: 16px; right: 16px;
  padding: 6px 14px; background: var(--accent); color: #fff;
  border: none; border-radius: 8px; font-size: 12px; font-weight: 700;
  cursor: pointer; opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.job-card:hover .job-card-apply-btn { opacity: 1; pointer-events: auto; }
.job-card:hover .bookmark-btn { opacity: 0; }

/* ── Skill tag simple hover ───────────────────────────────── */
.skill-tag {
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.job-card:hover .skill-tag { border-color: var(--accent-border); color: var(--accent); background: var(--accent-subtle); }

/* ── content-visibility: speed up paint of off-screen sections ── */
.categories-section,
.companies-strip-section,
.features-section,
.bot-section,
.footer {
  content-visibility: auto;
  contain-intrinsic-size: 0 600px;
}

/* ── Hero animation: shorten delays ────────────────────────── */
.hero-eyebrow    { animation-duration: 0.4s !important; }
.hero-headline   { animation-duration: 0.4s !important; animation-delay: 0.08s !important; }
.hero-subtext    { animation-duration: 0.4s !important; animation-delay: 0.16s !important; }
.hero-search-area { animation-duration: 0.4s !important; animation-delay: 0.24s !important; }

/* ── Mega menu: instant transition ─────────────────────────── */
.mega-menu { transition: opacity 0.15s ease, transform 0.15s ease; }

/* ── No box-shadow on scroll (expensive) ───────────────────── */
.navbar.scrolled { box-shadow: 0 1px 0 var(--border-light); }
