<!DOCTYPE html>
<html lang="en-IN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no, viewport-fit=cover">
<meta name="google-site-verification" content="NWQpIY44hWfH_Ly_x_yDspwPP1UigMmtRlrmMTtUp7g" />

<!-- Primary SEO -->
<title>Sarkari Naukri 2026 — Last Date, All India Recruitment 2026 | NaukriKhoj.in</title>
<meta name="description" content="Sarkari Naukri 2026 — All India & Maharashtra Recruitment 2026 ki Last Date, Days Left dekho. Railway, Bank, SSC, UPSC, Police, MPSC Bharti updates. Free Sarkari Naukri updates in Hindi, Marathi & English with official source links.">
<meta name="author" content="NaukriKhoj.in">
<meta name="robots" content="index, follow" id="meta-robots">
<meta name="language" content="English, Marathi">
<meta name="revisit-after" content="1 days">
<meta name="rating" content="general">

<!-- Canonical -->
<link rel="canonical" href="https://naukrikhoj.in/" id="canonical-url">
<link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml">
<!-- Hreflang for multilingual -->
<link rel="alternate" hreflang="en-IN" href="https://naukrikhoj.in/">
<link rel="alternate" hreflang="mr" href="https://naukrikhoj.in/">
<link rel="alternate" hreflang="x-default" href="https://naukrikhoj.in/">

<!-- Open Graph -->
<meta property="og:title" content="NaukriKhoj.in | Maharashtra Sarkari Job Update 2026 | Latest Posts & Free Alerts">
<meta property="og:description" content="Maharashtra Sarkari Job Update 2026 — Railway, Bank, SSC, UPSC, Police, MPSC Bharti. Sarkari Naukri Free Alerts in Hindi, Marathi & English. Admit Card, Result bhi.">
<meta property="og:url" content="https://naukrikhoj.in/">
<meta property="og:type" content="website">
<meta property="og:site_name" content="NaukriKhoj.in">
<meta property="og:locale" content="en_IN">
<meta property="og:image" content="https://naukrikhoj.in/og-image.png">

<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="NaukriKhoj.in | Maharashtra Sarkari Job Update 2026 | Latest Posts & Free Alerts">
<meta name="twitter:description" content="Maharashtra Sarkari Job Update, Sarkari Naukri 2026 — Free job updates in Hindi, Marathi & English with official source links.">
<meta name="twitter:image" content="https://naukrikhoj.in/og-image.png">

<!-- Schema.org Structured Data -->
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "NaukriKhoj.in",
  "url": "https://naukrikhoj.in/",
  "description": "Maharashtra Sarkari Jobs, सरकारी नौकरी, सरकारी नोकरी aur latest government jobs updates 2026",
  "inLanguage": ["en", "mr"],
  "potentialAction": {
    "@type": "SearchAction",
    "target": "https://naukrikhoj.in/?q={search_term_string}",
    "query-input": "required name=search_term_string"
  }
}
</script>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "NaukriKhoj.in",
  "url": "https://naukrikhoj.in/",
  "logo": "https://naukrikhoj.in/logo.png",
  "sameAs": [],
  "contactPoint": {
    "@type": "ContactPoint",
    "email": "contact@naukrikhoj.in",
    "contactType": "customer service"
  }
}
</script>
<!-- FAQ Schema - aligned with visible FAQ content -->
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "NaukriKhoj.in pe konsi sarkari naukri milti hai?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "NaukriKhoj.in par Railway, Bank, SSC, UPSC, Police, Army, Teaching, Medical aur Maharashtra State Government jobs ki latest vacancy information milti hai. Maharashtra ke liye MPSC, Police Bharti, Zilla Parishad, Nagar Parishad aur Mahanagar Palika jobs bhi cover kiye jate hain."
      }
    },
    {
      "@type": "Question",
      "name": "Government job ke liye apply karne ki last date kaise pata chalegi?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Har job listing me important dates, last date, eligibility, vacancy details aur official apply link diya jata hai. Apply karne se pehle official notification aur official website par details verify karna zaroori hai."
      }
    },
    {
      "@type": "Question",
      "name": "Free job alerts kaise subscribe karein?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Job alert preference site par save ki ja sakti hai. During review period, email preference browser me locally save hoti hai. Server-side email alerts launch hone par privacy policy update ki jayegi."
      }
    }
  ]
}
</script>

<!-- BreadcrumbList Schema -->
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {"@type": "ListItem", "position": 1, "name": "Home", "item": "https://naukrikhoj.in/"},
    {"@type": "ListItem", "position": 2, "name": "Latest Jobs", "item": "https://naukrikhoj.in/latest-jobs"},
    {"@type": "ListItem", "position": 3, "name": "Blog", "item": "https://naukrikhoj.in/blog"}
  ]
}
</script>

<!-- Performance & Additional SEO -->
<meta name="theme-color" content="#0B1F3A">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="format-detection" content="telephone=no">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="dns-prefetch" href="https://www.googletagmanager.com">

<script async src="https://www.googletagmanager.com/gtag/js?id=G-SKVWSRRE5S"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-SKVWSRRE5S');
</script>
<!-- Google Fonts — non-render-blocking -->
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=DM+Sans:wght@300;400;500;600;700&display=swap" as="style" onload="this.onload=null;this.rel='stylesheet'">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=DM+Sans:wght@300;400;500;600;700&display=swap" media="print" onload="this.media='all'">
<noscript><link href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=DM+Sans:wght@300;400;500;600;700&display=swap" rel="stylesheet"></noscript>

<!-- Initial route marker: prevents homepage content from flashing on standalone pages -->
<script>
(function(){
  var p = (window.location.pathname || '/').replace(/\/+$/, '') || '/';
  var map = {
    '/':'home',
    '/latest-jobs':'latest',
    '/results':'results',
    '/admit-card':'admitcard',
    '/blog':'blog',
    '/about':'about',
    '/contact':'contact',
    '/privacy':'privacy',
    '/disclaimer':'disclaimer'
  };
  var r = map[p] || (p.indexOf('/blog/') === 0 ? 'blog-detail' : (p.indexOf('/job/') === 0 || p.indexOf('/mr/') === 0 ? 'detail' : 'home'));
  document.documentElement.setAttribute('data-initial-route', r);
})();
</script>
<style>
:root {
  --navy: #0B1F3A; --navy2: #163560;
  --saffron: #E8470A; --saffron2: #FF6B2B;
  --gold: #F5C842; --green: #00875A; --red: #DC2626;
  --white: #fff; --bg: #F4F7FC; --border: #E2E8F4;
  --text: #0D1B2E; --muted: #64748b;
  --glass: rgba(255,255,255,0.72);
  --glass-border: rgba(255,255,255,0.55);
  --glass-shadow: 0 8px 32px rgba(11,31,58,0.10);
  --shadow-xs: 0 1px 4px rgba(11,31,58,0.06);
  --shadow-sm: 0 2px 12px rgba(11,31,58,0.08);
  --shadow-md: 0 8px 32px rgba(11,31,58,0.11);
  --shadow-lg: 0 20px 60px rgba(11,31,58,0.14);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
}
* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  font-family:'DM Sans',sans-serif;
  background: #EEF2FA;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(232,71,10,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(22,53,96,0.07) 0%, transparent 60%);
  background-attachment: fixed;
  color:var(--text); overflow-x:hidden;
  min-height:100vh;
  display:block !important;
  opacity:1 !important;
  visibility:visible !important;
}
a { text-decoration:none; color:inherit; }

/* TRICOLOR */
.tricolor { height:4px; background:linear-gradient(90deg,#FF9933 33%,#fff 33%,#fff 66%,#138808 66%); }

/* TICKER */
.ticker-wrap {
  background:linear-gradient(90deg,#0D1B2E 0%,#163560 50%,#0D1B2E 100%);
  padding:7px 0; overflow:hidden; white-space:nowrap;
  border-bottom:1px solid rgba(255,255,255,0.06);
}
.ticker { display:inline-block; animation:tick 38s linear infinite; font-size:0.78rem; font-weight:500; color:rgba(255,255,255,0.8); letter-spacing:0.2px; }
.ticker span { margin:0 32px; }
.ticker span::before { content:'◆  '; color:var(--saffron); font-size:0.5rem; vertical-align:middle; }
.ticker a { color:#fff; font-weight:700; cursor:pointer; border-bottom:1px dotted rgba(255,255,255,0.4); }
.ticker a:hover { color:var(--gold); }
@keyframes tick { from{transform:translateX(100vw)} to{transform:translateX(-100%)} }

/* NAV - frosted glass — FIXED on all devices */
nav {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 0 5%;
  display:flex; align-items:center; justify-content:space-between;
  box-shadow: 0 1px 0 rgba(11,31,58,0.08), 0 4px 24px rgba(11,31,58,0.06);
  border-bottom: 1px solid rgba(226,232,244,0.8);
  position:fixed; top:0; left:0; right:0; z-index:1000; height:66px;
  flex-direction:row; flex-wrap:nowrap; gap:16px;
}
/* Push body content below fixed nav */
body { padding-top:66px; }
.logo { display:flex; align-items:center; gap:11px; cursor:pointer; flex-shrink:0; }
.logo-icon {
  width:42px; height:42px;
  background: linear-gradient(145deg,#0B1F3A,#2255a4);
  border-radius:11px;
  display:flex; align-items:center; justify-content:center; font-size:1.2rem;
  box-shadow: 0 4px 14px rgba(11,31,58,0.28), inset 0 1px 0 rgba(255,255,255,0.15);
}
.logo-text { font-family:'Rajdhani',sans-serif; font-weight:700; font-size:1.5rem; color:var(--navy); white-space:nowrap; letter-spacing:-0.3px; }
.logo-text span { color:var(--saffron); }
.nav-links { display:flex; list-style:none; gap:1px; align-items:center; flex-wrap:nowrap; }
.nav-links a {
  padding:8px 14px; border-radius:9px; font-size:0.86rem; font-weight:500;
  color:#475569; transition:all 0.18s; white-space:nowrap; position:relative;
  text-decoration:none;
}
.nav-links a:hover { background:rgba(232,71,10,0.07); color:var(--saffron); text-decoration:underline; }
.nav-links a:focus-visible { outline:2px solid var(--saffron); outline-offset:2px; border-radius:6px; }
.nav-actions { display:flex; gap:8px; align-items:center; }
.btn {
  padding:9px 20px; border-radius:9px; font-size:0.86rem; font-weight:600;
  cursor:pointer; border:none; font-family:'DM Sans',sans-serif; transition:all 0.2s;
  letter-spacing:0.1px;
}
.btn-outline { background:transparent; border:1.5px solid rgba(11,31,58,0.18); color:var(--navy); }
.btn-outline:hover { background:var(--navy); color:#fff; transform:translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg,var(--saffron) 0%,var(--saffron2) 100%);
  color:#fff;
  box-shadow: 0 3px 12px rgba(232,71,10,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:hover { transform:translateY(-2px); box-shadow: 0 6px 20px rgba(232,71,10,0.4); }
/* TRILINGUAL SECTIONS */
.lang-block { border-radius:0; padding:0; margin-bottom:0; }
.lang-header { display:flex; align-items:center; gap:8px; padding:10px 14px; background:var(--bg); border-bottom:1px solid var(--border); }
.lang-flag { font-size:1rem; }
.lang-label { font-family:'Rajdhani',sans-serif; font-size:0.88rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:0.5px; }

#home-page { display:block; }
#detail-page { display:none; }
#latest-page { display:none; }
#results-page { display:none; }
#admitcard-page { display:none; }
.lj-list { max-width:860px; margin:0 auto; padding:32px 4% 60px; }
.lj-header { font-family:'Rajdhani',sans-serif; font-size:1.8rem; font-weight:700; color:var(--navy); margin-bottom:20px; }
.lj-row {
  display:flex; align-items:center; gap:12px; padding:14px 18px;
  background:#fff; border:1.5px solid var(--border); border-radius:12px;
  margin-bottom:8px; cursor:pointer; transition:all 0.22s;
  text-decoration:none; box-shadow:var(--shadow-sm);
}
.lj-row:hover { border-color:var(--saffron); box-shadow:0 6px 20px rgba(232,71,10,0.12); transform:translateX(5px); }
.lj-row-expired { /* expired but shown normally */ }
.lj-row-expired:hover { }

/* Page load animation */
@keyframes fadeInUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
.jcard { animation:fadeInUp 0.35s ease both; }
.jcard:nth-child(1){animation-delay:0.05s}
.jcard:nth-child(2){animation-delay:0.1s}
.jcard:nth-child(3){animation-delay:0.15s}
.jcard:nth-child(4){animation-delay:0.2s}
.jcard:nth-child(5){animation-delay:0.25s}
.lj-icon { font-size:1.4rem; flex-shrink:0; }
.lj-info { flex:1; }
.lj-title { font-weight:700; color:var(--navy); font-size:0.95rem; }
.lj-meta { font-size:0.8rem; color:var(--muted); margin-top:2px; }
.lj-date { font-size:0.8rem; font-weight:600; color:var(--saffron); white-space:nowrap; }
.lj-meta-row { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin-top:3px; }
.lj-days-badge { display:inline-block; font-size:0.69rem; font-weight:700; padding:2px 9px; border-radius:20px; white-space:nowrap; flex-shrink:0; }
.lj-badge-red    { background:rgba(220,38,38,0.1); color:#DC2626; border:1px solid rgba(220,38,38,0.2); animation:blink-red 1s step-start infinite; }
.lj-badge-orange { background:rgba(232,71,10,0.1); color:#E8470A; border:1px solid rgba(232,71,10,0.2); }
.lj-badge-yellow { background:rgba(217,119,6,0.1); color:#B45309; border:1px solid rgba(217,119,6,0.2); }
/* ===== HERO - Glassmorphism Light ===== */
.hero {
  background: linear-gradient(145deg, #0D1B2E 0%, #162847 45%, #1a3a6e 80%, #0f2545 100%);
  padding:64px 5% 80px; position:relative; overflow:hidden;
}
.hero::before {
  content:''; position:absolute; left:-80px; bottom:-80px; width:500px; height:500px;
  background:radial-gradient(circle,rgba(232,71,10,0.14) 0%,transparent 65%); pointer-events:none;
}
.hero::after {
  content:''; position:absolute; right:-80px; top:-80px; width:520px; height:520px;
  background:radial-gradient(circle,rgba(245,200,66,0.07) 0%,transparent 60%); pointer-events:none;
}
.hero-dots {
  position:absolute; inset:0; pointer-events:none;
  background-image:radial-gradient(circle,rgba(255,255,255,0.055) 1px,transparent 1px);
  background-size:28px 28px;
}
.hero-badge {
  display:inline-flex; align-items:center; gap:8px;
  background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.16);
  color:rgba(255,255,255,0.9); padding:6px 18px; border-radius:50px;
  font-size:0.75rem; font-weight:600; margin-bottom:22px; backdrop-filter:blur(8px); letter-spacing:0.3px;
  font-size:0.75rem; font-weight:600; margin-bottom:22px; -webkit-backdrop-filter:blur(8px); letter-spacing:0.3px;
}
.badge-dot { width:6px; height:6px; background:var(--gold); border-radius:50%; animation:pulse 1.8s infinite; box-shadow:0 0 6px var(--gold); }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.8)} }
.hero h1 {
  font-family:'Rajdhani',sans-serif; font-size:clamp(2rem,4.2vw,3.4rem);
  font-weight:700; color:#fff; line-height:1.12; margin-bottom:14px; letter-spacing:-0.5px;
}
.hero h1 .acc {
  background:linear-gradient(135deg,#FF6B2B,#FF9F00);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text;
}
.hero p { color:rgba(255,255,255,0.65); font-size:0.97rem; margin-bottom:32px; max-width:540px; line-height:1.75; font-weight:400; }
.search-box {
  background:rgba(255,255,255,0.97); backdrop-filter:blur(16px);
  background:rgba(255,255,255,0.97); -webkit-backdrop-filter:blur(16px);
  border-radius:var(--radius); padding:7px; display:flex; gap:6px; max-width:760px;
  box-shadow:0 24px 64px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.12), inset 0 1px 0 rgba(255,255,255,0.9);
}
.sg { flex:1; display:flex; align-items:center; gap:10px; padding:9px 14px; border-right:1px solid rgba(226,232,244,0.8); }
.sg:last-of-type { border-right:none; }
.sg .si { color:var(--saffron); font-size:1rem; flex-shrink:0; }
.sg input,.sg select { border:none; outline:none; font-size:0.88rem; color:var(--text); width:100%; font-family:'DM Sans',sans-serif; background:transparent; }
.search-go {
  background:linear-gradient(135deg,#E8470A 0%,#FF6B2B 100%); color:#fff; border:none;
  padding:12px 28px; border-radius:11px; font-size:0.92rem; font-weight:700; cursor:pointer;
  font-family:'DM Sans',sans-serif; white-space:nowrap; transition:all 0.22s; letter-spacing:0.2px;
  box-shadow:0 4px 16px rgba(232,71,10,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}
.search-go:hover { transform:translateY(-2px); box-shadow:0 8px 28px rgba(232,71,10,0.5); }
.hero-stats { display:flex; gap:12px; margin-top:30px; flex-wrap:wrap; }
.hstat {
  padding:12px 20px; background:rgba(255,255,255,0.07);
  border:1px solid rgba(255,255,255,0.12); border-radius:12px; backdrop-filter:blur(6px); transition:background 0.2s;
  border:1px solid rgba(255,255,255,0.12); border-radius:12px; -webkit-backdrop-filter:blur(6px); transition:background 0.2s;
}
.hstat:hover { background:rgba(255,255,255,0.12); }
.hstat-num { font-family:'Rajdhani',sans-serif; font-size:1.55rem; font-weight:700; color:#fff; line-height:1; }
.hstat-label { font-size:0.68rem; color:rgba(255,255,255,0.5); margin-top:3px; text-transform:uppercase; letter-spacing:0.5px; }

/* CATEGORY STRIP */
.cat-strip {
  background:rgba(255,255,255,0.82); backdrop-filter:blur(12px);
  background:rgba(255,255,255,0.82); -webkit-backdrop-filter:blur(12px);
  border-bottom:1px solid var(--border); padding:0 5%; overflow-x:auto; scrollbar-width:none;
  box-shadow:0 2px 8px rgba(11,31,58,0.04);
}
.cat-strip::-webkit-scrollbar { display:none; }
.cat-inner { display:flex; gap:6px; padding:10px 0; white-space:nowrap; }
.cpill {
  display:inline-flex; align-items:center; gap:6px; padding:7px 16px; border-radius:50px;
  font-size:0.82rem; font-weight:600; cursor:pointer;
  border:1.5px solid rgba(226,232,244,0.9); color:#475569;
  background:rgba(255,255,255,0.7); transition:all 0.18s; font-family:'DM Sans',sans-serif;
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
}
.cpill:hover { border-color:rgba(232,71,10,0.4); color:var(--saffron); background:#fff; box-shadow:0 2px 10px rgba(232,71,10,0.1); }
.cpill.active { background:linear-gradient(135deg,var(--saffron),var(--saffron2)); color:#fff; border-color:transparent; box-shadow:0 3px 12px rgba(232,71,10,0.3); }
.cpill .cnt { background:rgba(0,0,0,0.08); padding:1px 6px; border-radius:50px; font-size:0.7rem; }
.cpill.active .cnt { background:rgba(255,255,255,0.25); }

/* MAIN LAYOUT */
.main { padding:36px 5%; display:grid; grid-template-columns:1fr 300px; gap:26px; max-width:1280px; margin:0 auto; }
.jlist-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; }
.jlist-title { font-family:'Rajdhani',sans-serif; font-size:1.25rem; font-weight:700; color:var(--navy); }
.jcount {
  background:linear-gradient(135deg,var(--saffron),var(--saffron2)); color:#fff;
  font-size:0.71rem; font-weight:700; padding:3px 10px; border-radius:50px; margin-left:8px;
  box-shadow:0 2px 8px rgba(232,71,10,0.25);
}

/* JOB CARDS — glass style */
@keyframes fadeUp { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }
.jcard {
  background:rgba(255,255,255,0.92); backdrop-filter:blur(8px);
  background:rgba(255,255,255,0.92); -webkit-backdrop-filter:blur(8px);
  border:1px solid rgba(226,232,244,0.9);
  border-radius:var(--radius); padding:20px; margin-bottom:14px; cursor:pointer;
  transition:all 0.26s cubic-bezier(0.4,0,0.2,1);
  position:relative; overflow:hidden;
  box-shadow:var(--shadow-xs);
  animation:fadeUp 0.32s ease both;
}
.jcard:nth-child(1){animation-delay:0.04s}
.jcard:nth-child(2){animation-delay:0.09s}
.jcard:nth-child(3){animation-delay:0.14s}
.jcard:nth-child(4){animation-delay:0.19s}
.jcard:nth-child(5){animation-delay:0.24s}
.jcard::before {
  content:''; position:absolute; left:0; top:0; bottom:0; width:4px;
  background:transparent; transition:background 0.25s; border-radius:4px 0 0 4px;
}

.jcard:hover {
  border-color:rgba(232,71,10,0.2);
  box-shadow:0 12px 40px rgba(11,31,58,0.1), 0 2px 8px rgba(232,71,10,0.06);
  transform:translateY(-3px); background:#fff;
}
.jcard:hover::before,.jcard.featured::before { background:linear-gradient(180deg,var(--saffron),var(--saffron2)); }
.jcard.featured { border-color:rgba(232,71,10,0.18); background:linear-gradient(170deg,#fff 80%,#fff8f6 100%); }
.jc-top { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:12px; }
.jc-left { display:flex; gap:13px; }
.dept-ico {
  width:52px; height:52px; border-radius:14px; display:flex; align-items:center;
  justify-content:center; font-size:1.4rem;
  border:1.5px solid rgba(226,232,244,0.9); background:var(--bg); flex-shrink:0;
  box-shadow:0 4px 14px rgba(11,31,58,0.08);
  transition:transform 0.22s ease, box-shadow 0.22s ease;
  padding:8px;
}
.jcard:hover .dept-ico { transform:scale(1.08); box-shadow:0 6px 20px rgba(11,31,58,0.15); }
.jc-title { font-size:0.97rem; font-weight:700; color:var(--navy); margin-bottom:3px; line-height:1.4; }
.jc-org { font-size:0.8rem; color:var(--muted); }
.jc-org b { color:#2255a4; }
.badge { font-size:0.67rem; font-weight:700; padding:3px 10px; border-radius:50px; white-space:nowrap; }
.b-new { background:rgba(0,135,90,0.1); color:var(--green); border:1px solid rgba(0,135,90,0.15); }
.b-hot { background:rgba(220,38,38,0.08); color:var(--red); border:1px solid rgba(220,38,38,0.15); }
.b-feat { background:rgba(232,71,10,0.08); color:var(--saffron); border:1px solid rgba(232,71,10,0.15); }
.b-close { background:rgba(245,200,66,0.15); color:#8a6600; border:1px solid rgba(245,200,66,0.25); }
.jc-meta { display:flex; flex-wrap:wrap; gap:14px; margin:10px 0; }
.jmeta { display:flex; align-items:center; gap:4px; font-size:0.78rem; color:var(--muted); }
.jmeta b { color:var(--text); font-weight:600; }
.jc-tags { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:12px; }
.tag {
  background:rgba(244,247,252,0.9); color:#475569; font-size:0.72rem;
  padding:3px 10px; border-radius:5px; border:1px solid rgba(226,232,244,0.9);
}
.jc-foot { display:flex; justify-content:space-between; align-items:center; padding-top:12px; border-top:1px solid rgba(226,232,244,0.7); }
.jdate { font-size:0.75rem; color:var(--muted); }
.jdeadline { font-size:0.75rem; font-weight:600; }
.jdeadline.urg  { color:#DC2626; }
.jdeadline.warn { color:#D97706; }
.jdeadline.ok   { color:#00875A; }
.deadline-badge { display:inline-block; padding:2px 8px; border-radius:50px; font-size:0.68rem; font-weight:800; margin-left:6px; vertical-align:middle; }
.db-red    { color:#DC2626; animation:blink-red 1s step-start infinite; }
.db-yellow { color:#D97706; animation:blink-yellow 1.2s step-start infinite; }
.db-green  { color:#00875A; }
@keyframes blink-red    { 0%,100%{opacity:1} 50%{opacity:0} }
@keyframes blink-yellow { 0%,100%{opacity:1} 50%{opacity:0.2} }

/* VIEW BUTTON */
.view-btn {
  background:linear-gradient(135deg,var(--navy),var(--navy2)); color:#fff; border:none;
  padding:7px 18px; border-radius:8px; font-size:0.82rem; font-weight:600; cursor:pointer;
  font-family:'DM Sans',sans-serif; transition:all 0.22s;
  box-shadow:0 2px 8px rgba(11,31,58,0.18);
}
.view-btn:hover { background:linear-gradient(135deg,var(--saffron),var(--saffron2)); transform:translateY(-1px); box-shadow:0 4px 14px rgba(232,71,10,0.3); }

/* SIDEBAR CARDS */
.alert-card {
  background:linear-gradient(145deg,#0D1B2E,#162847,#1a3a6e);
  border-radius:var(--radius); padding:22px; color:#fff; margin-bottom:16px;
  position:relative; overflow:hidden;
  box-shadow:var(--shadow-md);
  border:1px solid rgba(255,255,255,0.06);
}
.alert-card::after {
  content:''; position:absolute; right:-24px; bottom:-24px; width:110px; height:110px;
  background:radial-gradient(circle,rgba(232,71,10,0.28),transparent 70%); pointer-events:none;
}
.alert-card h3 { font-family:'Rajdhani',sans-serif; font-size:1.1rem; font-weight:700; margin-bottom:6px; }
.alert-card p { font-size:0.8rem; color:rgba(255,255,255,0.6); margin-bottom:14px; line-height:1.6; }
.alert-input {
  width:100%; padding:10px 14px; border-radius:9px; border:none; outline:none;
  font-size:0.85rem; font-family:'DM Sans',sans-serif; margin-bottom:8px;
  box-shadow:0 2px 8px rgba(0,0,0,0.18); background:#fff;
}
.alert-btn {
  width:100%; background:linear-gradient(135deg,var(--saffron),var(--saffron2));
  color:#fff; border:none; padding:10px; border-radius:9px; font-weight:700;
  cursor:pointer; font-family:'DM Sans',sans-serif; font-size:0.85rem;
  transition:all 0.2s; box-shadow:0 4px 14px rgba(232,71,10,0.35);
}
.alert-btn:hover { transform:translateY(-1px); box-shadow:0 6px 20px rgba(232,71,10,0.45); }
.scard {
  background:rgba(255,255,255,0.9); backdrop-filter:blur(10px);
  background:rgba(255,255,255,0.9); -webkit-backdrop-filter:blur(10px);
  border:1px solid rgba(226,232,244,0.9); border-radius:var(--radius);
  padding:18px; margin-bottom:16px; box-shadow:var(--shadow-xs);
}
.stitle { font-family:'Rajdhani',sans-serif; font-size:0.98rem; font-weight:700; color:var(--navy); margin-bottom:14px; }
.dl-item { display:flex; gap:11px; padding:9px 0; border-bottom:1px solid var(--border); cursor:pointer; }
.dl-item:last-child { border-bottom:none; }
.dl-item:hover .dl-t { color:var(--saffron); }
.dl-date { min-width:42px; text-align:center; background:var(--bg); border-radius:7px; padding:5px 3px; border:1px solid var(--border); }
.dl-d { font-family:'Rajdhani',sans-serif; font-size:1.1rem; font-weight:700; color:var(--navy); line-height:1; }
.dl-m { font-size:0.62rem; color:var(--muted); font-weight:600; text-transform:uppercase; }
.dl-t { font-size:0.81rem; font-weight:600; color:var(--text); margin-bottom:2px; line-height:1.3; }
.dl-s { font-size:0.71rem; color:var(--muted); }
.state-dropdown { width:100%; padding:9px 12px; border:1.5px solid var(--border); border-radius:9px; font-size:0.86rem; font-family:'DM Sans',sans-serif; outline:none; color:var(--text); background:#fff; cursor:pointer; transition:border-color 0.2s; }
.state-dropdown:focus { border-color:var(--saffron); }
.useful-tools-sidebar-card { padding:18px; }
.tool-shortcut-list { display:flex; flex-direction:column; gap:10px; }
.tool-shortcut-item {
  background:rgba(244,247,252,0.9);
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
}
.tool-shortcut-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:5px; }
.tool-shortcut-name { font-size:0.84rem; font-weight:700; color:var(--navy); line-height:1.35; }
.tool-shortcut-desc { font-size:0.75rem; color:var(--muted); line-height:1.55; }
.tool-chip {
  display:inline-flex; align-items:center; justify-content:center;
  font-size:0.63rem; font-weight:800; text-transform:uppercase; letter-spacing:0.35px;
  padding:3px 8px; border-radius:20px;
  background:rgba(232,71,10,0.08); color:var(--saffron); border:1px solid rgba(232,71,10,0.14);
  flex-shrink:0;
}
.mobile-tools-section { display:none; }
.mobile-tools-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.mobile-tool-card {
  background:#fff; border:1.5px solid var(--border); border-radius:14px; padding:16px;
  box-shadow:var(--shadow-xs);
}
.mobile-tool-icon { font-size:1.45rem; margin-bottom:8px; }
.mobile-tool-title { font-family:'Rajdhani',sans-serif; font-size:1rem; font-weight:700; color:var(--navy); margin-bottom:5px; line-height:1.2; }
.mobile-tool-desc { font-size:0.8rem; color:var(--muted); line-height:1.6; margin-bottom:10px; }
.mobile-tool-note {
  display:inline-flex; align-items:center; gap:6px;
  font-size:0.69rem; font-weight:700; color:var(--saffron);
  background:rgba(232,71,10,0.06); border:1px solid rgba(232,71,10,0.12);
  border-radius:20px; padding:4px 10px;
}


.tool-shortcut-item { transition:all 0.2s ease; cursor:pointer; }
.tool-shortcut-item:hover { border-color:rgba(232,71,10,0.28); box-shadow:0 8px 20px rgba(232,71,10,0.08); transform:translateY(-2px); background:#fff; }
.tool-shortcut-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:10px; }
.tool-launch-btn {
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  background:linear-gradient(135deg,var(--navy),var(--navy2)); color:#fff;
  border:none; border-radius:9px; padding:8px 14px; cursor:pointer;
  font-family:'DM Sans',sans-serif; font-size:0.78rem; font-weight:700; transition:all 0.2s;
  box-shadow:0 4px 12px rgba(11,31,58,0.18);
}
.tool-launch-btn:hover { transform:translateY(-1px); background:linear-gradient(135deg,var(--saffron),var(--saffron2)); box-shadow:0 8px 22px rgba(232,71,10,0.22); }
.mobile-tool-card { transition:all 0.22s ease; cursor:pointer; }
.mobile-tool-card:hover { border-color:rgba(232,71,10,0.28); box-shadow:0 8px 24px rgba(232,71,10,0.08); transform:translateY(-2px); }
.mobile-tool-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:12px; }

.tool-page-wrap { max-width:980px; margin:0 auto; padding:28px 4% 60px; box-sizing:border-box; width:100%; }
.tool-page-hero {
  background:linear-gradient(145deg,#0D1B2E 0%,#163560 55%,#1f4a83 100%);
  border-radius:20px; padding:28px; color:#fff; position:relative; overflow:hidden;
  margin-bottom:22px; box-shadow:var(--shadow-md);
}
.tool-page-hero::after {
  content:''; position:absolute; right:-40px; top:-40px; width:180px; height:180px;
  background:radial-gradient(circle,rgba(232,71,10,0.22),transparent 65%);
}
.tool-page-hero > * { position:relative; z-index:1; }
.tool-kicker {
  display:inline-flex; align-items:center; gap:8px; padding:6px 14px; border-radius:999px;
  background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.16);
  font-size:0.72rem; font-weight:700; letter-spacing:0.35px; text-transform:uppercase; margin-bottom:14px;
}
.tool-hero-title { font-family:'Rajdhani',sans-serif; font-size:clamp(1.8rem,3vw,2.4rem); font-weight:700; line-height:1.1; margin-bottom:8px; }
.tool-hero-desc { font-size:0.92rem; color:rgba(255,255,255,0.75); line-height:1.8; max-width:760px; }
.tool-card {
  background:#fff; border:1.5px solid var(--border); border-radius:18px; padding:22px; box-shadow:var(--shadow-xs); margin-bottom:18px;
}
.tool-card-title { font-family:'Rajdhani',sans-serif; font-size:1.18rem; font-weight:700; color:var(--navy); margin-bottom:14px; }
.tool-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-bottom:14px; }
.tool-form-grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.tool-field { min-width:0; }
.tool-label {
  display:block; font-size:0.76rem; color:var(--muted); font-weight:700; text-transform:uppercase;
  letter-spacing:0.35px; margin-bottom:6px;
}
.tool-input, .tool-select {
  width:100%; padding:11px 13px; border:1.5px solid var(--border); border-radius:10px;
  font-size:0.9rem; color:var(--text); font-family:'DM Sans',sans-serif; outline:none; background:#fff;
}
.tool-input:focus, .tool-select:focus { border-color:var(--saffron); box-shadow:0 0 0 3px rgba(232,71,10,0.08); }
.tool-helper { font-size:0.77rem; color:var(--muted); line-height:1.55; margin-top:7px; }
.tool-btn-row { display:flex; gap:10px; flex-wrap:wrap; margin-top:8px; }
.tool-primary-btn, .tool-secondary-btn {
  border:none; border-radius:10px; padding:11px 18px; cursor:pointer; font-family:'DM Sans',sans-serif;
  font-size:0.9rem; font-weight:700; transition:all 0.2s;
}
.tool-primary-btn {
  background:linear-gradient(135deg,var(--saffron),var(--saffron2)); color:#fff; box-shadow:0 6px 18px rgba(232,71,10,0.26);
}
.tool-primary-btn:hover { transform:translateY(-1px); box-shadow:0 10px 24px rgba(232,71,10,0.3); }
.tool-secondary-btn { background:var(--bg); color:var(--navy); border:1.5px solid var(--border); }
.tool-secondary-btn:hover { border-color:var(--saffron); color:var(--saffron); }
.tool-result-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:16px; }
.tool-result-card {
  background:linear-gradient(180deg,#fff 0%,#f8fbff 100%); border:1.5px solid var(--border); border-radius:14px;
  padding:16px; min-width:0;
}
.tool-result-k { font-size:0.68rem; color:var(--muted); font-weight:700; text-transform:uppercase; letter-spacing:0.35px; margin-bottom:5px; }
.tool-result-v { font-family:'Rajdhani',sans-serif; font-size:1.35rem; font-weight:700; color:var(--navy); line-height:1.2; word-break:break-word; }
.tool-status-box {
  margin-top:16px; border-radius:14px; padding:15px 16px; font-size:0.88rem; line-height:1.7;
  border:1.5px solid var(--border); background:#fff;
}
.tool-status-box.ok { background:rgba(0,135,90,0.06); border-color:rgba(0,135,90,0.18); color:#065f46; }
.tool-status-box.warn { background:rgba(217,119,6,0.08); border-color:rgba(217,119,6,0.18); color:#92400e; }
.tool-status-box.err { background:rgba(220,38,38,0.06); border-color:rgba(220,38,38,0.18); color:#991b1b; }
.qual-chip-row { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.qual-chip {
  border:1.5px solid var(--border); background:#fff; color:var(--text); padding:8px 12px; border-radius:999px;
  font-size:0.82rem; font-weight:700; cursor:pointer; transition:all 0.18s; font-family:'DM Sans',sans-serif;
}
.qual-chip:hover, .qual-chip.active { background:rgba(232,71,10,0.08); border-color:rgba(232,71,10,0.32); color:var(--saffron); }
.qual-summary {
  background:rgba(11,31,58,0.04); border:1.5px solid rgba(11,31,58,0.08); border-radius:14px; padding:14px 16px;
  font-size:0.86rem; color:var(--text); line-height:1.7; margin-bottom:14px;
}
.qual-results-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.qual-job-card {
  background:#fff; border:1.5px solid var(--border); border-radius:14px; padding:16px; box-shadow:var(--shadow-xs);
}
.qual-job-title { font-size:0.95rem; font-weight:700; color:var(--navy); line-height:1.45; margin-bottom:5px; }
.qual-job-meta { font-size:0.79rem; color:var(--muted); line-height:1.6; margin-bottom:10px; }
.qual-job-tags { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.qual-job-tag {
  font-size:0.68rem; font-weight:700; color:var(--saffron); background:rgba(232,71,10,0.08);
  border:1px solid rgba(232,71,10,0.12); border-radius:999px; padding:3px 8px;
}
.qual-empty {
  text-align:center; border:1.5px dashed var(--border); border-radius:16px; padding:28px 18px; color:var(--muted);
}
.resizer-type-row { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.resizer-tab {
  border:1.5px solid var(--border); background:#fff; color:var(--text); padding:9px 14px; border-radius:999px;
  font-size:0.83rem; font-weight:700; cursor:pointer; transition:all 0.18s; font-family:'DM Sans',sans-serif;
}
.resizer-tab.active { background:rgba(232,71,10,0.08); border-color:rgba(232,71,10,0.28); color:var(--saffron); }
.resizer-layout { display:grid; grid-template-columns:minmax(0,1.05fr) minmax(290px,0.95fr); gap:16px; }
.resizer-preview-box {
  background:linear-gradient(180deg,#fff 0%,#f8fbff 100%); border:1.5px dashed var(--border); border-radius:16px;
  padding:18px; min-height:260px; display:flex; align-items:center; justify-content:center; text-align:center; overflow:hidden;
}
.resizer-preview-box img { max-width:100%; max-height:300px; display:block; border-radius:12px; box-shadow:0 6px 18px rgba(11,31,58,0.08); }
.resizer-stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:14px; }
.resizer-stat {
  background:#fff; border:1.5px solid var(--border); border-radius:12px; padding:12px; min-width:0;
}
.resizer-download-link {
  display:none; margin-top:14px; text-decoration:none;
}
.resizer-download-link.show { display:inline-flex; }
@media(max-width:880px) {
  .tool-page-wrap { padding:18px 4% 40px; }
  .tool-page-hero, .tool-card { padding:16px; border-radius:16px; }
  .tool-form-grid, .tool-form-grid-3, .tool-result-grid, .qual-results-list, .resizer-layout { grid-template-columns:1fr; }
  .tool-launch-btn, .tool-primary-btn, .tool-secondary-btn { width:100%; justify-content:center; }
  .tool-btn-row { flex-direction:column; }
}
@media(max-width:480px) {
  .tool-page-hero { padding:18px 14px; }
  .tool-hero-title { font-size:1.55rem; }
  .tool-result-v { font-size:1.15rem; }
  .tool-shortcut-actions, .mobile-tool-actions { flex-direction:column; align-items:stretch; }
  .resizer-stats { grid-template-columns:1fr; }
}

.cats-section { padding:40px 5%; background:rgba(255,255,255,0.6); backdrop-filter:blur(8px); border-top:1px solid rgba(226,232,244,0.7); }
.cats-section { padding:40px 5%; background:rgba(255,255,255,0.6); -webkit-backdrop-filter:blur(8px); border-top:1px solid rgba(226,232,244,0.7); }
.cs-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; }
.cs-title { font-family:'Rajdhani',sans-serif; font-size:1.45rem; font-weight:700; color:var(--navy); }
.cs-title span { color:var(--saffron); }
.cat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(155px,1fr)); gap:13px; }
.ccard {
  background:rgba(255,255,255,0.85); backdrop-filter:blur(8px);
  background:rgba(255,255,255,0.85); -webkit-backdrop-filter:blur(8px);
  border:1px solid rgba(226,232,244,0.85); border-radius:var(--radius);
  padding:22px 14px; text-align:center; cursor:pointer;
  transition:all 0.24s cubic-bezier(0.4,0,0.2,1);
  box-shadow:var(--shadow-xs);
}
.ccard:hover {
  border-color:rgba(232,71,10,0.3); background:#fff;
  transform:translateY(-5px); box-shadow:0 14px 32px rgba(232,71,10,0.1);
}
.ccard-ico { font-size:2rem; margin-bottom:10px; display:block; transition:transform 0.24s; }
.ccard:hover .ccard-ico { transform:scale(1.18); }
.ccard-label { font-size:0.87rem; font-weight:700; color:var(--navy); margin-bottom:3px; }
.ccard-count { font-size:0.73rem; color:var(--muted); }
.ccard-count b { color:var(--saffron); }
footer {
  background:linear-gradient(160deg,#0A1826 0%,#0D1B2E 50%,#111f38 100%);
  color:rgba(255,255,255,0.5); padding:48px 5% 26px;
  border-top:1px solid rgba(255,255,255,0.06);
}
.fg { display:grid; grid-template-columns:2fr 1fr 1fr; gap:36px; margin-bottom:32px; }
.fl { font-family:'Rajdhani',sans-serif; font-size:1.35rem; font-weight:700; color:#fff; margin-bottom:10px; }
.fl span { color:var(--saffron); }
.fd { font-size:0.8rem; line-height:1.7; margin-bottom:14px; }
.fsoc { display:flex; gap:8px; }
.fsoc div { width:32px; height:32px; background:rgba(255,255,255,0.08); border-radius:7px; display:flex; align-items:center; justify-content:center; font-size:0.85rem; cursor:pointer; transition:background 0.2s; }
.fsoc div:hover { background:var(--saffron); }
.fc h4 { color:#fff; font-size:0.87rem; font-weight:700; margin-bottom:12px; }
.fc ul { list-style:none; }
.fc li { margin-bottom:7px; }
.fc a { font-size:0.8rem; color:rgba(255,255,255,0.48); transition:color 0.2s; }
.fc a:hover { color:var(--saffron); }
.fb { border-top:1px solid rgba(255,255,255,0.08); padding-top:18px; display:flex; justify-content:space-between; font-size:0.76rem; }
/* DETAIL PAGE */
#detail-page { max-width:1100px; margin:0 auto; padding:32px 4% 60px; }
.back-btn { display:inline-flex; align-items:center; gap:7px; background:#fff; border:1.5px solid var(--border); color:var(--navy); padding:8px 18px; border-radius:8px; font-size:0.88rem; font-weight:600; cursor:pointer; margin-bottom:24px; transition:all 0.2s; font-family:'DM Sans',sans-serif; }
.back-btn:hover { border-color:var(--saffron); color:var(--saffron); }
.detail-grid { display:grid; grid-template-columns:1fr 280px; gap:24px; }
.job-header-card { background:#fff; border:1.5px solid var(--border); border-radius:16px; padding:28px; margin-bottom:20px; position:relative; overflow:hidden; }
.job-header-card::before { content:''; position:absolute; left:0; top:0; bottom:0; width:5px; background:var(--saffron); }
.jhc-top { display:flex; gap:16px; align-items:flex-start; margin-bottom:18px; }
.jhc-icon { width:64px; height:64px; border-radius:14px; background:var(--bg); border:1.5px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:1.8rem; flex-shrink:0; }
.jhc-title { font-family:'Rajdhani',sans-serif; font-size:1.5rem; font-weight:700; color:var(--navy); margin-bottom:5px; line-height:1.2; }
.jhc-org { font-size:0.9rem; color:var(--muted); margin-bottom:8px; }
.jhc-org b { color:#2255a4; }
.jhc-badges { display:flex; gap:7px; flex-wrap:wrap; max-width:100%; }
.jhc-badges .badge { max-width:200px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.quick-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; padding:18px 0; border-top:1px solid var(--border); border-bottom:1px solid var(--border); margin-bottom:18px; }
.qs-item { text-align:center; }
.qs-val { font-family:'Rajdhani',sans-serif; font-size:1.15rem; font-weight:700; color:var(--navy); }
.qs-key { font-size:0.7rem; color:var(--muted); margin-top:2px; }
.action-btns { display:flex; gap:10px; flex-wrap:wrap; }
.abtn { display:flex; align-items:center; justify-content:center; gap:7px; padding:11px 22px; border-radius:9px; font-size:0.9rem; font-weight:700; cursor:pointer; border:none; font-family:'DM Sans',sans-serif; transition:all 0.2s; flex:1; min-width:120px; text-align:center; }
.abtn-apply { background:var(--saffron); color:#fff; }
.abtn-apply:hover { background:var(--saffron2); transform:translateY(-1px); box-shadow:0 5px 16px rgba(232,71,10,0.35); }
.abtn-pdf { background:var(--navy); color:#fff; }
.abtn-pdf:hover { background:#163560; transform:translateY(-1px); }
.abtn-share { background:var(--bg); color:var(--text); border:1.5px solid var(--border); }
.abtn-share:hover { border-color:var(--saffron); color:var(--saffron); }
.detail-section { background:#fff; border:1.5px solid var(--border); border-radius:14px; padding:24px; margin-bottom:18px; overflow:hidden; box-sizing:border-box; width:100%; }
.ds-title { font-family:'Rajdhani',sans-serif; font-size:1.1rem; font-weight:700; color:var(--navy); margin-bottom:18px; padding-bottom:12px; border-bottom:2px solid var(--bg); display:flex; align-items:center; gap:8px; }
.elig-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.elig-table tr { border-bottom:1px solid var(--border); }
.elig-table tr:last-child { border-bottom:none; }
.elig-table td { padding:12px 14px; font-size:0.87rem; vertical-align:top; line-height:1.6; word-wrap:break-word; overflow-wrap:break-word; word-break:break-word; white-space:normal; }
.elig-table td:first-child { width:130px; font-weight:700; color:var(--navy); background:var(--bg); border-right:1px solid var(--border); }
.vac-table { width:100%; border-collapse:collapse; border-radius:10px; overflow:hidden; border:1px solid var(--border); }
.vac-table thead tr { background:var(--navy); color:#fff; }
.vac-table th { padding:10px 14px; font-size:0.82rem; font-weight:600; text-align:left; }
.vac-table td { padding:10px 14px; font-size:0.83rem; border-bottom:1px solid var(--border); }
.vac-table tr:last-child td { border-bottom:none; }
.vac-table tr:nth-child(even) td { background:var(--bg); }
.vac-total td { background:rgba(232,71,10,0.06) !important; font-weight:700; color:var(--saffron); }
.dates-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; width:100%; box-sizing:border-box; }
.date-item { background:var(--bg); border-radius:10px; padding:13px 16px; border:1px solid var(--border); box-sizing:border-box; min-width:0; overflow:hidden; }
.date-label { font-size:0.72rem; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:0.3px; margin-bottom:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.date-val { font-size:0.92rem; font-weight:700; color:var(--navy); word-break:break-word; overflow-wrap:break-word; }
.date-val.urg { color:var(--red); }
.date-val.ok { color:var(--green); }
.process-steps { display:flex; gap:0; flex-wrap:wrap; margin-top:4px; }
.pstep { display:flex; align-items:center; }
.pstep-box { background:var(--bg); border:1.5px solid var(--border); border-radius:9px; padding:10px 14px; text-align:center; min-width:95px; }
.pstep-num { font-family:'Rajdhani',sans-serif; font-size:1.1rem; font-weight:700; color:var(--saffron); }
.pstep-name { font-size:0.72rem; font-weight:600; color:var(--text); }
.pstep-arrow { color:var(--muted); font-size:1.2rem; padding:0 6px; }
.pdf-card { background:linear-gradient(135deg,#1a1a2e,#16213e); border-radius:12px; padding:16px 18px; display:flex; align-items:center; gap:14px; cursor:pointer; transition:all 0.2s; margin-bottom:10px; }
.pdf-card:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(0,0,0,0.2); }
.pdf-icon { width:46px; height:46px; background:rgba(220,38,38,0.2); border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:1.3rem; flex-shrink:0; }
.pdf-info { flex:1; }
.pdf-name { font-size:0.88rem; font-weight:700; color:#fff; margin-bottom:3px; }
.pdf-size { font-size:0.73rem; color:rgba(255,255,255,0.5); }
.pdf-dl { background:var(--saffron); color:#fff; border:none; padding:7px 15px; border-radius:7px; font-size:0.8rem; font-weight:700; cursor:pointer; font-family:'DM Sans',sans-serif; white-space:nowrap; }
.dscard { background:#fff; border:1.5px solid var(--border); border-radius:14px; padding:18px; margin-bottom:16px; }
.dstitle { font-family:'Rajdhani',sans-serif; font-size:0.97rem; font-weight:700; color:var(--navy); margin-bottom:13px; }
.key-point { display:flex; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); align-items:flex-start; }
.key-point:last-child { border-bottom:none; }
.kp-icon { font-size:1rem; flex-shrink:0; margin-top:1px; }
.kp-text { font-size:0.82rem; color:var(--text); line-height:1.5; }
.kp-text b { color:var(--navy); }
.similar-job { display:flex; gap:10px; padding:9px 0; border-bottom:1px solid var(--border); cursor:pointer; transition:all 0.2s; }
.similar-job:last-child { border-bottom:none; }
.similar-job:hover .sj-title { color:var(--saffron); }
.sj-ico { width:36px; height:36px; background:var(--bg); border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:1rem; flex-shrink:0; border:1px solid var(--border); }
.sj-title { font-size:0.82rem; font-weight:600; color:var(--text); margin-bottom:2px; }
.sj-sub { font-size:0.72rem; color:var(--muted); }
.wa-float { position:fixed; bottom:24px; right:24px; width:52px; height:52px; background:#25D366; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:1.4rem; box-shadow:0 4px 18px rgba(37,211,102,0.4); cursor:pointer; z-index:999; transition:transform 0.2s; text-decoration:none; }
.wa-float:hover { transform:scale(1.1); }
/* Desktop: table show, cards hide */
.vac-desktop { display:block; }
.vac-mobile { display:none; }
.elig-responsive .elig-table td:first-child { width:160px; }

@media(max-width:880px) {
  /* Layout */
  .main,.detail-grid { grid-template-columns:1fr; }
  .sidebar,.detail-sidebar { display:none; }
  .cat-strip { display:none; }

  /* Nav */
  nav { flex-wrap:wrap; height:auto; padding:10px 4%; }
  nav ul { display:none !important; }
  .logo { order:1; }
  .nav-actions { order:2; margin-left:auto; display:flex; align-items:center; gap:8px; }
  .hamburger { display:none !important; }
  .btn.btn-primary { font-size:0.78rem; padding:7px 12px; }

  /* Hero */
  .search-box { flex-direction:column; }
  .sg { border-right:none; border-bottom:1px solid var(--border); }

  /* Job cards */
  .quick-stats { grid-template-columns:repeat(2,1fr); }

  /* Footer */
  .fg { grid-template-columns:1fr 1fr; gap:20px; }
  .fb { flex-direction:column; gap:8px; text-align:center; }

  /* Latest jobs */
  .lj-row { padding:12px 14px; }
  .lj-date { display:none; }

  /* ===== DETAIL PAGE MOBILE ===== */
  #detail-page { padding:16px 4% 40px; }
  .back-btn { padding:7px 14px; font-size:0.82rem; margin-bottom:16px; }

  /* Job header card */
  .job-header-card { padding:16px; }
  .jhc-top { flex-direction:row; gap:12px; }
  .jhc-icon { width:48px; height:48px; font-size:1.4rem; flex-shrink:0; }
  .jhc-title { font-size:1.15rem; }
  .jhc-org { font-size:0.82rem; }

  /* Quick stats */
  .quick-stats { grid-template-columns:repeat(2,1fr); gap:8px; }
  .qs-val { font-size:1rem; }
  .qs-key { font-size:0.65rem; }

  /* Action buttons */
  .action-btns { flex-direction:column; gap:8px; }
  .abtn { width:100%; justify-content:center; padding:12px; font-size:0.88rem; }

  /* Detail sections */
  .detail-section { padding:16px; margin-bottom:12px; }
  .ds-title { font-size:1rem; margin-bottom:12px; }

  /* Eligibility table */
  .elig-table td:first-child { width:110px; font-size:0.8rem; }
  .elig-table td { padding:9px 10px; font-size:0.82rem; }

  /* Vacancy table - scrollable on mobile */
  .vac-table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .vac-table { min-width:500px; }
  .vac-table th,.vac-table td { padding:8px 10px; font-size:0.78rem; }

  /* Vacancy — hide table, show cards on mobile */
  .vac-desktop { display:none; }
  .vac-mobile { display:block; }

  /* Eligibility — stack layout on mobile */
  .elig-responsive .elig-table { display:block; }
  .elig-responsive .elig-table tr { display:flex; flex-direction:column; padding:10px 0; border-bottom:1px solid var(--border); }
  .elig-responsive .elig-table td { display:block; width:100% !important; border:none; padding:2px 0; }
  .elig-responsive .elig-table td:first-child { font-size:0.72rem; text-transform:uppercase; letter-spacing:0.3px; background:none; border:none; color:var(--muted); width:100% !important; }
  .elig-responsive .elig-table td:last-child { font-size:0.88rem; color:var(--text); line-height:1.7; word-break:break-word; }

  /* Dates grid */
  .dates-grid { grid-template-columns:1fr 1fr !important; gap:8px !important; width:100% !important; }
  .date-item { padding:10px 12px !important; min-width:0 !important; box-sizing:border-box !important; overflow:hidden !important; }
  .date-val { font-size:0.82rem !important; word-break:break-word !important; }
  .date-label { font-size:0.68rem !important; }

  /* PDF cards */
  .pdf-card { padding:12px 14px; }
  .pdf-name { font-size:0.85rem; }

  /* Similar jobs */
  .similar-job { padding:10px 12px; }

  /* Key highlights */
  .key-point { padding:10px 12px; }
  .kp-text { font-size:0.82rem; }
}
.hamburger { display:none; background:none; border:none; font-size:1.5rem; cursor:pointer; color:var(--navy); padding:4px 8px; }
.vac-table-wrap { overflow-x:auto; }

/* ============================================
   GLOBAL — all screen sizes
   ============================================ */
html, body { overflow-x:hidden; max-width:100vw; width:100%; }
*, *::before, *::after { box-sizing:border-box; }
img { max-width:100%; height:auto; }
#home-page, #detail-page, #latest-page, #results-page, #admitcard-page {
  width:100%; max-width:100vw; overflow-x:hidden;
}

/* ============================================
   TABLET 880px
   ============================================ */
@media(max-width:880px) {
  .main, .detail-grid { grid-template-columns:1fr; }
  .sidebar, .detail-sidebar { display:none; }
  .cat-strip { display:none; }
  nav { flex-wrap:wrap; height:auto; padding:10px 4%; }
  nav ul { display:none !important; }
  .logo { order:1; }
  .nav-actions { order:2; margin-left:auto; display:flex; align-items:center; gap:8px; }
  .hamburger { display:none !important; }
  .btn.btn-primary { font-size:0.78rem; padding:7px 12px; }
  .search-box { flex-direction:column; width:100%; box-sizing:border-box; }
  .sg { border-right:none; border-bottom:1px solid var(--border); }
  .main { padding:20px 4%; width:100%; box-sizing:border-box; }
  .hero { padding:40px 4% 56px; }
  .cats-section { padding:28px 4%; }
  .cat-grid { grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; }
  .quick-stats { grid-template-columns:repeat(2,1fr); }
  .fg { grid-template-columns:1fr 1fr; gap:20px; }
  .fb { flex-direction:column; gap:8px; text-align:center; }
  .lj-row { padding:12px 14px; }
  .lj-date { display:none; }
  #detail-page { padding:16px 4% 40px; }
  .back-btn { padding:7px 14px; font-size:0.82rem; margin-bottom:16px; }
  .job-header-card { padding:16px; }
  .jhc-title { font-size:1.15rem; }
  .jhc-icon { width:48px; height:48px; font-size:1.4rem; flex-shrink:0; }
  .jhc-org { font-size:0.82rem; }
  .qs-val { font-size:1rem; }
  .qs-key { font-size:0.65rem; }
  .action-btns { flex-direction:column; gap:8px; }
  .abtn { width:100%; justify-content:center; padding:12px; font-size:0.88rem; }
  .detail-section { padding:16px; margin-bottom:12px; overflow:hidden; }
  .ds-title { font-size:1rem; margin-bottom:12px; }
  .elig-table td:first-child { width:110px; font-size:0.8rem; }
  .elig-table td { padding:9px 10px; font-size:0.82rem; }
  .vac-table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .vac-table { min-width:500px; }
  .vac-table th, .vac-table td { padding:8px 10px; font-size:0.78rem; }
  .vac-desktop { display:none; }
  .vac-mobile { display:block; }
  .elig-responsive .elig-table { display:block; }
  .elig-responsive .elig-table tr { display:flex; flex-direction:column; padding:10px 0; border-bottom:1px solid var(--border); }
  .elig-responsive .elig-table td { display:block; width:100% !important; border:none; padding:2px 0; }
  .elig-responsive .elig-table td:first-child { font-size:0.72rem; text-transform:uppercase; background:none; border:none; color:var(--muted); }
  .elig-responsive .elig-table td:last-child { font-size:0.88rem; line-height:1.7; word-break:break-word; }
  .dates-grid { grid-template-columns:1fr 1fr; gap:8px; width:100%; }
  .date-item { padding:10px 12px; min-width:0; overflow:hidden; }
  .date-val { font-size:0.82rem; word-break:break-word; }
  .date-label { font-size:0.68rem; }
  .pdf-card { padding:12px 14px; }
  .pdf-name { font-size:0.85rem; }
}

/* ============================================
   MOBILE 480px
   ============================================ */
@media(max-width:480px) {
  html, body { overflow-x:hidden; }

  /* Nav */
  .logo-text { font-size:1.15rem; }
  .logo-icon { width:34px; height:34px; font-size:1rem; }

  /* Hero */
  .hero { padding:32px 4% 44px; }
  #hero-title { font-size:1.5rem; line-height:1.3; }
  .search-go { width:100%; border-radius:9px; }
  .search-box { border-radius:14px; }
  .hero-stats { gap:12px; }
  .hstat-num { font-size:1.3rem; }
  .hstat-label { font-size:0.62rem; }

  /* All page containers */
  #home-page, #detail-page, #latest-page, #results-page, #admitcard-page {
    width:100% !important; max-width:100vw !important; overflow-x:hidden !important;
  }

  /* lj pages */
  .lj-list { padding:14px 4% 36px !important; max-width:100% !important; }
  .lj-header { font-size:1.15rem !important; margin-bottom:10px !important; }
  .lj-row { padding:10px 12px !important; gap:8px !important; transform:none !important; }
  .lj-title { font-size:0.85rem !important; }
  .lj-meta { font-size:0.72rem !important; }
  .lj-icon { font-size:1.1rem !important; }
  .lj-info { min-width:0; flex:1; overflow:hidden; }
  .lj-date { display:none !important; }
  .lj-meta-row { gap:4px; }
  .lj-days-badge { font-size:0.65rem !important; padding:2px 7px !important; }

  /* Job cards */
  .jcard { padding:12px !important; }
  .jcard-title { font-size:0.9rem !important; line-height:1.4; }
  .jcard-org { font-size:0.76rem !important; }
  .jcard-stats { flex-wrap:wrap; gap:5px !important; }

  /* Detail page */
  #detail-page { padding:10px 4% 28px !important; }
  .back-btn { padding:6px 12px !important; font-size:0.78rem !important; margin-bottom:12px !important; }
  .job-header-card { padding:12px !important; }
  .jhc-title { font-size:0.95rem !important; line-height:1.4; }
  .jhc-org { font-size:0.76rem !important; }
  .jhc-badges .badge { font-size:0.65rem !important; padding:2px 7px !important; }
  .detail-section { padding:12px !important; margin-bottom:8px !important; overflow:hidden; }
  .ds-title { font-size:0.88rem !important; margin-bottom:8px !important; padding-bottom:6px !important; }

  /* Quick stats 2 col */
  .quick-stats { grid-template-columns:1fr 1fr !important; gap:6px !important; }
  .qs-val { font-size:0.9rem !important; }
  .qs-key { font-size:0.6rem !important; }

  /* Action buttons */
  .action-btns { flex-direction:column !important; gap:7px !important; }
  .abtn { width:100% !important; padding:11px !important; font-size:0.84rem !important; justify-content:center !important; min-width:unset !important; }

  /* Dates — 1 column on small mobile */
  .dates-grid { grid-template-columns:1fr !important; gap:6px !important; }
  .date-item { padding:9px 12px !important; }
  .date-val { font-size:0.86rem !important; word-break:break-word !important; }
  .date-label { font-size:0.67rem !important; }

  /* Eligibility */
  .elig-table td:first-child { width:85px !important; font-size:0.73rem !important; }
  .elig-table td { padding:7px 8px !important; font-size:0.79rem !important; }

  /* Vacancy cards */
  .vac-mobile div[style*="grid-template-columns"] { grid-template-columns:1fr 1fr !important; }
  .vac-mobile > div { width:100% !important; }

  /* PDF */
  .pdf-card { padding:9px 11px !important; flex-wrap:wrap; gap:7px; }
  .pdf-name { font-size:0.82rem !important; }
  .pdf-dl { padding:5px 9px !important; font-size:0.73rem !important; }

  /* Custom fields */
  div[style*="grid-template-columns:180px"] {
    grid-template-columns:1fr !important;
  }

  /* Footer */
  .fg { grid-template-columns:1fr !important; gap:14px; }
  .fb { flex-direction:column; gap:5px; text-align:center; font-size:0.76rem; }
  footer { padding:28px 4% 20px !important; }

  /* Global text overflow prevention */
  p, div, span, td, th, li, h1, h2, h3, h4, h5, a, button, label {
    word-break:break-word;
    overflow-wrap:break-word;
  }

  /* All inline max-width overrides */
  div[style*="max-width:860"], div[style*="max-width: 860"],
  div[style*="max-width:600"], div[style*="max-width: 600"],
  div[style*="max-width:480"], div[style*="max-width: 480"] {
    max-width:100% !important; width:100% !important;
  }

  /* Inline flex wrap */
  div[style*="display:flex"], div[style*="display: flex"] {
    flex-wrap:wrap !important;
  }

  /* Ticker */
  .ticker-wrap { padding:4px 0; }
  .ticker { font-size:0.7rem; }
}


/* ===== VACANCY TABLE HEADER FIX ===== */
.vac-table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.vac-table {
  width:100%;
  min-width:900px !important;
  table-layout:auto !important;
}
.vac-table th,
.vac-table td {
  word-break:normal !important;
  overflow-wrap:normal !important;
}
.vac-table th {
  white-space:nowrap !important;
}
.vac-table th:nth-child(1), .vac-table td:nth-child(1) { min-width:220px; }
.vac-table th:nth-child(2), .vac-table td:nth-child(2) { min-width:110px; }
.vac-table th:nth-child(3), .vac-table td:nth-child(3) { min-width:180px; }
.vac-table th:nth-child(4), .vac-table td:nth-child(4) { min-width:100px; }
.vac-table th:nth-child(5), .vac-table td:nth-child(5) { min-width:140px; }
.vac-table th:nth-child(6), .vac-table td:nth-child(6) { min-width:120px; }

@media(max-width:880px) {
  #detail-page .vac-table { min-width:900px !important; table-layout:auto !important; }
  #detail-page .vac-table th { white-space:nowrap !important; word-break:normal !important; overflow-wrap:normal !important; }
}

@media(max-width:480px) {
  #detail-page .vac-table th,
  #detail-page .vac-table td,
  #detail-page .vac-table-wrap th,
  #detail-page .vac-table-wrap td {
    word-break:normal !important;
    overflow-wrap:normal !important;
  }
  #detail-page .vac-table th,
  #detail-page .vac-table-wrap th {
    white-space:nowrap !important;
  }
}

/* ===== BLOG PAGE ===== */
#blog-page { display:none; width:100%; max-width:100vw; overflow-x:hidden; }
#blog-detail-page { display:none; width:100%; max-width:100vw; overflow-x:hidden; }
.blog-list-wrap { max-width:1100px; margin:0 auto; padding:32px 4% 60px; }
.blog-grid { display:grid; grid-template-columns:1fr 320px; gap:24px; }
.blog-main { min-width:0; }
.blog-sidebar { min-width:0; }
.blog-section-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.blog-section-title { font-family:'Rajdhani',sans-serif; font-size:1.5rem; font-weight:700; color:var(--navy); }
.blog-section-title span { color:var(--saffron); }
.bcard {
  background:#fff; border:1.5px solid var(--border); border-radius:var(--radius);
  overflow:hidden; margin-bottom:16px; cursor:pointer;
  transition:all 0.22s; box-shadow:var(--shadow-xs);
  display:flex; gap:0; position:relative;
}
.bcard:hover { border-color:rgba(232,71,10,0.25); box-shadow:0 8px 28px rgba(11,31,58,0.1); transform:translateY(-2px); }
.bcard-accent { width:4px; flex-shrink:0; background:var(--border); transition:background 0.22s; }
.bcard:hover .bcard-accent { background:var(--saffron); }
.bcard-body { padding:18px 20px; flex:1; min-width:0; }
.bcard-cat { display:inline-block; font-size:0.65rem; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; padding:3px 9px; border-radius:20px; background:rgba(232,71,10,0.09); color:var(--saffron); margin-bottom:8px; }
.bcard-title { font-family:'Rajdhani',sans-serif; font-size:1.1rem; font-weight:700; color:var(--navy); line-height:1.3; margin-bottom:6px; }
.bcard:hover .bcard-title { color:var(--saffron); }
.bcard-meta { font-size:0.76rem; color:var(--muted); display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.bcard-tags { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
.bcard-tag { background:rgba(244,247,252,0.9); color:#475569; font-size:0.68rem; padding:2px 8px; border-radius:5px; border:1px solid rgba(226,232,244,0.9); }
.bcard-status-live { display:inline-block; padding:2px 8px; border-radius:20px; font-size:0.65rem; font-weight:700; background:rgba(0,135,90,0.1); color:var(--green); }
.bcard-status-draft { display:inline-block; padding:2px 8px; border-radius:20px; font-size:0.65rem; font-weight:700; background:rgba(100,116,139,0.1); color:var(--muted); }

/* Blog detail page */
.blog-detail-wrap { max-width:860px; margin:0 auto; padding:28px 4% 60px; }
.blog-detail-body { background:#fff; border:1.5px solid var(--border); border-radius:var(--radius); padding:32px; margin-bottom:20px; overflow:hidden; }

/* Ad slots on blog page */
.ad-block {
  background:#f8f9fc; border:1.5px dashed #cbd5e1; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  color:#64748b; font-size:0.72rem; font-weight:600; text-transform:uppercase; letter-spacing:0.5px;
  margin:20px 0;
}
.ad-block-728 { min-height:90px; width:100%; max-width:728px; }
.ad-block-300 { min-height:250px; width:100%; max-width:300px; }
.ad-block-full { min-height:90px; width:100%; }

/* Blog filter pills */
.blog-filter { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
.bpill { background:rgba(244,247,252,0.9); color:#475569; border:1px solid var(--border); border-radius:20px; padding:5px 14px; font-size:0.8rem; font-weight:600; cursor:pointer; transition:all 0.18s; font-family:'DM Sans',sans-serif; }
.bpill:hover,.bpill.active { background:var(--saffron); color:#fff; border-color:var(--saffron); }
.blog-empty { text-align:center; padding:60px 20px; }
.blog-empty-icon { font-size:3rem; margin-bottom:12px; }

@media(max-width:880px) {
  .blog-grid { grid-template-columns:1fr; }
  .blog-sidebar { display:none; }
  .ad-block-728 { max-width:100%; }
}
@media(max-width:480px) {
  .blog-detail-body { padding:16px; }
  .bcard-body { padding:14px 16px; }
  .bcard-title { font-size:0.97rem; }
}

/* ===== BLOG CONTENT BODY STYLES ===== */
/* Yeh styles blog-detail-page ke andar render hone wale AI-generated HTML ke liye hain */
.blog-content-body { font-size:16px; line-height:1.8; color:#2d3a4a; }
.blog-content-body h1 { font-family:'Rajdhani',sans-serif; font-size:clamp(1.5rem,3vw,2.2rem); font-weight:700; color:var(--navy); line-height:1.2; margin:0 0 16px; }
.blog-content-body h2 { font-family:'Rajdhani',sans-serif; font-size:clamp(1.15rem,2.5vw,1.5rem); font-weight:700; color:var(--navy); margin:28px 0 14px; padding-bottom:8px; border-bottom:3px solid var(--saffron); }
.blog-content-body h3 { font-family:'Rajdhani',sans-serif; font-size:1.1rem; font-weight:700; color:var(--navy); margin:20px 0 10px; }
.blog-content-body p { margin-bottom:14px; }
.blog-content-body ul,.blog-content-body ol { padding-left:22px; margin-bottom:16px; }
.blog-content-body li { margin-bottom:6px; line-height:1.7; }
.blog-content-body strong { color:var(--navy); font-weight:700; }
.blog-content-body a { color:var(--saffron); text-decoration:underline; }
.blog-content-body a:hover { color:var(--saffron2); }
.blog-content-body small { font-size:0.82rem; color:var(--muted); }

/* Hero block inside blog */
.blog-content-body .blog-hero {
  background:linear-gradient(135deg,#0B1F3A,#163560);
  border-radius:14px; padding:28px 24px; margin-bottom:24px; color:#fff;
}
.blog-content-body .blog-hero-badge {
  display:inline-block; background:rgba(232,71,10,0.9); color:#fff;
  font-size:0.7rem; font-weight:700; padding:4px 12px; border-radius:20px;
  text-transform:uppercase; letter-spacing:0.5px; margin-bottom:10px;
}
.blog-content-body .blog-h1 { font-family:'Rajdhani',sans-serif; font-size:clamp(1.3rem,3vw,1.9rem); font-weight:700; line-height:1.25; margin-bottom:12px; color:#fff; border:none; padding:0; }
.blog-content-body .blog-intro { font-size:0.92rem; color:rgba(255,255,255,0.82); line-height:1.7; margin-bottom:18px; }
.blog-content-body .blog-quickinfo { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.blog-content-body .qi-item { background:rgba(255,255,255,0.1); border-radius:10px; padding:11px; text-align:center; }
.blog-content-body .qi-label { display:block; font-size:0.65rem; color:rgba(255,255,255,0.6); text-transform:uppercase; letter-spacing:0.4px; margin-bottom:4px; }
.blog-content-body .qi-val { font-family:'Rajdhani',sans-serif; font-size:1rem; font-weight:700; color:#fff; }

/* Section headings inside blog */
.blog-content-body .blog-h2 { font-family:'Rajdhani',sans-serif; font-size:clamp(1.1rem,2.2vw,1.4rem); font-weight:700; color:var(--navy); margin:28px 0 14px; padding-bottom:8px; border-bottom:3px solid var(--saffron); }

/* Tables — the main fix */
.blog-content-body .table-wrap,.blog-content-body table { overflow-x:auto; display:block; width:100%; }
.blog-content-body .blog-table,.blog-content-body table.blog-table {
  width:100%; min-width:480px; border-collapse:collapse;
  border-radius:10px; overflow:hidden;
  box-shadow:0 2px 12px rgba(0,0,0,0.07);
  display:table;
}
.blog-content-body .table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; display:block; margin-bottom:20px; border-radius:10px; }
.blog-content-body .blog-table thead tr,.blog-content-body table.blog-table thead tr { background:var(--navy); }
.blog-content-body .blog-table th,.blog-content-body table.blog-table th {
  padding:11px 14px; font-size:0.78rem; font-weight:700; color:#fff;
  text-align:left; text-transform:uppercase; letter-spacing:0.3px; white-space:nowrap;
}
.blog-content-body .blog-table td,.blog-content-body table.blog-table td {
  padding:10px 14px; font-size:0.85rem; border-bottom:1px solid #DDE4F0;
  color:#2d3a4a; vertical-align:middle;
}
.blog-content-body .blog-table tr:nth-child(even) td { background:#f8fafc; }
.blog-content-body .blog-table tfoot td { background:rgba(232,71,10,0.08); color:var(--saffron); font-weight:700; padding:10px 14px; }
.blog-content-body .date-highlight { color:var(--saffron); font-weight:700; }
.blog-content-body .dates-table td:first-child { font-weight:600; color:var(--navy); }

/* Eligibility grid */
.blog-content-body .eligibility-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin-bottom:20px; }
.blog-content-body .elig-card {
  background:#fff; border:1.5px solid #DDE4F0; border-radius:12px; padding:14px;
  display:flex; align-items:flex-start; gap:10px; box-shadow:0 1px 4px rgba(0,0,0,0.04);
}
.blog-content-body .elig-icon { font-size:1.4rem; flex-shrink:0; margin-top:2px; }
.blog-content-body .elig-label { font-size:0.68rem; font-weight:700; color:#64748b; text-transform:uppercase; letter-spacing:0.4px; margin-bottom:4px; display:block; }
.blog-content-body .elig-val { font-size:0.88rem; font-weight:600; color:var(--navy); line-height:1.4; }
.blog-content-body .elig-val small { font-weight:400; color:#64748b; font-size:0.76rem; display:block; margin-top:2px; }

/* Steps list */
.blog-content-body .steps-list { margin-bottom:20px; }
.blog-content-body .step { display:flex; align-items:flex-start; gap:14px; margin-bottom:12px; }
.blog-content-body .step-num {
  width:30px; height:30px; background:var(--saffron); color:#fff;
  border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:0.86rem; flex-shrink:0; margin-top:2px;
}
.blog-content-body .step-text { font-size:0.9rem; color:#2d3a4a; line-height:1.6; padding-top:4px; }
.blog-content-body .step-text strong { color:var(--navy); }

/* Important box */
.blog-content-body .important-box {
  background:#FFF3E0; border:2px solid #FED7AA; border-radius:12px;
  padding:16px 18px; margin:20px 0;
}
.blog-content-body .imp-title { font-family:'Rajdhani',sans-serif; font-size:1.02rem; font-weight:700; color:#9A3412; margin-bottom:8px; }
.blog-content-body .imp-list { padding-left:18px; }
.blog-content-body .imp-list li { font-size:0.86rem; color:#7C2D12; margin-bottom:5px; line-height:1.5; }

/* Apply CTA */
.blog-content-body .apply-cta {
  background:linear-gradient(135deg,#0B1F3A,#163560);
  border-radius:14px; padding:24px; text-align:center; margin:24px 0;
}
.blog-content-body .apply-cta h3 { font-family:'Rajdhani',sans-serif; font-size:1.3rem; color:#fff; margin-bottom:8px; }
.blog-content-body .apply-cta p { color:rgba(255,255,255,0.78); margin-bottom:16px; font-size:0.88rem; }
.blog-content-body .apply-cta strong { color:#FF6B2B; }
.blog-content-body .apply-btn {
  display:inline-block; background:var(--saffron); color:#fff !important;
  padding:12px 26px; border-radius:9px; font-weight:700; font-size:0.92rem;
  text-decoration:none !important; margin:5px; transition:all 0.2s; border:none; cursor:pointer;
}
.blog-content-body .apply-btn:hover { background:var(--saffron2); }
.blog-content-body .notif-btn {
  display:inline-block; background:rgba(255,255,255,0.12); color:#fff !important;
  padding:12px 20px; border-radius:9px; font-weight:600; font-size:0.88rem;
  text-decoration:none !important; margin:5px; border:1.5px solid rgba(255,255,255,0.25);
}

/* Ad slots inside blog content */
.blog-content-body .ad-slot { background:#f8f9fc; border:2px dashed #cbd5e1; border-radius:10px; margin:22px 0; display:flex; align-items:center; justify-content:center; color:#94a3b8; font-size:0.7rem; font-weight:600; text-transform:uppercase; letter-spacing:0.5px; }
.blog-content-body .ad-slot span { padding:14px; }
.blog-content-body .ad-slot-top { min-height:90px; }
.blog-content-body .ad-slot-mid { min-height:250px; }
.blog-content-body .ad-slot-inline { min-height:90px; }
.blog-content-body .ad-slot-bottom { min-height:250px; }

/* Mobile responsive for blog content */
@media(max-width:600px) {
  .blog-content-body .blog-quickinfo { grid-template-columns:repeat(2,1fr); }
  .blog-content-body .eligibility-grid { grid-template-columns:1fr; }
  .blog-content-body .blog-hero { padding:18px 14px; border-radius:10px; }
  .blog-content-body .apply-cta { padding:18px 14px; border-radius:10px; }
  .blog-content-body .apply-btn,.blog-content-body .notif-btn { display:block; margin:6px 0; text-align:center; }
  .blog-content-body .step-text { font-size:0.84rem; }
  .blog-content-body .blog-table th,.blog-content-body .blog-table td { padding:8px 10px; font-size:0.78rem; }
  .blog-content-body .elig-card { padding:10px 12px; }
  .blog-content-body .blog-h2 { font-size:1.1rem; margin:20px 0 10px; }
  .blog-content-body .ad-slot-mid { min-height:120px; }
  .blog-content-body .ad-slot-bottom { min-height:120px; }
}

/* ===== PERMANENT SEO SECTIONS ===== */
.seo-section { padding:48px 5%; border-top:1px solid rgba(226,232,244,0.7); }
.seo-section.alt { background:rgba(255,255,255,0.65); backdrop-filter:blur(8px); }
.seo-section.alt { background:rgba(255,255,255,0.65); -webkit-backdrop-filter:blur(8px); }
.seo-section-title { font-family:'Rajdhani',sans-serif; font-size:1.45rem; font-weight:700; color:var(--navy); margin-bottom:6px; }
.seo-section-title span { color:var(--saffron); }
.seo-section-sub { font-size:0.88rem; color:var(--muted); margin-bottom:28px; }

/* About section */
.about-grid { display:grid; grid-template-columns:1fr 1fr; gap:32px; align-items:start; }
.about-text p { font-size:0.92rem; color:#2d3a4a; line-height:1.85; margin-bottom:14px; }
.about-text strong { color:var(--navy); }
.about-stats { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.astat { background:#fff; border:1.5px solid var(--border); border-radius:14px; padding:18px; text-align:center; box-shadow:var(--shadow-xs); }
.astat-num { font-family:'Rajdhani',sans-serif; font-size:2rem; font-weight:700; color:var(--saffron); line-height:1; }
.astat-lbl { font-size:0.76rem; color:var(--muted); margin-top:4px; font-weight:500; }

/* How it works */
.hiw-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.hiw-card { background:#fff; border:1.5px solid var(--border); border-radius:var(--radius); padding:22px 18px; text-align:center; box-shadow:var(--shadow-xs); position:relative; overflow:hidden; }
.hiw-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:linear-gradient(90deg,var(--saffron),var(--saffron2)); }
.hiw-num { font-family:'Rajdhani',sans-serif; font-size:2rem; font-weight:700; color:rgba(232,71,10,0.12); line-height:1; margin-bottom:8px; }
.hiw-ico { font-size:1.8rem; margin-bottom:10px; display:block; }
.hiw-title { font-family:'Rajdhani',sans-serif; font-size:1rem; font-weight:700; color:var(--navy); margin-bottom:6px; }
.hiw-desc { font-size:0.8rem; color:var(--muted); line-height:1.6; }

/* FAQ section */
.faq-list { max-width:780px; margin:0 auto; }
.faq-item { background:#fff; border:1.5px solid var(--border); border-radius:12px; margin-bottom:10px; overflow:hidden; box-shadow:var(--shadow-xs); }
.faq-q { padding:16px 20px; font-size:0.92rem; font-weight:700; color:var(--navy); cursor:default; display:flex; align-items:flex-start; gap:10px; }
.faq-q-label { color:var(--saffron); font-weight:800; font-size:1rem; flex-shrink:0; margin-top:1px; }
.faq-a { padding:12px 20px 16px 20px; font-size:0.87rem; color:#2d3a4a; line-height:1.75; display:block !important; border-top:1px solid var(--border); background:#f8faff; visibility:visible !important; height:auto !important; overflow:visible !important; }
.faq-a-label { color:var(--saffron); font-weight:800; font-size:0.85rem; margin-right:6px; }
/* Job detail auto-generated FAQ answers — always visible */
.faq-answer { display:block !important; visibility:visible !important; height:auto !important; overflow:visible !important; }
/* Hide any dropdown arrows in FAQ */
.faq-item .faq-icon, .faq-item .faq-arrow { display:none !important; }

/* Job types info grid */
.jtype-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.jtype-card { background:#fff; border:1.5px solid var(--border); border-radius:14px; padding:18px; box-shadow:var(--shadow-xs); }
.jtype-ico { font-size:1.6rem; margin-bottom:8px; }
.jtype-title { font-family:'Rajdhani',sans-serif; font-size:1rem; font-weight:700; color:var(--navy); margin-bottom:6px; }
.jtype-desc { font-size:0.8rem; color:var(--muted); line-height:1.65; }

/* States coverage */
.states-wrap { display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }
.state-pill { background:rgba(11,31,58,0.06); color:var(--navy); border:1px solid rgba(11,31,58,0.1); border-radius:20px; padding:5px 14px; font-size:0.78rem; font-weight:600; }

/* Mobile */
@media(max-width:880px) {
  .about-grid { grid-template-columns:1fr; }
  .hiw-grid { grid-template-columns:1fr 1fr; }
  .jtype-grid { grid-template-columns:1fr 1fr; }
  .about-stats { grid-template-columns:1fr 1fr; }
  .mobile-tools-section { display:block; }
  .mobile-tools-grid { grid-template-columns:1fr; }
}
@media(max-width:480px) {
  .seo-section { padding:32px 4%; }
  .hiw-grid { grid-template-columns:1fr 1fr; gap:10px; }
  .hiw-card { padding:16px 12px; }
  .jtype-grid { grid-template-columns:1fr; }
  .faq-q { font-size:0.86rem; padding:14px 16px; }
  .astat-num { font-size:1.6rem; }
}

/* ===== EXTRA MOBILE OVERFLOW FIXES ===== */
#detail-page, #detail-page * { min-width: 0; }
#blog-detail-page, #blog-detail-page * { min-width: 0; }
#detail-page .detail-section,
#detail-page .job-header-card,
#detail-page .dscard,
#detail-page .pdf-card,
#detail-page .date-item,
#detail-page .similar-job,
#detail-page .key-point,
#blog-detail-page .blog-detail-body,
#blog-detail-page .bcard,
#blog-detail-page .ad-block { max-width:100%; box-sizing:border-box; overflow-wrap:anywhere; }
#detail-page img, #detail-page iframe, #detail-page table, #detail-page pre,
#blog-detail-page img, #blog-detail-page iframe, #blog-detail-page table, #blog-detail-page pre {
  max-width:100% !important;
}
#detail-page pre, #blog-detail-page pre {
  white-space:pre-wrap;
  word-break:break-word;
  overflow:auto;
}
#detail-page a, #detail-page button,
#blog-detail-page a, #blog-detail-page button {
  max-width:100%;
}
#blog-detail-page .blog-content-body,
#blog-detail-page .blog-content-body * {
  max-width:100%;
  word-break:break-word;
  overflow-wrap:anywhere;
}
@media(max-width:768px) {
  #detail-page [style*="display:flex;border-bottom:1px solid var(--border);"] {
    flex-wrap:wrap !important;
  }
  #detail-page [style*="min-width:150px;max-width:180px;flex:0 0 150px"] {
    min-width:100% !important;
    max-width:100% !important;
    flex:1 1 100% !important;
    width:100% !important;
  }
  #detail-page [style*="display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:8px;"] {
    grid-template-columns:1fr !important;
  }
  #detail-page [style*="display:flex;align-items:center;justify-content:center;margin:-1px 0;"] {
    padding:0 8px !important;
  }
  #detail-page [style*="display:flex;align-items:center;justify-content:center;margin:-1px 0;"] > div {
    max-width:100% !important;
    width:auto !important;
    padding:12px 16px !important;
  }
  #blog-detail-page [style*="display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:12px 0;border-top:1px solid var(--border);border-bottom:1px solid var(--border);margin-bottom:20px;"] button {
    margin-left:0 !important;
    width:100% !important;
  }
  #blog-detail-page [style*="display:flex;align-items:center;gap:8px;margin:0 0 14px;pointer-events:none;"] {
    gap:6px !important;
  }
  #blog-detail-page [style*="border-radius:24px;padding:8px 22px;display:flex;align-items:center;gap:8px;box-shadow:0 4px 16px rgba(249,115,22,0.3);"] {
    padding:8px 14px !important;
    max-width:100% !important;
  }
}
@media(max-width:480px) {
  #detail-page [style*="display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;"] {
    grid-template-columns:1fr !important;
  }
  #detail-page [style*="background:linear-gradient(135deg,#f97316,#ea580c);border-radius:50px;padding:14px 32px;"] {
    border-radius:18px !important;
    padding:10px 14px !important;
    width:100% !important;
    justify-content:center !important;
  }
  #detail-page [style*="background:#fff7ed;border:1.5px solid #fed7aa;border-radius:14px;padding:22px;"] {
    padding:16px 14px !important;
  }
  #blog-detail-page [style*="background:#fff7ed;border:1.5px solid #fed7aa;border-radius:14px;padding:22px;"] {
    padding:16px 14px !important;
  }
}


/* ===== EXTRA MOBILE MARGIN + OVERFLOW PATCH ===== */
@media(max-width:768px) {
  #home-page .main,
  #detail-page,
  .blog-list-wrap,
  .blog-detail-wrap,
  .lj-list,
  .tool-page-wrap {
    padding-left:12px !important;
    padding-right:12px !important;
    box-sizing:border-box !important;
  }

  #home-page .main,
  #detail-page .detail-grid,
  .blog-grid {
    gap:14px !important;
  }

  #home-page .main > *,
  #detail-page .detail-grid > *,
  .blog-grid > * {
    min-width:0 !important;
    max-width:100% !important;
  }

  #home-page .jcard,
  #latest-page .lj-row,
  #detail-page .job-header-card,
  #detail-page .detail-section,
  #detail-page .dscard,
  #detail-page .alert-card,
  #blog-page .bcard,
  #blog-detail-page .blog-detail-body,
  #blog-detail-page .ad-block,
  .tool-card,
  .tool-page-hero {
    width:100% !important;
    max-width:100% !important;
    margin-left:0 !important;
    margin-right:0 !important;
  }

  #detail-page .detail-section > *,
  #detail-page .job-header-card > *,
  #blog-detail-page .blog-detail-body > * {
    max-width:100% !important;
  }

  #detail-page .elig-table,
  #detail-page .vac-table,
  #blog-detail-page table,
  #blog-page table {
    width:100% !important;
    table-layout:fixed;
  }

  #detail-page .dates-grid,
  #detail-page .quick-stats,
  #detail-page .action-btns,
  #blog-page .blog-section-head,
  #blog-detail-page [style*="display:flex"] {
    max-width:100% !important;
  }
}

@media(max-width:480px) {
  #home-page .main,
  #detail-page,
  .blog-list-wrap,
  .blog-detail-wrap,
  .lj-list,
  .tool-page-wrap,
  .seo-section,
  .cats-section,
  footer {
    padding-left:10px !important;
    padding-right:10px !important;
  }

  #detail-page .job-header-card,
  #detail-page .detail-section,
  #detail-page .dscard,
  #blog-detail-page .blog-detail-body,
  #blog-page .bcard,
  .tool-card,
  .tool-page-hero {
    border-radius:12px !important;
  }

  #detail-page [style*="padding:24px"],
  #detail-page [style*="padding:22px"],
  #blog-detail-page [style*="padding:24px"],
  #blog-detail-page [style*="padding:22px"] {
    padding-left:12px !important;
    padding-right:12px !important;
  }

  #detail-page .detail-section,
  #detail-page .job-header-card,
  #blog-detail-page .blog-detail-body,
  #blog-page .bcard-body,
  .tool-card,
  .tool-page-hero {
    overflow:hidden !important;
  }
}


/* ============================================================
   DEVICE RENDERING — USABILITY FIXES (Score: C+ → B+)
   ============================================================ */

/* 1. VIEWPORT — prevent horizontal scroll on all devices */
html { overflow-x:hidden; -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body { overflow-x:hidden; }

/* 2. BASE FONT SIZE — minimum 16px for readability on mobile */
body { font-size:16px; }

/* 3. TOUCH TARGET SIZES — minimum 44x44px (Apple/Google standard) */
a, button, [role="button"], input[type="submit"], input[type="button"],
.btn, .cpill, .nav-links a, .abtn, .back-btn, .search-go,
.bpill, .ccard, .jcard, .lj-row, .wa-float {
  min-height:44px;
}
.nav-links a {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding-top:10px;
  padding-bottom:10px;
}
.btn { min-height:44px; display:inline-flex; align-items:center; justify-content:center; }
.cpill { min-height:40px; }
.hamburger { min-width:44px; min-height:44px; display:flex; align-items:center; justify-content:center; }

/* 4. INPUT / FORM ELEMENTS — font size min 16px prevents iOS zoom */
input, select, textarea {
  font-size:16px !important;
  -webkit-appearance:none;
  border-radius:8px;
}

/* 5. IMAGES — always responsive */
img, svg { max-width:100%; height:auto; display:block; }

/* 6. TAP HIGHLIGHT — custom colour instead of grey box */
* { -webkit-tap-highlight-color:rgba(232,71,10,0.12); }

/* 7. READABLE LINE HEIGHT */
p, li { line-height:1.7; }

/* 8. HERO TEXT — ensure clamp on small screens */
.hero h1 { font-size:clamp(1.5rem,5vw,3.4rem); }
.hero p  { font-size:clamp(0.9rem,2.5vw,1rem); }

/* 9. SEARCH BOX — full width + stacked on mobile */
@media(max-width:640px) {
  .search-box {
    flex-direction:column !important;
    width:100% !important;
    padding:8px !important;
    gap:0 !important;
    border-radius:14px !important;
  }
  .sg {
    border-right:none !important;
    border-bottom:1px solid var(--border) !important;
    padding:12px 14px !important;
    width:100% !important;
  }
  .sg:last-of-type { border-bottom:none !important; }
  .search-go {
    width:100% !important;
    padding:14px !important;
    font-size:1rem !important;
    border-radius:9px !important;
    margin-top:6px !important;
  }
}

/* 10. NAV — proper mobile fixed layout */
@media(max-width:880px) {
  nav { padding:8px 4% !important; min-height:56px; height:56px !important; }
  body { padding-top:56px !important; padding-bottom:58px; }
  .nav-actions .btn-outline { display:none; }
  .btn.btn-primary { padding:10px 16px !important; font-size:0.82rem !important; min-height:40px; }
}

/* 11. CATEGORY CARDS — 2-col grid on mobile */
@media(max-width:640px) {
  .cat-grid {
    grid-template-columns:repeat(2,1fr) !important;
    gap:10px !important;
  }
  .ccard { padding:14px 10px !important; }
  .ccard-label { font-size:0.78rem !important; }
}

/* 12. JOB CARDS — mobile alignment fix */
@media(max-width:880px) {
  .jcard { padding:14px 12px !important; }

  /* Top row: icon+title left, badge right — row direction always */
  .jc-top { flex-direction:row !important; align-items:flex-start !important; gap:10px !important; }
  .jc-left { flex-direction:row !important; align-items:flex-start !important; gap:10px !important; flex:1; min-width:0; }

  /* Icon — slightly smaller on mobile */
  .dept-ico { width:44px !important; height:44px !important; border-radius:11px !important; flex-shrink:0 !important; padding:6px !important; }

  /* Title + org text — must not overflow */
  .jc-info { min-width:0; flex:1; }
  .jc-title { font-size:0.9rem !important; line-height:1.35 !important; word-break:break-word; }
  .jc-org   { font-size:0.75rem !important; }

  /* Badge — stays top-right, no shrink */
  .jc-right { flex-shrink:0 !important; align-self:flex-start !important; }

  /* Meta row — wrap tightly */
  .jc-meta { gap:8px !important; margin:8px 0 !important; }
  .jmeta   { font-size:0.74rem !important; }

  /* Tags */
  .jc-tags { gap:4px !important; margin-bottom:10px !important; }
  .tag { font-size:0.69rem !important; padding:2px 8px !important; }

  /* Footer */
  .jc-foot { flex-wrap:wrap; gap:8px; }
  .jdate, .jdeadline { font-size:0.72rem !important; }
  .view-btn { font-size:0.78rem !important; padding:6px 14px !important; }
}

/* 13. FOOTER — single column on mobile */
@media(max-width:480px) {
  .fg { grid-template-columns:1fr !important; }
  footer { font-size:0.88rem; padding:28px 4% 20px !important; }
}

/* 14. SIDEBAR — hidden on mobile (already done, reinforcing) */
@media(max-width:880px) {
  .sidebar { display:none !important; }
}

/* 15. TEXT OVERFLOW — prevent horizontal bleed */
p, h1, h2, h3, h4, h5, h6, span, li, td, th, a, div {
  word-break:break-word;
  overflow-wrap:break-word;
  max-width:100%;
}

/* 16. TABLE OVERFLOW WRAPPER */
table { display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; max-width:100%; }

/* 17. HERO STATS — wrap properly on mobile */
@media(max-width:480px) {
  .hero-stats { gap:8px !important; }
  .hstat { padding:10px 14px !important; flex:1 1 calc(50% - 8px); min-width:120px; }
}

/* 18. PROCESS STEPS — stack on mobile */
@media(max-width:480px) {
  .process-steps { flex-direction:column !important; gap:6px; }
  .pstep-arrow { transform:rotate(90deg); display:block; text-align:center; }
}

/* 19. QUALIFICATION FILTER STRIP — visible on mobile only */
@media(max-width:880px) {
  #mobile-qual-strip { display:block !important; }
}

/* 20. BUTTON FOCUS — keyboard accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline:2px solid var(--saffron);
  outline-offset:2px;
}

/* 21. CONTENT WIDTH — max readable on large screens */
.main { max-width:1280px; margin:0 auto; }

/* 22. SMOOTH SCROLL & SCROLL PADDING for sticky nav */
html { scroll-padding-top:70px; }

/* ── QUALIFICATION POPUP MODAL ── */
#qual-popup-overlay {
  display:none;
  position:fixed; inset:0; z-index:9999;
  background:rgba(11,31,58,0.55);
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
  align-items:center; justify-content:center;
  padding:16px;
  animation:fadeInOverlay 0.2s ease;
}
#qual-popup-overlay.open { display:flex; }
@keyframes fadeInOverlay { from{opacity:0} to{opacity:1} }

#qual-popup-box {
  background:#fff;
  border-radius:20px;
  width:100%; max-width:600px;
  max-height:88vh;
  display:flex; flex-direction:column;
  box-shadow:0 24px 80px rgba(11,31,58,0.22);
  animation:slideUpModal 0.28s cubic-bezier(0.34,1.56,0.64,1);
  overflow:hidden;
}
@keyframes slideUpModal {
  from{transform:translateY(40px);opacity:0}
  to{transform:translateY(0);opacity:1}
}

#qual-popup-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 22px 14px;
  border-bottom:1px solid #E2E8F4;
  background:linear-gradient(135deg,#0B1F3A,#163560);
  flex-shrink:0;
}
#qual-popup-title {
  font-family:'Rajdhani',sans-serif;
  font-size:1.15rem; font-weight:700;
  color:#fff; line-height:1.3;
}
#qual-popup-subtitle {
  font-size:0.76rem; color:rgba(255,255,255,0.65);
  margin-top:3px;
}
#qual-popup-close {
  width:36px; height:36px;
  background:rgba(255,255,255,0.12);
  border:1px solid rgba(255,255,255,0.2);
  border-radius:50%; color:#fff;
  font-size:1.1rem; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0; transition:all 0.18s;
  font-weight:700; line-height:1;
}
#qual-popup-close:hover { background:rgba(232,71,10,0.7); border-color:transparent; transform:scale(1.1); }

#qual-popup-body {
  flex:1; overflow-y:auto;
  padding:16px 18px;
  -webkit-overflow-scrolling:touch;
}

.qpop-job-card {
  border:1.5px solid #E2E8F4;
  border-radius:12px;
  padding:13px 15px;
  margin-bottom:10px;
  background:#fff;
  cursor:pointer;
  transition:all 0.2s ease;
  position:relative;
}
.qpop-job-card:hover {
  border-color:rgba(232,71,10,0.3);
  box-shadow:0 6px 20px rgba(232,71,10,0.1);
  transform:translateY(-2px);
}
.qpop-job-card::before {
  content:'';position:absolute;left:0;top:0;bottom:0;width:3.5px;
  background:linear-gradient(180deg,var(--saffron),var(--saffron2));
  border-radius:3px 0 0 3px;
}
.qpop-title { font-size:0.9rem;font-weight:700;color:var(--navy);line-height:1.4;margin-bottom:4px; }
.qpop-meta { font-size:0.76rem;color:var(--muted);margin-bottom:6px; }
.qpop-tags { display:flex;flex-wrap:wrap;gap:5px;margin-bottom:8px; }
.qpop-tag {
  background:#F4F7FC;color:#475569;font-size:0.69rem;
  padding:2px 8px;border-radius:5px;border:1px solid #E2E8F4;
}
.qpop-tag.last-date { background:rgba(220,38,38,0.07);color:#DC2626;border-color:rgba(220,38,38,0.15);font-weight:700; }
.qpop-tag.posts { background:rgba(22,53,96,0.07);color:#163560;border-color:rgba(22,53,96,0.15);font-weight:700; }
.qpop-view-btn {
  background:linear-gradient(135deg,var(--navy),var(--navy2));
  color:#fff;border:none;padding:6px 14px;border-radius:7px;
  font-size:0.78rem;font-weight:600;cursor:pointer;
  font-family:'DM Sans',sans-serif;transition:all 0.2s;
  box-shadow:0 2px 8px rgba(11,31,58,0.15);
}
.qpop-view-btn:hover { background:linear-gradient(135deg,var(--saffron),var(--saffron2));box-shadow:0 4px 12px rgba(232,71,10,0.3); }

.qpop-empty {
  text-align:center;padding:40px 20px;color:var(--muted);
}
.qpop-empty div { font-size:2.5rem;margin-bottom:10px; }

#qual-popup-footer {
  padding:12px 18px;
  border-top:1px solid #E2E8F4;
  background:#F8FAFC;
  text-align:center;
  flex-shrink:0;
}
#qual-popup-footer span { font-size:0.78rem;color:var(--muted); }

/* ── GO TO TOP BUTTON ── */
#go-top-btn {
  position:fixed;
  bottom:24px; left:20px;
  z-index:8888;
  width:46px; height:46px;
  background:linear-gradient(135deg,var(--navy),var(--navy2));
  color:#fff;
  border:none; border-radius:50%;
  font-size:1.2rem;
  cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 6px 24px rgba(11,31,58,0.28);
  opacity:0; pointer-events:none;
  transform:translateY(16px);
  transition:opacity 0.3s ease, transform 0.3s ease, background 0.2s;
}
#go-top-btn.visible {
  opacity:1; pointer-events:auto;
  transform:translateY(0);
}
#go-top-btn:hover {
  background:linear-gradient(135deg,var(--saffron),var(--saffron2));
  box-shadow:0 8px 28px rgba(232,71,10,0.4);
  transform:translateY(-3px) scale(1.06);
}
@media(max-width:480px) {
  #go-top-btn { bottom:18px;left:14px;width:42px;height:42px;font-size:1rem; }
}

/* ── MOBILE BOTTOM NAV BAR ── */
#mobile-bottom-nav {
  display:none;
  position:fixed;
  bottom:0; left:0; right:0;
  z-index:9990;
  background:rgba(255,255,255,0.97);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border-top:1px solid #E2E8F4;
  box-shadow:0 -4px 24px rgba(11,31,58,0.1);
  height:58px;
  padding:0;
  flex-direction:row;
  align-items:stretch;
  justify-content:space-around;
}
.mbn-item {
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  padding:6px 2px 4px;
  color:#64748b;
  text-decoration:none;
  font-size:0.62rem;
  font-weight:600;
  letter-spacing:0.1px;
  transition:color 0.18s;
  -webkit-tap-highlight-color:transparent;
  border-bottom:2px solid transparent;
}
.mbn-item.active, .mbn-item:active {
  color:var(--saffron);
  border-bottom-color:var(--saffron);
}
.mbn-icon { font-size:1.18rem; line-height:1; }
.mbn-label { font-size:0.6rem; line-height:1; }

@media(max-width:880px) {
  #mobile-bottom-nav { display:flex; }
}

/* ===== SHIMMER SKELETON — Jobs load hone tak dikhega ===== */
@keyframes shimmer-wave {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.shimmer-card {
  background: #fff;
  border: 1.5px solid #E2E8F4;
  border-left: 4px solid #E2E8F4;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(11,31,58,0.06);
}
.shimmer-line {
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75%);
  background-size: 600px 100%;
  animation: shimmer-wave 1.4s infinite linear;
}
.shimmer-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}
.shimmer-title  { height: 16px; width: 65%; margin-bottom: 8px; }
.shimmer-org    { height: 12px; width: 45%; margin-bottom: 12px; }
.shimmer-tags   { height: 11px; width: 80%; margin-bottom: 10px; }
.shimmer-footer { height: 11px; width: 50%; }



/* AdSense review fix: show only the requested SPA page before JS routing completes */
html[data-initial-route]:not([data-initial-route="home"]):not([data-initial-route="detail"]) #home-page { display:none !important; }
html[data-initial-route="home"] #home-page { display:block !important; }
html[data-initial-route="latest"] #latest-page,
html[data-initial-route="results"] #results-page,
html[data-initial-route="admitcard"] #admitcard-page,
html[data-initial-route="blog"] #blog-page,
html[data-initial-route="blog-detail"] #blog-detail-page,
html[data-initial-route="about"] #about-page,
html[data-initial-route="contact"] #contact-page,
html[data-initial-route="privacy"] #privacy-page,
html[data-initial-route="disclaimer"] #disclaimer-page,
html[data-initial-route="detail"] #detail-page { display:block !important; }
html[data-initial-route="about"] .ticker-wrap,
html[data-initial-route="contact"] .ticker-wrap,
html[data-initial-route="privacy"] .ticker-wrap,
html[data-initial-route="disclaimer"] .ticker-wrap { display:none !important; }

/* AdSense iframe obsolete attribute overrides */
iframe { border:0; margin:0; padding:0; }
@supports not (backdrop-filter: blur(1px)) {
  nav { background: rgba(255,255,255,0.98) !important; }
  #mobile-bottom-nav { background: rgba(255,255,255,0.99) !important; }
  .cpill { background: rgba(255,255,255,0.95) !important; }
  #qual-popup-overlay { background: rgba(0,0,0,0.5) !important; }
  .scard { background: rgba(255,255,255,0.98) !important; }
}
</style>
<!-- Google AdSense Auto Ads -->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9338172815146651"
     crossorigin="anonymous"></script>
<!-- Force body visible — AdSense kabhi kabhi body display:none kar deta hai -->
<script>
(function(){
  function forceBodyVisible() {
    document.body.style.setProperty('display','block','important');
    document.body.style.setProperty('opacity','1','important');
    document.body.style.setProperty('visibility','visible','important');
    document.documentElement.style.setProperty('opacity','1','important');
    document.documentElement.style.setProperty('visibility','visible','important');
  }
  forceBodyVisible();
  document.addEventListener('DOMContentLoaded', forceBodyVisible);
  window.addEventListener('load', forceBodyVisible);
  // Har 500ms check karo — AdSense async load ke baad bhi fix rahe
  var _bodyFixInterval = setInterval(function(){
    if(document.body && getComputedStyle(document.body).display === 'none') {
      forceBodyVisible();
    }
  }, 500);
  // 10 second baad interval band karo
  setTimeout(function(){ clearInterval(_bodyFixInterval); }, 10000);
})();
</script>
<script>
// Keep this false during AdSense review to avoid empty ad blocks / low content-to-ad ratio.
// Change to true only after AdSense approval and after adding real ad units intentionally.
const NKJ_ADS_ENABLED = false;

function isRealAdSlot(slot) {
  return !!slot && !/^REPLACE_/.test(slot) && !/^NEW_/.test(slot);
}

function hideReviewAds(scope = document) {
  const ads = scope && scope.querySelectorAll ? scope.querySelectorAll('ins.adsbygoogle') : [];
  ads.forEach(ad => {
    const parent = ad.closest('.ad-block') || ad.parentElement;
    if (parent) parent.style.display = 'none';
    ad.style.display = 'none';
  });
}

function initAds(scope = document) {
  if (!scope) return;
  if (!NKJ_ADS_ENABLED) { hideReviewAds(scope); return; }
  const ads = scope.querySelectorAll ? scope.querySelectorAll('ins.adsbygoogle') : [];
  ads.forEach(ad => {
    if (ad.dataset.adInit === '1') return;
    const slot = ad.getAttribute('data-ad-slot') || '';
    if (!isRealAdSlot(slot)) return;
    try {
      (window.adsbygoogle = window.adsbygoogle || []).push({});
      ad.dataset.adInit = '1';
    } catch (err) {
      console.warn('[NKJ] AdSense init skipped:', err);
    }
  });
}

document.addEventListener('DOMContentLoaded', () => initAds(document));
</script>

<!-- ════════════════════════════════════════════════════════════════
  EARLY META INJECTOR — Google rendering ke liye
  Firebase fetch se pehle hi URL dekh ke correct title/description/
  canonical set karta hai. Googlebot second render mein bhi sahi
  meta tags dekhta hai. Koi delay nahi.
════════════════════════════════════════════════════════════════ -->
<script>
(function() {
  var path = window.location.pathname.replace(/\/$/, '') || '/';

  // Job + Blog meta data map — apne Firebase jobs ke slugs yahan add karo
  var META = {
    '/latest-jobs': {
      title: 'Latest Sarkari Jobs 2026 — All India Government Job Vacancies | NaukriKhoj.in',
      desc:  'Latest sarkari naukri 2026 — Railway, Bank, SSC, UPSC, Police, MPSC. Eligibility, vacancies, last date aur apply link — bilkul free. NaukriKhoj.in.',
      canonical: 'https://naukrikhoj.in/latest-jobs'
    },
    '/blog': {
      title: 'Sarkari Naukri Blog — Tips, Strategies & Guides | NaukriKhoj.in',
      desc:  'Sarkari naukri preparation tips, exam strategies aur government job guides in Hindi aur Marathi. NaukriKhoj.in Blog.',
      canonical: 'https://naukrikhoj.in/blog'
    },
    '/results': {
      title: 'Sarkari Exam Results 2026 — Latest Government Job Results | NaukriKhoj.in',
      desc:  'Latest sarkari exam results 2026 — SSC, Railway, Bank, UPSC, MPSC. Result date, merit list aur cut-off — NaukriKhoj.in.',
      canonical: 'https://naukrikhoj.in/results',
      robots: 'noindex, follow'
    },
    '/admit-card': {
      title: 'Admit Card 2026 — Download Hall Ticket for Sarkari Exams | NaukriKhoj.in',
      desc:  'Download admit card 2026 for Railway, SSC, Bank, MPSC aur other sarkari exams. Hall ticket release date aur direct download link — NaukriKhoj.in.',
      canonical: 'https://naukrikhoj.in/admit-card',
      robots: 'noindex, follow'
    },
    '/about': {
      title: 'About Us — NaukriKhoj.in',
      desc:  'Learn about NaukriKhoj.in, a free government job information portal with latest updates for Railway, Bank, SSC, UPSC, Police and state jobs.',
      canonical: 'https://naukrikhoj.in/about'
    },
    '/contact': {
      title: 'Contact Us — NaukriKhoj.in',
      desc:  'Contact NaukriKhoj.in for questions, suggestions or feedback related to government job updates and site information.',
      canonical: 'https://naukrikhoj.in/contact'
    },
    '/privacy': {
      title: 'Privacy Policy — NaukriKhoj.in',
      desc:  'Read the privacy policy of NaukriKhoj.in, including information on local storage, ads and external links.',
      canonical: 'https://naukrikhoj.in/privacy'
    },
    '/disclaimer': {
      title: 'Disclaimer — NaukriKhoj.in',
      desc:  'Read the disclaimer for NaukriKhoj.in. We are an informational portal and users should verify all details from official government sources.',
      canonical: 'https://naukrikhoj.in/disclaimer'
    },
    '/tools/age': {
      title: 'Age Calculator — NaukriKhoj.in',
      desc:  'Use the free age calculator on NaukriKhoj.in to check your age as on a specific date for government job eligibility.',
      canonical: 'https://naukrikhoj.in/tools/age'
    },
    '/tools/qualification': {
      title: 'Qualification Checker — NaukriKhoj.in',
      desc:  'Check government jobs by qualification such as 10th, 12th, ITI, Diploma or Graduate using NaukriKhoj.in Qualification Checker.',
      canonical: 'https://naukrikhoj.in/tools/qualification'
    },
    '/tools/photo-resizer': {
      title: 'Photo / Signature Resizer — NaukriKhoj.in',
      desc:  'Resize photo and signature for online forms with the free NaukriKhoj.in Photo / Signature Resizer.',
      canonical: 'https://naukrikhoj.in/tools/photo-resizer'
    }
  };

  // Blog URL pattern match — /blog/slug-id
  if (!META[path] && path.startsWith('/blog/')) {
    var bSlug = path.replace('/blog/', '');
    META[path] = {
      title: bSlug.replace(/-\d+$/, '').replace(/-/g, ' ').replace(/\b\w/g, function(c){ return c.toUpperCase(); }) + ' | NaukriKhoj.in Blog',
      desc:  'NaukriKhoj.in Blog — Sarkari naukri tips, preparation guide aur exam updates in Hindi aur Marathi.',
      canonical: 'https://naukrikhoj.in' + path
    };
  }

  // Result URL pattern match — /result/slug-id
  if (!META[path] && path.startsWith('/result/')) {
    var rSlug = path.replace('/result/', '');
    var rTitle = rSlug.replace(/-\d+$/, '').replace(/-/g, ' ').replace(/\w/g, function(c){ return c.toUpperCase(); });
    META[path] = {
      title: rTitle + ' — Result | NaukriKhoj.in',
      desc:  'Check result details, important dates and official result link on NaukriKhoj.in.',
      canonical: 'https://naukrikhoj.in' + path
    };
  }

  // Admit card detail pattern — /admit-card/slug-id
  if (!META[path] && path.startsWith('/admit-card/') && path !== '/admit-card') {
    var aSlug = path.replace('/admit-card/', '');
    var aTitle = aSlug.replace(/-\d+$/, '').replace(/-/g, ' ').replace(/\w/g, function(c){ return c.toUpperCase(); });
    META[path] = {
      title: aTitle + ' — Admit Card | NaukriKhoj.in',
      desc:  'Check admit card details, exam date and official download link on NaukriKhoj.in.',
      canonical: 'https://naukrikhoj.in' + path
    };
  }

  // Job URL pattern match — /job/slug-id (for dynamic Firebase jobs)
  if (!META[path] && path.startsWith('/job/')) {
    var jSlug = path.replace('/job/', '');
    var jTitle = jSlug.replace(/-\d+$/, '').replace(/-/g, ' ').replace(/\b\w/g, function(c){ return c.toUpperCase(); });
    META[path] = {
      title: jTitle + ' — Eligibility, Last Date, Apply Link | NaukriKhoj.in',
      desc:  jTitle + ' recruitment 2026 — eligibility, vacancies, last date aur official apply link. NaukriKhoj.in pe free government job updates.',
      canonical: 'https://naukrikhoj.in' + path
    };
  }

  var m = META[path];
  if (m) {
    // Update title
    document.title = m.title;

    // Update meta description
    var metaDesc = document.querySelector('meta[name="description"]');
    if (metaDesc) metaDesc.setAttribute('content', m.desc);

    // Update canonical
    var canonical = document.getElementById('canonical-url');
    if (canonical) canonical.setAttribute('href', m.canonical);

    // Update robots for review-sensitive thin pages
    var robots = document.getElementById('meta-robots');
    if (robots && m.robots) robots.setAttribute('content', m.robots);

    // Update OG tags
    var ogTitle = document.querySelector('meta[property="og:title"]');
    if (ogTitle) ogTitle.setAttribute('content', m.title);
    var ogDesc  = document.querySelector('meta[property="og:description"]');
    if (ogDesc)  ogDesc.setAttribute('content', m.desc);
    var ogUrl   = document.querySelector('meta[property="og:url"]');
    if (ogUrl)   ogUrl.setAttribute('content', m.canonical);

    // Update Twitter
    var twTitle = document.querySelector('meta[name="twitter:title"]');
    if (twTitle) twTitle.setAttribute('content', m.title);
    var twDesc  = document.querySelector('meta[name="twitter:description"]');
    if (twDesc)  twDesc.setAttribute('content', m.desc);
  }
})();
</script>
</head>
<body>
<div class="tricolor"></div>

<nav aria-label="Main navigation">
  <div class="logo" onclick="showHome()" role="button" aria-label="Go to NaukriKhoj home" tabindex="0">
    <div class="logo-icon">🏛️</div>
    <div class="logo-text">NaukriKhoj<span>.in</span></div>
  </div>
  <ul class="nav-links" id="nav-menu">
    <li><a href="/" onclick="showHome();closeMenu();return false;" aria-label="Home - NaukriKhoj">🏠 Home</a></li>
    <li><a href="/latest-jobs" onclick="showLatestJobs();closeMenu();return false;" aria-label="Latest Government Jobs">📋 Latest Jobs</a></li>
    <li><a href="/blog" onclick="showBlogPage();closeMenu();return false;" aria-label="Blog - Sarkari Naukri Guides">✍️ Blog</a></li>
  </ul>
  <div class="nav-actions">
    <button class="btn btn-primary" onclick="showLatestJobs()" aria-label="View latest government jobs">📋 View Jobs</button>
  </div>
</nav>

<!-- MOBILE BOTTOM NAV BAR -->
<nav id="mobile-bottom-nav">
  <a href="/" onclick="showHome();return false;" id="mbn-home" class="mbn-item active">
    <span class="mbn-icon">🏠</span>
    <span class="mbn-label">Home</span>
  </a>
  <a href="/latest-jobs" onclick="showLatestJobs();return false;" id="mbn-latest" class="mbn-item">
    <span class="mbn-icon">📋</span>
    <span class="mbn-label">Latest Jobs</span>
  </a>
  <a href="/blog" onclick="showBlogPage();return false;" id="mbn-blog" class="mbn-item">
    <span class="mbn-icon">✍️</span>
    <span class="mbn-label">Blog</span>
  </a>
</nav>

<!-- HOME PAGE -->
<main id="home-page">
  <!-- Mobile Qualification Filter — desktop pe hidden, mobile pe visible -->
  <div class="cat-strip" id="mobile-qual-strip" style="display:none; padding:8px 12px; background:#fff; border-bottom:1px solid #E2E8F4;">
    <select id="mobile-qual-select" class="state-dropdown" style="width:100%;font-size:0.85rem;" onchange="mobileSidebarQualFilter()" aria-label="Qualification filter">
      <option value="">-- Select Qualification --</option>
    </select>
    <div id="mobile-qual-results" style="margin-top:8px;max-height:260px;overflow-y:auto;"></div>
  </div>

  <div class="main">
    <div>
      <div class="jlist-head">
        <div><h1 class="jlist-title" style="display:inline;font-size:inherit;font-weight:inherit;margin:0;">All India Sarkari Naukri Recruitment 2026 — Last Date &amp; Days Left</h1><span class="jcount" id="jobs-count">Live</span></div>
      </div>

      <!-- STATIC CRAWLER-VISIBLE CONTENT: Always in DOM, hidden after JS loads -->
      <div id="static-job-preview" style="margin-bottom:8px;"></div>
      <div id="jobs-list">
        <!-- ═══ STATIC SEO JOB CARDS — Crawler ke liye (JS load hone ke baad replace hoga) ═══ -->
        <div id="static-seo-jobs">
          <div style="background:#fff;border:1.5px solid #E2E8F4;border-left:4px solid #E8470A;border-radius:14px;padding:18px 20px;margin-bottom:12px;box-shadow:0 2px 8px rgba(11,31,58,0.06);">
            <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.05rem;font-weight:800;color:#0B1F3A;margin:0 0 8px;">Latest Sarkari Naukri Updates from Official Sources</h2>
            <p style="font-size:0.86rem;color:#475569;line-height:1.7;margin:0 0 10px;">NaukriKhoj.in publishes government job information from official notifications. Each live listing is intended to include vacancy details, eligibility, important dates, application fee, document checklist and official apply / notification links.</p>
            <div style="display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px;">
              <div style="background:#F8FAFC;border:1px solid #E2E8F4;border-radius:10px;padding:12px;"><strong style="color:#0B1F3A;font-size:0.85rem;">Verify first</strong><p style="font-size:0.78rem;color:#64748b;line-height:1.55;margin:5px 0 0;">Always open the official notification before applying.</p></div>
              <div style="background:#F8FAFC;border:1px solid #E2E8F4;border-radius:10px;padding:12px;"><strong style="color:#0B1F3A;font-size:0.85rem;">Check eligibility</strong><p style="font-size:0.78rem;color:#64748b;line-height:1.55;margin:5px 0 0;">Confirm age limit, education, category relaxation and fee.</p></div>
              <div style="background:#F8FAFC;border:1px solid #E2E8F4;border-radius:10px;padding:12px;"><strong style="color:#0B1F3A;font-size:0.85rem;">Keep documents ready</strong><p style="font-size:0.78rem;color:#64748b;line-height:1.55;margin:5px 0 0;">Photo, signature, ID proof and certificates should match the form.</p></div>
            </div>
          </div>
        </div>
      </div>
      <div id="no-jobs-msg" style="display:none;visibility:hidden;height:0;overflow:hidden;margin:0;" hidden>
        <div style="background:#fff;border:1.5px solid var(--border);border-radius:14px;padding:22px;box-shadow:var(--shadow-xs);">
          <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.15rem;color:var(--navy);margin:0 0 8px;">Live jobs are being updated</h2>
          <p style="font-size:0.88rem;color:var(--muted);line-height:1.75;margin:0 0 10px;">No live job card is available right now. Please check again after some time or read the latest preparation guides on the blog.</p>
          <button onclick="showBlogPage()" style="background:var(--saffron);color:#fff;border:none;padding:9px 18px;border-radius:8px;font-weight:700;cursor:pointer;font-family:'DM Sans',sans-serif;">Read Job Guides</button>
        </div>
      </div>
      <!-- Content + Ad Section: Sarkari Naukri Info Banner -->
      <div style="background:#fff;border:1.5px solid #E2E8F4;border-radius:16px;padding:20px 24px;margin:16px 0;box-shadow:0 2px 12px rgba(11,31,58,0.06);">
        <div style="display:flex;align-items:flex-start;gap:16px;flex-wrap:wrap;">
          <div style="flex:1;min-width:220px;">
            <div style="font-family:'Rajdhani',sans-serif;font-size:1.1rem;font-weight:700;color:#0B1F3A;margin-bottom:6px;">🇮🇳 Sarkari Naukri 2026 — Free Job Updates</div>
            <p style="font-size:0.85rem;color:#64748b;line-height:1.7;margin:0;">NaukriKhoj.in pe Railway, Bank, SSC, UPSC, Police, MPSC aur State Govt jobs ki latest vacancy updates milti hain. Hindi, Marathi aur English mein free government job updates pao — koi payment nahi, bilkul muft.</p>
          </div>
          <div style="flex-shrink:0;display:flex;gap:8px;flex-wrap:wrap;align-items:center;">
            <div style="text-align:center;background:#F4F7FC;border-radius:10px;padding:10px 16px;border:1px solid #E2E8F4;"><div style="font-family:'Rajdhani',sans-serif;font-size:1.4rem;font-weight:700;color:#E8470A;">8+</div><div style="font-size:0.7rem;color:#64748b;font-weight:600;">Categories</div></div>
            <div style="text-align:center;background:#F4F7FC;border-radius:10px;padding:10px 16px;border:1px solid #E2E8F4;"><div style="font-family:'Rajdhani',sans-serif;font-size:1.4rem;font-weight:700;color:#E8470A;">28+</div><div style="font-size:0.7rem;color:#64748b;font-weight:600;">States</div></div>
            <div style="text-align:center;background:#F4F7FC;border-radius:10px;padding:10px 16px;border:1px solid #E2E8F4;"><div style="font-family:'Rajdhani',sans-serif;font-size:1.4rem;font-weight:700;color:#00875A;">Free</div><div style="font-size:0.7rem;color:#64748b;font-weight:600;">Always</div></div>
          </div>
        </div>
        <!-- Ad inside content block -->
        <div style="margin-top:16px;border-top:1px solid #E2E8F4;padding-top:14px;">
          <!-- SLOT: HOME_CONTENT_BANNER (90px) — AdSense mein "Home Content Banner" unit banao -->
          <!-- AdSense unit disabled during review: enable only after approval and after adding enough original content. -->
</div>
      </div>
    </div>
    <div class="sidebar">
      <!-- ── Qualification Filter Box ── -->
      <div class="scard" style="margin-bottom:12px;">
        <div class="stitle">🎓 Search Jobs by Qualification</div>
        <div style="margin-top:10px;">
          <select id="sidebar-qual-select" class="state-dropdown" style="margin-bottom:8px;" onchange="sidebarQualFilter()" aria-label="Filter by qualification">
            <option value="">-- Select Qualification --</option>
          </select>
          <div id="sidebar-qual-results" style="max-height:280px;overflow-y:auto;"></div>
        </div>
      </div>
      <div class="scard useful-tools-sidebar-card">
        <div class="stitle">🛠 Useful Tools</div>
        <div class="tool-shortcut-list">
          <div class="tool-shortcut-item" onclick="showTool('age')">
            <div class="tool-shortcut-head">
              <div class="tool-shortcut-name">🎂 Age Calculator</div>
              <span class="tool-chip">Free</span>
            </div>
            <div class="tool-shortcut-desc">DOB se current age instantly check karo.</div>
            <div class="tool-shortcut-actions">
              <div class="tool-helper" style="margin-top:0;">Useful for SSC, Bank, Railway, Police forms</div>
              <button class="tool-launch-btn" onclick="event.stopPropagation();showTool('age')">Open Tool →</button>
            </div>
          </div>
          <div class="tool-shortcut-item" onclick="showTool('qualification')">
            <div class="tool-shortcut-head">
              <div class="tool-shortcut-name">🎓 Qualification Checker</div>
              <span class="tool-chip">Free</span>
            </div>
            <div class="tool-shortcut-desc">10th, 12th, ITI, Diploma ya Graduate ke hisaab se matching jobs dekho.</div>
            <div class="tool-shortcut-actions">
              <div class="tool-helper" style="margin-top:0;">Current live jobs me se quick shortlist</div>
              <button class="tool-launch-btn" onclick="event.stopPropagation();showTool('qualification')">Open Tool →</button>
            </div>
          </div>
          <div class="tool-shortcut-item" onclick="showTool('photo-resizer')">
            <div class="tool-shortcut-head">
              <div class="tool-shortcut-name">🖼️ Photo / Signature Resizer</div>
              <span class="tool-chip">Free</span>
            </div>
            <div class="tool-shortcut-desc">Photo aur signature ko size, dimensions aur download ke saath ready karo.</div>
            <div class="tool-shortcut-actions">
              <div class="tool-helper" style="margin-top:0;">Exam form upload ke liye handy</div>
              <button class="tool-launch-btn" onclick="event.stopPropagation();showTool('photo-resizer')">Open Tool →</button>
            </div>
          </div>
        </div>
      </div>
      <div class="scard" id="closing-sidebar">
        <div class="stitle">🔴 Closing Soon</div>
        <div id="closing-list" aria-live="polite"></div>
      </div>
      <div class="scard">
        <div class="stitle">📍 Jobs by State</div>
        <select class="state-dropdown" onchange="filterByState(this.value)" aria-label="Filter by state">
          <option value="">-- Select State --</option>
          <option value="All India">🇮🇳 All India</option>
          <optgroup label="── Popular States ──">
          <option value="Maharashtra">Maharashtra</option>
          <option value="Uttar Pradesh">Uttar Pradesh</option>
          <option value="Rajasthan">Rajasthan</option>
          <option value="Bihar">Bihar</option>
          <option value="Gujarat">Gujarat</option>
          <option value="Madhya Pradesh">Madhya Pradesh</option>
          <option value="Karnataka">Karnataka</option>
          <option value="Tamil Nadu">Tamil Nadu</option>
          </optgroup>
          <optgroup label="── All States ──">
          <option value="Andhra Pradesh">Andhra Pradesh</option>
          <option value="Arunachal Pradesh">Arunachal Pradesh</option>
          <option value="Assam">Assam</option>
          <option value="Chhattisgarh">Chhattisgarh</option>
          <option value="Goa">Goa</option>
          <option value="Haryana">Haryana</option>
          <option value="Himachal Pradesh">Himachal Pradesh</option>
          <option value="Jharkhand">Jharkhand</option>
          <option value="Kerala">Kerala</option>
          <option value="Manipur">Manipur</option>
          <option value="Meghalaya">Meghalaya</option>
          <option value="Mizoram">Mizoram</option>
          <option value="Nagaland">Nagaland</option>
          <option value="Odisha">Odisha</option>
          <option value="Punjab">Punjab</option>
          <option value="Sikkim">Sikkim</option>
          <option value="Telangana">Telangana</option>
          <option value="Tripura">Tripura</option>
          <option value="Uttarakhand">Uttarakhand</option>
          <option value="West Bengal">West Bengal</option>
          </optgroup>
          <optgroup label="── UTs ──">
          <option value="Delhi">Delhi</option>
          <option value="Jammu and Kashmir">Jammu & Kashmir</option>
          <option value="Chandigarh">Chandigarh</option>
          <option value="Puducherry">Puducherry</option>
          </optgroup>
        </select>
      </div>
    </div>
  </div>



  <div class="cats-section">
    <div class="cs-head"><div><div class="cs-title">Browse by <span>Category</span></div></div><a href="/latest-jobs" onclick="showLatestJobs();return false;" style="color:var(--saffron);font-size:0.88rem;font-weight:600;">View All →</a></div>
    <div class="cat-grid">
      <div class="ccard" onclick="filterCat('Railway',null)"><div class="ccard-ico">🚂</div><div class="ccard-label">Railway Jobs</div><div class="ccard-count"><b id="cc-railway">Latest</b> Vacancies</div></div>
      <div class="ccard" onclick="filterCat('Bank',null)"><div class="ccard-ico">🏦</div><div class="ccard-label">Bank Jobs</div><div class="ccard-count"><b id="cc-bank">Latest</b> Vacancies</div></div>
      <div class="ccard" onclick="filterCat('Police',null)"><div class="ccard-ico">👮</div><div class="ccard-label">Police / Army</div><div class="ccard-count"><b id="cc-police">Latest</b> Vacancies</div></div>
      <div class="ccard" onclick="filterCat('SSC',null)"><div class="ccard-ico">📋</div><div class="ccard-label">SSC / UPSC</div><div class="ccard-count"><b id="cc-ssc">Latest</b> Vacancies</div></div>
      <div class="ccard" onclick="filterCat('State',null)"><div class="ccard-ico">🏛️</div><div class="ccard-label">State Govt</div><div class="ccard-count"><b id="cc-state">Latest</b> Vacancies</div></div>
      <div class="ccard" onclick="filterCat('Teaching',null)"><div class="ccard-ico">📖</div><div class="ccard-label">Teaching</div><div class="ccard-count"><b id="cc-teaching">Latest</b> Vacancies</div></div>
      <div class="ccard" onclick="filterCat('Medical',null)"><div class="ccard-ico">🏥</div><div class="ccard-label">Medical</div><div class="ccard-count"><b id="cc-medical">Latest</b> Vacancies</div></div>
      <div class="ccard" onclick="filterCat('Defence',null)"><div class="ccard-ico" style="font-size:0.82rem;font-weight:800;letter-spacing:0.6px;">DEF</div><div class="ccard-label">Defence</div><div class="ccard-count"><b id="cc-defence">Latest</b> Vacancies</div></div>
    </div>
  </div>


  <!-- ===== PERMANENT SECTION 1: ABOUT NAUKRIKHOJ ===== -->
  <div class="seo-section alt">
    <div class="seo-section-title">NaukriKhoj<span>.in</span> ke baare mein</div>
    <div class="seo-section-sub">Maharashtra Sarkari Job Update 2026 — Free Govt Job Alerts, Maharashtra Sarkari Naukri, Sarkari Job Update</div>
    <div class="about-grid">
      <div class="about-text">
        <p><strong>NaukriKhoj.in</strong> ek free online platform hai jo Indian job seekers ko latest sarkari naukri notifications ek jagah provide karta hai. Railway, Bank, SSC, UPSC, Police, Army, Teaching, Medical aur State Government jobs ki complete information — eligibility, vacancy details, important dates, aur official apply links — sab kuch yahan milta hai.</p>
        <p>Hum <strong>Maharashtra ke candidates</strong> ke liye specially Marathi mein bhi job notifications provide karte hain. MPSC, Police Bharti, Zilla Parishad, Nagar Parishad, Mahanagar Palika aur sabhi Maharashtra state government jobs ki updates yahan milti hain.</p>
        <p>Hamara goal ek simple hai — <strong>sarkari naukri ki information har Indian tak free mein pahunche</strong>, chahe woh Hindi padhe, Marathi padhe, ya English mein. Koi registration nahi, koi fees nahi — sirf free job alerts.</p>
      </div>
      <div class="about-stats">
        <div class="astat"><div class="astat-num">8+</div><div class="astat-lbl">Job Categories</div></div>
        <div class="astat"><div class="astat-num">28+</div><div class="astat-lbl">States Covered</div></div>
        <div class="astat"><div class="astat-num">3</div><div class="astat-lbl">Languages</div></div>
        <div class="astat"><div class="astat-num">Free</div><div class="astat-lbl">Always Free</div></div>
      </div>
    </div>
  </div>


  <!-- ===== MOBILE USEFUL TOOLS SECTION ===== -->
  <div class="seo-section alt mobile-tools-section">
    <div class="seo-section-title">Useful <span>Tools</span></div>
    <div class="seo-section-sub">Govt job updates ke saath form filling aur age/qualification check ke kaam aane wale tools</div>
    <div class="mobile-tools-grid">
      <div class="mobile-tool-card" onclick="showTool('age')">
        <div class="mobile-tool-icon">🎂</div>
        <div class="mobile-tool-title">Age Calculator</div>
        <div class="mobile-tool-desc">DOB daalke current age turant check karo.</div>
        <div class="mobile-tool-actions">
          <div class="mobile-tool-note">Free</div>
          <button class="tool-launch-btn" onclick="event.stopPropagation();showTool('age')">Open Tool →</button>
        </div>
      </div>
      <div class="mobile-tool-card" onclick="showTool('qualification')">
        <div class="mobile-tool-icon">🎓</div>
        <div class="mobile-tool-title">Qualification Checker</div>
        <div class="mobile-tool-desc">10th, 12th, ITI, Diploma ya Graduate ke hisaab se matching jobs dekho.</div>
        <div class="mobile-tool-actions">
          <div class="mobile-tool-note">Free</div>
          <button class="tool-launch-btn" onclick="event.stopPropagation();showTool('qualification')">Open Tool →</button>
        </div>
      </div>
      <div class="mobile-tool-card" onclick="showTool('photo-resizer')">
        <div class="mobile-tool-icon">🖼️</div>
        <div class="mobile-tool-title">Photo / Signature Resizer</div>
        <div class="mobile-tool-desc">Photo aur signature ko dimensions aur target size ke saath resize karo.</div>
        <div class="mobile-tool-actions">
          <div class="mobile-tool-note">Free</div>
          <button class="tool-launch-btn" onclick="event.stopPropagation();showTool('photo-resizer')">Open Tool →</button>
        </div>
      </div>
    </div>
  </div>

  <!-- ===== PERMANENT SECTION 2: HOW IT WORKS ===== -->
  <div class="seo-section">
    <div class="seo-section-title">Sarkari Naukri Kaise <span>Dhundein?</span></div>
    <div class="seo-section-sub">Sirf 4 steps mein apni government job find karo</div>
    <div class="hiw-grid">
      <div class="hiw-card">
        <div class="hiw-num">01</div>
        <span class="hiw-ico">🔍</span>
        <div class="hiw-title">Job Browse Karo</div>
        <div class="hiw-desc">Category ya state ke hisaab se filter karo — Railway, Bank, Police, SSC ya koi bhi sarkari vibhag.</div>
      </div>
      <div class="hiw-card">
        <div class="hiw-num">02</div>
        <span class="hiw-ico">📋</span>
        <div class="hiw-title">Details Padho</div>
        <div class="hiw-desc">Eligibility, vacancies, salary, last date aur selection process ki complete information ek jagah.</div>
      </div>
      <div class="hiw-card">
        <div class="hiw-num">03</div>
        <span class="hiw-ico">🔔</span>
        <div class="hiw-title">Updates Check Karo</div>
        <div class="hiw-desc">Latest Jobs aur Blog pages regularly check karo. Email preference locally save ho sakti hai; full alerts launch hone par policy update hogi.</div>
      </div>
      <div class="hiw-card">
        <div class="hiw-num">04</div>
        <span class="hiw-ico">✅</span>
        <div class="hiw-title">Official Site Pe Apply Karo</div>
        <div class="hiw-desc">Seedha official government website ka link milega — safe aur authentic application process.</div>
      </div>
    </div>
  </div>

  <!-- ===== PERMANENT SECTION 3: JOB TYPES INFO ===== -->
  <div class="seo-section alt">
    <div class="seo-section-title">Konsi <span>Sarkari Naukri</span> Aapke Liye Sahi Hai?</div>
    <div class="seo-section-sub">Alag-alag vibhagon ki naukri ki complete jankari</div>
    <div class="jtype-grid">
      <div class="jtype-card">
        <div class="jtype-ico">🚂</div>
        <div class="jtype-title">Railway Jobs</div>
        <div class="jtype-desc">Indian Railways mein Group A, B, C aur D posts — RRB NTPC, Group D, ALP, JE, SSE aur aur bhi. 10th pass se graduation tak sab ke liye vacancies nikalti hain. Salary ₹18,000 se ₹2,00,000+ tak.</div>
      </div>
      <div class="jtype-card">
        <div class="jtype-ico">🏦</div>
        <div class="jtype-title">Bank Jobs</div>
        <div class="jtype-desc">SBI, IBPS PO, Clerk, SO, RRB — government banking sector mein lakhs of vacancies. Graduation zaruri hai. IBPS aur SBI exam through selection. Best job for commerce students.</div>
      </div>
      <div class="jtype-card">
        <div class="jtype-ico">👮</div>
        <div class="jtype-title">Police / Army Jobs</div>
        <div class="jtype-desc">Maharashtra Police Bharti, CRPF, BSF, CISF, SSB, Army GD, NDA — physical fitness ke saath service ka mauka. 10th se graduation tak posts available hain.</div>
      </div>
      <div class="jtype-card">
        <div class="jtype-ico">📋</div>
        <div class="jtype-title">SSC / UPSC Jobs</div>
        <div class="jtype-desc">SSC CGL, CHSL, MTS, CPO — central government ke top posts. UPSC Civil Services — IAS, IPS, IFS. India ki sabse prestigious government exams.</div>
      </div>
      <div class="jtype-card">
        <div class="jtype-ico">🏛️</div>
        <div class="jtype-title">State Govt / MPSC</div>
        <div class="jtype-desc">Maharashtra mein MPSC Rajyaseva, Police Bharti, Zilla Parishad, Nagar Palika, Mahanagar Palika aur sabhi state government departments ki latest vacancies.</div>
      </div>
      <div class="jtype-card">
        <div class="jtype-ico">📖</div>
        <div class="jtype-title">Teaching Jobs</div>
        <div class="jtype-desc">CTET, STET, KVS, NVS, Maharashtra TET — primary se college level tak teaching posts. B.Ed ya D.Ed qualified candidates ke liye best opportunity.</div>
      </div>
    </div>
  </div>

  <!-- ===== PERMANENT SECTION 4: FAQ ===== -->
  <div class="seo-section">
    <div class="seo-section-title" style="text-align:center;">Aksar Pooche Jane Wale <span>Sawaal</span></div>
    <div class="seo-section-sub" style="text-align:center;">Government jobs ke baare mein aapke sabhi sawaalon ke jawab</div>
    <div class="faq-list">

      <div class="faq-item">
        <div class="faq-q"><span class="faq-q-label">Q.</span>NaukriKhoj.in pe konsi sarkari naukri milti hai?</div>
        <div class="faq-a"><span class="faq-a-label">A.</span>NaukriKhoj.in pe Railway, Bank (SBI/IBPS), SSC, UPSC, Police, Army, Teaching (CTET/TET), Medical aur Maharashtra State Government jobs ki latest vacancy milti hai. Maharashtra ke liye MPSC, Police Bharti, Zilla Parishad, Nagar Parishad aur Mahanagar Palika jobs bhi hain. Sabhi notifications Hindi, Marathi aur English mein free mein available hain.</div>
      </div>

      <div class="faq-item">
        <div class="faq-q"><span class="faq-q-label">Q.</span>Government job ke liye apply karne ki last date kaise pata chalegi?</div>
        <div class="faq-a"><span class="faq-a-label">A.</span>NaukriKhoj.in par har job card mein application ki last date clearly mention hoti hai. "Closing Soon" section mein urgent deadlines alag se highlight hoti hain — red badge matlab 3 din ya kam bache hain. Latest Jobs page regularly check karein. Email alert preference locally save ki ja sakti hai; server-side alerts launch hone par privacy policy update hogi.</div>
      </div>

      <div class="faq-item">
        <div class="faq-q"><span class="faq-q-label">Q.</span>SSC CGL ke liye kya eligibility chahiye?</div>
        <div class="faq-a"><span class="faq-a-label">A.</span>SSC CGL (Combined Graduate Level) ke liye kisi bhi stream mein graduation zaroori hai. Age limit generally 18-32 years hoti hai aur alag-alag posts ke liye alag relaxation milti hai — OBC ko 3 saal, SC/ST ko 5 saal. Computer proficiency aur typing speed kuch posts ke liye zaroori hoti hai.</div>
      </div>

      <div class="faq-item">
        <div class="faq-q"><span class="faq-q-label">Q.</span>Railway Group D ke liye kya qualification chahiye?</div>
        <div class="faq-a"><span class="faq-a-label">A.</span>Railway Group D ke liye minimum 10th pass (ITI ke saath) ya simple 10th pass hona zaroori hai. Age limit 18-33 years hoti hai. Selection process mein Computer Based Test (CBT), Physical Efficiency Test (PET) aur document verification hota hai.</div>
      </div>

      <div class="faq-item">
        <div class="faq-q"><span class="faq-q-label">Q.</span>Maharashtra Police Bharti ke liye kya preparation karni chahiye?</div>
        <div class="faq-a"><span class="faq-a-label">A.</span>Maharashtra Police Bharti ke liye 12th pass hona zaroori hai. Height aur chest ke requirements hain — men ke liye 165cm height, women ke liye 157cm. Selection mein written exam, physical test, medical test aur document verification hota hai. NaukriKhoj.in pe latest Maharashtra Police Bharti notification ke saath complete details milti hain.</div>
      </div>

      <div class="faq-item">
        <div class="faq-q"><span class="faq-q-label">Q.</span>Bank PO ki salary kitni hoti hai?</div>
        <div class="faq-a"><span class="faq-a-label">A.</span>SBI PO ki starting salary approximately ₹52,000 per month hoti hai jisme basic pay, DA, HRA aur other allowances shamil hain. IBPS PO ki starting salary ₹52,000 se ₹55,000 per month ke beech hoti hai. Experience ke saath aur promotions se salary significantly badhti hai.</div>
      </div>

      <div class="faq-item">
        <div class="faq-q"><span class="faq-q-label">Q.</span>Admit card aur result kahan check karein?</div>
        <div class="faq-a"><span class="faq-a-label">A.</span>NaukriKhoj.in par dedicated "Admit Card" aur "Results" section hai jahan Railway, SSC, Bank, Police aur state government exams ke admit card download links aur result notifications milte hain. Hamesha official website se hi download karein — NaukriKhoj.in direct link provide karta hai.</div>
      </div>

      <div class="faq-item">
        <div class="faq-q"><span class="faq-q-label">Q.</span>Free job alerts kaise subscribe karein?</div>
        <div class="faq-a"><span class="faq-a-label">A.</span>Website par email preference save kar sakte hain. Review period mein yeh preference aapke browser mein locally save hoti hai. Server-side email alerts launch hone ke baad privacy policy update ki jayegi. Job updates dekhne ke liye Latest Jobs aur Blog pages check karte rahein.</div>
      </div>

    </div>
  </div>

  <!-- ===== PERMANENT SECTION 5: STATES COVERAGE ===== -->
  <div class="seo-section alt">
    <div class="seo-section-title">Kitne <span>States</span> Cover Hote Hain?</div>
    <div class="seo-section-sub">NaukriKhoj.in poore India ki sarkari naukri track karta hai</div>
    <p style="font-size:0.9rem;color:#2d3a4a;line-height:1.8;margin-bottom:20px;">Hum Maharashtra ke saath saath poore India ke government jobs cover karte hain. Kisi bhi state ki central ya state government vacancy ho — Railway zones, banking regions, SSC regions — sabka notification NaukriKhoj.in pe milega.</p>
    <div class="states-wrap">
      <span class="state-pill">🏆 Maharashtra</span>
      <span class="state-pill">Uttar Pradesh</span>
      <span class="state-pill">Rajasthan</span>
      <span class="state-pill">Bihar</span>
      <span class="state-pill">Madhya Pradesh</span>
      <span class="state-pill">Gujarat</span>
      <span class="state-pill">Karnataka</span>
      <span class="state-pill">Tamil Nadu</span>
      <span class="state-pill">West Bengal</span>
      <span class="state-pill">Andhra Pradesh</span>
      <span class="state-pill">Telangana</span>
      <span class="state-pill">Odisha</span>
      <span class="state-pill">Punjab</span>
      <span class="state-pill">Haryana</span>
      <span class="state-pill">Delhi</span>
      <span class="state-pill">Jharkhand</span>
      <span class="state-pill">Chhattisgarh</span>
      <span class="state-pill">Kerala</span>
      <span class="state-pill">Assam</span>
      <span class="state-pill">Uttarakhand</span>
      <span class="state-pill">Himachal Pradesh</span>
      <span class="state-pill">Jammu & Kashmir</span>
      <span class="state-pill">Goa</span>
      <span class="state-pill">All India</span>
    </div>

    <!-- SEO Info Boxes -->
    <div style="margin-top:20px;display:flex;flex-direction:column;gap:10px;">
      <div style="background:#fff;border:1.5px solid #E2E8F4;border-radius:14px;padding:18px 20px;box-shadow:0 2px 8px rgba(11,31,58,0.06);">
        <div style="display:flex;align-items:center;gap:10px;margin-bottom:8px;">
          <span style="font-size:1.3rem;">🏛️</span>
          <div>
            <div style="font-family:'Rajdhani',sans-serif;font-size:1rem;font-weight:700;color:#0B1F3A;">Maharashtra Sarkari Naukri 2026 — Latest Vacancies</div>
            <div style="font-size:0.78rem;color:#64748b;margin-top:2px;">Railway • Bank • SSC • MPSC • Police Bharti • State Govt</div>
          </div>
        </div>
        <p style="font-size:0.86rem;color:#2d3a4a;line-height:1.75;margin:0 0 10px;">NaukriKhoj.in pe Maharashtra aur All India ki sabse latest sarkari naukri notifications milti hain. Yahan Railway Group D/C, Bank (SBI/IBPS/RRB), SSC CGL/CHSL/MTS, UPSC Civil Services, Maharashtra Police Bharti, MPSC Rajyaseva, Zilla Parishad, Nagar Parishad aur anya state government jobs ki poori jankari free mein milti hai.</p>
        <p style="font-size:0.86rem;color:#2d3a4a;line-height:1.75;margin:0;">Har job notification mein eligibility criteria, total vacancies, age limit, application last date aur official apply link clearly diya gaya hai. Latest notifications regularly update hoti hain.</p>
      </div>
      <div style="background:#f8fafc;border:1.5px solid #E2E8F4;border-radius:12px;padding:14px 18px;">
        <div style="font-family:'Rajdhani',sans-serif;font-size:0.92rem;font-weight:700;color:#0B1F3A;margin-bottom:8px;">🔔 Active Job Categories on NaukriKhoj.in</div>
        <div style="display:flex;flex-wrap:wrap;gap:7px;">
          <span style="background:rgba(232,71,10,0.09);color:#E8470A;border:1px solid rgba(232,71,10,0.2);border-radius:18px;padding:4px 12px;font-size:0.78rem;font-weight:600;">🚂 Railway Jobs</span>
          <span style="background:rgba(11,31,58,0.07);color:#0B1F3A;border:1px solid rgba(11,31,58,0.15);border-radius:18px;padding:4px 12px;font-size:0.78rem;font-weight:600;">🏦 Bank Jobs</span>
          <span style="background:rgba(0,135,90,0.08);color:#00875A;border:1px solid rgba(0,135,90,0.2);border-radius:18px;padding:4px 12px;font-size:0.78rem;font-weight:600;">👮 Police / Army</span>
          <span style="background:rgba(232,71,10,0.09);color:#B45309;border:1px solid rgba(217,119,6,0.2);border-radius:18px;padding:4px 12px;font-size:0.78rem;font-weight:600;">📋 SSC / UPSC</span>
          <span style="background:rgba(11,31,58,0.07);color:#0B1F3A;border:1px solid rgba(11,31,58,0.15);border-radius:18px;padding:4px 12px;font-size:0.78rem;font-weight:600;">🏛️ MPSC / State Govt</span>
          <span style="background:rgba(0,135,90,0.08);color:#00875A;border:1px solid rgba(0,135,90,0.2);border-radius:18px;padding:4px 12px;font-size:0.78rem;font-weight:600;">📖 Teaching / TET</span>
          <span style="background:rgba(232,71,10,0.09);color:#E8470A;border:1px solid rgba(232,71,10,0.2);border-radius:18px;padding:4px 12px;font-size:0.78rem;font-weight:600;">🏥 Medical / Health</span>
          <span style="background:rgba(11,31,58,0.07);color:#0B1F3A;border:1px solid rgba(11,31,58,0.15);border-radius:18px;padding:4px 12px;font-size:0.78rem;font-weight:600;">Defence</span>
        </div>
      </div>
      <div style="background:#fff;border:1.5px solid #E2E8F4;border-radius:12px;padding:14px 18px;">
        <div style="font-family:'Rajdhani',sans-serif;font-size:0.9rem;font-weight:700;color:#0B1F3A;margin-bottom:6px;">📋 Latest Sarkari Naukri 2026 — NaukriKhoj.in</div>
        <p style="font-size:0.84rem;color:#64748b;line-height:1.7;margin:0;">NaukriKhoj.in pe Maharashtra aur All India ki Railway, Bank, SSC, UPSC, Police aur MPSC jobs ki latest vacancies milti hain. Sabhi jobs mein eligibility, vacancies, last date aur official apply link diya jata hai.</p>
      </div>
    </div>
  </div>

  <div class="seo-section">
    <div class="seo-section-title">Sarkari Naukri Ki <span>Poori Jaankari</span></div>
    <div class="seo-section-sub">Government job seekers ke liye complete guide — eligibility se leke selection tak</div>

    <div style="display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:24px;">
      <div style="background:#fff;border:1.5px solid var(--border);border-radius:14px;padding:20px;">
        <div style="font-size:1.5rem;margin-bottom:8px;">🚂</div>
        <div style="font-family:'Rajdhani',sans-serif;font-weight:700;color:var(--navy);margin-bottom:8px;">Railway Jobs 2026</div>
        <p style="font-size:0.85rem;color:#374151;line-height:1.7;margin:0;">Indian Railways India ka sabse bada employer hai. RRB NTPC, Group D, ALP, JE aur Station Master jaise posts ke liye 10th pass se graduate tak apply kar sakte hain. Selection mein CBT test, physical test aur document verification hota hai. Railway jobs mein job security, travel allowance aur pension milti hai.</p>
      </div>
      <div style="background:#fff;border:1.5px solid var(--border);border-radius:14px;padding:20px;">
        <div style="font-size:1.5rem;margin-bottom:8px;">🏦</div>
        <div style="font-family:'Rajdhani',sans-serif;font-weight:700;color:var(--navy);margin-bottom:8px;">Bank Jobs 2026</div>
        <p style="font-size:0.85rem;color:#374151;line-height:1.7;margin:0;">SBI, IBPS, RBI aur nabard bank jobs ke liye graduation compulsory hai. PO aur Clerk posts ke alawa SO (Specialist Officer) posts bhi nikhalte hain. IBPS ek saath kai banks ke liye common exam conduct karta hai. Bank jobs mein attractive salary, DA aur housing loan facility milti hai.</p>
      </div>
      <div style="background:#fff;border:1.5px solid var(--border);border-radius:14px;padding:20px;">
        <div style="font-size:1.5rem;margin-bottom:8px;">📋</div>
        <div style="font-family:'Rajdhani',sans-serif;font-weight:700;color:var(--navy);margin-bottom:8px;">SSC Jobs 2026</div>
        <p style="font-size:0.85rem;color:#374151;line-height:1.7;margin:0;">Staff Selection Commission (SSC) CGL, CHSL, MTS aur GD Constable exams conduct karta hai. CGL ke liye graduation zaruri hai jabki MTS 10th pass ke liye hai. SSC jobs mein various central government ministries aur departments mein posting milti hai. Tier 1, Tier 2 aur skill test/document verification selection process mein hota hai.</p>
      </div>
      <div style="background:#fff;border:1.5px solid var(--border);border-radius:14px;padding:20px;">
        <div style="font-size:1.5rem;margin-bottom:8px;">🏛️</div>
        <div style="font-family:'Rajdhani',sans-serif;font-weight:700;color:var(--navy);margin-bottom:8px;">MPSC Jobs 2026</div>
        <p style="font-size:0.85rem;color:#374151;line-height:1.7;margin:0;">Maharashtra Public Service Commission (MPSC) Maharashtra state government ke liye officers recruit karta hai. Rajyaseva, PSI, STI aur Assistant exams famous hain. MPSC exam Marathi medium mein bhi de sakte hain. Maharashtra ke sarkari jobs ke liye MPSC sabse important pathway hai. Prelims, Mains aur Interview teen stages hain.</p>
      </div>
    </div>

    <div style="background:#fff8f5;border:1.5px solid #fed7aa;border-radius:16px;padding:24px;margin-bottom:20px;">
      <div style="font-family:'Rajdhani',sans-serif;font-size:1.1rem;font-weight:700;color:#9a3412;margin-bottom:14px;">⚡ Sarkari Naukri Mein Selection Process Kaise Hota Hai?</div>
      <p style="font-size:0.9rem;color:#7c2d12;line-height:1.8;margin-bottom:12px;">Zyaatar government jobs mein selection 3-4 stages mein hota hai. Pehle written exam (Computer Based Test ya OMR based), phir physical test (police/army mein), phir document verification aur finally medical examination. Kuch posts mein skill test ya interview bhi hota hai.</p>
      <p style="font-size:0.9rem;color:#7c2d12;line-height:1.8;margin:0;">Merit list final marks ke basis pe banti hai. Reserved category candidates ke liye cutoff alag hoti hai. Selection ke baad training period hota hai — railway aur police mein yeh 6 months se 2 saal tak ho sakta hai.</p>
    </div>

    <div style="background:#f0f9ff;border:1.5px solid #bae6fd;border-radius:16px;padding:24px;">
      <div style="font-family:'Rajdhani',sans-serif;font-size:1.1rem;font-weight:700;color:#075985;margin-bottom:14px;">💡 Common Galtiyan Jo Candidates Karte Hain</div>
      <ul style="margin:0;padding-left:20px;display:flex;flex-direction:column;gap:10px;">
        <li style="font-size:0.88rem;color:#0369a1;line-height:1.7;"><strong>Last date pe apply karna</strong> — Server jam ho jaata hai, form submit nahi hota. Hamesha 3-4 din pehle apply karo.</li>
        <li style="font-size:0.88rem;color:#0369a1;line-height:1.7;"><strong>Wrong photo/signature size</strong> — Har form mein size alag hota hai. Notification padho aur humara Photo Resizer Tool use karo.</li>
        <li style="font-size:0.88rem;color:#0369a1;line-height:1.7;"><strong>Age limit calculate nahi karna</strong> — Cut-off date ke basis pe age count hoti hai, aaj ki date pe nahi. Age Calculator tool use karo.</li>
        <li style="font-size:0.88rem;color:#0369a1;line-height:1.7;"><strong>Qualification verify nahi karna</strong> — Kuch posts mein specific stream ya percentage bhi maangti hai. Notification ka eligibility section zaroor padho.</li>
        <li style="font-size:0.88rem;color:#0369a1;line-height:1.7;"><strong>Application number save nahi karna</strong> — Submit ke baad admit card aur result ke liye application number chahiye hoga. Screenshot lo aur save karo.</li>
      </ul>
    </div>
  </div>

  <footer>
    <div class="fg">
      <div>
        <div class="fl">NaukriKhoj<span>.in</span></div>
        <p class="fd">NaukriKhoj.in ek free government job information portal hai. Railway, Bank, SSC, UPSC, Police aur State Govt jobs ki latest notifications yahan milti hain. Yahan di gayi jaankari sirf reference ke liye hai — apply karne se pehle official website zaroor check karein.</p>
      </div>
      <div class="fc">
        <h4>Quick Links</h4>
        <ul>
          <li><a href="/" onclick="showHome();return false;" aria-label="Home">🏠 Home</a></li>
          <li><a href="/latest-jobs" onclick="showLatestJobs();return false;" aria-label="Latest Jobs">📋 Latest Jobs</a></li>
          <li><a href="/blog" onclick="showBlogPage();return false;" aria-label="Blog">✍️ Blog</a></li>
        </ul>
      </div>
      <div class="fc">
        <h4>Support</h4>
        <ul>
          <li><a href="/about" onclick="showAboutUs();return false;" aria-label="About Us">About Us</a></li>
          <li><a href="/contact" onclick="showContact();return false;" aria-label="Contact Us">Contact Us</a></li>
          <li><a href="/privacy" onclick="showPrivacyPolicy();return false;" aria-label="Privacy Policy">Privacy Policy</a></li>
          <li><a href="/disclaimer" onclick="showDisclaimer();return false;" aria-label="Disclaimer">Disclaimer</a></li>
        </ul>
      </div>
    </div>
    <div class="fb"><span>© 2026 NaukriKhoj.in | All Rights Reserved 🇮🇳</span><span>Made with ❤️ for India's Job Seekers</span></div>
  </footer>
</main>

<!-- DETAIL PAGE -->
<div id="detail-page"></div>

<!-- No-JS fallback: concise site information without duplicate/fake job articles -->
<noscript>
<style>
  #home-page, #latest-page, #blog-page, #blog-detail-page, #detail-page, #results-page, #admitcard-page, #contact-page, #privacy-page, #disclaimer-page, #about-page { display:none !important; }
</style>
<div style="max-width:860px;margin:0 auto;padding:32px 5%;font-family:Arial,sans-serif;line-height:1.7;color:#0D1B2E;">
  <h1>NaukriKhoj.in — Free Government Job Updates</h1>
  <p>NaukriKhoj.in provides free Sarkari Naukri updates, eligibility details, official notification links, admit card updates and result information for job seekers across India, especially Maharashtra.</p>
  <p>For the best experience, please enable JavaScript. You can also visit these important pages directly:</p>
  <ul>
    <li><a href="/latest-jobs">Latest Jobs</a></li>
    <li><a href="/blog">Blog</a></li>
    <li><a href="/about">About Us</a></li>
    <li><a href="/contact">Contact Us</a></li>
    <li><a href="/privacy">Privacy Policy</a></li>
    <li><a href="/disclaimer">Disclaimer</a></li>
  </ul>
</div>
</noscript>


<!-- LATEST JOBS PAGE -->
<div id="latest-page" style="display:none;">
  <div class="lj-list">
    <button class="back-btn" onclick="showHome()" style="margin-bottom:16px;">← Back to Home</button>
    <h1 style="font-family:'Rajdhani',sans-serif;font-size:1.5rem;font-weight:800;color:var(--navy);margin:0 0 4px;">Latest Government Jobs 2026 — सरकारी नोकरी</h1>
    <p style="font-size:0.82rem;color:var(--muted);margin:0 0 12px;">All India & Maharashtra sarkari naukri listings with eligibility, vacancies, last date and apply link</p>
    <div id="lj-items"><div style="background:#fff;border:1.5px solid var(--border);border-radius:12px;padding:24px;margin-bottom:16px;"><h2 style="font-family:'Rajdhani',sans-serif;color:var(--navy);font-size:1.2rem;margin:0 0 10px;">Maharashtra Latest Government Jobs 2026</h2><p style="font-size:0.88rem;color:var(--text);line-height:1.7;margin:0 0 10px;">Yahan pe Maharashtra aur All India ki latest sarkari naukri listings milti hain. Railway, Bank, SSC, Police, MPSC, Zilla Parishad aur sabhi state government departments ki naukri ki complete jankari milti hai — eligibility, vacancies, last date aur apply link ke saath.</p><p style="font-size:0.88rem;color:var(--text);line-height:1.7;margin:0;">Har listing mein qualification, age limit, selection process aur official notification PDF milega. Apply link pe click karke seedha official website pe jao aur online application bharo.</p></div><div style="background:#fff;border:1.5px solid var(--border);border-radius:12px;padding:18px 20px;"><div style="font-family:'Rajdhani',sans-serif;font-size:0.92rem;font-weight:700;color:var(--navy);margin-bottom:8px;">Railway • Bank • Police • SSC/UPSC • MPSC • Teaching • Medical • Defence</div><p style="font-size:0.84rem;color:var(--muted);margin:0;line-height:1.7;">NaukriKhoj.in pe sabhi categories ki latest sarkari naukri 2026 available hai. Eligibility, age limit, vacancies aur apply link ke saath — bilkul free. Niche scroll karo ya category select karo.</p></div></div>
  </div>
</div>

<!-- RESULTS PAGE -->
<div id="results-page" style="display:none;">
  <div class="lj-list">
    <button class="back-btn" onclick="showHome()" style="margin-bottom:16px;">← Back to Home</button>
    <div class="lj-header">📝 Results / निकाल / परिणाम</div>
    <div id="results-items"><div style="background:#fff;border:1.5px solid var(--border);border-radius:12px;padding:24px;margin-bottom:16px;"><h2 style="font-family:'Rajdhani',sans-serif;color:var(--navy);font-size:1.2rem;margin:0 0 10px;">Government Exam Results 2026 — सरकारी परीक्षा निकाल</h2><p style="font-size:0.88rem;color:var(--text);line-height:1.7;margin:0 0 10px;">Yahan pe Railway, SSC, UPSC, Bank, MPSC, Police aur anya sarkari exams ke results milte hain. Result aane ke baad seedha official website link yahaan provide kiya jata hai.</p><p style="font-size:0.88rem;color:var(--text);line-height:1.7;margin:0;">Apna roll number ya registration number ready rakhein. Result link pe click karein aur official website pe apna result download karein.</p></div><div style="background:#fff;border:1.5px solid var(--border);border-radius:12px;padding:18px 20px;"><div style="font-family:'Rajdhani',sans-serif;font-size:0.92rem;font-weight:700;color:var(--navy);margin-bottom:8px;">📊 Railway • SSC • UPSC • Bank • MPSC • Police Results 2026</div><p style="font-size:0.84rem;color:var(--muted);margin:0;line-height:1.7;">NaukriKhoj.in pe sabhi major sarkari exams ke results jaise hi declare hote hain, yahan update kar diye jate hain. Result PDF link seedha official website se liya jata hai. Apna roll number ready rakhein.</p></div></div>
  </div>
</div>

<!-- ADMIT CARD PAGE -->
<div id="admitcard-page" style="display:none;">
  <div class="lj-list">
    <button class="back-btn" onclick="showHome()" style="margin-bottom:16px;">← Back to Home</button>
    <div class="lj-header">📅 Admit Card / प्रवेशपत्र / एडमिट कार्ड</div>
    <div id="admitcard-items"><div style="background:#fff;border:1.5px solid var(--border);border-radius:12px;padding:24px;margin-bottom:16px;"><h2 style="font-family:'Rajdhani',sans-serif;color:var(--navy);font-size:1.2rem;margin:0 0 10px;">Sarkari Exam Admit Card 2026 — प्रवेशपत्र डाउनलोड</h2><p style="font-size:0.88rem;color:var(--text);line-height:1.7;margin:0 0 10px;">Railway, SSC, Bank, MPSC, Police Bharti aur UPSC exams ke admit card yahan se download kar sakte hain. Bina admit card ke exam hall mein entry nahi milti, isliye exam se 2-3 din pehle zaroor download karein.</p><p style="font-size:0.88rem;color:var(--text);line-height:1.7;margin:0;">Registration number aur date of birth ready rakhein. Niche diye link pe click karein aur official website pe login karke admit card PDF download karein.</p></div><div style="background:#fff;border:1.5px solid var(--border);border-radius:12px;padding:18px 20px;"><div style="font-family:'Rajdhani',sans-serif;font-size:0.92rem;font-weight:700;color:var(--navy);margin-bottom:8px;">🎫 Railway • SSC • Bank • MPSC • Police • UPSC Admit Cards 2026</div><p style="font-size:0.84rem;color:var(--muted);margin:0;line-height:1.7;">Exam ke 1-2 hafte pehle admit card release hota hai. NaukriKhoj.in pe admit card ka direct link diya jata hai — seedha official website pe jao, login karo aur PDF download karo. Exam hall mein original printout le jaana zaroor.</p></div></div>
  </div>
</div>


<!-- BLOG LIST PAGE -->
<div id="blog-page" style="display:none;">
  <div class="blog-list-wrap">
    <button class="back-btn" onclick="showHome()" style="margin-bottom:20px;">← Back to Home</button>
    <h1 style="font-family:'Rajdhani',sans-serif;font-size:1.5rem;font-weight:800;color:var(--navy);margin:0 0 4px;">NaukriKhoj Blog — Sarkari Naukri Guides & Exam Tips</h1>
    <p style="font-size:0.82rem;color:var(--muted);margin:0 0 16px;">Railway, Bank, SSC, UPSC, MPSC, Police Bharti aur State Govt exam preparation articles in Hindi, Marathi & English</p>

    <!-- Blog intro with ad -->
    <div style="background:#fff;border:1.5px solid #E2E8F4;border-radius:14px;padding:18px 20px;margin-bottom:20px;">
      <div style="font-family:'Rajdhani',sans-serif;font-size:1rem;font-weight:700;color:#0B1F3A;margin-bottom:5px;">✍️ NaukriKhoj Blog — Sarkari Exam Guides & Job Tips</div>
      <p style="font-size:0.83rem;color:#64748b;line-height:1.6;margin:0 0 12px;">Railway, Bank, SSC, MPSC, Police Bharti aur State Govt exam preparation ke liye helpful articles, syllabus guides aur latest updates yahan milti hain. Hindi aur Marathi mein bhi padhein.</p>
      <!-- Ad: Top of blog page -->
      <!-- SLOT: BLOG_TOP_BANNER (90px) — AdSense mein "Blog Top Banner" unit banao -->
      <!-- AdSense unit disabled during review: enable only after approval and after adding enough original content. -->
</div>

    <div class="blog-section-head">
      <div class="blog-section-title">Latest <span>Blogs</span></div>
      <span style="font-size:0.82rem;color:var(--muted);" id="blog-count-label">Latest Articles</span>
    </div>
    <!-- Category filter pills -->
    <div class="blog-filter" id="blog-filter-pills">
      <button class="bpill active" onclick="filterBlogs('',this)">🌐 All</button>
      <button class="bpill" onclick="filterBlogs('Railway Jobs',this)">🚂 Railway</button>
      <button class="bpill" onclick="filterBlogs('Bank Jobs',this)">🏦 Bank</button>
      <button class="bpill" onclick="filterBlogs('Police / Army',this)">👮 Police/Army</button>
      <button class="bpill" onclick="filterBlogs('SSC / UPSC',this)">📋 SSC/UPSC</button>
      <button class="bpill" onclick="filterBlogs('State Govt Jobs',this)">🏛️ State Govt</button>
      <button class="bpill" onclick="filterBlogs('Teaching Jobs',this)">📖 Teaching</button>
      <button class="bpill" onclick="filterBlogs('Defence',this)">Defence</button>
    </div>

    <!-- Static intro for crawlers - always visible, below filter pills like jobs section -->
    <div style="background:#fff;border:1.5px solid var(--border);border-radius:12px;padding:16px 20px;margin-bottom:16px;" id="blog-intro-static">
      <p style="font-size:0.88rem;color:var(--text);line-height:1.7;margin:0;">NaukriKhoj.in Blog pe sarkari naukri ki preparation ke liye tips, exam syllabus analysis, last year question papers aur government jobs updates milte hain. Railway, Bank, SSC, UPSC, MPSC, Police Bharti aur State Government exams ke baare mein detailed articles padhein aur apni taiyari behtar karein.</p>
    </div>

    <div class="blog-grid">
      <div class="blog-main" id="blog-cards-container">
        <!-- Static blog teasers for crawler - JS replaces these -->
        <div id="static-blog-preview">
          <div class="bcard" style="pointer-events:none;"><div class="bcard-accent"></div><div class="bcard-body"><span class="bcard-cat">Railway Jobs</span><div class="bcard-title">Railway Group D Guide — Eligibility, Vacancy aur Apply Process</div><div class="bcard-meta">📅 2026 &nbsp;•&nbsp; 5 min read</div></div></div>
          <div class="bcard" style="pointer-events:none;"><div class="bcard-accent"></div><div class="bcard-body"><span class="bcard-cat">Bank Jobs</span><div class="bcard-title">IBPS PO Guide — Syllabus, Age Limit, Salary aur Selection Process</div><div class="bcard-meta">📅 2026 &nbsp;•&nbsp; 6 min read</div></div></div>
          <div class="bcard" style="pointer-events:none;"><div class="bcard-accent"></div><div class="bcard-body"><span class="bcard-cat">State Govt Jobs</span><div class="bcard-title">Police Bharti Guide — Physical Test, Written Exam aur Salary Details</div><div class="bcard-meta">📅 2026 &nbsp;•&nbsp; 4 min read</div></div></div>
          <div style="background:#f8fafc;border:1.5px solid var(--border);border-radius:10px;padding:14px 16px;"><p style="font-size:0.83rem;color:var(--muted);margin:0;line-height:1.6;">NaukriKhoj.in Blog pe Railway, Bank, SSC, UPSC, MPSC aur Police Bharti exams ki preparation tips, syllabus analysis aur exam strategy milti hai. Hindi aur Marathi mein bhi padhein.</p></div>
        </div>
      </div>
      <div class="blog-sidebar">
        <!-- Blog Info Card - always visible, ensures content alongside ads -->
        <div class="scard" style="margin-bottom:16px;">
          <div class="stitle">✍️ NaukriKhoj Blog</div>
          <p style="font-size:0.82rem;color:var(--text);line-height:1.6;margin:8px 0;">Sarkari naukri preparation tips, exam updates, syllabus analysis aur government jobs se judi important jankari yahan milti hai.</p>
          <p style="font-size:0.82rem;color:var(--text);line-height:1.6;margin:0;">Railway, Bank, SSC, MPSC, Police aur anya sarkari exams ke baare mein detailed guides padhein.</p>
        </div>
        <!-- Sidebar Ad 300x250 -->
        <div style="margin-bottom:16px;">
          <!-- SLOT: BLOG_SIDEBAR_TOP (250px) — AdSense mein "Blog Sidebar" unit banao -->
          <!-- AdSense unit disabled during review: enable only after approval and after adding enough original content. -->
</div>
        <!-- Trending blogs sidebar -->
        <div class="scard" id="trending-blogs-sidebar">
          <div class="stitle">🔥 Trending Blogs</div>
          <div id="trending-blogs-list">
            <div class="dl-item" style="pointer-events:none;"><div class="dl-t" style="font-size:0.79rem;color:var(--text);">SSC CGL 2026 Syllabus — Complete Guide</div></div>
            <div class="dl-item" style="pointer-events:none;"><div class="dl-t" style="font-size:0.79rem;color:var(--text);">MPSC Rajyaseva 2026 — Eligibility & Exam Pattern</div></div>
            <div class="dl-item" style="pointer-events:none;"><div class="dl-t" style="font-size:0.79rem;color:var(--text);">Bank PO vs Clerk — Salary, Growth & Difference</div></div>
          </div>
        </div>
        <!-- ADSENSE FIX: Duplicate 250x250 sidebar ad intentionally removed to avoid duplicate-slot issues. -->
        <!-- Quick Links — internal link building -->
        <div style="margin-top:16px;background:#F8FAFF;border:1px solid #E2E8F4;border-radius:10px;padding:14px 16px;">
          <div style="font-weight:700;font-size:0.85rem;color:var(--navy);margin-bottom:10px;">🔗 Quick Links</div>
          <ul style="list-style:none;margin:0;padding:0;font-size:0.82rem;line-height:2;">
            <li><a href="/latest-jobs" onclick="showLatestJobs();filterCat('Railway',null);return false;" style="color:var(--saffron);text-decoration:none;">🚂 Railway Jobs 2026</a></li>
            <li><a href="/latest-jobs" onclick="showLatestJobs();filterCat('Bank',null);return false;" style="color:var(--saffron);text-decoration:none;">🏦 Bank Jobs 2026</a></li>
            <li><a href="/latest-jobs" onclick="showLatestJobs();filterCat('SSC',null);return false;" style="color:var(--saffron);text-decoration:none;">📋 SSC Jobs 2026</a></li>
            <li><a href="/latest-jobs" onclick="showLatestJobs();filterCat('Police',null);return false;" style="color:var(--saffron);text-decoration:none;">👮 Police Bharti 2026</a></li>
            <li><a href="/latest-jobs" onclick="showLatestJobs();filterCat('State',null);return false;" style="color:var(--saffron);text-decoration:none;">🏛️ MPSC Bharti 2026</a></li>
          </ul>
        </div>
      </div>
    </div>

    <!-- Content + Ad: Bottom of blog list -->
    <div style="background:#fff;border:1.5px solid #E2E8F4;border-radius:14px;padding:18px 20px;margin-top:8px;">
      <p style="font-size:0.82rem;color:#64748b;line-height:1.6;margin:0 0 12px;">Aur blogs padhne ke liye upar filter pills use karein. Railway, SSC, Bank, Police, MPSC, Teaching aur anya categories ke blog articles available hain. Latest naukri aur exam updates ke liye Latest Jobs page regularly check karein.</p>
      <!-- Ad: Bottom of blog list -->
      <!-- SLOT: BLOG_BOTTOM_BANNER (90px) — AdSense mein "Blog Bottom Banner" unit banao — use a DIFFERENT slot from top banner -->
      <!-- AdSense unit disabled during review: enable only after approval and after adding enough original content. -->
</div>
  </div>
</div>

<!-- BLOG DETAIL PAGE -->
<div id="blog-detail-page" style="display:none;">
  <div class="blog-detail-wrap" id="blog-detail-content">
    <!-- Content injected by JS -->
  </div>
</div>

<!-- ══════════════════════════════════════════════════════
     STANDALONE STATIC PAGES — Crawler-visible, dedicated divs
     (No JS injection needed — content is always in DOM)
══════════════════════════════════════════════════════ -->

<!-- CONTACT PAGE -->
<div id="contact-page" style="display:none;" itemscope itemtype="https://schema.org/ContactPage">
  <div style="max-width:860px;margin:0 auto;padding:40px 5%;box-sizing:border-box;width:100%;">
    <button class="back-btn" onclick="showHome()">← Back to Home</button>
    <div style="background:#fff;border-radius:16px;padding:32px 4%;box-shadow:0 4px 20px rgba(0,0,0,0.06);box-sizing:border-box;width:100%;margin-top:20px;">
      <h1 style="font-family:'Rajdhani',sans-serif;font-size:2rem;color:var(--navy);margin-bottom:6px;" itemprop="name">📬 Contact Us</h1>
      <p style="color:var(--muted);font-size:0.88rem;margin-bottom:24px;">Have a question, suggestion or feedback? We'd love to hear from you.</p>
      <p style="color:#374151;font-size:0.92rem;line-height:1.85;margin-bottom:20px;">NaukriKhoj.in is a free government job information portal serving job seekers across Maharashtra and all of India. We welcome feedback, corrections and suggestions to help us serve you better.</p>
      <div style="display:flex;align-items:center;gap:14px;padding:18px;background:var(--bg);border-radius:12px;margin-bottom:20px;border:1.5px solid var(--border);">
        <span style="font-size:1.6rem;">📧</span>
        <div>
          <div style="font-weight:700;color:var(--navy);font-size:0.95rem;margin-bottom:3px;">Email Us</div>
          <a href="mailto:contact@naukrikhoj.in" style="color:var(--saffron);font-size:0.92rem;" itemprop="email">contact@naukrikhoj.in</a>
        </div>
      </div>
      <div style="display:flex;align-items:center;gap:14px;padding:18px;background:var(--bg);border-radius:12px;margin-bottom:24px;border:1.5px solid var(--border);">
        <span style="font-size:1.6rem;">🌐</span>
        <div>
          <div style="font-weight:700;color:var(--navy);font-size:0.95rem;margin-bottom:3px;">Website</div>
          <a href="https://naukrikhoj.in" style="color:var(--saffron);font-size:0.92rem;">naukrikhoj.in</a>
        </div>
      </div>
      <div style="background:#f0fdf4;border:1.5px solid #bbf7d0;border-radius:12px;padding:18px;margin-bottom:16px;">
        <div style="font-family:'Rajdhani',sans-serif;font-weight:700;color:#166534;margin-bottom:6px;">📮 What you can contact us about:</div>
        <ul style="color:#15803d;font-size:0.88rem;line-height:2;padding-left:18px;margin:0;">
          <li>Reporting incorrect or outdated job information</li>
          <li>Suggesting new government jobs to cover</li>
          <li>Technical issues with the website</li>
          <li>General feedback and suggestions</li>
        </ul>
      </div>
      <div style="background:#fff8f5;border:1.5px solid #fed7aa;border-radius:12px;padding:18px;">
        <p style="color:#9a3412;font-size:0.88rem;line-height:1.8;margin:0;"><b>⚠️ Important:</b> NaukriKhoj.in is an information portal only. We do not conduct any recruitment directly. Please verify all job details from the official government website before applying. We do not charge any fee for job information.</p>
      </div>
    </div>
  </div>
</div>

<!-- PRIVACY POLICY PAGE -->
<div id="privacy-page" style="display:none;" itemscope itemtype="https://schema.org/WebPage">
  <div style="max-width:860px;margin:0 auto;padding:40px 5%;box-sizing:border-box;width:100%;">
    <button class="back-btn" onclick="showHome()">← Back to Home</button>
    <div style="background:#fff;border-radius:16px;padding:32px 4%;box-shadow:0 4px 20px rgba(0,0,0,0.06);box-sizing:border-box;width:100%;margin-top:20px;">
      <h1 style="font-family:'Rajdhani',sans-serif;font-size:2rem;color:var(--navy);margin-bottom:6px;" itemprop="name">Privacy Policy</h1>
      <p style="color:var(--muted);font-size:0.85rem;margin-bottom:28px;">Last updated: March 2026</p>
      <p style="color:#374151;font-size:0.92rem;line-height:1.85;margin-bottom:20px;">NaukriKhoj.in is committed to protecting your privacy. This Privacy Policy explains how we handle information when you use our website at <strong>naukrikhoj.in</strong>.</p>
      <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.2rem;color:var(--navy);margin:20px 0 8px;">1. Information We Collect</h2>
      <p style="color:#374151;font-size:0.9rem;line-height:1.8;margin-bottom:12px;">If you use our job alert form, your entered email address may be stored in your browser's local storage on your device only. We do not intentionally collect any other personal information without your explicit consent. We do not have a server-side database of user email addresses at this time.</p>
      <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.2rem;color:var(--navy);margin:20px 0 8px;">2. How We Use Your Information</h2>
      <p style="color:#374151;font-size:0.9rem;line-height:1.8;margin-bottom:12px;">Alert preferences entered on this site are stored locally in your browser for your convenience. If server-side email alerts are enabled in the future, this policy will be updated before any collection or use of email addresses for notifications.</p>
      <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.2rem;color:var(--navy);margin:20px 0 8px;">3. Cookies and Local Storage</h2>
      <p style="color:#374151;font-size:0.9rem;line-height:1.8;margin-bottom:12px;">We use browser local storage to save your preferences and job data locally for faster page loads. This data stays on your device and is not transmitted to our servers. We use Google Analytics to understand site traffic patterns using anonymised data.</p>
      <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.2rem;color:var(--navy);margin:20px 0 8px;">4. Third-Party Links</h2>
      <p style="color:#374151;font-size:0.9rem;line-height:1.8;margin-bottom:12px;">Our website contains links to official government websites (upsc.gov.in, rrbcdg.gov.in, sbi.co.in, etc.). We are not responsible for the privacy practices or content of these external sites. We encourage you to review the privacy policy of any site you visit.</p>
      <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.2rem;color:var(--navy);margin:20px 0 8px;">5. Google AdSense</h2>
      <p style="color:#374151;font-size:0.9rem;line-height:1.8;margin-bottom:12px;">We may use Google AdSense to display advertisements. Google uses cookies to serve ads based on your prior visits to our website and other sites. You can opt out of personalised advertising at <a href="https://www.google.com/settings/ads" target="_blank" rel="noopener noreferrer" style="color:var(--saffron);">Google Ad Settings</a>.</p>
      <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.2rem;color:var(--navy);margin:20px 0 8px;">6. Data Security</h2>
      <p style="color:#374151;font-size:0.9rem;line-height:1.8;margin-bottom:12px;">Since we do not collect personal data on our servers, there is minimal risk of data breaches. Your locally stored preferences are protected by your device's own security measures.</p>
      <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.2rem;color:var(--navy);margin:20px 0 8px;">7. Changes to This Policy</h2>
      <p style="color:#374151;font-size:0.9rem;line-height:1.8;margin-bottom:12px;">We may update this Privacy Policy from time to time. Any changes will be posted on this page with an updated revision date. Continued use of our website after changes constitutes acceptance of the updated policy.</p>
      <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.2rem;color:var(--navy);margin:20px 0 8px;">8. Contact Us</h2>
      <p style="color:#374151;font-size:0.9rem;line-height:1.8;">For any privacy-related queries, please contact us at: <a href="mailto:contact@naukrikhoj.in" style="color:var(--saffron);">contact@naukrikhoj.in</a></p>
    </div>
  </div>
</div>

<!-- DISCLAIMER PAGE -->
<div id="disclaimer-page" style="display:none;" itemscope itemtype="https://schema.org/WebPage">
  <div style="max-width:860px;margin:0 auto;padding:40px 5%;box-sizing:border-box;width:100%;">
    <button class="back-btn" onclick="showHome()">← Back to Home</button>
    <div style="background:#fff;border-radius:16px;padding:32px 4%;box-shadow:0 4px 20px rgba(0,0,0,0.06);box-sizing:border-box;width:100%;margin-top:20px;">
      <h1 style="font-family:'Rajdhani',sans-serif;font-size:2rem;color:var(--navy);margin-bottom:6px;" itemprop="name">Disclaimer</h1>
      <p style="color:var(--muted);font-size:0.85rem;margin-bottom:28px;">Last updated: March 2026</p>
      <p style="color:#374151;font-size:0.92rem;line-height:1.85;margin-bottom:20px;">Please read this disclaimer carefully before using NaukriKhoj.in. By accessing or using our website, you agree to the terms of this disclaimer.</p>
      <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.2rem;color:var(--navy);margin:20px 0 8px;">1. Information Purpose Only</h2>
      <p style="color:#374151;font-size:0.9rem;line-height:1.8;margin-bottom:12px;">NaukriKhoj.in is an independent information portal. All government job notifications published on this website are for informational purposes only. We are not affiliated with any government department, ministry, recruitment board, or public sector organisation.</p>
      <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.2rem;color:var(--navy);margin:20px 0 8px;">2. Verify from Official Sources</h2>
      <p style="color:#374151;font-size:0.9rem;line-height:1.8;margin-bottom:12px;">Candidates are strongly advised to verify all job details — vacancies, eligibility criteria, age limit, last date, application fee and selection process — from the official government website or official notification PDF before applying. NaukriKhoj.in is not responsible for any discrepancies, errors or omissions in the information provided.</p>
      <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.2rem;color:var(--navy);margin:20px 0 8px;">3. No Recruitment Activity</h2>
      <p style="color:#374151;font-size:0.9rem;line-height:1.8;margin-bottom:12px;">We do not conduct any recruitment process and do not charge any fee for job information. NaukriKhoj.in is not a recruitment agency. If anyone asks for money in the name of NaukriKhoj.in, please report it immediately to the concerned authorities.</p>
      <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.2rem;color:var(--navy);margin:20px 0 8px;">4. External Links</h2>
      <p style="color:#374151;font-size:0.9rem;line-height:1.8;margin-bottom:12px;">Our website may contain links to official government websites (ssc.nic.in, indianrailways.gov.in, mpsc.gov.in, etc.). We are not responsible for the content, accuracy or availability of those external sites. Links are provided solely for the convenience of the user.</p>
      <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.2rem;color:var(--navy);margin:20px 0 8px;">5. Accuracy of Information</h2>
      <p style="color:#374151;font-size:0.9rem;line-height:1.8;margin-bottom:12px;">While we make every effort to ensure that the information on NaukriKhoj.in is accurate and up-to-date, we cannot guarantee the completeness or accuracy of all content. Job notifications and their details can change at any time; always refer to the official source for the latest information.</p>
      <div style="background:#fff8f5;border:1.5px solid #fed7aa;border-radius:12px;padding:18px;margin-top:20px;">
        <p style="color:#9a3412;font-size:0.9rem;line-height:1.8;margin:0;"><b>⚠️ Important:</b> Always check the official notification from the respective government department before filling any application form. NaukriKhoj.in shall not be held responsible for any loss or damage arising from the use of information on this website.</p>
      </div>
    </div>
  </div>
</div>

<!-- ABOUT US PAGE -->
<div id="about-page" style="display:none;" itemscope itemtype="https://schema.org/AboutPage">
  <div style="max-width:860px;margin:0 auto;padding:40px 5%;box-sizing:border-box;width:100%;">
    <button class="back-btn" onclick="showHome()">← Back to Home</button>
    <div style="background:#fff;border-radius:16px;padding:32px 4%;box-shadow:0 4px 20px rgba(0,0,0,0.06);box-sizing:border-box;width:100%;margin-top:20px;">
      <h1 style="font-family:'Rajdhani',sans-serif;font-size:2rem;color:var(--navy);margin-bottom:6px;" itemprop="name">About NaukriKhoj.in</h1>
      <p style="color:var(--muted);font-size:0.88rem;margin-bottom:24px;">Government job notifications and updates — Free, Multilingual, Trusted</p>

      <p style="color:#374151;font-size:0.95rem;line-height:1.9;margin-bottom:16px;" itemprop="description"><strong>NaukriKhoj.in</strong> is a free online government job information portal that provides the latest Sarkari Naukri notifications to job seekers across Maharashtra and all of India. Our mission is to deliver accurate, timely and trustworthy government job information — completely free of charge, available in English and Marathi.</p>

      <p style="color:#374151;font-size:0.95rem;line-height:1.9;margin-bottom:24px;">We cover Railway, Bank, SSC, UPSC, Police, Army, Teaching, Medical and State Government jobs including MPSC, Zilla Parishad, Nagar Parishad and Mahanagar Palika recruitments. All notifications are sourced from official government websites and every job listing includes a direct link back to the official source.</p>

      <div style="background:#f8fafc;border:1.5px solid #E2E8F4;border-radius:14px;padding:18px 20px;margin-bottom:20px;">
        <div style="font-family:'Rajdhani',sans-serif;font-size:1.05rem;font-weight:700;color:var(--navy);margin-bottom:8px;">🛡️ Editorial & Correction Policy</div>
        <p style="color:#374151;font-size:0.9rem;line-height:1.8;margin:0 0 10px;">We prepare job pages using official recruitment notifications, official department websites and candidate-facing public notices. We do not guarantee selection, conduct recruitment, or collect application fees.</p>
        <p style="color:#374151;font-size:0.9rem;line-height:1.8;margin:0;">If you notice an incorrect last date, vacancy count, eligibility point or broken official link, email us at <a href="mailto:contact@naukrikhoj.in" style="color:var(--saffron);font-weight:700;">contact@naukrikhoj.in</a>. We review correction requests and update pages as soon as practical.</p>
      </div>

      <p style="color:var(--muted);font-size:0.82rem;margin:-6px 0 20px;">Last reviewed: May 2026</p>

      <div style="display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-bottom:24px;">
        <div style="background:var(--bg);border:1.5px solid var(--border);border-radius:14px;padding:18px;text-align:center;">
          <div style="font-family:'Rajdhani',sans-serif;font-size:2rem;font-weight:700;color:var(--saffron);">8+</div>
          <div style="font-size:0.8rem;color:var(--muted);margin-top:4px;font-weight:500;">Job Categories</div>
        </div>
        <div style="background:var(--bg);border:1.5px solid var(--border);border-radius:14px;padding:18px;text-align:center;">
          <div style="font-family:'Rajdhani',sans-serif;font-size:2rem;font-weight:700;color:var(--saffron);">28+</div>
          <div style="font-size:0.8rem;color:var(--muted);margin-top:4px;font-weight:500;">States Covered</div>
        </div>
        <div style="background:var(--bg);border:1.5px solid var(--border);border-radius:14px;padding:18px;text-align:center;">
          <div style="font-family:'Rajdhani',sans-serif;font-size:2rem;font-weight:700;color:var(--saffron);">2</div>
          <div style="font-size:0.8rem;color:var(--muted);margin-top:4px;font-weight:500;">Languages (EN + MR)</div>
        </div>
        <div style="background:var(--bg);border:1.5px solid var(--border);border-radius:14px;padding:18px;text-align:center;">
          <div style="font-family:'Rajdhani',sans-serif;font-size:2rem;font-weight:700;color:var(--saffron);">Free</div>
          <div style="font-size:0.8rem;color:var(--muted);margin-top:4px;font-weight:500;">Always Free</div>
        </div>
      </div>

      <div style="background:linear-gradient(135deg,#f0f9ff,#e0f2fe);border:1.5px solid #bae6fd;border-radius:14px;padding:20px;margin-bottom:16px;">
        <div style="font-family:'Rajdhani',sans-serif;font-size:1.1rem;font-weight:700;color:#075985;margin-bottom:8px;">🎯 Our Mission</div>
        <p style="color:#0369a1;font-size:0.92rem;line-height:1.8;margin:0;">To provide every Indian job seeker — especially those in Maharashtra — with accurate, timely and free government job information. We believe no one should miss out on a government job opportunity due to lack of access to information.</p>
      </div>

      <div style="background:#f0fdf4;border:1.5px solid #bbf7d0;border-radius:14px;padding:20px;margin-bottom:16px;">
        <div style="font-family:'Rajdhani',sans-serif;font-size:1.1rem;font-weight:700;color:#166534;margin-bottom:8px;">✅ What We Provide</div>
        <ul style="color:#15803d;font-size:0.9rem;line-height:2;padding-left:18px;margin:0;">
          <li>Latest government job notifications with eligibility, vacancies and last date</li>
          <li>Official PDF notification links and direct apply links</li>
          <li>Bilingual content in English and Marathi</li>
          <li>Results and admit card updates when official links are available</li>
          <li>Free tools: Age Calculator, Qualification Checker, Photo Resizer</li>
        </ul>
      </div>

      <div style="background:#fff8f5;border:1.5px solid #fed7aa;border-radius:14px;padding:20px;margin-bottom:20px;">
        <div style="font-family:'Rajdhani',sans-serif;font-size:1.1rem;font-weight:700;color:#9a3412;margin-bottom:8px;">⚠️ Important Disclaimer</div>
        <p style="color:#7c2d12;font-size:0.9rem;line-height:1.8;margin:0;">NaukriKhoj.in is not affiliated with any government department or recruitment board. All information is for reference only. Always verify details from the official government website before applying. We do not charge any fee and are not involved in any recruitment process.</p>
      </div>

      <div style="background:var(--bg);border:1.5px solid var(--border);border-radius:14px;padding:18px;">
        <div style="font-family:'Rajdhani',sans-serif;font-size:1rem;font-weight:700;color:var(--navy);margin-bottom:8px;">📬 Get in Touch</div>
        <p style="color:#374151;font-size:0.9rem;line-height:1.8;margin:0;">For queries, suggestions or feedback: <a href="mailto:contact@naukrikhoj.in" style="color:var(--saffron);font-weight:600;">contact@naukrikhoj.in</a></p>
      </div>

      <div style="margin-top:24px;">
        <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.3rem;font-weight:700;color:var(--navy);margin-bottom:12px;">🇮🇳 Sarkari Naukri Ki Taiyari Kaise Karein?</h2>
        <p style="color:#374151;font-size:0.92rem;line-height:1.9;margin-bottom:14px;">Government jobs India mein lakho logon ka sapna hai — stable income, job security, pension aur social respect. Lekin sahi jankari ke bina taiyari adhoori rehti hai. NaukriKhoj.in is gap ko bharne ke liye bana hai.</p>
        <p style="color:#374151;font-size:0.92rem;line-height:1.9;margin-bottom:14px;">Hamare platform pe har job notification mein eligibility criteria, age limit, application process aur selection process ki complete jankari di jati hai — taaki aapko alag-alag websites pe jaane ki zarurat na pade. Sabhi information ek hi jagah, bilkul free.</p>

        <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.3rem;font-weight:700;color:var(--navy);margin:20px 0 12px;">📚 Hamare Blog Se Kya Seekh Sakte Ho?</h2>
        <p style="color:#374151;font-size:0.92rem;line-height:1.9;margin-bottom:14px;">NaukriKhoj.in ke blog section mein aapko milega:</p>
        <ul style="color:#374151;font-size:0.9rem;line-height:2;padding-left:20px;margin-bottom:16px;">
          <li>Railway Bharti ki taiyari kaise karein — syllabus, books aur tips</li>
          <li>SSC CGL, CHSL aur MTS ke liye complete guide</li>
          <li>MPSC exam strategy aur Marathi medium students ke liye tips</li>
          <li>Bank PO aur Clerk exam ki preparation strategy</li>
          <li>Police Bharti physical test ki taiyari</li>
          <li>Government job application form kaise bharen — step by step</li>
          <li>Age relaxation rules SC/ST/OBC ke liye</li>
          <li>Document verification mein kya laana padta hai</li>
        </ul>

        <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.3rem;font-weight:700;color:var(--navy);margin:20px 0 12px;">🛠️ Free Tools Jo Aapke Kaam Aayenge</h2>
        <p style="color:#374151;font-size:0.92rem;line-height:1.9;margin-bottom:14px;">Sirf job notifications nahi — NaukriKhoj.in pe 3 free tools bhi hain jo government job application mein directly help karte hain:</p>
        <div style="display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:20px;">
          <div style="background:#fff;border:1.5px solid var(--border);border-radius:12px;padding:16px;">
            <div style="font-size:1.3rem;margin-bottom:6px;">🎂</div>
            <div style="font-weight:700;color:var(--navy);font-size:0.9rem;margin-bottom:6px;">Age Calculator</div>
            <div style="font-size:0.82rem;color:var(--muted);line-height:1.6;">Apni exact age calculate karo government job ke cut-off date ke basis pe. SC/ST/OBC age relaxation bhi include hai.</div>
          </div>
          <div style="background:#fff;border:1.5px solid var(--border);border-radius:12px;padding:16px;">
            <div style="font-size:1.3rem;margin-bottom:6px;">🎓</div>
            <div style="font-weight:700;color:var(--navy);font-size:0.9rem;margin-bottom:6px;">Qualification Checker</div>
            <div style="font-size:0.82rem;color:var(--muted);line-height:1.6;">Apni qualification ke hisab se suitable government jobs check karo — 10th pass se post graduate tak.</div>
          </div>
          <div style="background:#fff;border:1.5px solid var(--border);border-radius:12px;padding:16px;">
            <div style="font-size:1.3rem;margin-bottom:6px;">🖼️</div>
            <div style="font-weight:700;color:var(--navy);font-size:0.9rem;margin-bottom:6px;">Photo Resizer</div>
            <div style="font-size:0.82rem;color:var(--muted);line-height:1.6;">Government job forms ke liye photo resize aur compress karo — exact size aur KB limit ke saath. Download bhi kar sakte ho.</div>
          </div>
          <div style="background:#fff;border:1.5px solid var(--border);border-radius:12px;padding:16px;">
            <div style="font-size:1.3rem;margin-bottom:6px;">🔔</div>
            <div style="font-weight:700;color:var(--navy);font-size:0.9rem;margin-bottom:6px;">Job Alerts</div>
            <div style="font-size:0.82rem;color:var(--muted);line-height:1.6;">WhatsApp channel join karo — naya job notification aate hi turant alert milega. Koi bhi deadline miss nahi hogi.</div>
          </div>
        </div>

        <h2 style="font-family:'Rajdhani',sans-serif;font-size:1.3rem;font-weight:700;color:var(--navy);margin:20px 0 12px;">🌐 Maharashtra Ke Job Seekers Ke Liye Khaas</h2>
        <p style="color:#374151;font-size:0.92rem;line-height:1.9;margin-bottom:14px;">NaukriKhoj.in Maharashtra ke job seekers ko khaas dhyan mein rakhke bana hai. Isliye hamare platform pe saari job notifications <strong>English aur Marathi dono bhashao</strong> mein available hain. MPSC, Zilla Parishad, Nagar Parishad, Mahanagar Palika, Maharashtra Police, Maharashtra Arogya Vibhag — sabhi Maharashtra government jobs yahan milenge.</p>
        <p style="color:#374151;font-size:0.92rem;line-height:1.9;margin-bottom:0;">Aage bhi NaukriKhoj.in aur zyada states aur languages mein expand karega — taaki poore Bharat ke job seekers ko free, accurate aur timely government job information mil sake.</p>
      </div>
    </div>
  </div>
</div>

<!-- WhatsApp removed -->

<script>
// ===== PAGE MANAGER — ek jagah se sab pages control =====
function showPage(page) {
  document.documentElement.removeAttribute('data-initial-route');
  // Force body visible — Cloudflare cache ya AdSense se opacity/visibility issue fix
  document.body.style.opacity = '1';
  document.body.style.visibility = 'visible';
  document.documentElement.style.opacity = '1';
  document.documentElement.style.visibility = 'visible';
  document.getElementById('home-page').style.display        = page === 'home'        ? 'block' : 'none';
  document.getElementById('detail-page').style.display      = page === 'detail'      ? 'block' : 'none';
  document.getElementById('latest-page').style.display      = page === 'latest'      ? 'block' : 'none';
  document.getElementById('results-page').style.display     = page === 'results'     ? 'block' : 'none';
  document.getElementById('admitcard-page').style.display   = page === 'admitcard'   ? 'block' : 'none';
  document.getElementById('blog-page').style.display        = page === 'blog'        ? 'block' : 'none';
  document.getElementById('blog-detail-page').style.display = page === 'blog-detail' ? 'block' : 'none';
  document.getElementById('contact-page').style.display     = page === 'contact'     ? 'block' : 'none';
  document.getElementById('privacy-page').style.display     = page === 'privacy'     ? 'block' : 'none';
  document.getElementById('disclaimer-page').style.display  = page === 'disclaimer'  ? 'block' : 'none';
  document.getElementById('about-page').style.display       = page === 'about'       ? 'block' : 'none';
  window.scrollTo(0, 0);
  // Update mobile bottom nav active state
  const mbnMap = { home:'mbn-home', latest:'mbn-latest', blog:'mbn-blog' };
  document.querySelectorAll('.mbn-item').forEach(el => el.classList.remove('active'));
  const activeKey = page === 'blog-detail' ? 'blog' : page;
  const activeId = mbnMap[activeKey];
  if(activeId) { const el = document.getElementById(activeId); if(el) el.classList.add('active'); }
  // Init ads when page becomes visible (SPA navigation fix)
  const pageId = {
    'home': 'home-page', 'detail': 'detail-page', 'latest': 'latest-page',
    'results': 'results-page', 'admitcard': 'admitcard-page',
    'blog': 'blog-page', 'blog-detail': 'blog-detail-page'
  }[page];
  if (pageId) setTimeout(() => initAds(document.getElementById(pageId)), 100);
}

// ===== FIREBASE DATABASE =====
const FIREBASE_URL = 'https://naukrikhoj-bb6df-default-rtdb.asia-southeast1.firebasedatabase.app';


const LOCAL_KEYS = {
  jobs: 'nkj_jobs',
  results: 'nkj_results',
  admitcards: 'nkj_admitcards',
  blogs: 'nkj_blogs'
};

const DEFAULT_JOBS = [];

const DEFAULT_RESULTS = [];

const DEFAULT_ADMIT_CARDS = [];

const DEFAULT_BLOGS = [
  {
    id: 'blog_1001',
    title: 'SSC CGL Preparation Strategy 2026',
    titleMr: 'SSC CGL तयारी धोरण 2026',
    category: 'SSC / UPSC',
    tags: 'SSC, CGL, Preparation',
    postedOn: '11 Apr 2026',
    status: 'published',
    meta: 'SSC CGL 2026 ke liye smart preparation strategy, timetable aur section-wise focus samjho.',
    metaMr: 'SSC CGL 2026 साठी अभ्यास योजना आणि सेक्शननुसार फोकस समजून घ्या.',
    content: '<div class="blog-hero"><div class="blog-hero-badge">SSC Guide</div><div class="blog-h1">SSC CGL Preparation Strategy 2026</div><div class="blog-intro">Agar aap SSC CGL ki tayari kar rahe ho, to sabse pehle syllabus, previous year trend aur daily revision system fix karna zaroori hai.</div></div><h2>1. Syllabus ko topic-wise break karo</h2><p>Reasoning, Quant, English aur General Awareness ko alag weekly targets me divide karo. Har section me high-weightage topics pehle cover karo.</p><h2>2. Mock tests regularly do</h2><p>Week me kam se kam do full-length mocks do aur unka analysis likho. Sirf test dena kaafi nahi hai, weak areas ko track karna bhi zaroori hai.</p><h2>3. Revision cycle maintain karo</h2><p>Daily short revision aur weekly full revision rakho. Isi se speed aur retention dono improve hote hain.</p>',
    contentMr: '<p>SSC CGL तयारी करताना अभ्यासक्रम छोट्या भागांत विभागा. नियमित mock tests द्या आणि चुका लिहून ठेवा.</p><p>दर आठवड्याला revision केल्यास स्कोअर स्थिर राहतो आणि आत्मविश्वास वाढतो.</p>'
  },
  {
    id: 'blog_1002',
    title: 'Railway Jobs ke liye Best Document Checklist',
    titleMr: 'रेल्वे नोकरीसाठी सर्वोत्तम दस्तऐवज चेकलिस्ट',
    category: 'Railway Jobs',
    tags: 'Railway, Documents, Verification',
    postedOn: '10 Apr 2026',
    status: 'published',
    meta: 'Railway recruitment me commonly required documents aur verification ke important points ek jagah samjho.',
    metaMr: 'रेल्वे भरतीसाठी लागणारे महत्त्वाचे कागदपत्रे आणि पडताळणीचे मुद्दे समजून घ्या.',
    content: '<h2>Common documents</h2><p>10th marksheet, ITI certificate, ID proof, domicile, caste certificate, passport photo aur signature copies ready rakho.</p><h2>Verification tips</h2><p>Original aur self-attested photocopies dono saath rakho. Name, date of birth aur category details sab documents me same honi chahiye.</p>',
    contentMr: '<p>१०वीचे मार्कशीट, ITI प्रमाणपत्र, ओळखपत्र, जात प्रमाणपत्र आणि फोटोची प्रत आधीपासून तयार ठेवा.</p>'
  },
  {
    id: 'blog_1003',
    title: 'Bank Exam Time Management Tips',
    titleMr: 'बँक परीक्षेसाठी वेळ व्यवस्थापन टिप्स',
    category: 'Bank Jobs',
    tags: 'Bank, Speed, Accuracy',
    postedOn: '09 Apr 2026',
    status: 'published',
    meta: 'Bank PO aur Clerk exams me speed aur accuracy balance kaise karein — practical tips.',
    metaMr: 'Bank PO आणि Clerk परीक्षेत speed आणि accuracy कसे balance करायचे यासाठी practical tips.',
    content: '<p>Bank exam me sectional timing ka discipline bahut important hota hai. Easy questions pehle solve karo aur doubtful questions mark करके बाद me revisit karo.</p><p>Daily timed practice se speed naturally improve hoti hai.</p>',
    contentMr: '<p>बँक परीक्षेत सोपे प्रश्न आधी सोडवा. वेळ संपण्यापूर्वी पुनरावलोकनासाठी काही मिनिटे राखून ठेवा.</p>'
  }
];

function deepClone(value) {
  return JSON.parse(JSON.stringify(value));
}

function normalizeCollection(data) {
  if (Array.isArray(data)) return data.filter(Boolean);
  if (data && typeof data === 'object') return Object.values(data).filter(Boolean);
  return [];
}

function readLocalCollection(key, fallback = []) {
  try {
    const parsed = JSON.parse(localStorage.getItem(key) || 'null');
    const items = normalizeCollection(parsed);
    return items.length ? items : deepClone(fallback);
  } catch(e) {
    return deepClone(fallback);
  }
}

function writeLocalCollection(key, items) {
  try {
    localStorage.setItem(key, JSON.stringify(normalizeCollection(items)));
  } catch(e) {}
}
let _cachedJobs = null;

function parseJobDate(dateStr) {
  if(!dateStr) return null;
  // YYYY-MM-DD (correct format)
  if(/^\d{4}-\d{2}-\d{2}$/.test(dateStr)) {
    const [y, m, d] = dateStr.split('-').map(Number);
    return new Date(y, m - 1, d);
  }
  // DD-MM-YYYY (wrong but handle karo)
  const ddmmyyyy = dateStr.match(/^(\d{2})[-\/](\d{2})[-\/](\d{4})$/);
  if(ddmmyyyy) {
    return new Date(parseInt(ddmmyyyy[3]), parseInt(ddmmyyyy[2]) - 1, parseInt(ddmmyyyy[1]));
  }
  const dt = new Date(dateStr);
  return isNaN(dt.getTime()) ? null : dt;
}

async function fetchJobsFromBlob() {
  try {
    const res = await fetch(`${FIREBASE_URL}/jobs.json`, { cache: 'no-store' });
    if(res.ok) {
      const data = await res.json();
      const jobs = normalizeCollection(data);
      if(jobs.length) {
        const cleanedJobs = await autoCleanupJobs(jobs);
        _cachedJobs = cleanedJobs;
        writeLocalCollection(LOCAL_KEYS.jobs, cleanedJobs);
        return cleanedJobs;
      }
    }
  } catch(e) {}
  const fallbackJobs = readLocalCollection(LOCAL_KEYS.jobs, DEFAULT_JOBS);
  _cachedJobs = normalizeCollection(fallbackJobs);
  return _cachedJobs;
}

// ===== AUTO CLEANUP =====
// Logic:
// 1. Last date nikal gayi → status = 'expired' (UI mein bottom pe dikhega)
// 2. Last date + 5 days nikal gayi → Firebase se delete + PDF delete
async function autoCleanupJobs(jobs) {
  const now = new Date();
  now.setHours(0,0,0,0);
  const fiveDaysMs = 5 * 24 * 60 * 60 * 1000;

  const updatedJobs = [];
  let changed = false;
  const pdfUrlsToDelete = [];

  jobs.forEach(j => {
    if(!j || !j.id) return;

    if(!j.rawLastDate || !String(j.rawLastDate).trim()) {
      updatedJobs.push(j);
      return;
    }

    const ld = parseJobDate(j.rawLastDate);
    if(!ld || isNaN(ld.getTime())) {
      updatedJobs.push(j);
      return;
    }

    ld.setHours(0,0,0,0);
    const diffMs = now - ld;

    if(diffMs > fiveDaysMs) {
      // 5 din se zyada expired — Firebase se bhi delete karo
      changed = true;
      if(j.pdfs && j.pdfs.length) {
        j.pdfs.forEach(p => { if(p.u) pdfUrlsToDelete.push(p.u); });
      }
      return; // array se hata do
    }

    if(diffMs > 0) {
      // Expired (1+ din baad) — status 'expired' karo, bottom pe dikhega SEO ke liye
      // Note: diffMs === 0 matlab aaj last date hai — aaj bhi live rakhna hai!
      if(j.status === 'live' || j.status === 'draft') {
        updatedJobs.push({ ...j, status: 'expired' });
        changed = true;
        return;
      }
    }

    updatedJobs.push(j);
  });

  // Firebase Storage PDFs delete karo (silently)
  pdfUrlsToDelete.forEach(url => {
    try {
      const match = url.match(/\/o\/(.+?)\?/);
      if(match) {
        const encodedPath = match[1];
        fetch(`https://firebasestorage.googleapis.com/v0/b/naukrikhoj-bb6df.appspot.com/o/${encodedPath}`, { method: 'DELETE' }).catch(()=>{});
      }
    } catch(e) {}
  });

  if(!changed) return jobs;

  try {
    const jobsObj = {};
    updatedJobs.forEach(j => { jobsObj[j.id] = j; });

    const saveRes = await fetch(`${FIREBASE_URL}/jobs.json`, {
      method: 'PUT',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(jobsObj)
    });

    if(saveRes.ok) {
      _cachedJobs = updatedJobs;
      localStorage.setItem('nkj_jobs', JSON.stringify(updatedJobs));
      return updatedJobs;
    }
  } catch(e) {
    console.log('Auto cleanup error:', e);
  }

  return updatedJobs;
}

function getJobs() {
  // Live jobs + expired jobs dono return karo
  // renderJobs mein sort hoga — live pehle, expired last
  if(_cachedJobs !== null) return _cachedJobs.filter(j => j.status === 'live' || j.status === 'expired');
  try { return JSON.parse(localStorage.getItem('nkj_jobs') || '[]').filter(j => j.status === 'live' || j.status === 'expired'); }
  catch { return []; }
}

// ===== SHIMMER SKELETON — Firebase fetch ke dauran dikhega =====
function showJobShimmer(count = 5) {
  const list = document.getElementById('jobs-list');
  if (!list) return;
  // Static SEO cards hain toh unhe pehle hata do
  const staticSeoJobs = document.getElementById('static-seo-jobs');
  if (staticSeoJobs) staticSeoJobs.remove();

  list.innerHTML = Array.from({ length: count }, () => `
    <div class="shimmer-card">
      <div style="display:flex;align-items:flex-start;gap:10px;margin-bottom:12px;">
        <div class="shimmer-line shimmer-icon"></div>
        <div style="flex:1;">
          <div class="shimmer-line shimmer-title"></div>
          <div class="shimmer-line shimmer-org"></div>
        </div>
        <div class="shimmer-line" style="width:52px;height:22px;border-radius:20px;flex-shrink:0;"></div>
      </div>
      <div class="shimmer-line shimmer-tags"></div>
      <div style="margin-top:10px;padding-top:10px;border-top:1px solid #F1F5F9;display:flex;justify-content:space-between;align-items:center;">
        <div class="shimmer-line shimmer-footer"></div>
        <div class="shimmer-line" style="width:90px;height:30px;border-radius:7px;"></div>
      </div>
    </div>`).join('');
}

// ===== RENDER JOB CARDS =====
let currentPage = 1;
const JOBS_PER_PAGE = 10;
let _allFilteredJobs = [];

function renderJobs(jobs) {
  // Filter out completely broken/null jobs
  const safeJobs = (jobs || []).filter(j => j && typeof j === 'object');
  const live = safeJobs.filter(j => j.status === 'live');
  const expired = safeJobs.filter(j => j.status === 'expired');

  // Live jobs — nearest last date pehle
  live.sort((a, b) => {
    if(!a.rawLastDate && !b.rawLastDate) return 0;
    if(!a.rawLastDate) return 1;
    if(!b.rawLastDate) return -1;
    const da = parseJobDate(a.rawLastDate) || new Date('9999-12-31');
    const db = parseJobDate(b.rawLastDate) || new Date('9999-12-31');
    return da - db;
  });

  // Expired jobs — most recently expired pehle
  expired.sort((a, b) => {
    if(!a.rawLastDate && !b.rawLastDate) return 0;
    if(!a.rawLastDate) return 1;
    if(!b.rawLastDate) return -1;
    const da = parseJobDate(a.rawLastDate) || new Date('0000-01-01');
    const db = parseJobDate(b.rawLastDate) || new Date('0000-01-01');
    return db - da;
  });

  // Live pehle, expired last
  _allFilteredJobs = [...live, ...expired];
  currentPage = 1;
  renderJobsPage();
}

function renderJobsPage() {
  const list = document.getElementById('jobs-list');
  const noMsg = document.getElementById('no-jobs-msg');
  const count = document.getElementById('jobs-count');
  const jobs = _allFilteredJobs;

  if(!jobs.length) {
    list.innerHTML = '';
    if(noMsg) { noMsg.removeAttribute('hidden'); noMsg.style.display = 'block'; noMsg.style.visibility = 'visible'; noMsg.style.height = 'auto'; noMsg.style.overflow = ''; noMsg.style.margin = ''; }
    if(count) count.textContent = '0';
    renderPagination(0);
    return;
  }
  if(noMsg) { noMsg.setAttribute('hidden', ''); noMsg.style.display = 'none'; noMsg.style.visibility = 'hidden'; noMsg.style.height = '0'; noMsg.style.overflow = 'hidden'; noMsg.style.margin = '0'; }
  if(count) count.textContent = jobs.length;

  const totalPages = Math.ceil(jobs.length / JOBS_PER_PAGE);
  const start = (currentPage - 1) * JOBS_PER_PAGE;
  const pageJobs = jobs.slice(start, start + JOBS_PER_PAGE);

  // Helper: build the Marathi block HTML using saved Marathi data only
  function buildMrBlock(titleMr, orgMr, deptMr, locMr, lastDateMr, vacancies, location, lastDate, descMr) {
    // Card mein sirf: Marathi title + org/dept + key fields (NO big description)
    return `
      <div style="display:flex;align-items:center;gap:8px;margin:12px 0 10px;pointer-events:none;">
        <div style="flex:1;height:1px;background:linear-gradient(90deg,transparent,#f97316 40%,#f97316 60%,transparent);"></div>
        <div style="background:linear-gradient(135deg,#f97316,#ea580c);border-radius:20px;padding:4px 14px;display:flex;align-items:center;gap:6px;box-shadow:0 2px 8px rgba(249,115,22,0.25);">
          <span style="font-size:0.75rem;">🇮🇳</span>
          <span style="font-family:'Rajdhani',sans-serif;font-size:0.72rem;font-weight:700;color:#fff;letter-spacing:0.5px;">मराठी</span>
        </div>
        <div style="flex:1;height:1px;background:linear-gradient(90deg,#f97316 40%,#f97316 60%,transparent);"></div>
      </div>
      <div style="background:#fff7ed;border-radius:10px;padding:10px 14px;">
        <div style="font-family:'Rajdhani',sans-serif;font-size:0.95rem;font-weight:700;color:#9a3412;line-height:1.35;margin-bottom:3px;">${titleMr}</div>
        ${orgMr ? `<div style="font-size:0.78rem;color:#c2410c;margin-bottom:5px;">${orgMr}${deptMr?' | <b>'+deptMr+'</b>':''}</div>` : ''}
        <div style="display:flex;gap:10px;flex-wrap:wrap;font-size:0.75rem;color:#9a3412;">
          <span>👥 <b>${vacancies} पदे</b></span>
          ${locMr ? `<span>📍 <b>${locMr}</b></span>` : (location && location !== 'All India' ? `<span>📍 <b>${location}</b></span>` : '')}
          ${lastDateMr ? `<span>📅 अंतिम तारीख: <b>${lastDateMr}</b></span>` : (lastDate ? `<span>📅 <b>${lastDate}</b></span>` : '')}
        </div>
      </div>`;
  }


  list.innerHTML = pageJobs.map((j, i) => {
    try {
    const title = (typeof j.title === 'object' ? (j.title.en || '') : (j.title || '')) || 'Untitled Job';
    const org = typeof j.org === 'object' ? (j.org.en || '') : (j.org || '');
    const dept = typeof j.dept === 'object' ? (j.dept.en || '') : (j.dept || '');
    const lastDate = typeof j.lastDate === 'object' ? (j.lastDate.en || '') : (j.lastDate || '');
    const location = (typeof j.location === 'object' ? (j.location.en || '') : (j.location || '')) || 'All India';
    const posted = typeof j.posted === 'object' ? (j.posted.en || '') : (j.posted || '');
    const vacancies = j.vacancies || '—';
    const jobId = j.id || '';
    let deadlineHtml = '';
    if(lastDate) {
      if(j.rawLastDate) {
        try {
          const today = new Date(); today.setHours(0,0,0,0);
          const ld = parseJobDate(j.rawLastDate) || new Date(j.rawLastDate); ld.setHours(0,0,0,0);
          const daysLeft = Math.round((ld - today) / (1000*60*60*24));
          let cls, badge;
          if(daysLeft < 0) {
            cls='urg'; badge=`<span class="deadline-badge db-red">Closed</span>`;
          } else if(daysLeft === 0) {
            cls='urg'; badge=`<span class="deadline-badge db-red">Last Day!</span>`;
          } else if(daysLeft <= 2) {
            cls='urg'; badge=`<span class="deadline-badge db-red">Hurry Up! ${daysLeft} Day${daysLeft>1?'s':''} Only</span>`;
          } else if(daysLeft <= 8) {
            cls='warn'; badge=`<span class="deadline-badge db-yellow">${daysLeft} Days Left</span>`;
          } else {
            cls='ok'; badge=`<span class="deadline-badge db-green">${daysLeft} Days Left</span>`;
          }
          deadlineHtml = `<div class="jdeadline ${cls}">✅ Last Date: ${lastDate} ${badge}</div>`;
        } catch(e) {
          deadlineHtml = `<div class="jdeadline ok">✅ Last Date: ${lastDate}</div>`;
        }
      } else {
        deadlineHtml = `<div class="jdeadline ok">✅ Last Date: ${lastDate}</div>`;
      }
    }

    // Marathi: saved data (new jobs) ya placeholder for async translate (old jobs)
    const savedTitleMr = (typeof j.title === 'object' && j.title.mr) ? j.title.mr : '';
    const savedOrgMr   = j.orgMr || ((typeof j.org === 'object' && j.org.mr) ? j.org.mr : '');
    const savedDeptMr  = j.deptMr || ((typeof j.dept === 'object' && j.dept.mr) ? j.dept.mr : '');
    const savedLocMr   = j.locationMr || ((typeof j.location === 'object' && j.location.mr) ? j.location.mr : '');
    const savedLdMr    = (typeof j.lastDate === 'object' && j.lastDate.mr) ? j.lastDate.mr : (j.lastDateMr || '');
    const savedDescMr  = j.descMr || '';

    const hasSavedMr = !!(savedTitleMr || savedOrgMr || savedDeptMr || savedLocMr || savedLdMr || savedDescMr);

    // mrBlock shows org/location/date in Marathi (title already shown in card header)
    const mrBlockHasMeta = !!(savedOrgMr || savedDeptMr || savedLocMr || savedLdMr);
    const mrBlock = mrBlockHasMeta
      ? buildMrBlock('', savedOrgMr, savedDeptMr, savedLocMr, savedLdMr, vacancies, location, lastDate, '')
      : '';

    return `
    <div class="jcard ${i===0&&currentPage===1?'featured':''}" onclick="showDetail('${jobId}')">
      <div class="jc-top">
        <div class="jc-left">
          <div class="dept-ico">${j.icon || '📋'}</div>
          <div class="jc-info">
            <div class="jc-title">${title}</div>
            ${savedTitleMr ? `<div style="font-family:'Rajdhani',sans-serif;font-size:0.82rem;font-weight:600;color:#c2410c;line-height:1.3;margin-top:2px;">${savedTitleMr}</div>` : ''}
            <div class="jc-org">${org}${dept?' | <b>'+dept+'</b>':''}</div>
          </div>
        </div>
        <span class="badge ${j.badgeClass || 'b-new'}">${j.badge || '✅ NEW'}</span>
      </div>
      <div class="jc-meta">
        <div class="jmeta">👥 <b>${vacancies} Posts</b></div>
        ${j.salary ? `<div class="jmeta">💰 <b>${j.salary}</b></div>` : ''}
        <div class="jmeta">📍 <b>${location}</b></div>
      </div>
      <div class="jc-tags">
        <span class="tag">${j.category || 'Govt Job'}</span>
        <span class="tag">${location}</span>
      </div>
      ${mrBlock}
      <div class="jc-foot">
        <div>
          <div class="jdate">📅 Posted: ${posted}</div>
          ${deadlineHtml}
        </div>
        <button class="view-btn">View Details →</button>
      </div>
    </div>`;
    } catch(cardErr) {
      // Ek job card crash kare toh baaki cards show hote rahein
      console.warn('Job card render error for id:', j && j.id, cardErr);
      return '';
    }
  }).join('');

  renderPagination(totalPages);
}

function renderPagination(totalPages) {
  // Remove old pagination if any
  const old = document.getElementById('pagination-wrap');
  if(old) old.remove();
  if(totalPages <= 1) return;

  const wrap = document.createElement('div');
  wrap.id = 'pagination-wrap';
  wrap.style.cssText = 'display:flex;justify-content:center;align-items:center;gap:8px;padding:24px 0 8px;flex-wrap:wrap;';

  // Prev button
  const prev = document.createElement('button');
  prev.textContent = '← Prev';
  prev.style.cssText = `padding:8px 18px;border-radius:8px;border:1.5px solid var(--border);background:${currentPage===1?'var(--bg)':'var(--navy)'};color:${currentPage===1?'var(--muted)':'#fff'};cursor:${currentPage===1?'not-allowed':'pointer'};font-family:'DM Sans',sans-serif;font-size:0.85rem;font-weight:600;`;
  prev.disabled = currentPage === 1;
  prev.onclick = () => { if(currentPage > 1) { currentPage--; renderJobsPage(); document.getElementById('jobs-list').scrollIntoView({behavior:'smooth'}); }};
  wrap.appendChild(prev);

  // Page numbers
  for(let i = 1; i <= totalPages; i++) {
    if(totalPages > 7 && i > 2 && i < totalPages - 1 && Math.abs(i - currentPage) > 1) {
      if(i === 3 || i === totalPages - 2) {
        const dots = document.createElement('span');
        dots.textContent = '...';
        dots.style.cssText = 'color:var(--muted);padding:0 4px;';
        wrap.appendChild(dots);
      }
      continue;
    }
    const btn = document.createElement('button');
    btn.textContent = i;
    const isActive = i === currentPage;
    btn.style.cssText = `padding:8px 14px;border-radius:8px;border:1.5px solid ${isActive?'var(--saffron)':'var(--border)'};background:${isActive?'var(--saffron)':'#fff'};color:${isActive?'#fff':'var(--text)'};cursor:pointer;font-family:'DM Sans',sans-serif;font-size:0.85rem;font-weight:${isActive?'700':'500'};`;
    btn.onclick = ((pg) => () => { currentPage = pg; renderJobsPage(); document.getElementById('jobs-list').scrollIntoView({behavior:'smooth'}); })(i);
    wrap.appendChild(btn);
  }

  // Next button
  const next = document.createElement('button');
  next.textContent = 'Next →';
  next.style.cssText = `padding:8px 18px;border-radius:8px;border:1.5px solid var(--border);background:${currentPage===totalPages?'var(--bg)':'var(--navy)'};color:${currentPage===totalPages?'var(--muted)':'#fff'};cursor:${currentPage===totalPages?'not-allowed':'pointer'};font-family:'DM Sans',sans-serif;font-size:0.85rem;font-weight:600;`;
  next.disabled = currentPage === totalPages;
  next.onclick = () => { if(currentPage < totalPages) { currentPage++; renderJobsPage(); document.getElementById('jobs-list').scrollIntoView({behavior:'smooth'}); }};
  wrap.appendChild(next);

  // Insert after jobs-list
  const jobsList = document.getElementById('jobs-list');
  jobsList.parentNode.insertBefore(wrap, jobsList.nextSibling);
}

// ===== RENDER TICKER — disabled =====
function renderTicker(jobs) { /* ticker removed */ }

// ===== RENDER CLOSING SIDEBAR =====
function renderClosing(jobs) {
  try {
  const container = document.getElementById('closing-list');
  if(!container) return;
  const now = new Date();
  now.setHours(0,0,0,0);
  const week = new Date(now.getTime() + 7 * 24 * 60 * 60 * 1000);

  // Sirf wahi jobs jo aaj se lekar 7 din ke andar close ho rahi hain
  const closing = (jobs||[])
    .filter(j => {
      if(!j || !j.rawLastDate) return false;
      const d = parseJobDate(j.rawLastDate);
      if(!d) return false;
      return d >= now && d <= week;
    })
    .sort((a,b) => (parseJobDate(a.rawLastDate)||new Date("9999-12-31")) - (parseJobDate(b.rawLastDate)||new Date("9999-12-31")));

  if(!closing.length) {
    container.innerHTML = '<div style="color:var(--muted);font-size:0.82rem;padding:8px 0;">अगले 7 दिनों में कोई closing नहीं</div>';
    return;
  }

  container.innerHTML = closing.map(j => {
    try {
    const dt = parseJobDate(j.rawLastDate) || new Date(j.rawLastDate);
    dt.setHours(0,0,0,0);
    const title = typeof j.title==='object' ? (j.title.en||'') : (j.title||'');
    const isToday = dt.getTime() === now.getTime();
    const isTomorrow = dt.getTime() === now.getTime() + 24*60*60*1000;

    const dayLabel = isToday ? 'TODAY' : isTomorrow ? 'TMRW' : dt.getDate();
    const monLabel = isToday ? '⚠️' : isTomorrow ? '⚡' : dt.toLocaleString('en',{month:'short'}).toUpperCase();
    const urgColor = isToday ? '#DC2626' : isTomorrow ? '#E8470A' : '#0B1F3A';

    return `<div class="dl-item" onclick="showDetail('${j.id}')">
      <div class="dl-date" style="background:${isToday?'#DC2626':isTomorrow?'#FFF3E8':'var(--bg)'};border-radius:8px;padding:6px 4px;min-width:44px;text-align:center;">
        <div class="dl-d" style="color:${isToday?'#fff':urgColor};font-size:${isToday||isTomorrow?'0.7rem':'1.1rem'};font-weight:800;">${dayLabel}</div>
        <div class="dl-m" style="color:${isToday?'#fff':urgColor};">${monLabel}</div>
      </div>
      <div style="flex:1;min-width:0;">
        <div style="font-size:0.72rem;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:0.3px;margin-bottom:1px;">${j.org||j.dept||'Govt of India'}</div>
        <div class="dl-t" style="${isToday?'color:var(--red);font-weight:700;':''}">${title}</div>
        <div class="dl-s">📅 Last Date: <b style="color:${isToday?'var(--red)':isTomorrow?'var(--saffron)':'inherit'}">${isToday?'TODAY':isTomorrow?'Tomorrow':dt.toLocaleDateString('en-IN',{day:'numeric',month:'short'})}</b> • ${j.vacancies||''} Posts</div>
      </div>
    </div>`;
    } catch(e) { return ''; }
  }).join('');
  } catch(e) { console.warn('renderClosing error:', e); }
}

// ===== SUBSCRIBE =====
function subscribeEmail() {
  const input = document.getElementById('sub-email');
  const msg = document.getElementById('sub-msg');
  const email = input.value.trim();
  if(!email || !email.includes('@') || !email.includes('.')) {
    msg.style.display = 'block';
    msg.style.color = '#DC2626';
    msg.textContent = '❌ Valid email daalo!';
    return;
  }
  // Save to localStorage
  const subs = JSON.parse(localStorage.getItem('nkj_subscribers')||'[]');
  if(subs.includes(email)) {
    msg.style.display = 'block';
    msg.style.color = 'var(--saffron)';
    msg.textContent = '⚠️ Already subscribed!';
    return;
  }
  subs.push(email);
  localStorage.setItem('nkj_subscribers', JSON.stringify(subs));
  input.value = '';
  msg.style.display = 'block';
  msg.style.color = '#00875A';
  msg.textContent = '✅ Preference saved on this device. Full email alerts are launching soon.';
  setTimeout(() => msg.style.display = 'none', 4000);
}

// ===== FILTER BY STATE =====
function filterByState(state) {
  const jobs = getJobs();
  if(!state || state === 'All India') {
    renderJobs(jobs);
    return;
  }
  const filtered = jobs.filter(j => {
    const loc = typeof j.location==='object' ? j.location.en : (j.location||'');
    return loc.toLowerCase().includes(state.toLowerCase()) || loc.toLowerCase().includes('all india');
  });
  renderJobs(filtered);
  // Scroll to jobs
  document.getElementById('jobs-list').scrollIntoView({behavior:'smooth'});
}

// ===== SHOW DETAIL =====
function showDetail(id, pushState = true) {
  const jobs = getJobs();
  const j = jobs.find(j => j.id === id);
  if(!j) {
    showPage('detail');
    setPageMeta({
      title: 'Job not found — NaukriKhoj.in',
      description: 'This job listing is no longer available. Browse the latest jobs on NaukriKhoj.in.',
      canonical: 'https://naukrikhoj.in/latest-jobs',
      robots: 'noindex, follow'
    });
    upsertJobPostingSchema(null);
    document.getElementById('detail-page').innerHTML = `
      <div style="max-width:860px;margin:0 auto;padding:40px 4%;text-align:center;box-sizing:border-box;">
        <button class="back-btn" onclick="showHome()" style="margin-bottom:24px;">← Back to Home</button>
        <div style="background:#fff;border:1.5px solid var(--border);border-radius:18px;padding:48px 32px;box-shadow:var(--shadow-sm);">
          <div style="font-size:3.5rem;margin-bottom:16px;">🔍</div>
          <div style="font-family:'Rajdhani',sans-serif;font-size:1.5rem;font-weight:700;color:var(--navy);margin-bottom:10px;">Job nahi mili</div>
          <div style="font-size:0.92rem;color:var(--muted);margin-bottom:28px;line-height:1.7;">Yeh job listing abhi available nahi hai ya hata di gayi hai.<br>Latest jobs dekho — nayi vacancies regularly update hoti hain.</div>
          <div style="display:flex;gap:12px;justify-content:center;flex-wrap:wrap;">
            <button onclick="showHome()" style="background:var(--saffron);color:#fff;border:none;padding:11px 28px;border-radius:9px;font-size:0.92rem;font-weight:700;cursor:pointer;font-family:'DM Sans',sans-serif;">🏠 Latest Jobs Dekho</button>
            <button onclick="showLatestJobs()" style="background:var(--navy);color:#fff;border:none;padding:11px 28px;border-radius:9px;font-size:0.92rem;font-weight:700;cursor:pointer;font-family:'DM Sans',sans-serif;">📋 All Jobs</button>
          </div>
        </div>
      </div>`;
    return;
  }

  window.scrollTo(0,0);
  showPage('detail');

  try {
  const title = typeof j.title === 'object' ? j.title.en : j.title;
  const slug = (title || id).toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'').substring(0,60);
  const jobUrl = `/job/${slug}-${id.replace('job_','')}`;
  if(pushState) history.pushState({ page: 'detail', jobId: id }, title, jobUrl);
  setPageMeta({
    title: `${title} — NaukriKhoj.in`,
    description: `${title} – eligibility, vacancies, last date, salary and official apply link on NaukriKhoj.in.`,
    canonical: `https://naukrikhoj.in${jobUrl}`,
    robots: 'index, follow'
  });
  upsertJobPostingSchema(j);

  const L = (field) => typeof field === 'object' ? (field.en || '') : (field || '');
  const Lmr = (field, fallback = '') => typeof field === 'object' ? (field.mr || field.en || fallback) : (fallback || field || '');


  // ===== FORMAT TEXT — newlines, numbered lists =====
  function formatText(text) {
    if(!text) return '';
    // Split by newlines
    const lines = text.split(/\n/);
    let html = '';
    let inList = false;

    lines.forEach(line => {
      const trimmed = line.trim();
      if(!trimmed) {
        if(inList) { html += '</ol>'; inList = false; }
        return;
      }
      // Numbered list: starts with 1. 2. 3. or 1) 2) 3)
      const numMatch = trimmed.match(/^(\d+)[.)]\s+(.*)/);
      if(numMatch) {
        if(!inList) { html += '<ol style="margin:6px 0 6px 18px;padding:0;">'; inList = true; }
        html += `<li style="margin-bottom:4px;line-height:1.7;">${numMatch[2]}</li>`;
      } else {
        if(inList) { html += '</ol>'; inList = false; }
        // Bullet: starts with - or *
        const bulletMatch = trimmed.match(/^[-*•]\s+(.*)/);
        if(bulletMatch) {
          html += `<div style="display:flex;gap:6px;margin-bottom:4px;"><span style="color:var(--saffron);font-weight:700;">•</span><span style="line-height:1.7;">${bulletMatch[1]}</span></div>`;
        } else {
          html += `<div style="line-height:1.7;margin-bottom:3px;">${trimmed}</div>`;
        }
      }
    });
    if(inList) html += '</ol>';
    return html;
  }

  // Only show lang block if it has at least one filled field
  function eligTable(lang) {
    const data = (j.elig && j.elig[lang]) || {};
    const entries = Object.entries(data).filter(([k,v]) => v && v.trim());
    if(!entries.length) return null;
    return entries.map(([k,v]) => `<tr><td>${k}</td><td style="word-break:break-word;white-space:normal;">${formatText(v)}</td></tr>`).join('');
  }

  function langBlock(lang, label) {
    const rows = eligTable(lang);
    if(!rows) return '';
    return `<div class="lang-block" style="margin-bottom:18px;">
      <div class="lang-header"><span class="lang-label">${label}</span></div>
      <div class="elig-responsive">
        <table class="elig-table">${rows}</table>
      </div>
    </div>`;
  }

  const enBlock  = langBlock('en','English');
  const eligSection = enBlock ? `
    <div class="detail-section">
      <div class="ds-title">✅ Eligibility Criteria · पात्रता निकष</div>
      ${enBlock}
    </div>` : '';

  // Vacancy table — only show if rows exist
  const vacData = (j.vacTable||[]).filter(r => {
    const name = Array.isArray(r) ? r[0] : r.name;
    return name && name.trim();
  });
  const vacSection = vacData.length ? `
    <div class="detail-section">
      <div class="ds-title">👥 Vacancy Details · पदांचा तपशील</div>

      <!-- Desktop: Table -->
      <div class="vac-desktop">
        <div class="vac-table-wrap">
        <table class="vac-table">
          <thead><tr><th>Post / पद</th><th>Vacancies</th><th>Qualification</th><th>Pay</th><th>Notification</th><th>Apply</th></tr></thead>
          <tbody>
            ${vacData.map(r=>{
              const name = Array.isArray(r) ? r[0] : r.name||'';
              const vac  = Array.isArray(r) ? r[1] : r.vac||'';
              const qual = Array.isArray(r) ? r[2] : r.qual||'';
              const pay  = Array.isArray(r) ? r[3] : r.pay||'';
              const notifLink = Array.isArray(r) ? r[4]||'' : r.notifLink||'';
              const applyLink = Array.isArray(r) ? '' : r.applyLink||'';
              const notifLinkValid = notifLink && notifLink !== '#';
              const applyLinkValid = applyLink && applyLink !== '#';
              return `<tr>
                <td style="word-break:break-word;">${name}</td>
                <td>${vac}</td>
                <td style="word-break:break-word;">${qual}</td>
                <td>${pay?'₹'+pay:''}</td>
                <td>${notifLinkValid?`<a href="${notifLink}" target="_blank" rel="noopener noreferrer" style="background:var(--navy);color:#fff;padding:4px 10px;border-radius:6px;font-size:0.75rem;font-weight:700;text-decoration:none;">📄 View</a>`:'—'}</td>
                <td>${applyLinkValid?`<a href="${applyLink}" target="_blank" rel="noopener noreferrer" style="background:var(--saffron);color:#fff;padding:4px 10px;border-radius:6px;font-size:0.75rem;font-weight:700;text-decoration:none;">🖊️ Apply</a>`:'—'}</td>
              </tr>`;
            }).join('')}
            <tr class="vac-total"><td colspan="5"><b>Total Vacancies / एकूण रिक्त पदे</b></td><td><b>${j.vacancies||''}</b></td></tr>
          </tbody>
        </table>
        </div>
      </div>

      <!-- Mobile: Cards -->
      <div class="vac-mobile">
        ${vacData.map(r=>{
          const name = Array.isArray(r) ? r[0] : r.name||'';
          const vac  = Array.isArray(r) ? r[1] : r.vac||'';
          const qual = Array.isArray(r) ? r[2] : r.qual||'';
          const pay  = Array.isArray(r) ? r[3] : r.pay||'';
          const notifLink = Array.isArray(r) ? r[4]||'' : r.notifLink||'';
          const applyLink = Array.isArray(r) ? '' : r.applyLink||'';
          const notifLinkValid = notifLink && notifLink !== '#';
          const applyLinkValid = applyLink && applyLink !== '#';
          return `<div style="background:var(--bg);border:1.5px solid var(--border);border-radius:12px;padding:16px;margin-bottom:10px;">
            <div style="font-weight:700;color:var(--navy);font-size:0.95rem;margin-bottom:10px;">📋 ${name}</div>
            <div style="display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:10px;">
              ${vac?`<div style="background:#fff;border-radius:8px;padding:8px 12px;"><div style="font-size:0.68rem;color:var(--muted);font-weight:600;text-transform:uppercase;">Vacancies</div><div style="font-weight:700;color:var(--saffron);font-size:0.95rem;">${vac}</div></div>`:''}
              ${pay?`<div style="background:#fff;border-radius:8px;padding:8px 12px;"><div style="font-size:0.68rem;color:var(--muted);font-weight:600;text-transform:uppercase;">Pay Scale</div><div style="font-weight:700;color:var(--navy);font-size:0.88rem;">₹${pay}</div></div>`:''}
            </div>
            ${qual?`<div style="font-size:0.82rem;color:var(--text);margin-bottom:10px;line-height:1.6;word-break:break-word;"><b>Qualification:</b> ${qual}</div>`:''}
            <div style="display:flex;gap:8px;flex-wrap:wrap;">
              ${notifLinkValid?`<a href="${notifLink}" target="_blank" rel="noopener noreferrer" style="background:var(--navy);color:#fff;padding:7px 14px;border-radius:7px;font-size:0.8rem;font-weight:700;text-decoration:none;">📄 Notification</a>`:''}
              ${applyLinkValid?`<a href="${applyLink}" target="_blank" rel="noopener noreferrer" style="background:var(--saffron);color:#fff;padding:7px 14px;border-radius:7px;font-size:0.8rem;font-weight:700;text-decoration:none;">🖊️ Apply</a>`:''}
            </div>
          </div>`;
        }).join('')}
        <div style="background:rgba(232,71,10,0.06);border-radius:10px;padding:12px 16px;text-align:center;font-weight:700;color:var(--saffron);">
          Total Vacancies: ${j.vacancies||''}
        </div>
      </div>
    </div>` : '';

  // Dates — only filled ones
  const datesData = (j.dates||[]).filter(d => d.v && d.v.trim());
  const datesSection = datesData.length ? `
    <div class="detail-section">
      <div class="ds-title">📅 Important Dates · महत्त्वाच्या तारखा</div>
      <div class="dates-grid">
        ${datesData.map(d=>`<div class="date-item"><div class="date-label">${d.l}</div><div class="date-val ${d.c||''}">${d.v}</div></div>`).join('')}
      </div>
    </div>` : '';

  // Fees section — only if filled
  const feesSection = j.fees ? `
    <div class="detail-section">
      <div class="ds-title">💰 Application Fee · अर्ज शुल्क</div>
      <div style="background:#FFF8F0;border:1.5px solid #FFD9B3;border-radius:10px;padding:16px 20px;font-size:0.92rem;font-weight:600;color:var(--navy);">
        💳 ${j.fees}
      </div>
    </div>` : '';

  // ===== KEY HIGHLIGHTS =====
  const kh = j.keyHighlights || {};
  const khRows = [
    ['Organisation', kh.org || L(j.org)],
    ['Exam Name', kh.exam || L(j.title)],
    ['Posts', kh.posts],
    ['Total Vacancies', kh.vacancies || j.vacancies],
    ['Mode of Application', kh.mode],
    ['Registration Dates', kh.regDates],
    ['Qualification', kh.qual],
    ['Age Limit', kh.age || (j.elig?.en?.['Age Limit'])],
    ['Salary / Pay Scale', kh.salary || j.salary],
    ['Application Fee', kh.fee || j.fees],
    ['Job Location', kh.location || j.location],
    ['Official Website', kh.website ? `<a href="${kh.website}" target="_blank" rel="noopener noreferrer" style="color:var(--saffron);word-break:break-all;">${kh.website}</a>` : ''],
  ].filter(([,v]) => v && String(v).trim());
  const keyHighlightsSection = khRows.length ? `
    <div class="detail-section">
      <div class="ds-title">⭐ Key Highlights · मुख्य माहिती</div>
      <div class="vac-table-wrap">
        <table class="elig-table" style="width:100%;">
          <thead><tr style="background:var(--navy);color:#fff;"><th style="padding:10px 14px;text-align:left;">Detail</th><th style="padding:10px 14px;text-align:left;">Information</th></tr></thead>
          <tbody>
            ${khRows.map(([k,v],i)=>`<tr style="background:${i%2===0?'#fff':'#f8fafc'};"><td style="padding:10px 14px;font-weight:600;color:var(--navy);white-space:nowrap;">${k}</td><td style="padding:10px 14px;color:var(--text);">${v}</td></tr>`).join('')}
          </tbody>
        </table>
      </div>
    </div>` : '';

  // ===== SELECTION PROCESS =====
  const selSteps = (j.selectionSteps||[]).filter(s => s && s.trim());
  const selectionSection = selSteps.length ? `
    <div class="detail-section">
      <div class="ds-title">🎯 Selection Process · निवड प्रक्रिया</div>
      <div style="display:flex;flex-direction:column;gap:10px;">
        ${selSteps.map((step,i)=>`
          <div style="display:flex;gap:12px;align-items:flex-start;background:#f8fafc;border-radius:10px;padding:13px 16px;border-left:4px solid var(--saffron);">
            <div style="background:var(--saffron);color:#fff;border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:0.82rem;flex-shrink:0;margin-top:1px;">${i+1}</div>
            <div style="font-size:0.91rem;color:var(--text);line-height:1.65;">${step}</div>
          </div>`).join('')}
      </div>
    </div>` : '';

  // ===== EXAM PATTERN =====
  const ep = j.examPattern || {};
  const preRows = (ep.prelims||[]).filter(r => r.subj && r.subj.trim());
  const mainRows = (ep.mains||[]).filter(r => r.subj && r.subj.trim());
  const examNote = ep.note && ep.note.trim() ? ep.note : '';
  const examPatternSection = (preRows.length || mainRows.length || examNote) ? `
    <div class="detail-section">
      <div class="ds-title">📝 Exam Pattern · परीक्षा स्वरूप</div>
      ${preRows.length ? `
        <div style="font-size:0.82rem;font-weight:700;color:var(--navy);text-transform:uppercase;letter-spacing:0.5px;margin-bottom:8px;">Phase 1 — Prelims</div>
        <div class="vac-table-wrap" style="margin-bottom:16px;">
          <table class="vac-table">
            <thead><tr><th>Subject / Section</th><th>Questions</th><th>Marks</th><th>Duration</th></tr></thead>
            <tbody>
              ${preRows.map((r,i)=>`<tr style="background:${i%2===0?'#fff':'#f8fafc'};"><td style="font-weight:600;">${r.subj}</td><td>${r.qs||'—'}</td><td>${r.marks||'—'}</td><td>${r.dur||'—'}</td></tr>`).join('')}
            </tbody>
          </table>
        </div>` : ''}
      ${mainRows.length ? `
        <div style="font-size:0.82rem;font-weight:700;color:var(--navy);text-transform:uppercase;letter-spacing:0.5px;margin-bottom:8px;">Phase 2 — Mains</div>
        <div class="vac-table-wrap" style="margin-bottom:16px;">
          <table class="vac-table">
            <thead><tr><th>Paper / Subject</th><th>Type</th><th>Marks</th><th>Duration</th></tr></thead>
            <tbody>
              ${mainRows.map((r,i)=>`<tr style="background:${i%2===0?'#fff':'#f8fafc'};"><td style="font-weight:600;">${r.subj}</td><td>${r.type||'—'}</td><td>${r.marks||'—'}</td><td>${r.dur||'—'}</td></tr>`).join('')}
            </tbody>
          </table>
        </div>` : ''}
      ${examNote ? `<div style="background:#FFF8F0;border:1.5px solid #FFD9B3;border-radius:10px;padding:13px 16px;font-size:0.86rem;color:var(--text);line-height:1.7;"><b>📌 Note:</b> ${examNote}</div>` : ''}
    </div>` : '';

  // ===== AGE LIMIT =====
  const al = j.ageLimitData || {};
  const alRelax = (al.relaxation||[]).filter(r => r.cat && r.rel);
  const ageLimitSection = (al.minAge || al.maxAge || alRelax.length) ? `
    <div class="detail-section">
      <div class="ds-title">🎂 Age Limit · वयोमर्यादा</div>
      ${(al.minAge || al.maxAge) ? `
        <div style="display:flex;gap:12px;margin-bottom:16px;flex-wrap:wrap;">
          ${al.minAge ? `<div style="background:#EEF2FF;border-radius:10px;padding:14px 22px;text-align:center;flex:1;min-width:120px;"><div style="font-size:0.72rem;color:var(--muted);font-weight:600;text-transform:uppercase;">Minimum Age</div><div style="font-size:1.25rem;font-weight:700;color:var(--navy);margin-top:4px;">${al.minAge}</div></div>` : ''}
          ${al.maxAge ? `<div style="background:#FFF0E6;border-radius:10px;padding:14px 22px;text-align:center;flex:1;min-width:120px;"><div style="font-size:0.72rem;color:var(--muted);font-weight:600;text-transform:uppercase;">Maximum Age</div><div style="font-size:1.25rem;font-weight:700;color:var(--saffron);margin-top:4px;">${al.maxAge}</div></div>` : ''}
        </div>` : ''}
      ${al.refDate ? `<div style="font-size:0.8rem;color:var(--muted);margin-bottom:12px;">📅 ${al.refDate}</div>` : ''}
      ${alRelax.length ? `
        <div style="font-size:0.78rem;font-weight:700;color:var(--navy);text-transform:uppercase;margin-bottom:8px;">Age Relaxation</div>
        <div class="vac-table-wrap">
          <table class="elig-table" style="width:100%;">
            <thead><tr style="background:var(--navy);color:#fff;"><th style="padding:9px 14px;text-align:left;">Category</th><th style="padding:9px 14px;text-align:left;">Relaxation</th></tr></thead>
            <tbody>
              ${alRelax.map((r,i)=>`<tr style="background:${i%2===0?'#fff':'#f8fafc'};"><td style="padding:9px 14px;font-weight:600;color:var(--text);">${r.cat}</td><td style="padding:9px 14px;color:var(--saffron);font-weight:700;">${r.rel}</td></tr>`).join('')}
            </tbody>
          </table>
        </div>` : ''}
    </div>` : '';

  // ===== HOW TO APPLY =====
  const applySteps = (j.howToApply||[]).filter(s => s && s.trim());
  const howToApplySection = applySteps.length ? `
    <div class="detail-section">
      <div class="ds-title">📋 How to Apply · अर्ज कसा करावा</div>
      <div style="display:flex;flex-direction:column;gap:10px;">
        ${applySteps.map((step,i)=>`
          <div style="display:flex;gap:12px;align-items:flex-start;background:#f0f4ff;border-radius:10px;padding:13px 16px;border-left:4px solid var(--navy);">
            <div style="background:var(--navy);color:#fff;border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:0.82rem;flex-shrink:0;margin-top:1px;">${i+1}</div>
            <div style="font-size:0.91rem;color:var(--text);line-height:1.65;">${step}</div>
          </div>`).join('')}
      </div>
    </div>` : '';

  // PDFs — only filled
  const pdfsData = (j.pdfs||[]).filter(p => p.u && p.u.trim());
  const pdfsSection = pdfsData.length ? `
    <div class="detail-section">
      <div class="ds-title">📄 Official Documents · अधिकृत कागदपत्रे</div>
      ${pdfsData.map(p=>`
        <div class="pdf-card" onclick="window.open('${p.u}','_blank')">
          <div class="pdf-icon">📄</div>
          <div class="pdf-info"><div class="pdf-name">${p.n}</div><div class="pdf-size">Official Govt Document</div></div>
          <button class="pdf-dl">⬇ Download</button>
        </div>`).join('')}
      <p style="font-size:0.76rem;color:var(--muted);margin-top:12px;line-height:1.8;">
        ⚠️ <b>Disclaimer:</b> For reference only. Always verify from official govt website before applying.
      </p>
    </div>` : '';


  const mrTitle = (typeof j.title === 'object' && j.title.mr) ? j.title.mr : L(j.title);
  const mrOrg = j.orgMr || (typeof j.org === 'object' ? (j.org.mr || L(j.org)) : '');
  const mrDept = j.deptMr || (typeof j.dept === 'object' ? (j.dept.mr || L(j.dept)) : '');
  const mrLocation = j.locationMr || (typeof j.location === 'object' ? (j.location.mr || L(j.location)) : '');
  const mrLastDate = typeof j.lastDate === 'object' ? (j.lastDate.mr || j.lastDate.en || '') : '';
  const mrFees = j.feesMr || j.fees || '';
  const mrSalary = j.salaryMr || j.salary || '';
  const mrElig = (j.elig && j.elig.mr) || {};
  const mrVacData = (j.vacTableMr || []).filter(r => r && (r.mrName || r.vac || r.mrQual || r.mrPay));
  const mrDatesData = (j.datesMr || []).filter(d => d && d.v && String(d.v).trim());
  const mrCustomFields = j.customFieldsMr || {};
  const marathiSection = (mrTitle || j.descMr || Object.values(mrElig).some(v => v && String(v).trim()) || mrVacData.length || mrDatesData.length)
    ? `
        <div style="margin:34px 0 24px;position:relative;">
          <div style="height:1px;background:linear-gradient(90deg,transparent 0%,#f97316 30%,#f97316 70%,transparent 100%);"></div>
          <div style="display:flex;align-items:center;justify-content:center;margin:-1px 0;">
            <div style="background:linear-gradient(135deg,#f97316,#ea580c);border-radius:50px;padding:14px 32px;box-shadow:0 8px 28px rgba(249,115,22,0.35);display:flex;align-items:center;gap:14px;flex-wrap:wrap;justify-content:center;">
              <span style="font-size:1.2rem;">🇬🇧</span>
              <div style="text-align:center;">
                <div style="font-family:'Rajdhani',sans-serif;font-size:0.72rem;font-weight:700;color:rgba(255,255,255,0.75);text-transform:uppercase;letter-spacing:1.5px;margin-bottom:2px;">English Above · Marathi Below</div>
                <div style="font-family:'Rajdhani',sans-serif;font-size:1rem;font-weight:700;color:#fff;letter-spacing:0.5px;">मराठी विभाग</div>
              </div>
              <span style="font-size:1.2rem;">🇮🇳</span>
            </div>
          </div>
          <div style="height:1px;background:linear-gradient(90deg,transparent 0%,#f97316 30%,#f97316 70%,transparent 100%);"></div>
        </div>

        <div class="detail-section" style="border-color:#fed7aa;background:#fffdfa;">
          <div style="background:linear-gradient(135deg,#f97316,#ea580c);border-radius:12px;padding:12px 18px;margin-bottom:16px;display:flex;align-items:center;gap:10px;">
            <span style="font-size:1.25rem;">🇮🇳</span>
            <span style="font-family:'Rajdhani',sans-serif;font-size:1.05rem;font-weight:700;color:#fff;letter-spacing:0.5px;">मराठी</span>
          </div>

          <div style="background:#fff7ed;border:1.5px solid #fed7aa;border-radius:12px;padding:12px 16px;margin-bottom:16px;font-size:0.82rem;color:#9a3412;line-height:1.7;">
            ⚠️ ही माहिती संदर्भासाठी आहे. अर्ज करण्यापूर्वी अधिकृत अधिसूचना आणि अधिकृत वेबसाइट नक्की तपासा.
          </div>

          <div style="background:#fff;border:1.5px solid #fed7aa;border-radius:14px;padding:18px;margin-bottom:16px;">
            <div style="font-family:'Rajdhani',sans-serif;font-size:1.35rem;font-weight:700;color:var(--navy);margin-bottom:6px;">${j.icon||'📋'} ${mrTitle}</div>
            <div style="font-size:0.88rem;color:var(--muted);margin-bottom:4px;">${mrOrg}${mrDept ? ' | <b>'+mrDept+'</b>' : ''}</div>
            ${mrLocation ? `<div style="font-size:0.8rem;color:var(--muted);margin-bottom:10px;">📍 ${mrLocation}</div>` : ''}
            <div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;">
              ${j.vacancies ? `<div style="background:var(--bg);border-radius:10px;padding:10px;text-align:center;"><div style="font-weight:700;color:var(--saffron);font-size:1rem;">${j.vacancies}</div><div style="font-size:0.7rem;color:var(--muted);">एकूण जागा</div></div>` : ''}
              ${mrSalary ? `<div style="background:var(--bg);border-radius:10px;padding:10px;text-align:center;"><div style="font-weight:700;color:var(--navy);font-size:0.82rem;">${mrSalary}</div><div style="font-size:0.7rem;color:var(--muted);">वेतन</div></div>` : ''}
              ${mrLastDate ? `<div style="background:var(--bg);border-radius:10px;padding:10px;text-align:center;"><div style="font-weight:700;color:#dc2626;font-size:0.82rem;">${mrLastDate}</div><div style="font-size:0.7rem;color:var(--muted);">अंतिम तारीख</div></div>` : ''}
              ${mrFees ? `<div style="background:var(--bg);border-radius:10px;padding:10px;text-align:center;"><div style="font-weight:700;color:var(--navy);font-size:0.82rem;">${mrFees}</div><div style="font-size:0.7rem;color:var(--muted);">अर्ज शुल्क</div></div>` : ''}
            </div>
          </div>

          ${j.descMr ? `<div style="background:#fff;border:1.5px solid #fed7aa;border-radius:14px;padding:18px;margin-bottom:16px;"><div class="ds-title">📝 नोकरीची माहिती</div><div style="font-size:0.88rem;color:var(--text);line-height:1.9;word-break:break-word;">${formatText(j.descMr)}</div></div>` : ''}

          ${Object.values(mrElig).some(v => v && String(v).trim()) ? `<div style="background:#fff;border:1.5px solid #fed7aa;border-radius:14px;padding:18px;margin-bottom:16px;"><div class="ds-title">✅ पात्रता</div><div class="elig-responsive"><table class="elig-table">${Object.entries(mrElig).filter(([k,v]) => v && String(v).trim()).map(([k,v]) => `<tr><td>${k}</td><td style="word-break:break-word;white-space:normal;">${formatText(v)}</td></tr>`).join('')}</table></div></div>` : ''}

          ${mrVacData.length ? `<div style="background:#fff;border:1.5px solid #fed7aa;border-radius:14px;padding:18px;margin-bottom:16px;"><div class="ds-title">👥 पदनिहाय तपशील</div>${mrVacData.map(r => `
              <div style="background:var(--bg);border-radius:12px;padding:14px;margin-bottom:10px;">
                <div style="font-weight:700;color:var(--navy);margin-bottom:8px;">📋 ${r.mrName || ''}</div>
                <div style="display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:8px;">
                  ${r.vac ? `<div style="background:#fff;border-radius:8px;padding:8px;"><div style="font-size:0.68rem;color:var(--muted);text-transform:uppercase;">जागा</div><div style="font-weight:700;color:var(--saffron);">${r.vac}</div></div>` : ''}
                  ${r.mrPay ? `<div style="background:#fff;border-radius:8px;padding:8px;"><div style="font-size:0.68rem;color:var(--muted);text-transform:uppercase;">वेतन</div><div style="font-weight:700;color:var(--navy);font-size:0.88rem;">${r.mrPay}</div></div>` : ''}
                </div>
                ${r.mrQual ? `<div style="font-size:0.82rem;color:var(--text);margin-bottom:8px;line-height:1.6;"><b>पात्रता:</b> ${r.mrQual}</div>` : ''}
                <div style="display:flex;gap:8px;flex-wrap:wrap;">
                  ${r.notifLink && r.notifLink !== '#' ? `<a href="${r.notifLink}" target="_blank" rel="noopener noreferrer" style="background:var(--navy);color:#fff;padding:6px 12px;border-radius:6px;font-size:0.78rem;font-weight:700;text-decoration:none;">📄 अधिसूचना</a>` : ''}
                  ${r.applyLink && r.applyLink !== '#' ? `<a href="${r.applyLink}" target="_blank" rel="noopener noreferrer" style="background:var(--saffron);color:#fff;padding:6px 12px;border-radius:6px;font-size:0.78rem;font-weight:700;text-decoration:none;">🖊️ अर्ज करा</a>` : ''}
                </div>
              </div>`).join('')}</div>` : ''}

          ${mrFees ? `<div style="background:#fff;border:1.5px solid #fed7aa;border-radius:14px;padding:18px;margin-bottom:16px;"><div class="ds-title">💰 अर्ज शुल्क</div><div style="background:#FFF8F0;border:1.5px solid #FFD9B3;border-radius:10px;padding:16px 20px;font-size:0.92rem;font-weight:600;color:var(--navy);">💳 ${mrFees}</div></div>` : ''}

          ${mrDatesData.length ? `<div style="background:#fff;border:1.5px solid #fed7aa;border-radius:14px;padding:18px;margin-bottom:16px;"><div class="ds-title">📅 महत्त्वाच्या तारखा</div><div class="dates-grid">${mrDatesData.map(d => `<div class="date-item"><div class="date-label">${d.l}</div><div class="date-val ${d.c||''}">${d.v}</div></div>`).join('')}</div></div>` : ''}

          ${Object.keys(mrCustomFields).length ? `<div style="background:#fff;border:1.5px solid #fed7aa;border-radius:14px;padding:18px;margin-bottom:16px;"><div class="ds-title">📌 अतिरिक्त माहिती</div>${Object.entries(mrCustomFields).map(([key,val]) => `<div style="display:flex;border-bottom:1px solid var(--border);"><div style="min-width:150px;max-width:180px;flex:0 0 150px;padding:10px 14px;background:var(--bg);font-size:0.78rem;font-weight:700;color:var(--navy);text-transform:uppercase;letter-spacing:0.3px;word-break:break-word;box-sizing:border-box;">${key}</div><div style="flex:1;min-width:0;padding:10px 14px;font-size:0.87rem;color:var(--text);line-height:1.6;word-break:break-word;box-sizing:border-box;">${val}</div></div>`).join('')}</div>` : ''}
        </div>`
    : '';

  // Quick stats — only show filled ones
  const lastDate = typeof j.lastDate==='object' ? j.lastDate.en : j.lastDate;
  const examDate = typeof j.examDate==='object' ? j.examDate.en : j.examDate;
  const quickStats = [
    j.vacancies ? `<div class="qs-item"><div class="qs-val">${j.vacancies}</div><div class="qs-key">Vacancies · एकूण जागा</div></div>` : '',
    j.salary    ? `<div class="qs-item"><div class="qs-val" style="font-size:0.85rem">${j.salary.split('–')[0].trim()}</div><div class="qs-key">Salary · वेतन</div></div>` : '',
    lastDate    ? `<div class="qs-item"><div class="qs-val ${j.lastDateClass||''}" style="font-size:0.82rem">${lastDate}</div><div class="qs-key">Last Date · अंतिम तारीख</div></div>` : '',
    examDate    ? `<div class="qs-item"><div class="qs-val" style="font-size:0.75rem">${examDate}</div><div class="qs-key">Exam Date · परीक्षा तारीख</div></div>` : '',
  ].filter(Boolean).join('');

  // Key highlights sidebar — only filled (remove duplicate fees entry)
  const highlights = [
    j.vacancies ? `<div class="key-point"><div class="kp-icon">📋</div><div class="kp-text"><b>Total Posts / एकूण जागा:</b> ${j.vacancies}</div></div>` : '',
    j.salary    ? `<div class="key-point"><div class="kp-icon">💰</div><div class="kp-text"><b>Salary / वेतन:</b> ${j.salary}</div></div>` : '',
    j.fees      ? `<div class="key-point"><div class="kp-icon">💳</div><div class="kp-text"><b>Application Fee / अर्ज शुल्क:</b> ${j.fees}</div></div>` : '',
    lastDate    ? `<div class="key-point"><div class="kp-icon">⏰</div><div class="kp-text"><b>Last Date / अंतिम तारीख:</b> <span class="${j.lastDateClass||''}">${lastDate}</span></div></div>` : '',
    j.applyUrl  ? `<div class="key-point"><div class="kp-icon">🌐</div><div class="kp-text"><b>Apply / अर्ज:</b> Online only</div></div>` : '',
    L(j.location) ? `<div class="key-point"><div class="kp-icon">📍</div><div class="kp-text"><b>Location / स्थान:</b> ${L(j.location)}</div></div>` : '',
  ].filter(Boolean).join('');

  // Similar jobs
  const allJobs = getJobs();
  const simJobs = allJobs.filter(jj => jj.id !== j.id && jj.status === 'live' && jj.category === j.category).slice(0,3);
  const simHtml = simJobs.length ? simJobs.map(s =>
    `<div class="similar-job" onclick="showDetail('${s.id}')">
      <div class="sj-ico">${s.icon||'📋'}</div>
      <div><div class="sj-title">${typeof s.title==='object'?s.title.en:s.title}</div><div class="sj-sub">${s.vacancies} Posts • ${s.category}</div></div>
    </div>`).join('')
    : '<div style="color:var(--muted);font-size:0.82rem;">No similar jobs right now</div>';

  document.getElementById('detail-page').style.display = 'block';
  document.getElementById('detail-page').innerHTML = `
    <div style="max-width:1100px;margin:0 auto;padding:32px 4% 0;box-sizing:border-box;width:100%;">
      <div style="display:flex;gap:10px;margin-bottom:16px;flex-wrap:wrap;align-items:center;">
        <button class="back-btn" onclick="showHome()" style="margin-bottom:0;">← Back to Jobs</button>
      </div>
    </div>
    <div class="detail-grid" style="max-width:1100px;margin:0 auto;padding:0 4% 60px;box-sizing:border-box;width:100%;">
      <div class="detail-main">
        <div class="job-header-card">
          <div class="jhc-top">
            <div class="jhc-icon">${j.icon||'📋'}</div>
            <div style="flex:1">
              <div class="jhc-title">${L(j.title)}</div>
              <div class="jhc-org" style="margin-top:6px;">${L(j.org)}${L(j.dept)?' | <b>'+L(j.dept)+'</b>':''}</div>
              <div class="jhc-badges" style="margin-top:8px;">
                <span class="badge ${j.badgeClass||'b-new'}">${j.badge||'✅ NEW'}</span>
                ${L(j.location)?`<span class="badge b-feat">📍 ${L(j.location)}</span>`:''}
              </div>
            </div>
          </div>
          ${quickStats?`<div class="quick-stats">${quickStats}</div>`:''}
          <div class="action-btns">
            ${j.applyUrl && j.applyUrl !== '#'?`<a href="${j.applyUrl}" target="_blank" rel="noopener noreferrer" class="abtn abtn-apply" style="text-decoration:none;display:inline-flex;align-items:center;gap:6px;">🖊️ Apply Now</a>`:''}
            ${j.applyUrl && j.applyUrl !== '#'?`<a href="${j.applyUrl}" target="_blank" rel="noopener noreferrer" class="abtn" style="text-decoration:none;display:inline-flex;align-items:center;gap:6px;background:#f97316;color:#fff;border:none;">📋 अर्ज करा</a>`:''}
            ${pdfsData.length?`<button class="abtn abtn-pdf" onclick="window.open('${pdfsData[0].u}','_blank')">📄 Download PDF</button>`:''}
            <button class="abtn abtn-share" onclick="navigator.share?navigator.share({title:'${L(j.title)}',url:window.location.href}):alert('Copy this page link to share!')">🔗 Share · शेअर करा</button>
          </div>
        </div>

        ${keyHighlightsSection}
        ${eligSection}
        ${vacSection}
        ${j.desc ? `<div class="detail-section"><div class="ds-title">📝 Job Description · नोकरी तपशील</div><div style="font-size:0.88rem;color:var(--text);line-height:1.8;word-break:break-word;">${formatText(j.desc)}</div></div>` : ''}
        ${feesSection}
        ${ageLimitSection}
        ${datesSection}
        ${selectionSection}
        ${examPatternSection}
        ${howToApplySection}
        ${pdfsSection}
        ${marathiSection}
        ${(()=>{
          const cf = j.customFields;
          if(!cf || !Object.keys(cf).length) return '';
          return `<div class="detail-section">
            <div class="ds-title">📌 Additional Information · अतिरिक्त माहिती</div>
            ${Object.entries(cf).map(([key,val])=>`
              <div style="display:flex;border-bottom:1px solid var(--border);">
                <div style="min-width:150px;max-width:180px;flex:0 0 150px;padding:10px 14px;background:var(--bg);font-size:0.78rem;font-weight:700;color:var(--navy);text-transform:uppercase;letter-spacing:0.3px;word-break:break-word;box-sizing:border-box;">${key}</div>
                <div style="flex:1;min-width:0;padding:10px 14px;font-size:0.87rem;color:var(--text);line-height:1.6;word-break:break-word;box-sizing:border-box;">${val}</div>
              </div>`).join('')}
          </div>`;
        })()}

        <!-- ===== FAQ SECTION ===== -->
        ${(()=>{
          const title = L(j.title) || 'This Job';
          const org = L(j.org) || 'the organization';
          const lastDateVal = typeof j.lastDate==='object' ? j.lastDate.en : j.lastDate;
          const examDateVal = typeof j.examDate==='object' ? j.examDate.en : j.examDate;
          const faqs = [
            j.vacancies ? { q: `How many vacancies are available in ${title}?`, a: `A total of <strong>${j.vacancies} posts</strong> have been announced under ${title}. Candidates are advised to check the official notification for category-wise vacancy details.` } : null,
            j.eligibility ? { q: `What is the educational qualification required for ${title}?`, a: `${typeof j.eligibility==='object' ? (j.eligibility.en||j.eligibility.mr||Object.values(j.eligibility)[0]) : j.eligibility}` } : null,
            (j.ageMin||j.ageMax) ? { q: `What is the age limit for ${title}?`, a: `The age limit is ${j.ageMin||'18'} to ${j.ageMax||'40'} years. Age relaxation is applicable for reserved category candidates as per government norms (SC/ST: 5 years, OBC: 3 years).` } : null,
            j.fees ? { q: `What is the application fee for ${title}?`, a: `${j.fees}. SC/ST/PH candidates may be eligible for fee exemption — check the official notification.` } : null,
            lastDateVal ? { q: `What is the last date to apply for ${title}?`, a: `The last date to submit the online application is <strong>${lastDateVal}</strong>. Apply well before the deadline to avoid last-minute issues.` } : null,
            examDateVal ? { q: `When is the exam date for ${title}?`, a: `The examination is scheduled for <strong>${examDateVal}</strong>. Admit cards will be released on the official website before the exam.` } : null,
            j.salary ? { q: `What is the salary for ${title}?`, a: `The salary offered is <strong>${j.salary}</strong>. Additional allowances like DA, HRA and TA may also be applicable.` } : null,
            { q: `How to apply for ${title}?`, a: `Candidates can apply online through the official website. Visit the official portal, fill the application form, upload required documents, pay the application fee (if applicable), and submit. Keep a printout of the application for future reference.` },
          ].filter(Boolean);
          if(!faqs.length) return '';
          return `<div class="detail-section" style="background:#fff;border:1.5px solid var(--border);border-radius:16px;padding:24px;margin-bottom:20px;">
            <div class="ds-title" style="margin-bottom:16px;">❓ Frequently Asked Questions · वारंवार विचारले जाणारे प्रश्न</div>
            <div class="faq-list">
              ${faqs.map((faq, i) => `
                <div class="faq-item" style="border:1.5px solid var(--border);border-radius:10px;margin-bottom:10px;overflow:hidden;">
                  <div style="width:100%;text-align:left;padding:14px 16px;background:#F8FAFF;display:flex;align-items:flex-start;gap:10px;font-family:'DM Sans',sans-serif;">
                    <span style="color:var(--saffron);font-weight:700;flex-shrink:0;">Q.</span>
                    <span style="font-size:0.88rem;font-weight:700;color:var(--navy);line-height:1.4;">${faq.q}</span>
                  </div>
                  <div class="faq-answer" style="display:block;padding:14px 16px;font-size:0.86rem;color:var(--text);line-height:1.7;border-top:1px solid var(--border);background:#fff;">${faq.a}</div>
                </div>`).join('')}
            </div>
          </div>

          <div class="detail-section" style="background:#fff;border:1.5px solid var(--border);border-radius:16px;padding:24px;margin-bottom:20px;">
            <div class="ds-title" style="margin-bottom:16px;">📋 How to Apply — Step by Step Guide · अर्ज कसा करावा</div>
            <div style="display:flex;flex-direction:column;gap:14px;">
              <div style="display:flex;gap:14px;align-items:flex-start;">
                <div style="background:var(--saffron);color:#fff;border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:0.9rem;flex-shrink:0;">1</div>
                <div><div style="font-weight:700;color:var(--navy);margin-bottom:4px;">Official Notification Padho</div><div style="font-size:0.87rem;color:var(--text);line-height:1.7;">Pehle upar diye "View Notification" button se official PDF download karo. Eligibility, age limit, vacancies aur selection process dhyan se padho. Bina notification padhe apply mat karo.</div></div>
              </div>
              <div style="display:flex;gap:14px;align-items:flex-start;">
                <div style="background:var(--saffron);color:#fff;border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:0.9rem;flex-shrink:0;">2</div>
                <div><div style="font-weight:700;color:var(--navy);margin-bottom:4px;">Documents Taiyaar Karo</div><div style="font-size:0.87rem;color:var(--text);line-height:1.7;">10th/12th marksheet, degree certificate, caste certificate (agar required ho), aadhar card, passport size photo (recent), signature scan — ye sab ready rakhein. Photo aur signature ka size notification mein clearly bataya hota hai.</div></div>
              </div>
              <div style="display:flex;gap:14px;align-items:flex-start;">
                <div style="background:var(--saffron);color:#fff;border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:0.9rem;flex-shrink:0;">3</div>
                <div><div style="font-weight:700;color:var(--navy);margin-bottom:4px;">Registration Karo</div><div style="font-size:0.87rem;color:var(--text);line-height:1.7;">Official website pe jao, "New Registration" ya "Apply Online" link dhundo. Valid email ID aur mobile number se register karo. Registration ke baad jo User ID aur Password milega use save karke rakho.</div></div>
              </div>
              <div style="display:flex;gap:14px;align-items:flex-start;">
                <div style="background:var(--saffron);color:#fff;border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:0.9rem;flex-shrink:0;">4</div>
                <div><div style="font-weight:700;color:var(--navy);margin-bottom:4px;">Form Fill Karo</div><div style="font-size:0.87rem;color:var(--text);line-height:1.7;">Personal details, educational qualification, experience (agar required ho) carefully fill karo. Photo aur signature upload karo — size aur format dhyan se dekho. Submit karne se pehle ek baar poora form check karo.</div></div>
              </div>
              <div style="display:flex;gap:14px;align-items:flex-start;">
                <div style="background:var(--saffron);color:#fff;border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:0.9rem;flex-shrink:0;">5</div>
                <div><div style="font-weight:700;color:var(--navy);margin-bottom:4px;">Fee Pay Karo aur Submit Karo</div><div style="font-size:0.87rem;color:var(--text);line-height:1.7;">Application fee online pay karo — net banking, debit card ya UPI se. Payment ke baad confirmation page screenshot lo. Final submit ke baad application form ka printout zaroor lo aur safe rakhein.</div></div>
              </div>
            </div>
          </div>

          <div class="detail-section" style="background:#f0fdf4;border:1.5px solid #bbf7d0;border-radius:16px;padding:24px;margin-bottom:20px;">
            <div class="ds-title" style="color:#166534;margin-bottom:14px;">✅ Important Tips for Government Job Aspirants · महत्त्वाच्या गोष्टी</div>
            <ul style="margin:0;padding-left:20px;display:flex;flex-direction:column;gap:10px;">
              <li style="font-size:0.88rem;color:#15803d;line-height:1.7;"><strong>Last date se pehle apply karo</strong> — deadline ke din server slow ya down ho sakta hai. Kam se kam 2-3 din pehle apply karo.</li>
              <li style="font-size:0.88rem;color:#15803d;line-height:1.7;"><strong>Documents size check karo</strong> — photo usually 20-50KB aur signature 10-20KB mein hona chahiye. Hamare <a href="/tools" onclick="showTool('photo-resizer');return false;" style="color:var(--saffron);font-weight:600;">Photo Resizer Tool</a> se resize kar sakte ho.</li>
              <li style="font-size:0.88rem;color:#15803d;line-height:1.7;"><strong>Age limit carefully calculate karo</strong> — official notification mein jo date di gayi hai usi ke basis pe age count hoti hai. Hamare <a href="/tools" onclick="showTool('age');return false;" style="color:var(--saffron);font-weight:600;">Age Calculator</a> se check karo.</li>
              <li style="font-size:0.88rem;color:#15803d;line-height:1.7;"><strong>Official website pe hi apply karo</strong> — kisi bhi third-party website ya agent ko fee mat do. Sarkari job application hamesha free ya official fee hi hoti hai.</li>
              <li style="font-size:0.88rem;color:#15803d;line-height:1.7;"><strong>Application number save karo</strong> — submission ke baad jo application number milta hai use note karke rakhein. Admit card download aur result check ke liye zarurat padegi.</li>
            </ul>
          </div>`;
        })()}

        <!-- ===== WHATSAPP / TELEGRAM JOIN ===== -->
        <div style="background:linear-gradient(135deg,#0B1F3A 0%,#163560 100%);border-radius:16px;padding:22px;margin-bottom:20px;text-align:center;">
          <div style="font-family:'Rajdhani',sans-serif;font-size:1.1rem;font-weight:700;color:#fff;margin-bottom:6px;">📢 Job Alerts Join Karo — Free!</div>
          <div style="font-size:0.8rem;color:rgba(255,255,255,0.65);margin-bottom:16px;">नवीन नोकरी आल्यावर लगेच सूचना मिळवा / नई नौकरी की तुरंत सूचना पाएं</div>
          <div style="display:flex;gap:10px;justify-content:center;flex-wrap:wrap;">
            <a href="https://whatsapp.com/channel/0029Vb81hDG1iUxWPHrYgq3d" target="_blank" rel="noopener" style="display:inline-flex;align-items:center;gap:8px;background:#25D366;color:#fff;padding:12px 28px;border-radius:10px;font-size:0.92rem;font-weight:700;text-decoration:none;transition:all 0.2s;box-shadow:0 4px 14px rgba(37,211,102,0.35);">
              <svg width="20" height="20" viewBox="0 0 24 24" fill="white"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>
              Join WhatsApp Channel 🔔
            </a>
          </div>
        </div>

        <!-- ===== MORE JOBS ACCORDION ===== -->
        ${(()=>{
          const allJ = getJobs();
          // Same category ya same org wali jobs — live pehle, nearest date upar
          const related = allJ
            .filter(jj => jj.id !== j.id && jj.status === 'live' && (jj.category === j.category || (L(jj.org)||'').toLowerCase() === (L(j.org)||'').toLowerCase()))
            .sort((a,b) => {
              if(a.status === 'live' && b.status !== 'live') return -1;
              if(a.status !== 'live' && b.status === 'live') return 1;
              const da = a.rawLastDate ? (parseJobDate(a.rawLastDate)||new Date('9999-12-31')) : new Date('9999-12-31');
              const db = b.rawLastDate ? (parseJobDate(b.rawLastDate)||new Date('9999-12-31')) : new Date('9999-12-31');
              return da - db;
            })
            .slice(0, 8);
          if(!related.length) return '';

          const today2 = new Date(); today2.setHours(0,0,0,0);

          function makeJobAccordion(r, idx, defaultOpen) {
            const rTitle = L(r.title);
            const rLastDate = typeof r.lastDate==='object' ? r.lastDate.en : r.lastDate;
            const rDesc = r.desc ? r.desc.substring(0,120) + (r.desc.length > 120 ? '...' : '') : '';
            const rOrg = L(r.org) || '';
            const isExpired = r.status === 'expired';

            let daysBadge = '';
            if(r.rawLastDate) {
              const rd = parseJobDate(r.rawLastDate) || new Date(r.rawLastDate); rd.setHours(0,0,0,0);
              const diff = Math.round((rd - today2) / (1000*60*60*24));
              if(isExpired || diff < 0) daysBadge = '<span style="background:rgba(220,38,38,0.1);color:#DC2626;border:1px solid rgba(220,38,38,0.2);font-size:0.68rem;font-weight:700;padding:2px 8px;border-radius:20px;">🔒 Closed</span>';
              else if(diff === 0) daysBadge = '<span style="background:rgba(220,38,38,0.1);color:#DC2626;border:1px solid rgba(220,38,38,0.2);font-size:0.68rem;font-weight:700;padding:2px 8px;border-radius:20px;animation:blink-red 1s step-start infinite;">🔴 Last Day!</span>';
              else if(diff <= 3) daysBadge = `<span style="background:rgba(220,38,38,0.1);color:#DC2626;border:1px solid rgba(220,38,38,0.2);font-size:0.68rem;font-weight:700;padding:2px 8px;border-radius:20px;">${diff}d Left ⚡</span>`;
              else if(diff <= 7) daysBadge = `<span style="background:rgba(232,71,10,0.1);color:#E8470A;border:1px solid rgba(232,71,10,0.2);font-size:0.68rem;font-weight:700;padding:2px 8px;border-radius:20px;">${diff} Days Left</span>`;
            }

            const bodyId = `rjob-body-${idx}`;
            const arrowId = `rjob-arrow-${idx}`;

            return `<div style="border:1.5px solid ${defaultOpen ? '#E8470A' : 'var(--border)'};border-radius:12px;margin-bottom:8px;overflow:hidden;background:#fff;transition:border-color 0.2s;" id="rjob-wrap-${idx}">
              <!-- Header — always visible, click to toggle -->
              <div onclick="toggleRelatedJob(${idx})" style="display:flex;align-items:center;gap:11px;padding:13px 14px;cursor:pointer;background:${defaultOpen ? '#FFF8F5' : '#FAFBFF'};transition:background 0.2s;" id="rjob-head-${idx}">
                <div style="width:40px;height:40px;border-radius:9px;background:var(--bg);border:1.5px solid var(--border);display:flex;align-items:center;justify-content:center;font-size:1.2rem;flex-shrink:0;">${r.icon||'📋'}</div>
                <div style="flex:1;min-width:0;">
                  <div style="font-size:0.85rem;font-weight:700;color:var(--navy);line-height:1.3;margin-bottom:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${rTitle}</div>
                  <div style="display:flex;align-items:center;gap:6px;flex-wrap:wrap;">
                    <span style="font-size:0.72rem;color:var(--muted);">${[r.vacancies ? r.vacancies+' Posts' : '', r.category||''].filter(Boolean).join(' • ')}</span>
                    ${daysBadge}
                  </div>
                </div>
                <div style="display:flex;align-items:center;gap:8px;flex-shrink:0;">
                  ${rLastDate ? `<span style="font-size:0.7rem;color:var(--saffron);font-weight:700;white-space:nowrap;">📅 ${rLastDate}</span>` : ''}
                  <span id="${arrowId}" style="font-size:0.9rem;color:var(--muted);transition:transform 0.25s;display:inline-block;${defaultOpen ? 'transform:rotate(180deg);' : ''}"">▼</span>
                </div>
              </div>
              <!-- Body — expanded content -->
              <div id="${bodyId}" style="display:${defaultOpen ? 'block' : 'none'};border-top:1.5px solid var(--border);padding:14px 14px 12px;background:#fff;">
                ${rOrg ? `<div style="font-size:0.78rem;color:var(--muted);margin-bottom:8px;">🏢 ${rOrg}</div>` : ''}
                ${rDesc ? `<div style="font-size:0.82rem;color:var(--text);line-height:1.6;margin-bottom:10px;">${rDesc}</div>` : ''}
                <div style="display:flex;gap:8px;flex-wrap:wrap;">
                  <button onclick="showDetail('${r.id}')" style="background:var(--saffron);color:#fff;border:none;padding:8px 18px;border-radius:8px;font-size:0.82rem;font-weight:700;cursor:pointer;font-family:'DM Sans',sans-serif;">View Full Details →</button>
                  ${r.applyUrl && !isExpired ? `<a href="${r.applyUrl}" target="_blank" rel="noopener noreferrer" style="background:#00875A;color:#fff;padding:8px 16px;border-radius:8px;font-size:0.82rem;font-weight:700;text-decoration:none;display:inline-flex;align-items:center;">🖊️ Apply Now</a>` : ''}
                </div>
              </div>
            </div>`;
          }

          const accordionHtml = related.map((r, idx) => makeJobAccordion(r, idx, idx < 2)).join('');

          return `<div style="background:#fff;border:1.5px solid var(--border);border-radius:16px;padding:20px;margin-bottom:20px;">
            <div style="font-family:'Rajdhani',sans-serif;font-size:1.1rem;font-weight:700;color:var(--navy);margin-bottom:14px;display:flex;align-items:center;gap:8px;">
              📋 More Jobs Like This
              <span style="font-size:0.72rem;font-weight:600;color:var(--muted);background:var(--bg);padding:2px 9px;border-radius:20px;border:1px solid var(--border);">${related.length} Jobs</span>
            </div>
            ${accordionHtml}
          </div>`;
        })()}
      </div>

      <div class="detail-sidebar">
        <div class="alert-card">
          <h3>🔔 Job Alert Preference</h3>
          <p>Email preference is saved on this device. Server-side alerts will launch later.</p>
          <input class="alert-input" type="email" id="sub-email-detail" placeholder="Your email / आपला ईमेल" aria-label="Email address for job alerts">
          <button class="alert-btn" onclick="subscribeEmailDetail()">Save Preference →</button>
          <div id="sub-msg-detail" style="display:none;margin-top:8px;font-size:0.8rem;text-align:center;"></div>
        </div>
        ${highlights?`<div class="dscard"><div class="dstitle">💡 Key Highlights</div>${highlights}</div>`:''}
        <div class="dscard">
          <div class="dstitle">🔍 Similar Jobs</div>
          ${simHtml}
        </div>
        <!-- Sidebar ad on job detail -->
        <div style="margin-top:16px;text-align:center;">
          <!-- SLOT: JOB_DETAIL_SIDEBAR (250px) — AdSense mein "Job Detail Sidebar" unit banao -->
          <!-- AdSense unit disabled during review: enable only after approval and after adding enough original content. -->
</div>
      </div>
    </div>
  `;
  try { initAds(document.getElementById('detail-page')); } catch(e) {}
  } catch(detailErr) {
    console.error('showDetail crash for id:', id, detailErr);
    document.getElementById('detail-page').innerHTML = `
      <div style="max-width:860px;margin:60px auto;padding:0 5%;text-align:center;box-sizing:border-box;">
        <button class="back-btn" onclick="showHome()" style="margin-bottom:24px;">← Back to Home</button>
        <div style="background:#fff;border:1.5px solid var(--border);border-radius:18px;padding:48px 32px;box-shadow:var(--shadow-sm);">
          <div style="font-size:3.5rem;margin-bottom:16px;">⚠️</div>
          <div style="font-family:'Rajdhani',sans-serif;font-size:1.5rem;font-weight:700;color:var(--navy);margin-bottom:10px;">Job details load nahi huye</div>
          <div style="color:var(--muted);font-size:0.92rem;margin-bottom:28px;line-height:1.7;">Is job ka data incomplete ho sakta hai.<br>Wapas jao aur doosri job dekho.</div>
          <button onclick="showHome()" style="background:var(--saffron);color:#fff;border:none;padding:11px 28px;border-radius:9px;font-size:0.92rem;font-weight:700;cursor:pointer;font-family:'DM Sans',sans-serif;">🏠 Home Pe Jao</button>
        </div>
      </div>`;
  }
}

// ===== FAQ TOGGLE =====
function toggleRelatedJob(idx) {
  const body  = document.getElementById('rjob-body-' + idx);
  const arrow = document.getElementById('rjob-arrow-' + idx);
  const head  = document.getElementById('rjob-head-' + idx);
  const wrap  = document.getElementById('rjob-wrap-' + idx);
  if(!body) return;
  const isOpen = body.style.display === 'block';
  if(isOpen) {
    body.style.display = 'none';
    arrow.style.transform = '';
    head.style.background = '#FAFBFF';
    wrap.style.borderColor = 'var(--border)';
  } else {
    body.style.display = 'block';
    arrow.style.transform = 'rotate(180deg)';
    head.style.background = '#FFF8F5';
    wrap.style.borderColor = '#E8470A';
  }
}

function toggleFaq(btn) {
  // FAQ answers ab seedha visible hain — toggle ki zaroorat nahi
  // Yeh function backwards compatibility ke liye rakha hai
}

// Safety: ensure all FAQ answers always stay visible
function ensureFaqVisible() {
  document.querySelectorAll('.faq-answer, .faq-a').forEach(el => {
    el.style.display = 'block';
    el.style.visibility = 'visible';
    el.style.opacity = '1';
    el.style.height = 'auto';
    el.style.overflow = 'visible';
  });
  // Remove any arrow/chevron elements inside faq-item headers
  document.querySelectorAll('.faq-item .faq-icon, .faq-item .faq-arrow').forEach(el => {
    el.style.display = 'none';
  });
}
document.addEventListener('DOMContentLoaded', ensureFaqVisible);
// Re-run after job detail loads
const _faqObserver = new MutationObserver(ensureFaqVisible);
document.addEventListener('DOMContentLoaded', () => {
  const detailWrap = document.getElementById('detail-page');
  if (detailWrap) _faqObserver.observe(detailWrap, { childList: true, subtree: true });
});


function setMetaDescription(content) {
  const meta = document.querySelector('meta[name="description"]');
  if(meta && content) meta.setAttribute('content', content);
}
function setCanonical(url) {
  const canonical = document.getElementById('canonical-url');
  if(canonical && url) canonical.setAttribute('href', url);
}
function setRobots(content) {
  const metaRobots = document.getElementById('meta-robots');
  if(metaRobots && content) metaRobots.setAttribute('content', content);
}
function setSocialMeta(title, description, canonical) {
  const ogTitle = document.querySelector('meta[property="og:title"]');
  const ogDesc = document.querySelector('meta[property="og:description"]');
  const ogUrl = document.querySelector('meta[property="og:url"]');
  const twTitle = document.querySelector('meta[name="twitter:title"]');
  const twDesc = document.querySelector('meta[name="twitter:description"]');
  if(ogTitle && title) ogTitle.setAttribute('content', title);
  if(ogDesc && description) ogDesc.setAttribute('content', description);
  if(ogUrl && canonical) ogUrl.setAttribute('content', canonical);
  if(twTitle && title) twTitle.setAttribute('content', title);
  if(twDesc && description) twDesc.setAttribute('content', description);
}
function setPageMeta({ title, description, canonical, robots = 'index, follow' }) {
  if(title) document.title = title;
  if(description) setMetaDescription(description);
  if(canonical) setCanonical(canonical);
  if(robots) setRobots(robots);
  setSocialMeta(title || document.title, description || '', canonical || window.location.href);
}
function upsertJobPostingSchema(job) {
  let script = document.getElementById('jobposting-schema');
  if(!job) {
    if(script) script.remove();
    return;
  }
  if(!script) {
    script = document.createElement('script');
    script.type = 'application/ld+json';
    script.id = 'jobposting-schema';
    document.head.appendChild(script);
  }
  const L = f => typeof f === 'object' ? (f.en || '') : (f || '');
  const title = L(job.title);
  const desc = (L(job.desc) || '').replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim();
  const posted = (() => {
    const p = typeof job.posted === 'object' ? job.posted.en : job.posted;
    if(!p) return undefined;
    const d = new Date(p);
    return isNaN(d.getTime()) ? undefined : d.toISOString().split('T')[0];
  })();
  const validThrough = (() => {
    const ld = typeof job.lastDate === 'object' ? job.lastDate.en : (job.rawLastDate || job.lastDate || '');
    if(!ld) return undefined;
    const d = new Date(ld);
    return isNaN(d.getTime()) ? undefined : `${d.toISOString().split('T')[0]}T23:59`;
  })();
  const org = L(job.org) || 'NaukriKhoj.in';
  const data = {
    '@context': 'https://schema.org',
    '@type': 'JobPosting',
    title,
    description: desc || `${title} job listing on NaukriKhoj.in`,
    hiringOrganization: { '@type': 'Organization', name: org },
    employmentType: 'FULL_TIME',
    applicantLocationRequirements: { '@type': 'Country', name: 'India' },
    identifier: { '@type': 'PropertyValue', name: org, value: job.id || title }
  };
  const location = L(job.location);
  if(location) data.jobLocation = { '@type': 'Place', address: { '@type': 'PostalAddress', addressLocality: location, addressCountry: 'IN' } };
  if(posted) data.datePosted = posted;
  if(validThrough) data.validThrough = validThrough;
  if(job.applyLink) data.directApply = true;
  script.textContent = JSON.stringify(data);
}

function showHome(pushState = true) {
  showPage('home');
  if(pushState) history.pushState({ page: 'home' }, 'NaukriKhoj.in', '/');
  setPageMeta({
    title: 'Sarkari Naukri 2026 — Latest Government Jobs, Notifications | NaukriKhoj.in',
    description: 'Maharashtra Sarkari Jobs 2026 — Railway, Bank, SSC, UPSC, Police, MPSC bharti updates. Free govt job alerts in Marathi & English. Admit card, result bhi.',
    canonical: 'https://naukrikhoj.in/',
    robots: 'index, follow'
  });
  upsertJobPostingSchema(null);
}

// ===== UPDATE ALL COUNTS =====
function updateCounts() {
  try {
  const jobs = getJobs();

  // Total vacancies sum
  const totalVac = jobs.reduce((sum, j) => {
    const v = String(j.vacancies || '0');
    const n = parseInt(v.replace(/,/g,'')) || 0;
    return sum + n;
  }, 0);

  // Format number
  function fmt(n) {
    if(n >= 100000) return (n/100000).toFixed(1).replace(/\.0$/,'') + 'L+';
    if(n >= 1000) return (n/1000).toFixed(1).replace(/\.0$/,'') + 'K+';
    return n.toString();
  }

  // Hero stats
  const el = id => document.getElementById(id);
  if(el('cnt-total-vac')) el('cnt-total-vac').textContent = totalVac > 0 ? fmt(totalVac) : '0';
  if(el('cnt-today')) {
    const today = new Date().toDateString();
    const todayJobs = jobs.filter(j => {
      const p = typeof j.posted==='object' ? j.posted.en : j.posted;
      return p && new Date(p).toDateString() === today;
    });
    el('cnt-today').textContent = todayJobs.length || jobs.length;
  }
  if(el('cnt-depts')) {
    const depts = new Set(jobs.map(j => j.org||j.dept||'').filter(Boolean));
    el('cnt-depts').textContent = depts.size || 0;
  }

  // Category map
  const catMap = {
    'railway': 'Railway', 'bank': 'Bank', 'police': 'Police',
    'ssc': 'SSC', 'state': 'State', 'teaching': 'Teaching',
    'medical': 'Medical', 'defence': 'Defence'
  };

  // Count vacancies per category
  function catVac(keyword) {
    return jobs.filter(j => j.category && j.category.toLowerCase().includes(keyword.toLowerCase()))
      .reduce((sum, j) => sum + (parseInt((j.vacancies||'0').replace(/,/g,''))||0), 0);
  }

  // Update pill counts — hide pills with 0 jobs
  if(el('cnt-all')) el('cnt-all').textContent = jobs.length;
  Object.entries(catMap).forEach(([key, val]) => {
    const cnt = jobs.filter(j => j.category && j.category.toLowerCase().includes(val.toLowerCase())).length;
    const vac = catVac(val);
    if(el('cnt-'+key)) el('cnt-'+key).textContent = cnt;
    if(el('cc-'+key)) el('cc-'+key).textContent = vac > 0 ? fmt(vac) : 'Latest';
    // Show/hide pill based on count
    const pill = document.getElementById('pill-'+key);
    if(pill) pill.style.display = cnt > 0 ? 'inline-flex' : 'none';
    // Show/hide category card
    const cc = el('cc-'+key);
    if(cc) { const card = cc.closest('.ccard'); if(card) card.style.display = cnt > 0 ? '' : 'none'; }
  });

  // Jobs count in list header
  if(el('jobs-count')) el('jobs-count').textContent = jobs.length;
  } catch(e) { console.warn('updateCounts error:', e); }
}

// ===== CATEGORY FILTER =====
function filterCat(keyword, pillEl) {
  // Update active pill
  document.querySelectorAll('.cpill').forEach(p => p.classList.remove('active'));
  if(pillEl) pillEl.classList.add('active');

  const jobs = getJobs();
  if(!keyword) {
    renderJobs(jobs);
  } else {
    renderJobs(jobs.filter(j => j.category && j.category.toLowerCase().includes(keyword.toLowerCase())));
  }
  document.getElementById('home-page').scrollIntoView({behavior:'smooth'});
}

// ===== ALERT POPUP =====
function openAlertPopup() {
  // Popup disabled during AdSense review to avoid intrusive UX signals.
  const emailInput = document.getElementById('sub-email-detail') || document.querySelector('.alert-input');
  if (emailInput) {
    emailInput.scrollIntoView({ behavior: 'smooth', block: 'center' });
    setTimeout(() => emailInput.focus(), 300);
  } else {
    showLatestJobs();
  }
}
function closeAlertPopup() {
  const popup = document.getElementById('alert-popup');
  const msg = document.getElementById('popup-msg');
  const email = document.getElementById('popup-email');
  if(popup) popup.style.display = 'none';
  if(msg) msg.style.display = 'none';
  if(email) email.value = '';
}
function subscribePopup() {
  const emailEl = document.getElementById('popup-email');
  const msg = document.getElementById('popup-msg');
  if(!emailEl || !msg) return;
  const email = emailEl.value.trim();
  if(!email || !email.includes('@') || !email.includes('.')) {
    msg.style.display = 'block'; msg.style.color = '#DC2626';
    msg.textContent = '❌ Valid email daalo!'; return;
  }
  const subs = JSON.parse(localStorage.getItem('nkj_subscribers')||'[]');
  if(subs.includes(email)) {
    msg.style.display = 'block'; msg.style.color = '#D97706';
    msg.textContent = '⚠️ Already subscribed!'; return;
  }
  subs.push(email);
  localStorage.setItem('nkj_subscribers', JSON.stringify(subs));
  msg.style.display = 'block'; msg.style.color = '#00875A';
  msg.textContent = '✅ Preference saved on this device. Full email alerts are launching soon.';
  if(emailEl) emailEl.value = '';
  setTimeout(() => closeAlertPopup(), 2500);
}
// Close popup on outside click — setTimeout ensures DOM ready
function initPopupListener() {
  const popup = document.getElementById('alert-popup');
  if(popup) popup.addEventListener('click', function(e) {
    if(e.target === this) closeAlertPopup();
  });
}

// Detail page subscribe
function subscribeEmailDetail() {
  const input = document.getElementById('sub-email-detail');
  const msg = document.getElementById('sub-msg-detail');
  if(!input || !msg) return;
  const email = input.value.trim();
  if(!email || !email.includes('@') || !email.includes('.')) {
    msg.style.display='block'; msg.style.color='#DC2626';
    msg.textContent='❌ Valid email daalo!'; return;
  }
  const subs = JSON.parse(localStorage.getItem('nkj_subscribers')||'[]');
  if(subs.includes(email)) {
    msg.style.display='block'; msg.style.color='#D97706';
    msg.textContent='⚠️ Already subscribed!'; return;
  }
  subs.push(email);
  localStorage.setItem('nkj_subscribers', JSON.stringify(subs));
  input.value='';
  msg.style.display='block'; msg.style.color='#00875A';
  msg.textContent='✅ Saved on this device.';
  setTimeout(()=>{ msg.style.display='none'; }, 4000);
}

// ===== FOOTER HELPERS =====
function scrollToJobs() {
  document.getElementById('jobs-list').scrollIntoView({behavior:'smooth'});
}

// ===== HAMBURGER MENU =====
function toggleMenu() {
  document.getElementById('nav-menu').classList.toggle('open');
}
function closeMenu() {
  document.getElementById('nav-menu').classList.remove('open');
}
document.addEventListener('click', function(e) {
  const menu = document.getElementById('nav-menu');
  const btn = document.getElementById('hamburger-btn');
  if(menu && btn && !menu.contains(e.target) && !btn.contains(e.target)) {
    menu.classList.remove('open');
  }
});

// ===== LATEST JOBS PAGE =====
async function showLatestJobs(pushState = true) {
  showPage('latest');
  if(pushState) history.pushState({ page: 'latest' }, 'Latest Govt Jobs — NaukriKhoj.in', '/latest-jobs');
  setPageMeta({
    title: 'Latest Govt Jobs — NaukriKhoj.in',
    description: 'Latest government jobs in Maharashtra and All India with eligibility, vacancies, last date and official apply links.',
    canonical: 'https://naukrikhoj.in/latest-jobs',
    robots: 'index, follow'
  });
  upsertJobPostingSchema(null);

  const container = document.getElementById('lj-items');
  // Fresh fetch karo
  const jobs = await fetchJobsFromBlob();
  const today = new Date(); today.setHours(0,0,0,0);

  // Live jobs + expired jobs
  const live = jobs.filter(j => j.status === 'live');
  const expiredLatest = jobs.filter(j => j.status === 'expired');

  // Sort live: nearest last date pehle (jiska date sabse jaldi aayega wo upar)
  live.sort((a, b) => {
    const da = a.rawLastDate ? (parseJobDate(a.rawLastDate)||new Date('9999-12-31')) : new Date('9999-12-31');
    const db = b.rawLastDate ? (parseJobDate(b.rawLastDate)||new Date('9999-12-31')) : new Date('9999-12-31');
    return da - db;
  });

  // Sort expired: most recently expired pehle
  expiredLatest.sort((a, b) => {
    const da = a.rawLastDate ? (parseJobDate(a.rawLastDate)||new Date('0000-01-01')) : new Date('0000-01-01');
    const db = b.rawLastDate ? (parseJobDate(b.rawLastDate)||new Date('0000-01-01')) : new Date('0000-01-01');
    return db - da;
  });

  // Merge: live pehle (nearest date upar), expired last
  const allLatest = [...live, ...expiredLatest];
  if(!allLatest.length) {
    container.innerHTML = '<div style="text-align:center;padding:40px;color:var(--muted);">Koi jobs nahi hain abhi.</div>';
    return;
  }

  container.innerHTML = allLatest.map(j => {
    const title = typeof j.title==='object' ? j.title.en : j.title;
    const lastDate = typeof j.lastDate==='object' ? j.lastDate.en : j.lastDate;
    const vac = j.vacancies ? `${j.vacancies} Posts` : '';
    const cat = j.category || '';
    const isExpired = j.status === 'expired';

    let daysBadge = '';
    if(j.rawLastDate) {
      const d = parseJobDate(j.rawLastDate) || new Date(j.rawLastDate); d.setHours(0,0,0,0);
      const diff = Math.round((d - today) / (1000*60*60*24));
      if(isExpired || diff < 0) daysBadge = `<span class="lj-days-badge lj-badge-red">🔒 Closed</span>`;
      else if(diff === 0) daysBadge = `<span class="lj-days-badge lj-badge-red">🔴 Last Day!</span>`;
      else if(diff <= 2) daysBadge = `<span class="lj-days-badge lj-badge-red">⚡ ${diff}d left</span>`;
      else if(diff <= 7) daysBadge = `<span class="lj-days-badge lj-badge-orange">⚡ ${diff} days left</span>`;
      else if(diff <= 15) daysBadge = `<span class="lj-days-badge lj-badge-yellow">⏰ ${diff} days left</span>`;
    }

    return `<div class="lj-row${isExpired ? ' lj-row-expired' : ''}" onclick="showLatestDetail('${j.id}')">
      <div class="lj-icon" style="">${j.icon||'📋'}</div>
      <div class="lj-info">
        <div class="lj-title" style="">${title}</div>
        <div class="lj-meta-row">
          <span class="lj-meta">${[cat, vac].filter(Boolean).join(' • ')}</span>
          ${daysBadge}
        </div>
      </div>
      ${lastDate ? `<div class="lj-date" style="">📅 ${lastDate}</div>` : ''}
    </div>`;
  }).join('');
}

// ===== RESULTS PAGE =====
function getResultSlug(result) {
  const title = (result && result.title ? result.title : 'result').toLowerCase();
  return title.replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'').substring(0,60) || 'result';
}

function getResultUrl(result) {
  return `/result/${getResultSlug(result)}-${String(result.id || '').replace('result_','')}`;
}

let _cachedResults = null;

async function fetchResultsData(forceRefresh = false) {
  if(_cachedResults && !forceRefresh) return _cachedResults;
  try {
    const res = await fetch(`${FIREBASE_URL}/results.json`, { cache: 'no-store' });
    const data = res.ok ? await res.json() : null;
    const results = normalizeCollection(data);
    if(results.length) {
      _cachedResults = results;
      writeLocalCollection(LOCAL_KEYS.results, results);
      return results;
    }
  } catch(e) { console.warn('[NKJ] fetchResultsData error:', e); }
  const local = readLocalCollection(LOCAL_KEYS.results, DEFAULT_RESULTS);
  _cachedResults = local;
  return local;
}

async function showResultDetail(id, pushState = true) {
  showPage('detail');
  document.getElementById('detail-page').innerHTML = '<div style="max-width:860px;margin:0 auto;padding:40px 4%;box-sizing:border-box;"><div style="background:#fff;border:1.5px solid var(--border);border-radius:14px;padding:32px;text-align:center;color:var(--muted);font-size:0.9rem;">📝 Result details fetch ho rahi hain...</div></div>';

  try {
    const results = await fetchResultsData();
    const result = results.find(r => r.id === id);

    if(!result) {
      document.getElementById('detail-page').innerHTML = `
        <div style="max-width:860px;margin:0 auto;padding:32px 4%;box-sizing:border-box;width:100%;">
          <button class="back-btn" onclick="showResults()">← Back to Results</button>
          <div style="background:#fff3cd;border:1.5px solid #fde68a;border-radius:12px;padding:24px;text-align:center;color:#92400e;">
            ⚠️ Result nahi mila.
          </div>
        </div>`;
      return;
    }

    const detailUrl = getResultUrl(result);
    if(pushState) history.pushState({ page: 'result-detail', resultId: id }, `${result.title} — NaukriKhoj.in`, detailUrl);
    setPageMeta({
      title: `${result.title} — Result — NaukriKhoj.in`,
      description: `${result.title} result details, result date and official result link on NaukriKhoj.in.`,
      canonical: `https://naukrikhoj.in${detailUrl}`,
      robots: 'index, follow'
    });
    upsertJobPostingSchema(null);

    const resultDate = result.date ? new Date(result.date).toLocaleDateString('en-IN',{day:'numeric',month:'long',year:'numeric'}) : '';
    const postedOn = result.postedOn || '';
    const descHtml = result.desc
      ? formatAdmitCardText(result.desc)
      : '<div style="line-height:1.8;">Is result ka official link neeche diya gaya hai. Open karne se pehle title, organization aur result date verify kar lo.</div>';

    document.getElementById('detail-page').innerHTML = `
      <div style="max-width:1100px;margin:0 auto;padding:32px 4% 60px;box-sizing:border-box;width:100%;">
        <button class="back-btn" onclick="showResults()">← Back to Results</button>
        <div class="detail-grid">
          <div class="detail-main">
            <div class="job-header-card">
              <div class="jhc-top">
                <div class="jhc-icon">📝</div>
                <div style="flex:1">
                  <div class="jhc-title">${result.title || 'Result'}</div>
                  <div class="jhc-org" style="margin-top:6px;">${result.org || 'Official Result'}${result.category ? ' | <b>' + result.category + '</b>' : ''}</div>
                  <div class="jhc-badges" style="margin-top:8px;">
                    <span class="badge b-feat">📢 Result</span>
                    ${resultDate ? `<span class="badge b-new">📅 Declared: ${resultDate}</span>` : ''}
                  </div>
                </div>
              </div>
              <div class="quick-stats">
                <div class="qs-item"><div class="qs-val">${result.org || '—'}</div><div class="qs-key">Organization</div></div>
                <div class="qs-item"><div class="qs-val">${result.category || '—'}</div><div class="qs-key">Category</div></div>
                <div class="qs-item"><div class="qs-val">${resultDate || '—'}</div><div class="qs-key">Result Date</div></div>
                <div class="qs-item"><div class="qs-val">${postedOn || '—'}</div><div class="qs-key">Posted On</div></div>
              </div>
              <div class="action-btns">
                ${result.url ? `<button class="abtn abtn-pdf" onclick="window.open('${result.url}','_blank')">📄 Open / Download Result</button>` : ''}
                <button class="abtn abtn-share" onclick="showResults()">📋 More Results</button>
              </div>
            </div>

            <div class="detail-section">
              <div class="ds-title">📝 Result Description</div>
              <div style="font-size:0.9rem;color:var(--text);line-height:1.8;word-break:break-word;">${descHtml}</div>
            </div>

            <div class="detail-section">
              <div class="ds-title">📌 Important Details</div>
              <div class="dates-grid" style="grid-template-columns:repeat(2,1fr);">
                <div class="date-item"><div class="date-label">Title</div><div class="date-val">${result.title || '—'}</div></div>
                <div class="date-item"><div class="date-label">Organization</div><div class="date-val">${result.org || '—'}</div></div>
                <div class="date-item"><div class="date-label">Category</div><div class="date-val">${result.category || '—'}</div></div>
                <div class="date-item"><div class="date-label">Result Date</div><div class="date-val">${resultDate || '—'}</div></div>
              </div>
            </div>
          </div>

          <div class="detail-sidebar">
            <div class="dscard">
              <div class="dstitle">📥 Result Link</div>
              <div class="kp-text" style="margin-bottom:12px;">Result open karne ke liye neeche button dabao.</div>
              ${result.url ? `<button class="abtn abtn-apply" style="width:100%;" onclick="window.open('${result.url}','_blank')">⬇️ Open / Download</button>` : '<div class="kp-text">Result link abhi available nahi hai.</div>'}
            </div>
            <div class="dscard">
              <div class="dstitle">ℹ️ Note</div>
              <div class="kp-text">Official website par naam, roll number aur result status verify karke hi aage proceed karo.</div>
            </div>
          </div>
        </div>
      </div>`;
  } catch(e) {
    document.getElementById('detail-page').innerHTML = `
      <div style="max-width:860px;margin:0 auto;padding:32px 4%;box-sizing:border-box;width:100%;">
        <button class="back-btn" onclick="showResults()">← Back to Results</button>
        <div style="background:#fef2f2;border-radius:12px;padding:24px;text-align:center;color:#dc2626;">
          ❌ Result detail load nahi ho saka. Internet check karo aur dobara try karo.
        </div>
      </div>`;
  }
}

async function showResults(pushState = true) {
  showPage('results');
  if(pushState) history.pushState({ page: 'results' }, 'Results — NaukriKhoj.in', '/results');
  setPageMeta({
    title: 'Exam Results 2026 — NaukriKhoj.in',
    description: 'Latest government exam results, result dates and direct official result links on NaukriKhoj.in.',
    canonical: 'https://naukrikhoj.in/results',
    robots: 'index, follow'
  });
  upsertJobPostingSchema(null);

  const container = document.getElementById('results-items');
  try {
    const results = await fetchResultsData();

    if(!results.length) {
      setRobots('noindex, follow');
      container.innerHTML = `
        <div style="text-align:center;padding:60px 20px;max-width:480px;margin:0 auto;">
          <div style="font-size:4rem;margin-bottom:16px;">📝</div>
          <div style="font-family:'Rajdhani',sans-serif;font-size:1.6rem;font-weight:700;color:var(--navy);margin-bottom:8px;">Results Jald Aayenge!</div>
          <div style="font-size:0.92rem;color:var(--muted);margin-bottom:24px;line-height:1.6;">Latest exam results yahan update honge. Tab tak latest government jobs dekho!</div>
          <button onclick="showHome()" style="background:var(--saffron);color:#fff;border:none;padding:11px 28px;border-radius:9px;font-size:0.92rem;font-weight:700;cursor:pointer;font-family:'DM Sans',sans-serif;">← Latest Jobs Dekho</button>
        </div>`;
      return;
    }

    container.innerHTML = results.map(r => `
      <div class="lj-row" onclick="showResultDetail('${r.id}')">
        <div class="lj-icon">📝</div>
        <div class="lj-info">
          <div class="lj-title">${r.title}</div>
          <div class="lj-meta">${[r.org, r.category].filter(Boolean).join(' • ')}${r.desc ? ' • View Details' : ' • Open Details'}</div>
        </div>
        ${r.date ? `<div class="lj-date">📅 ${new Date(r.date).toLocaleDateString('en-IN',{day:'numeric',month:'short',year:'numeric'})}</div>` : ''}
      </div>`).join('');
  } catch(e) {
    container.innerHTML = `
      <div style="text-align:center;padding:60px 20px;">
        <div style="font-size:3rem;margin-bottom:12px;">⚠️</div>
        <div style="font-size:1rem;color:var(--muted);">Load nahi ho saka. Internet check karo aur dobara try karo.</div>
        <button onclick="showResults()" style="margin-top:16px;background:var(--saffron);color:#fff;border:none;padding:10px 24px;border-radius:8px;font-weight:700;cursor:pointer;font-family:'DM Sans',sans-serif;">🔄 Retry</button>
      </div>`;
  }
}

// ===== ADMIT CARD PAGE =====
function getAdmitCardSlug(card) {
  const title = (card && card.title ? card.title : 'admit-card').toLowerCase();
  return title.replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'').substring(0,60) || 'admit-card';
}

function getAdmitCardUrl(card) {
  return `/admit-card/${getAdmitCardSlug(card)}-${String(card.id || '').replace('ac_','')}`;
}

function formatAdmitCardText(text) {
  if(!text) return '';
  const lines = String(text).split(/\n/);
  let html = '';
  let inList = false;

  lines.forEach(line => {
    const trimmed = line.trim();
    if(!trimmed) {
      if(inList) { html += '</ol>'; inList = false; }
      return;
    }
    const numMatch = trimmed.match(/^(\d+)[.)]\s+(.*)/);
    if(numMatch) {
      if(!inList) { html += '<ol style="margin:6px 0 6px 18px;padding:0;">'; inList = true; }
      html += `<li style="margin-bottom:4px;line-height:1.7;">${numMatch[2]}</li>`;
    } else {
      if(inList) { html += '</ol>'; inList = false; }
      const bulletMatch = trimmed.match(/^[-*•]\s+(.*)/);
      if(bulletMatch) {
        html += `<div style="display:flex;gap:6px;margin-bottom:4px;"><span style="color:var(--saffron);font-weight:700;">•</span><span style="line-height:1.7;">${bulletMatch[1]}</span></div>`;
      } else {
        html += `<div style="line-height:1.7;margin-bottom:3px;">${trimmed}</div>`;
      }
    }
  });
  if(inList) html += '</ol>';
  return html;
}

let _cachedAdmitCards = null;

async function fetchAdmitCardsData(forceRefresh = false) {
  if(_cachedAdmitCards && !forceRefresh) return _cachedAdmitCards;
  // Try both node names - admin panel may use different casing
  const paths = ['admitcards', 'admitCards', 'admit_cards'];
  for(const path of paths) {
    try {
      const res = await fetch(`${FIREBASE_URL}/${path}.json`, { cache: 'no-store' });
      const data = res.ok ? await res.json() : null;
      const cards = normalizeCollection(data);
      if(cards.length) {
        _cachedAdmitCards = cards;
        writeLocalCollection(LOCAL_KEYS.admitcards, cards);
        return cards;
      }
    } catch(e) { console.warn(`[NKJ] fetchAdmitCardsData(${path}) error:`, e); }
  }
  const local = readLocalCollection(LOCAL_KEYS.admitcards, DEFAULT_ADMIT_CARDS);
  _cachedAdmitCards = local;
  return local;
}

async function showAdmitCardDetail(id, pushState = true) {
  showPage('detail');
  document.getElementById('detail-page').innerHTML = '<div style="max-width:860px;margin:0 auto;padding:40px 4%;box-sizing:border-box;"><div style="background:#fff;border:1.5px solid var(--border);border-radius:14px;padding:32px;text-align:center;color:var(--muted);font-size:0.9rem;">📅 Admit card details fetch ho rahi hain...</div></div>';

  try {
    const cards = await fetchAdmitCardsData();
    const card = cards.find(c => c.id === id);
    if(!card) {
      document.getElementById('detail-page').innerHTML = `
        <div style="max-width:860px;margin:0 auto;padding:32px 4%;box-sizing:border-box;width:100%;">
          <button class="back-btn" onclick="showAdmitCards()">← Back to Admit Cards</button>
          <div style="background:#fff3cd;border:1.5px solid #fde68a;border-radius:12px;padding:24px;text-align:center;color:#92400e;">
            ⚠️ Admit card nahi mila.
          </div>
        </div>`;
      return;
    }

    const detailUrl = getAdmitCardUrl(card);
    if(pushState) history.pushState({ page: 'admitcard-detail', cardId: id }, `${card.title} — NaukriKhoj.in`, detailUrl);
    setPageMeta({
      title: `${card.title} — Admit Card — NaukriKhoj.in`,
      description: `${card.title} admit card details, exam date and official download link on NaukriKhoj.in.`,
      canonical: `https://naukrikhoj.in${detailUrl}`,
      robots: 'index, follow'
    });
    upsertJobPostingSchema(null);

    const examDate = card.examDate ? new Date(card.examDate).toLocaleDateString('en-IN',{day:'numeric',month:'long',year:'numeric'}) : '';
    const postedOn = card.postedOn || '';
    const descHtml = card.desc ? formatAdmitCardText(card.desc) : '<div style="line-height:1.8;">Is admit card ka official download link neeche diya gaya hai. Download karne se pehle exam date aur organization details verify kar lo.</div>';

    document.getElementById('detail-page').innerHTML = `
      <div style="max-width:1100px;margin:0 auto;padding:32px 4% 60px;box-sizing:border-box;width:100%;">
        <button class="back-btn" onclick="showAdmitCards()">← Back to Admit Cards</button>
        <div class="detail-grid">
          <div class="detail-main">
            <div class="job-header-card">
              <div class="jhc-top">
                <div class="jhc-icon">📅</div>
                <div style="flex:1">
                  <div class="jhc-title">${card.title || 'Admit Card'}</div>
                  <div class="jhc-org" style="margin-top:6px;">${card.org || 'Official Admit Card'}${card.category ? ' | <b>' + card.category + '</b>' : ''}</div>
                  <div class="jhc-badges" style="margin-top:8px;">
                    <span class="badge b-feat">🎫 Admit Card</span>
                    ${examDate ? `<span class="badge b-new">🗓️ Exam: ${examDate}</span>` : ''}
                  </div>
                </div>
              </div>
              <div class="quick-stats">
                <div class="qs-item"><div class="qs-val">${card.org || '—'}</div><div class="qs-key">Organization</div></div>
                <div class="qs-item"><div class="qs-val">${card.category || '—'}</div><div class="qs-key">Category</div></div>
                <div class="qs-item"><div class="qs-val">${examDate || '—'}</div><div class="qs-key">Exam Date</div></div>
                <div class="qs-item"><div class="qs-val">${postedOn || '—'}</div><div class="qs-key">Posted On</div></div>
              </div>
              <div class="action-btns">
                ${card.url ? `<button class="abtn abtn-pdf" onclick="window.open('${card.url}','_blank')">📄 Download Admit Card</button>` : ''}
                <button class="abtn abtn-share" onclick="showAdmitCards()">📋 More Admit Cards</button>
              </div>
            </div>

            <div class="detail-section">
              <div class="ds-title">📝 Admit Card Description</div>
              <div style="font-size:0.9rem;color:var(--text);line-height:1.8;word-break:break-word;">${descHtml}</div>
            </div>

            <div class="detail-section">
              <div class="ds-title">📌 Important Details</div>
              <div class="dates-grid" style="grid-template-columns:repeat(2,1fr);">
                <div class="date-item"><div class="date-label">Title</div><div class="date-val">${card.title || '—'}</div></div>
                <div class="date-item"><div class="date-label">Organization</div><div class="date-val">${card.org || '—'}</div></div>
                <div class="date-item"><div class="date-label">Category</div><div class="date-val">${card.category || '—'}</div></div>
                <div class="date-item"><div class="date-label">Exam Date</div><div class="date-val">${examDate || '—'}</div></div>
              </div>
            </div>
          </div>

          <div class="detail-sidebar">
            <div class="dscard">
              <div class="dstitle">📥 Download</div>
              <div class="kp-text" style="margin-bottom:12px;">Admit card open karne ke liye neeche button dabao.</div>
              ${card.url ? `<button class="abtn abtn-apply" style="width:100%;" onclick="window.open('${card.url}','_blank')">⬇️ Open / Download</button>` : '<div class="kp-text">Download link abhi available nahi hai.</div>'}
            </div>
            <div class="dscard">
              <div class="dstitle">ℹ️ Note</div>
              <div class="kp-text">Official website par details verify karke hi admit card download karo.</div>
            </div>
          </div>
        </div>
      </div>`;
  } catch(e) {
    document.getElementById('detail-page').innerHTML = `
      <div style="max-width:860px;margin:0 auto;padding:32px 4%;box-sizing:border-box;width:100%;">
        <button class="back-btn" onclick="showAdmitCards()">← Back to Admit Cards</button>
        <div style="background:#fef2f2;border-radius:12px;padding:24px;text-align:center;color:#dc2626;">
          ❌ Admit card detail load nahi ho saka. Internet check karo aur dobara try karo.
        </div>
      </div>`;
  }
}

async function showAdmitCards(pushState = true) {
  showPage('admitcard');
  if(pushState) history.pushState({ page: 'admitcard' }, 'Admit Card — NaukriKhoj.in', '/admit-card');
  setPageMeta({
    title: 'Admit Card 2026 — NaukriKhoj.in',
    description: 'Download hall tickets and check exam dates with direct official admit card links on NaukriKhoj.in.',
    canonical: 'https://naukrikhoj.in/admit-card',
    robots: 'index, follow'
  });
  upsertJobPostingSchema(null);

  const container = document.getElementById('admitcard-items');
  try {
    const cards = await fetchAdmitCardsData();

    if(!cards.length) {
      setRobots('noindex, follow');
      container.innerHTML = `
        <div style="text-align:center;padding:60px 20px;max-width:480px;margin:0 auto;">
          <div style="font-size:4rem;margin-bottom:16px;">📅</div>
          <div style="font-family:'Rajdhani',sans-serif;font-size:1.6rem;font-weight:700;color:var(--navy);margin-bottom:8px;">Admit Cards Jald Aayenge!</div>
          <div style="font-size:0.92rem;color:var(--muted);margin-bottom:24px;line-height:1.6;">Latest exam admit cards yahan update honge. Tab tak latest government jobs dekho!</div>
          <button onclick="showHome()" style="background:var(--saffron);color:#fff;border:none;padding:11px 28px;border-radius:9px;font-size:0.92rem;font-weight:700;cursor:pointer;font-family:'DM Sans',sans-serif;">← Latest Jobs Dekho</button>
        </div>`;
      return;
    }

    container.innerHTML = cards.map(c => `
      <div class="lj-row" onclick="showAdmitCardDetail('${c.id}')">
        <div class="lj-icon">📅</div>
        <div class="lj-info">
          <div class="lj-title">${c.title}</div>
          <div class="lj-meta">${[c.org, c.category].filter(Boolean).join(' • ')}${c.desc ? ' • View Details' : ' • Open Details'}</div>
        </div>
        ${c.examDate ? `<div class="lj-date">🗓️ ${new Date(c.examDate).toLocaleDateString('en-IN',{day:'numeric',month:'short',year:'numeric'})}</div>` : ''}
      </div>`).join('');
  } catch(e) {
    container.innerHTML = `
      <div style="text-align:center;padding:60px 20px;">
        <div style="font-size:3rem;margin-bottom:12px;">⚠️</div>
        <div style="font-size:1rem;color:var(--muted);">Load nahi ho saka. Internet check karo aur dobara try karo.</div>
        <button onclick="showAdmitCards()" style="margin-top:16px;background:var(--saffron);color:#fff;border:none;padding:10px 24px;border-radius:8px;font-weight:700;cursor:pointer;font-family:'DM Sans',sans-serif;">🔄 Retry</button>
      </div>`;
  }
}


const TOOL_META = {
  'age': {
    title: 'Age Calculator',
    icon: '🎂',
    path: '/tools/age',
    subtitle: 'DOB se current age check karo.'
  },
  'qualification': {
    title: 'Qualification Checker',
    icon: '🎓',
    path: '/tools/qualification',
    subtitle: 'Highest qualification ke hisaab se current live jobs me se matching roles dekh lo.'
  },
  'photo-resizer': {
    title: 'Photo / Signature Resizer',
    icon: '🖼️',
    path: '/tools/photo-resizer',
    subtitle: 'Exam form upload ke liye photo aur signature ko resize, compress aur download karo.'
  }
};

const QUALIFICATION_LABELS = {
  '10th':          '10th Pass',
  '12th':          '12th Pass',
  'iti':           'ITI',
  'diploma':       'Diploma',
  'graduate':      'Graduation (BA / B.Com / BMS / BBA / BSc / BCA / Any Degree)',
  'engineering':   'Engineering (BE / B.Tech)',
  'postgraduate':  'Post Graduate (MA / M.Com / MBA / MSc / MCA)',
  'law':           'Law (LLB / LLM)',
  'medical':       'Medical (MBBS / BDS / Nursing / Pharmacy)',
};

// Smart qual map — precise terms jo sirf uss level ke jobs match karein
const QUAL_SEARCH_MAP = {
  '10th':         ['10th pass','10th','matriculation','sslc','class 10','matric','10वीं','दहावी'],
  '12th':         ['12th pass','12th','hsc','intermediate','higher secondary','class 12','10+2','12वीं','बारावी'],
  'iti':          ['iti','industrial training','trade certificate','tradesman'],
  'diploma':      ['diploma','polytechnic','diploma holder'],
  'graduate':     ['any graduate','any degree','bachelor','graduation','b.a.','b.com','b.sc','bca','bms','bba','b.a ','b.com ','bsc ','ba pass','b.ed'],
  'engineering':  ['b.tech','btech','b.e.','be ','engineering graduate','engineering degree'],
  'postgraduate': ['post graduate','postgraduate','master\'s','masters degree','m.a.','m.com','mba','m.sc','mca','m.tech','mtech','ma pass'],
  'law':          ['llb','llm','law graduate','law degree'],
  'medical':      ['mbbs','bds','gnm','b.pharm','d.pharm','nursing','b.sc nursing','pharmacy graduate','ayurveda'],
};

let _toolImageDataUrl = '';
let _toolImageName = 'resized-image.jpg';
let _toolOriginalImageInfo = null;

function toolPageShell(meta, innerHtml, pushState = true) {
  showPage('detail');
  if(pushState) history.pushState({ page: 'tool', tool: meta.key }, `${meta.title} | NaukriKhoj.in`, meta.path);
  setPageMeta({
    title: `${meta.title} | NaukriKhoj.in`,
    description: meta.subtitle || `${meta.title} tool on NaukriKhoj.in.`,
    canonical: `https://naukrikhoj.in${meta.path}`,
    robots: 'index, follow'
  });
  upsertJobPostingSchema(null);
  document.getElementById('detail-page').innerHTML = `
    <div class="tool-page-wrap">
      <button class="back-btn" onclick="showHome()" style="margin-bottom:16px;">← Back to Home</button>
      <div class="tool-page-hero">
        <div class="tool-kicker">${meta.icon} Useful Tool</div>
        <div class="tool-hero-title">${meta.title}</div>
        <div class="tool-hero-desc">${meta.subtitle}</div>
      </div>
      ${innerHtml}
    </div>`;
  window.scrollTo(0,0);
}

function showTool(toolKey, pushState = true) {
  const meta = TOOL_META[toolKey];
  if(!meta) return;
  meta.key = toolKey;

  if(toolKey === 'age') {
    const today = getTodayDateInput();
    toolPageShell(meta, `
      <div class="tool-card">
        <div class="tool-card-title">Current age check karo</div>
        <div class="tool-form-grid">
          <div class="tool-field">
            <label class="tool-label">Date of Birth</label>
            ${renderDateSelect('age-dob', '', 1950, new Date().getFullYear())}
          </div>
          <div class="tool-field">
            <label class="tool-label">Age as on date</label>
            ${renderDateSelect('age-ason', today, 1950, new Date().getFullYear())}
          </div>
        </div>
        <div class="tool-helper">Default browser calendar hata diya gaya hai. Ab day, month aur year dropdown se date select kar sakte ho.</div>
        <div class="tool-btn-row">
          <button class="tool-primary-btn" onclick="calculateAgeTool()">Calculate Age</button>
          <button class="tool-secondary-btn" onclick="resetAgeTool()">Reset</button>
        </div>
        <div id="age-tool-output"></div>
      </div>
      <div class="tool-card">
        <div class="tool-card-title">Quick tip</div>
        <div class="tool-helper" style="font-size:0.86rem;color:var(--text);line-height:1.8;margin-top:0;">
          Result ek <b>basic age calculator</b> hai. Official notification me diya gaya cut-off date hi final maana jayega.
        </div>
      </div>`, pushState);
    return;
  }

  if(toolKey === 'qualification') {
    toolPageShell(meta, `
      <div class="tool-card">
        <div class="tool-card-title">Qualification select karo</div>
        <div class="qual-chip-row">
          ${Object.entries(QUALIFICATION_LABELS).map(([key, label]) => `<button class="qual-chip" id="qual-chip-${key}" onclick="selectQualificationChip('${key}')">${label}</button>`).join('')}
        </div>
        <div class="tool-form-grid">
          <div class="tool-field">
            <label class="tool-label" for="qualification-select">Highest qualification</label>
            <select class="tool-select" id="qualification-select" onchange="syncQualificationChip(this.value)">
              <option value="">Select qualification</option>
              ${Object.entries(QUALIFICATION_LABELS).map(([key, label]) => `<option value="${key}">${label}</option>`).join('')}
            </select>
          </div>
          <div class="tool-field">
            <label class="tool-label" for="qualification-limit">Show jobs</label>
            <select class="tool-select" id="qualification-limit">
              <option value="6">Top 6 matches</option>
              <option value="12" selected>Top 12 matches</option>
              <option value="20">Top 20 matches</option>
            </select>
          </div>
        </div>
        <div class="tool-btn-row">
          <button class="tool-primary-btn" onclick="runQualificationTool()">Check Matching Jobs</button>
          <button class="tool-secondary-btn" onclick="resetQualificationTool()">Reset</button>
        </div>
        <div id="qualification-tool-output" style="margin-top:16px;"></div>
      </div>`, pushState);
    return;
  }

  if(toolKey === 'photo-resizer') {
    toolPageShell(meta, `
      <div class="tool-card">
        <div class="tool-card-title">Upload aur resize</div>
        <div class="resizer-type-row">
          <button class="resizer-tab active" id="resizer-type-photo" onclick="setResizerPreset('photo')">Photo Preset</button>
          <button class="resizer-tab" id="resizer-type-signature" onclick="setResizerPreset('signature')">Signature Preset</button>
        </div>
        <div class="resizer-layout">
          <div>
            <div class="tool-form-grid tool-form-grid-3">
              <div class="tool-field">
                <label class="tool-label" for="tool-image-file">Upload image</label>
                <input class="tool-input" type="file" id="tool-image-file" accept="image/*" onchange="handleToolImageUpload(event)">
              </div>
              <div class="tool-field">
                <label class="tool-label" for="resizer-width">Width (px)</label>
                <input class="tool-input" type="number" id="resizer-width" min="1" value="300">
              </div>
              <div class="tool-field">
                <label class="tool-label" for="resizer-height">Height (px)</label>
                <input class="tool-input" type="number" id="resizer-height" min="1" value="400">
              </div>
              <div class="tool-field">
                <label class="tool-label" for="resizer-maxkb">Target size (KB)</label>
                <input class="tool-input" type="number" id="resizer-maxkb" min="1" value="50">
              </div>
              <div class="tool-field">
                <label class="tool-label" for="resizer-format">Output format</label>
                <select class="tool-select" id="resizer-format">
                  <option value="image/jpeg">JPG</option>
                  <option value="image/webp">WEBP</option>
                  <option value="image/png">PNG</option>
                </select>
              </div>
              <div class="tool-field">
                <label class="tool-label" for="resizer-bg">Signature background</label>
                <select class="tool-select" id="resizer-bg">
                  <option value="#ffffff">White</option>
                  <option value="#f8fafc">Light Grey</option>
                </select>
              </div>
            </div>
            <div class="tool-helper">Photo ke liye JPG/WEBP best rahega. Signature ke liye PNG rakh sakte ho, lekin target KB exact match har browser me guarantee nahi hota.</div>
            <div class="tool-btn-row">
              <button class="tool-primary-btn" onclick="resizeToolImage()">Resize & Prepare Download</button>
              <button class="tool-secondary-btn" onclick="resetResizerTool()">Reset</button>
            </div>
            <div id="resizer-status"></div>
            <a id="resizer-download-link" class="tool-primary-btn resizer-download-link" download="resized-image.jpg">⬇ Download Image</a>
          </div>
          <div>
            <div id="resizer-preview" class="resizer-preview-box">Upload image karne ke baad preview yahan dikhega.</div>
            <div class="resizer-stats">
              <div class="resizer-stat"><div class="tool-result-k">Original</div><div class="tool-result-v" id="resizer-original-stat" style="font-size:1.05rem;">—</div></div>
              <div class="resizer-stat"><div class="tool-result-k">Output</div><div class="tool-result-v" id="resizer-output-stat" style="font-size:1.05rem;">—</div></div>
            </div>
          </div>
        </div>
      </div>
      <div class="tool-card">
        <div class="tool-card-title">Recommended presets</div>
        <div class="tool-helper" style="font-size:0.86rem;color:var(--text);line-height:1.85;margin-top:0;">
          <b>Photo preset:</b> 300×400 px, 50 KB target.<br>
          <b>Signature preset:</b> 300×120 px, 20 KB target.<br>
          Different exams alag specs maang sakte hain — official notice ki dimensions ko preference do.
        </div>
      </div>`, pushState);
    _toolImageDataUrl = '';
    _toolOriginalImageInfo = null;
    setResizerPreset('photo');
  }
}

function renderDateSelect(prefix, selectedDate = '', startYear = 1950, endYear = new Date().getFullYear()) {
  const parts = selectedDate ? selectedDate.split('-') : [];
  const selYear = parts[0] || '';
  const selMonth = parts[1] || '';
  const selDay = parts[2] || '';
  const months = ['01','02','03','04','05','06','07','08','09','10','11','12'];
  const days = Array.from({ length: 31 }, (_, i) => String(i + 1).padStart(2, '0'));
  const years = [];
  for(let y = endYear; y >= startYear; y--) years.push(String(y));

  return `
    <div style="display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;">
      <select class="tool-select" id="${prefix}-day">
        <option value="">Day</option>
        ${days.map(day => `<option value="${day}" ${day === selDay ? 'selected' : ''}>${day}</option>`).join('')}
      </select>
      <select class="tool-select" id="${prefix}-month">
        <option value="">Month</option>
        ${months.map((month, idx) => `<option value="${month}" ${month === selMonth ? 'selected' : ''}>${idx + 1}</option>`).join('')}
      </select>
      <select class="tool-select" id="${prefix}-year">
        <option value="">Year</option>
        ${years.map(year => `<option value="${year}" ${year === selYear ? 'selected' : ''}>${year}</option>`).join('')}
      </select>
    </div>`;
}

function getDateFromSelects(prefix) {
  const day = document.getElementById(`${prefix}-day`)?.value || '';
  const month = document.getElementById(`${prefix}-month`)?.value || '';
  const year = document.getElementById(`${prefix}-year`)?.value || '';
  if(!day || !month || !year) return '';
  return `${year}-${month}-${day}`;
}

function setDateSelectValues(prefix, dateStr) {
  const parts = dateStr ? dateStr.split('-') : [];
  const [year = '', month = '', day = ''] = parts;
  const dayEl = document.getElementById(`${prefix}-day`);
  const monthEl = document.getElementById(`${prefix}-month`);
  const yearEl = document.getElementById(`${prefix}-year`);
  if(dayEl) dayEl.value = day;
  if(monthEl) monthEl.value = month;
  if(yearEl) yearEl.value = year;
}

function getTodayDateInput() {
  const today = new Date();
  const y = today.getFullYear();
  const m = String(today.getMonth() + 1).padStart(2, '0');
  const d = String(today.getDate()).padStart(2, '0');
  return `${y}-${m}-${d}`;
}

function diffAge(dob, asOn) {
  let years = asOn.getFullYear() - dob.getFullYear();
  let months = asOn.getMonth() - dob.getMonth();
  let days = asOn.getDate() - dob.getDate();

  if(days < 0) {
    const prevMonth = new Date(asOn.getFullYear(), asOn.getMonth(), 0).getDate();
    days += prevMonth;
    months--;
  }
  if(months < 0) {
    months += 12;
    years--;
  }
  return { years, months, days };
}

function calculateAgeTool() {
  const dobVal = getDateFromSelects('age-dob');
  const asOnVal = getDateFromSelects('age-ason');
  const out = document.getElementById('age-tool-output');
  if(!out) return;

  if(!dobVal || !asOnVal) {
    out.innerHTML = `<div class="tool-status-box err">DOB aur age-as-on date dono select karo.</div>`;
    return;
  }

  const dob = new Date(dobVal + 'T00:00:00');
  const asOn = new Date(asOnVal + 'T00:00:00');
  if(Number.isNaN(dob.getTime()) || Number.isNaN(asOn.getTime()) || dob > asOn) {
    out.innerHTML = `<div class="tool-status-box err">Valid dates daalo. DOB age-as-on date se future me nahi ho sakti.</div>`;
    return;
  }

  if((dob.getMonth() + 1) !== parseInt(dobVal.split('-')[1], 10) || dob.getDate() !== parseInt(dobVal.split('-')[2], 10) ||
     (asOn.getMonth() + 1) !== parseInt(asOnVal.split('-')[1], 10) || asOn.getDate() !== parseInt(asOnVal.split('-')[2], 10)) {
    out.innerHTML = `<div class="tool-status-box err">Date sahi select karo. Invalid day/month combination allow nahi hai.</div>`;
    return;
  }

  const age = diffAge(dob, asOn);

  out.innerHTML = `
    <div class="tool-result-grid">
      <div class="tool-result-card">
        <div class="tool-result-k">Current age</div>
        <div class="tool-result-v">${age.years}Y ${age.months}M ${age.days}D</div>
      </div>
    </div>`;
}

function resetAgeTool() {
  const today = getTodayDateInput();
  setDateSelectValues('age-dob', '');
  setDateSelectValues('age-ason', today);
  const out = document.getElementById('age-tool-output');
  if(out) out.innerHTML = '';
}

function syncQualificationChip(value) {
  Object.keys(QUALIFICATION_LABELS).forEach(key => {
    const chip = document.getElementById(`qual-chip-${key}`);
    if(chip) chip.classList.toggle('active', key === value);
  });
}

function selectQualificationChip(value) {
  const select = document.getElementById('qualification-select');
  if(select) select.value = value;
  syncQualificationChip(value);
}

function resetQualificationTool() {
  const select = document.getElementById('qualification-select');
  const limit = document.getElementById('qualification-limit');
  if(select) select.value = '';
  if(limit) limit.value = '12';
  syncQualificationChip('');
  const out = document.getElementById('qualification-tool-output');
  if(out) out.innerHTML = '';
}

function qualificationSearchText(job) {
  const bits = [];
  const pushVal = (v) => {
    if(!v) return;
    if(typeof v === 'string') bits.push(v);
    else if(Array.isArray(v)) v.forEach(pushVal);
    else if(typeof v === 'object') Object.values(v).forEach(pushVal);
  };

  pushVal(job.title);
  pushVal(job.org);
  pushVal(job.dept);
  pushVal(job.category);
  pushVal(job.desc);
  pushVal(job.eligibility);
  pushVal(job.elig);
  if(Array.isArray(job.vacTable)) {
    job.vacTable.forEach(r => {
      if(Array.isArray(r)) r.forEach(pushVal);
      else pushVal(r);
    });
  }
  return bits.join(' ').toLowerCase();
}

function qualificationPatterns(level) {
  // Sirf selected level ke exact patterns — lower levels include NAHI honge
  // Taaki filter sahi kaam kare aur alag alag results aayein
  return QUAL_SEARCH_MAP[level] || [];
}

function jobMatchesQualification(job, level) {
  const text = qualificationSearchText(job);
  const pats = qualificationPatterns(level);
  if(!pats.length) return false;

  // Strict match: job text mein selected level ka koi bhi term hona chahiye
  // lekin saath mein yeh bhi check karo ki higher level ke terms to nahi hain
  // (e.g. 10th filter mein graduate-only jobs na aayein)
  const levelRank = ['10th','12th','iti','diploma','graduate','engineering','postgraduate','law','medical'];
  const selectedIdx = levelRank.indexOf(level);

  // Higher level exclusive patterns — agar job mein yeh hain aur selected level neeche hai to skip
  const EXCLUSIVE = {
    'graduate':     ['graduate','graduation','degree','bachelor','ba ','b.a','b.com','bcom','bms','bba','bsc','b.sc','bca','b.ca','arts','commerce','science'],
    'engineering':  ['b.tech','btech','b.e','be ','engineering','engineer'],
    'postgraduate': ['post graduate','postgraduate','master','mba','msc','m.sc','mca','m.ca','m.com','mcom','ma ','m.a'],
    'law':          ['llb','llm','law degree','legal'],
    'medical':      ['mbbs','bds','nursing','pharmacy','pharma','ayurveda'],
  };

  const higherLevels = levelRank.slice(selectedIdx + 1);
  const hasHigherExclusive = higherLevels.some(higher => {
    const excl = EXCLUSIVE[higher] || [];
    return excl.some(term => text.includes(term));
  });

  // Agar job mein higher-level exclusive terms hain aur current level ke terms nahi hain, skip karo
  if(hasHigherExclusive && !pats.some(term => text.includes(term))) return false;

  return pats.some(term => text.includes(term));
}

function summarizeQualification(level) {
  const map = {
    '10th':         'Showing jobs that require 10th / Matriculation qualification.',
    '12th':         'Showing jobs for 12th / HSC pass candidates.',
    'iti':          'Showing ITI trade-based jobs.',
    'diploma':      'Showing Diploma level jobs.',
    'graduate':     'Showing jobs open for Graduates — BA, B.Com, BMS, BBA, BSc, BCA and any degree holders.',
    'engineering':  'Showing jobs for BE / B.Tech Engineering graduates.',
    'postgraduate': 'Showing jobs for Post Graduate candidates.',
    'law':          'Showing jobs for Law graduates (LLB / LLM).',
    'medical':      'Showing jobs for Medical / Health sector candidates.',
  };
  return map[level] || '';
}

// Auto-detect which qualifications exist in current live jobs
// and populate the dropdown — expired jobs automatically excluded
function buildQualDropdown() {
  const jobs = getJobs().filter(j => j.status === 'live');
  const ORDER = ['10th','12th','iti','diploma','graduate','engineering','postgraduate','law','medical'];
  const LABELS = {
    '10th':          '10th Pass',
    '12th':          '12th Pass',
    'iti':           'ITI',
    'diploma':       'Diploma',
    'graduate':      'Graduation (BA / B.Com / BMS / BBA / BSc / BCA)',
    'engineering':   'Engineering (BE / B.Tech)',
    'postgraduate':  'Post Graduate (MA / M.Com / MBA / MSc)',
    'law':           'Law (LLB / LLM)',
    'medical':       'Medical (MBBS / Nursing / Pharmacy)',
  };

  const available = ORDER.filter(level =>
    jobs.some(j => jobMatchesQualification(j, level))
  );

  // Populate both sidebar + mobile dropdowns
  ['sidebar-qual-select','mobile-qual-select'].forEach(id => {
    const select = document.getElementById(id);
    if(!select) return;
    select.innerHTML = '<option value="">-- Select Qualification --</option>';
    available.forEach(level => {
      const count = jobs.filter(j => jobMatchesQualification(j, level)).length;
      const opt = document.createElement('option');
      opt.value = level;
      opt.textContent = `${LABELS[level]} (${count} jobs)`;
      select.appendChild(opt);
    });
  });
}

function mobileSidebarQualFilter() {
  const level = document.getElementById('mobile-qual-select')?.value;
  const out = document.getElementById('mobile-qual-results');
  if(!out) return;
  if(!level) { out.innerHTML = ''; return; }

  const jobs = getJobs().filter(j => j.status === 'live');
  const matched = sortJobsByDeadlineThenNew(jobs.filter(j => jobMatchesQualification(j, level))).slice(0, 10);

  if(!matched.length) {
    out.innerHTML = `<div style="font-size:0.82rem;color:var(--muted);padding:10px 0;text-align:center;">No matching jobs available right now.</div>`;
    return;
  }

  out.innerHTML = matched.map(job => {
    const title = typeof job.title === 'object' ? job.title.en : job.title;
    const lastDate = typeof job.lastDate === 'object' ? job.lastDate.en : (job.lastDate || '');
    return `<div style="border:1px solid #E2E8F4;border-radius:9px;padding:9px 11px;margin-bottom:7px;background:#fff;cursor:pointer;" onclick="showDetail('${job.id}')">
      <div style="font-size:0.82rem;font-weight:700;color:#0B1F3A;line-height:1.4;margin-bottom:3px;">${title}</div>
      ${job.vacancies ? `<div style="font-size:0.75rem;color:#64748b;">👥 ${job.vacancies} Posts</div>` : ''}
      ${lastDate ? `<div style="font-size:0.75rem;color:#E8470A;font-weight:600;">Last Date: ${lastDate}</div>` : ''}
    </div>`;
  }).join('');
}

function sortJobsByDeadlineThenNew(jobs) {
  return jobs.slice().sort((a, b) => {
    const ad = a.rawLastDate ? (parseJobDate(a.rawLastDate)||new Date('9999-12-31')).getTime() : Number.MAX_SAFE_INTEGER;
    const bd = b.rawLastDate ? (parseJobDate(b.rawLastDate)||new Date('9999-12-31')).getTime() : Number.MAX_SAFE_INTEGER;
    return ad - bd;
  });
}

function sidebarQualFilter() {
  const level = document.getElementById('sidebar-qual-select')?.value;
  const out = document.getElementById('sidebar-qual-results');
  if(!out) return;
  if(!level) { out.innerHTML = ''; return; }

  const jobs = getJobs().filter(j => j.status === 'live');
  const matched = sortJobsByDeadlineThenNew(jobs.filter(j => jobMatchesQualification(j, level))).slice(0, 10);

  if(!matched.length) {
    out.innerHTML = `<div style="font-size:0.82rem;color:var(--muted);padding:10px 0;text-align:center;">No matching jobs available right now. Check back later.</div>`;
    return;
  }

  out.innerHTML = matched.map(job => {
    const title = typeof job.title === 'object' ? job.title.en : job.title;
    const lastDate = typeof job.lastDate === 'object' ? job.lastDate.en : (job.lastDate || '');
    return `<div style="border:1px solid #E2E8F4;border-radius:9px;padding:9px 11px;margin-bottom:7px;background:#fff;cursor:pointer;" onclick="showDetail('${job.id}')">
      <div style="font-size:0.82rem;font-weight:700;color:#0B1F3A;line-height:1.4;margin-bottom:3px;">${title}</div>
      ${job.vacancies ? `<div style="font-size:0.75rem;color:#64748b;">👥 ${job.vacancies} Posts</div>` : ''}
      ${lastDate ? `<div style="font-size:0.75rem;color:#E8470A;font-weight:600;">Last Date: ${lastDate}</div>` : ''}
    </div>`;
  }).join('');
}

function runQualificationTool() {
  const level = document.getElementById('qualification-select')?.value || '';
  const limit = parseInt(document.getElementById('qualification-limit')?.value || '12', 10);
  const out = document.getElementById('qualification-tool-output');
  if(!out) return;

  if(!level) {
    out.innerHTML = `<div class="tool-status-box err">Please select a qualification first.</div>`;
    return;
  }

  const jobs = getJobs().filter(j => j.status === 'live');
  const matched = sortJobsByDeadlineThenNew(jobs.filter(j => jobMatchesQualification(j, level))).slice(0, limit);

  out.innerHTML = `
    <div class="qual-summary">
      <b>${QUALIFICATION_LABELS[level] || level}</b> ke hisaab se current live jobs me quick text-match kiya gaya hai. ${summarizeQualification(level)}
    </div>
    ${matched.length ? `
      <div class="qual-results-list">
        ${matched.map(job => {
          const title = typeof job.title === 'object' ? job.title.en : job.title;
          const org = typeof job.org === 'object' ? job.org.en : (job.org || '');
          const location = typeof job.location === 'object' ? job.location.en : (job.location || 'All India');
          const lastDate = typeof job.lastDate === 'object' ? job.lastDate.en : (job.lastDate || 'Check notice');
          return `
            <div class="qual-job-card">
              <div class="qual-job-title">${title}</div>
              <div class="qual-job-meta">${org}${job.category ? ` • ${job.category}` : ''}${location ? ` • ${location}` : ''}</div>
              <div class="qual-job-tags">
                <span class="qual-job-tag">${QUALIFICATION_LABELS[level] || level}</span>
                ${job.vacancies ? `<span class="qual-job-tag">${job.vacancies} Posts</span>` : ''}
                ${lastDate ? `<span class="qual-job-tag">Last Date: ${lastDate}</span>` : ''}
              </div>
              <button class="tool-launch-btn" onclick="showDetail('${job.id}')">View Job →</button>
            </div>`;
        }).join('')}
      </div>` : `
      <div class="qual-empty">
        <div style="font-size:2rem;margin-bottom:10px;">🔎</div>
        <div style="font-weight:700;color:var(--navy);margin-bottom:4px;">Abhi direct match nahi mila</div>
        <div style="font-size:0.86rem;line-height:1.7;">Dusri qualification select karke dekho ya home page pe saari jobs manually browse karo.</div>
      </div>`}`;
}

function setResizerPreset(type) {
  const photoBtn = document.getElementById('resizer-type-photo');
  const signBtn = document.getElementById('resizer-type-signature');
  if(photoBtn) photoBtn.classList.toggle('active', type === 'photo');
  if(signBtn) signBtn.classList.toggle('active', type === 'signature');

  const width = document.getElementById('resizer-width');
  const height = document.getElementById('resizer-height');
  const maxkb = document.getElementById('resizer-maxkb');
  const format = document.getElementById('resizer-format');

  if(type === 'signature') {
    if(width) width.value = 300;
    if(height) height.value = 120;
    if(maxkb) maxkb.value = 20;
    if(format) format.value = 'image/png';
  } else {
    if(width) width.value = 300;
    if(height) height.value = 400;
    if(maxkb) maxkb.value = 50;
    if(format) format.value = 'image/jpeg';
  }
}

function bytesToReadable(bytes) {
  if(!bytes || bytes < 0) return '—';
  if(bytes < 1024) return `${bytes} B`;
  return `${(bytes / 1024).toFixed(1)} KB`;
}

function handleToolImageUpload(event) {
  const file = event?.target?.files?.[0];
  const preview = document.getElementById('resizer-preview');
  const originalStat = document.getElementById('resizer-original-stat');
  const outputStat = document.getElementById('resizer-output-stat');
  const status = document.getElementById('resizer-status');
  const dl = document.getElementById('resizer-download-link');

  if(!file) return;
  if(status) status.innerHTML = '';
  if(dl) { dl.classList.remove('show'); dl.removeAttribute('href'); }

  const reader = new FileReader();
  reader.onload = function(e) {
    _toolImageDataUrl = e.target?.result || '';
    _toolImageName = file.name || 'resized-image.jpg';
    _toolOriginalImageInfo = { name: file.name, size: file.size, type: file.type };
    if(preview) preview.innerHTML = `<img src="${_toolImageDataUrl}" alt="Preview">`;
    if(originalStat) originalStat.textContent = `${bytesToReadable(file.size)}`;
    if(outputStat) outputStat.textContent = '—';
  };
  reader.readAsDataURL(file);
}

async function canvasToBlob(canvas, mime, quality) {
  return new Promise(resolve => canvas.toBlob(resolve, mime, quality));
}

async function resizeToolImage() {
  const status = document.getElementById('resizer-status');
  const dl = document.getElementById('resizer-download-link');
  const preview = document.getElementById('resizer-preview');
  const outputStat = document.getElementById('resizer-output-stat');

  if(!_toolImageDataUrl) {
    if(status) status.innerHTML = `<div class="tool-status-box err">Pehle image upload karo.</div>`;
    return;
  }

  const width = parseInt(document.getElementById('resizer-width')?.value || '0', 10);
  const height = parseInt(document.getElementById('resizer-height')?.value || '0', 10);
  const maxKB = parseInt(document.getElementById('resizer-maxkb')?.value || '0', 10);
  const mime = document.getElementById('resizer-format')?.value || 'image/jpeg';
  const bg = document.getElementById('resizer-bg')?.value || '#ffffff';

  if(!width || !height || !maxKB) {
    if(status) status.innerHTML = `<div class="tool-status-box err">Width, height aur target KB valid hone chahiye.</div>`;
    return;
  }

  const img = new Image();
  img.onload = async function() {
    const canvas = document.createElement('canvas');
    canvas.width = width;
    canvas.height = height;
    const ctx = canvas.getContext('2d');

    ctx.fillStyle = bg;
    ctx.fillRect(0, 0, width, height);

    const scale = Math.min(width / img.width, height / img.height);
    const drawW = img.width * scale;
    const drawH = img.height * scale;
    const dx = (width - drawW) / 2;
    const dy = (height - drawH) / 2;
    ctx.drawImage(img, dx, dy, drawW, drawH);

    let blob = null;
    if(mime === 'image/png') {
      blob = await canvasToBlob(canvas, mime);
    } else {
      let quality = 0.92;
      blob = await canvasToBlob(canvas, mime, quality);
      const targetBytes = maxKB * 1024;
      while(blob && blob.size > targetBytes && quality > 0.2) {
        quality -= 0.07;
        blob = await canvasToBlob(canvas, mime, quality);
      }
    }

    if(!blob) {
      if(status) status.innerHTML = `<div class="tool-status-box err">Image process nahi ho payi. Dobara try karo.</div>`;
      return;
    }

    const objectUrl = URL.createObjectURL(blob);
    const ext = mime === 'image/png' ? 'png' : (mime === 'image/webp' ? 'webp' : 'jpg');
    if(preview) preview.innerHTML = `<img src="${objectUrl}" alt="Resized preview">`;
    if(outputStat) outputStat.textContent = `${bytesToReadable(blob.size)} • ${width}×${height}`;
    if(dl) {
      dl.href = objectUrl;
      dl.download = (_toolImageName || 'resized-image').replace(/\.[^.]+$/, '') + `-ready.${ext}`;
      dl.classList.add('show');
      dl.textContent = `⬇ Download ${ext.toUpperCase()} Image`;
    }

    const withinTarget = blob.size <= maxKB * 1024;
    if(status) {
      status.innerHTML = `<div class="tool-status-box ${withinTarget ? 'ok' : 'warn'}">
        ${withinTarget
          ? `Image ready hai. Target ${maxKB} KB ke andar output mil gaya.`
          : `Image resize ho gayi hai, lekin size target se thoda upar ho sakta hai. Format change karke ya dimensions aur kam karke dubara try karo.`}
      </div>`;
    }
  };
  img.onerror = function() {
    if(status) status.innerHTML = `<div class="tool-status-box err">Image load nahi ho payi.</div>`;
  };
  img.src = _toolImageDataUrl;
}

function resetResizerTool() {
  _toolImageDataUrl = '';
  _toolOriginalImageInfo = null;
  _toolImageName = 'resized-image.jpg';
  const file = document.getElementById('tool-image-file');
  const preview = document.getElementById('resizer-preview');
  const originalStat = document.getElementById('resizer-original-stat');
  const outputStat = document.getElementById('resizer-output-stat');
  const status = document.getElementById('resizer-status');
  const dl = document.getElementById('resizer-download-link');
  if(file) file.value = '';
  if(preview) preview.textContent = 'Upload image karne ke baad preview yahan dikhega.';
  if(originalStat) originalStat.textContent = '—';
  if(outputStat) outputStat.textContent = '—';
  if(status) status.innerHTML = '';
  if(dl) { dl.classList.remove('show'); dl.removeAttribute('href'); }
  setResizerPreset('photo');
}


function showComingSoon(name) {
  showPage('detail');
  setPageMeta({
    title: `${name} — Coming Soon | NaukriKhoj.in`,
    description: `${name} section is coming soon on NaukriKhoj.in.`,
    canonical: window.location.href,
    robots: 'noindex, follow'
  });
  upsertJobPostingSchema(null);
  document.getElementById('detail-page').innerHTML = `
    <div style="max-width:600px;margin:80px auto;text-align:center;padding:0 5%;box-sizing:border-box;width:100%;">
      <div style="font-size:4rem;margin-bottom:16px;">🚧</div>
      <h1 style="font-family:'Rajdhani',sans-serif;font-size:2rem;color:var(--navy);margin-bottom:12px;">${name} — Coming Soon!</h1>
      <p style="color:var(--muted);font-size:0.95rem;margin-bottom:28px;">Yeh section jald hi available hoga. Tab tak Latest Jobs dekho!</p>
      <button class="back-btn" onclick="showHome()" style="display:inline-block;">← Back to Home</button>
    </div>`;
  window.scrollTo(0,0);
}

function showLatestDetail(id) {
  showDetail(id);
  // Back button ko latest jobs pe le jaao
  const checkBackBtn = setInterval(() => {
    const backBtn = document.querySelector('.back-btn');
    if(backBtn) {
      backBtn.textContent = '← Latest Jobs';
      backBtn.onclick = function(e) {
        e.preventDefault();
        showLatestJobs();
      };
      clearInterval(checkBackBtn);
    }
  }, 50);
  // 2 second baad bhi nahi mila toh clear karo
  setTimeout(() => clearInterval(checkBackBtn), 2000);
}

// ===== CONTACT US =====
function showContact(pushState = true) {
  showPage('contact');
  if(pushState) history.pushState({ page: 'contact' }, 'Contact Us — NaukriKhoj.in', '/contact');
  setPageMeta({
    title: 'Contact Us — NaukriKhoj.in',
    description: 'Contact NaukriKhoj.in for questions, suggestions or feedback related to government job updates and site information.',
    canonical: 'https://naukrikhoj.in/contact',
    robots: 'index, follow'
  });
}

function showPrivacyPolicy(pushState = true) {
  showPage('privacy');
  if(pushState) history.pushState({ page: 'privacy' }, 'Privacy Policy — NaukriKhoj.in', '/privacy');
  setPageMeta({
    title: 'Privacy Policy — NaukriKhoj.in',
    description: 'Read the privacy policy of NaukriKhoj.in, including information on local storage, ads and external links.',
    canonical: 'https://naukrikhoj.in/privacy',
    robots: 'index, follow'
  });
}

function showAboutUs(pushState = true) {
  showPage('about');
  if(pushState) history.pushState({ page: 'about' }, 'About Us — NaukriKhoj.in', '/about');
  setPageMeta({
    title: 'About Us — NaukriKhoj.in',
    description: 'Learn about NaukriKhoj.in, a free government job information portal with latest updates for Railway, Bank, SSC, UPSC, Police and state jobs.',
    canonical: 'https://naukrikhoj.in/about',
    robots: 'index, follow'
  });
}

function goHome() {
  showHome();
}

function showDisclaimer(pushState = true) {
  showPage('disclaimer');
  if(pushState) history.pushState({ page: 'disclaimer' }, 'Disclaimer — NaukriKhoj.in', '/disclaimer');
  setPageMeta({
    title: 'Disclaimer — NaukriKhoj.in',
    description: 'Read the disclaimer for NaukriKhoj.in. We are an informational portal and users should verify all details from official government sources.',
    canonical: 'https://naukrikhoj.in/disclaimer',
    robots: 'index, follow'
  });
}

// ===== AI DESCRIPTION GENERATOR — Anthropic API =====
async function generateJobDescription(j, lang = 'en') {
  const L = f => typeof f === 'object' ? (f.en || '') : (f || '');
  const title     = L(j.title);
  const org       = L(j.org);
  const dept      = L(j.dept);
  const vacancies = j.vacancies || '';
  const salary    = j.salary || '';
  const lastDate  = typeof j.lastDate === 'object' ? j.lastDate.en : (j.lastDate || '');
  const location  = L(j.location);
  const edu       = j.elig?.en?.Education || '';
  const age       = j.elig?.en?.['Age Limit'] || '';
  const fees      = j.fees || '';

  const promptEn = `Write a professional government job description in English for a job portal. Use ONLY the details provided below. Do NOT invent or assume any information. Write 100 to 150 words in a clear, engaging paragraph style suitable for Indian job seekers.

Job Details:
- Title: ${title}
- Organization: ${org}${dept ? ' — ' + dept : ''}
- Vacancies: ${vacancies || 'Not specified'}
- Salary: ${salary || 'As per government norms'}
- Last Date: ${lastDate || 'Check official notification'}
- Location: ${location || 'India'}
- Education: ${edu || 'As per official notification'}
- Age Limit: ${age || 'As per official notification'}
- Application Fee: ${fees || 'As per official notification'}

Write only the description paragraph. No headings, no bullet points.`;

  const promptMr = `तुम्ही एक सरकारी नोकरी पोर्टलसाठी मराठीत नोकरीचे वर्णन लिहा. फक्त खाली दिलेल्या माहितीचा वापर करा. कोणतीही माहिती स्वतः तयार करू नका. 100 ते 150 शब्दांत स्पष्ट आणि आकर्षक परिच्छेद लिहा.

नोकरीचा तपशील:
- पद: ${title}
- संस्था: ${org}${dept ? ' — ' + dept : ''}
- जागा: ${vacancies || 'अधिकृत जाहिरातीनुसार'}
- वेतन: ${salary || 'शासन नियमानुसार'}
- अंतिम तारीख: ${lastDate || 'अधिकृत जाहिरात पहा'}
- स्थान: ${location || 'भारत'}
- शिक्षण: ${edu || 'अधिकृत जाहिरातीनुसार'}
- वयोमर्यादा: ${age || 'अधिकृत जाहिरातीनुसार'}
- अर्ज शुल्क: ${fees || 'अधिकृत जाहिरातीनुसार'}

फक्त वर्णनाचा परिच्छेद लिहा. कोणते शीर्षक किंवा यादी नको.`;

  try {
    const response = await fetch('https://api.anthropic.com/v1/messages', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        model: 'claude-sonnet-4-20250514',
        max_tokens: 400,
        messages: [{ role: 'user', content: lang === 'mr' ? promptMr : promptEn }]
      })
    });
    const data = await response.json();
    return data?.content?.[0]?.text?.trim() || '';
  } catch(e) {
    return '';
  }
}

// ===== MARATHI PAGE — MyMemory Translation API (Free, No CORS issues) =====
const _translationCache = {};
async function gTranslate(text, targetLang='mr') {
  if(!text || !text.trim()) return '';
  const cacheKey = targetLang + '::' + text;
  if(_translationCache[cacheKey]) return _translationCache[cacheKey];
  try {
    // Try MyMemory first (free, reliable, no CORS)
    const url = `https://api.mymemory.translated.net/get?q=${encodeURIComponent(text)}&langpair=en|${targetLang}`;
    const res = await fetch(url);
    if(!res.ok) throw new Error('MyMemory failed');
    const data = await res.json();
    if(data.responseStatus === 200 && data.responseData?.translatedText) {
      const translated = data.responseData.translatedText;
      // MyMemory sometimes returns unchanged text on failure — fallback check
      if(translated && translated !== text) {
        _translationCache[cacheKey] = translated;
        return translated;
      }
    }
    throw new Error('Translation empty or unchanged');
  } catch {
    // Fallback: Google Translate free endpoint
    try {
      const url2 = `https://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=${targetLang}&dt=t&q=${encodeURIComponent(text)}`;
      const res2 = await fetch(url2);
      const data2 = await res2.json();
      const translated2 = data2[0].map(x => x[0]).join('');
      _translationCache[cacheKey] = translated2;
      return translated2;
    } catch {
      return text; // Return original if both fail
    }
  }
}

async function showMarathiPage(id, pushState = true) {
  return showDetail(id, pushState);
}


// ===== BLOG SECTION =====
let _cachedBlogs = null;

async function fetchBlogs() {
  if (_cachedBlogs) return _cachedBlogs;
  try {
    const res = await fetch(FIREBASE_URL + '/blogs.json', { cache: 'no-store' });
    if (res.ok) {
      const data = await res.json();
      const blogs = normalizeCollection(data).filter(b => b.status === 'published');
      if (blogs.length) {
        _cachedBlogs = blogs;
        writeLocalCollection(LOCAL_KEYS.blogs, blogs);
        return _cachedBlogs;
      }
    }
  } catch(e) {}
  const local = readLocalCollection(LOCAL_KEYS.blogs, DEFAULT_BLOGS);
  _cachedBlogs = local.filter(b => b.status === 'published');
  return _cachedBlogs;
}

async function showBlogPage(pushState = true) {
  showPage('blog');
  if (pushState) history.pushState({ page: 'blog' }, '', '/blog');
  setPageMeta({
    title: 'Blog — NaukriKhoj.in',
    description: 'Sarkari exam guides, job tips, syllabus and preparation articles on NaukriKhoj.in.',
    canonical: 'https://naukrikhoj.in/blog',
    robots: 'index, follow'
  });
  upsertJobPostingSchema(null);
  const blogs = await fetchBlogs();
  renderBlogCards(blogs, '');
  renderTrendingBlogsSidebar(blogs);
}

// ===== AI BLOG SUMMARY GENERATOR =====
async function generateBlogSummary(blog, lang = 'en') {
  const title   = blog.title || '';
  const rawText = (blog.content || '').replace(/<[^>]+>/g, '').substring(0, 800);
  const category = blog.category || 'General';

  const promptEn = `You are writing a short summary for a government job blog post on NaukriKhoj.in. Write 100 to 150 engaging words in English. Use the information below. Add helpful context from your knowledge about this topic. Write in a friendly, informative tone for Indian job seekers. No headings, no bullet points — just a flowing paragraph.

Blog Title: ${title}
Category: ${category}
Content Preview: ${rawText || 'No content available'}

Write only the summary paragraph.`;

  const promptMr = `तुम्ही NaukriKhoj.in साठी एका सरकारी नोकरी ब्लॉग पोस्टचा थोडक्यात सारांश लिहा. 100 ते 150 शब्दांत मराठीत लिहा. खालील माहिती वापरा आणि महाराष्ट्रातील नोकरी शोधणाऱ्यांसाठी उपयुक्त माहिती जोडा. फक्त परिच्छेद लिहा, यादी किंवा शीर्षक नको.

ब्लॉग शीर्षक: ${title}
वर्ग: ${category}
आशय: ${rawText || 'माहिती उपलब्ध नाही'}

फक्त सारांश परिच्छेद लिहा.`;

  try {
    const response = await fetch('https://api.anthropic.com/v1/messages', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        model: 'claude-sonnet-4-20250514',
        max_tokens: 400,
        messages: [{ role: 'user', content: lang === 'mr' ? promptMr : promptEn }]
      })
    });
    const data = await response.json();
    return data?.content?.[0]?.text?.trim() || '';
  } catch(e) {
    return '';
  }
}

// ===== BLOG MARATHI BLOCK BUILDER (En + Mr AI summaries) =====

function buildBlogMrBlock(titleMr, previewMr, postedOn) {
  const hasMr = !!((titleMr && titleMr.trim()) || (previewMr && previewMr.trim()));
  if (!hasMr) return '';
  return `
    <div style="display:flex;align-items:center;gap:8px;margin:10px 14px 8px;pointer-events:none;">
      <div style="flex:1;height:1px;background:linear-gradient(90deg,transparent,#f97316 40%,#f97316 60%,transparent);"></div>
      <div style="background:linear-gradient(135deg,#f97316,#ea580c);border-radius:20px;padding:4px 14px;display:flex;align-items:center;gap:6px;box-shadow:0 2px 8px rgba(249,115,22,0.2);">
        <span style="font-size:0.72rem;">🇮🇳</span>
        <span style="font-family:'Rajdhani',sans-serif;font-size:0.7rem;font-weight:700;color:#fff;letter-spacing:0.5px;">मराठी</span>
      </div>
      <div style="flex:1;height:1px;background:linear-gradient(90deg,#f97316 40%,transparent);"></div>
    </div>
    <div style="background:#fff7ed;border-radius:0 0 12px 12px;padding:12px 14px 14px;">
      ${titleMr ? `<div style="font-family:'Rajdhani',sans-serif;font-size:0.92rem;font-weight:700;color:#9a3412;line-height:1.4;margin-bottom:6px;">${titleMr}</div>` : ''}
      ${previewMr ? `<div style="font-size:0.82rem;color:#7c2d12;line-height:1.75;">${previewMr}</div>` : ''}
      <div style="font-size:0.72rem;color:#ea580c;margin-top:8px;border-top:1px solid #fed7aa;padding-top:6px;">📅 ${postedOn || ''}</div>
    </div>`;
}

function renderBlogCards(blogs, catFilter) {
  const container = document.getElementById('blog-cards-container');
  const countLabel = document.getElementById('blog-count-label');
  // Hide static preview once real content loads
  const staticBlogPreview = document.getElementById('static-blog-preview');
  // SEO FIX: Static blog preview ko hide mat karo — Googlebot ko real content milna chahiye
  // if (staticBlogPreview) staticBlogPreview.style.display = 'none';
  if (!container) return;

  // Sort newest first — postedOn date se sort karo, fallback to ID
  const sortedBlogs = [...blogs].sort((a, b) => {
    // postedOn se date parse karo (e.g. "10 Apr 2026")
    const parseDate = (s) => {
      if (!s) return 0;
      const d = new Date(s);
      return isNaN(d.getTime()) ? 0 : d.getTime();
    };
    const da = parseDate(a.postedOn);
    const db = parseDate(b.postedOn);
    if (da !== db) return db - da; // latest date pehle
    // same date ya no date — ID se sort
    return (b.id || '').localeCompare(a.id || '');
  });
  let filtered = catFilter ? sortedBlogs.filter(b => (b.category || '').toLowerCase().includes(catFilter.toLowerCase())) : sortedBlogs;
  if (countLabel) countLabel.textContent = filtered.length + ' blog' + (filtered.length !== 1 ? 's' : '');

  if (!filtered.length) {
    container.innerHTML = `<div class="blog-empty"><div class="blog-empty-icon">&#128221;</div><div style="font-size:1.1rem;font-weight:700;color:var(--navy);margin-bottom:6px;">Koi blog nahi mila</div><div style="font-size:0.88rem;color:var(--muted);">Is category mein abhi koi article nahi hai. Jald hi nayi guides aur updates aayenge!</div></div>`;
    return;
  }

  let html = '';
  filtered.forEach((b, i) => {
    if (i > 0 && i % 4 === 0) {
      html += `<div class="ad-block ad-block-full" style="margin:12px 0 16px;">
        <!-- SLOT: BLOG_LIST_INLINE (90px) — AdSense mein "Blog List Inline" unit banao -->
        <!-- AdSense unit disabled during review: enable only after approval and after adding enough original content. -->
</div>`;
    }
    const tags = b.tags ? b.tags.split(',').slice(0, 3) : [];
    const preview = b.content ? b.content.replace(/<[^>]+>/g, '').substring(0, 120) + '...' : '';
    const mrPreview = b.contentMr ? b.contentMr.replace(/<[^>]+>/g, '').substring(0, 110) + '...' : '';
    const mrBlogBlock = buildBlogMrBlock(b.titleMr || '', mrPreview, b.postedOn);

    html += `<div class="bcard" onclick="showBlogDetail('${b.id}')" style="padding-bottom:0;overflow:hidden;">
      <div class="bcard-accent"></div>
      <div style="flex:1;min-width:0;display:flex;flex-direction:column;">
        <div class="bcard-body" style="padding-bottom:14px;">
          ${b.category ? `<div class="bcard-cat">${b.category}</div>` : ''}
          <div class="bcard-title">${b.title || 'Untitled Blog'}</div>
          ${preview ? `<div style="font-size:0.82rem;color:var(--muted);margin:6px 0;line-height:1.5;">${preview}</div>` : ''}
          <div class="bcard-meta">
            <span>&#128197; ${b.postedOn || ''}</span>
            ${b.tags ? `<span>&#127991;&#65039; ${b.tags.split(',')[0].trim()}</span>` : ''}
          </div>
          ${tags.length ? `<div class="bcard-tags">${tags.map(t => `<span class="bcard-tag">${t.trim()}</span>`).join('')}</div>` : ''}
        </div>
        ${mrBlogBlock}
      </div>
    </div>`;
  });
  container.innerHTML = html;
  initAds(container);
}

function filterBlogs(cat, el) {

  document.querySelectorAll('.bpill').forEach(p => p.classList.remove('active'));
  if (el) el.classList.add('active');
  fetchBlogs().then(blogs => renderBlogCards(blogs, cat));
}

function renderTrendingBlogsSidebar(blogs) {
  const list = document.getElementById('trending-blogs-list');
  if (!list) return;
  const recent = [...blogs].sort((a, b) => (b.id||'').localeCompare(a.id||'')).slice(0, 5);
  if (!recent.length) { list.innerHTML = '<div style="color:var(--muted);font-size:0.82rem;padding:8px 0;">Koi blog nahi hai</div>'; return; }
  list.innerHTML = recent.map(b => `
    <div class="dl-item" onclick="showBlogDetail('${b.id}')">
      <div class="dl-date"><div class="dl-d">${b.postedOn ? b.postedOn.split(' ')[0] : '—'}</div><div class="dl-m">${b.postedOn ? (b.postedOn.split(' ')[1] || '') : ''}</div></div>
      <div><div class="dl-t">${b.title || 'Blog'}</div><div class="dl-s">${b.category || 'General'}</div></div>
    </div>`).join('');
}

async function showBlogDetail(blogId, pushState = true) {
  showPage('blog-detail');
  if (pushState) history.pushState({ page: 'blog-detail', blogId }, '', '/blog/' + blogId.replace('blog_', ''));
  const container = document.getElementById('blog-detail-content');
  if (!container) return;
  const blogs = await fetchBlogs();
  const b = blogs.find(x => x.id === blogId);

  if (!b) {
    container.innerHTML = `
      <div style="max-width:860px;margin:0 auto;padding:40px 4%;text-align:center;box-sizing:border-box;">
        <button class="back-btn" onclick="showBlogPage()" style="margin-bottom:24px;">← Back to Blogs</button>
        <div style="background:#fff;border:1.5px solid var(--border);border-radius:18px;padding:48px 32px;box-shadow:var(--shadow-sm);">
          <div style="font-size:3.5rem;margin-bottom:16px;">📝</div>
          <div style="font-family:'Rajdhani',sans-serif;font-size:1.5rem;font-weight:700;color:var(--navy);margin-bottom:10px;">Blog nahi mila</div>
          <div style="font-size:0.92rem;color:var(--muted);margin-bottom:28px;line-height:1.7;">Yeh blog post abhi available nahi hai.<br>Doosre articles zaroor padhein!</div>
          <button onclick="showBlogPage()" style="background:var(--saffron);color:#fff;border:none;padding:11px 28px;border-radius:9px;font-size:0.92rem;font-weight:700;cursor:pointer;font-family:'DM Sans',sans-serif;">✍️ All Blogs Dekho</button>
        </div>
      </div>`;
    return;
  }

  const blogMrSection = buildBlogDetailMrBlock(b.titleMr || '', b.metaMr || '', b.contentMr || '', b.postedOn || '');

  // SEO: update title and meta
  setPageMeta({
    title: (b.title || 'Blog') + ' | NaukriKhoj.in',
    description: b.meta || 'Read the latest government job guide on NaukriKhoj.in.',
    canonical: 'https://naukrikhoj.in/blog/' + blogId.replace('blog_', ''),
    robots: 'index, follow'
  });
  upsertJobPostingSchema(null);

  container.innerHTML = `
    <button class="back-btn" onclick="showBlogPage()" style="margin-bottom:20px;">← Back to Blogs</button>

    <div class="blog-detail-body">
      ${b.category ? `<div class="bcard-cat" style="margin-bottom:12px;">${b.category}</div>` : ''}
      <h1 style="font-family:'Rajdhani',sans-serif;font-size:clamp(1.4rem,3vw,2rem);font-weight:700;color:var(--navy);line-height:1.25;margin-bottom:10px;">${b.title || ''}</h1>
      ${b.meta ? `<p style="font-size:0.9rem;color:var(--muted);margin-bottom:14px;font-style:italic;">${b.meta}</p>` : ''}
      <div style="display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:12px 0;border-top:1px solid var(--border);border-bottom:1px solid var(--border);margin-bottom:20px;">
        <span style="font-size:0.8rem;color:var(--muted);">📅 ${b.postedOn || ''}</span>
        ${b.tags ? `<span style="font-size:0.8rem;color:var(--muted);">🏷️ ${b.tags}</span>` : ''}
        <button onclick="navigator.share ? navigator.share({title:'${(b.title||'').replace(/'/g,'').substring(0,50)}',url:window.location.href}) : navigator.clipboard.writeText(window.location.href).then(()=>alert('Link copied!'))" style="margin-left:auto;background:var(--bg);border:1px solid var(--border);padding:6px 14px;border-radius:7px;font-size:0.78rem;font-weight:600;cursor:pointer;color:var(--navy);font-family:'DM Sans',sans-serif;">🔗 Share</button>
      </div>

      <!-- Ad: After article intro, before content body -->
      <div class="ad-block ad-block-full" style="margin-bottom:20px;">
        <!-- SLOT: BLOG_ARTICLE_TOP (90px) -->
        <!-- AdSense unit disabled during review: enable only after approval and after adding enough original content. -->
</div>

      <div class="blog-content-body">${b.content || '<p>No content</p>'}</div>

      ${blogMrSection}

      <!-- Ad: Bottom of blog content -->
      <div class="ad-block ad-block-full" style="margin:24px 0 0;">
        <!-- SLOT: BLOG_ARTICLE_BOTTOM (90px) -->
        <!-- AdSense unit disabled during review: enable only after approval and after adding enough original content. -->
</div>
    </div>

    <!-- More blogs -->
    <div style="margin-top:24px;">
      <div style="font-family:'Rajdhani',sans-serif;font-size:1.2rem;font-weight:700;color:var(--navy);margin-bottom:14px;">📰 Aur Blogs Padho</div>
      <div id="more-blogs-list"></div>
    </div>
  `;

  // Load related blogs
  const others = blogs.filter(x => x.id !== blogId).slice(0, 4);
  const moreList = document.getElementById('more-blogs-list');
  if (moreList && others.length) {
    moreList.innerHTML = others.map(ob => `
      <div class="bcard" onclick="showBlogDetail('${ob.id}')">
        <div class="bcard-accent"></div>
        <div class="bcard-body">
          ${ob.category ? `<div class="bcard-cat">${ob.category}</div>` : ''}
          <div class="bcard-title">${ob.title || 'Blog'}</div>
          <div class="bcard-meta"><span>📅 ${ob.postedOn || ''}</span></div>
        </div>
      </div>`).join('');
  }
  initAds(container);
}


function buildBlogDetailMrBlock(titleMr, metaMr, contentMr, postedOn) {
  const hasMr = !!((titleMr && titleMr.trim()) || (contentMr && contentMr.trim()) || (metaMr && metaMr.trim()));
  if (!hasMr) return '';
  return `
    <div style="margin-top:32px;">
      <div style="display:flex;align-items:center;gap:8px;margin:0 0 14px;pointer-events:none;">
        <div style="flex:1;height:2px;background:linear-gradient(90deg,transparent,#f97316 30%,#f97316 70%,transparent);"></div>
        <div style="background:linear-gradient(135deg,#f97316,#ea580c);border-radius:24px;padding:8px 22px;display:flex;align-items:center;gap:8px;box-shadow:0 4px 16px rgba(249,115,22,0.3);">
          <span style="font-size:1rem;">🇮🇳</span>
          <span style="font-family:'Rajdhani',sans-serif;font-size:0.95rem;font-weight:700;color:#fff;letter-spacing:0.5px;">मराठी</span>
        </div>
        <div style="flex:1;height:2px;background:linear-gradient(90deg,#f97316 30%,transparent);"></div>
      </div>
      <div style="background:#fff7ed;border:1.5px solid #fed7aa;border-radius:14px;padding:22px;">
        <div style="font-size:0.72rem;color:#c2410c;background:rgba(249,115,22,0.08);border-radius:6px;padding:4px 10px;display:inline-block;margin-bottom:16px;">🌐 Admin Saved Marathi</div>
        ${titleMr ? `<h2 style="font-family:'Rajdhani',sans-serif;font-size:1.4rem;font-weight:700;color:#9a3412;line-height:1.3;margin-bottom:10px;">${titleMr}</h2>` : ''}
        ${metaMr ? `<p style="font-size:0.9rem;color:#7c2d12;margin-bottom:16px;font-style:italic;">${metaMr}</p>` : ''}
        <div class="blog-content-body">${contentMr || ''}</div>
        <div style="margin-top:16px;font-size:0.78rem;color:#c2410c;border-top:1px solid #fed7aa;padding-top:10px;">📅 ${postedOn || ''}</div>
      </div>
    </div>`;
}

// ===== BROWSER BACK/FORWARD BUTTON =====

window.addEventListener('popstate', function(e) {
  const state = e.state;
  if(!state || state.page === 'home') {
    showHome(false);
  } else if(state.page === 'detail' && state.jobId) {
    showDetail(state.jobId, false);
  } else if(state.page === 'marathi' && state.jobId) {
    showMarathiPage(state.jobId, false);
  } else if(state.page === 'latest') {
    showLatestJobs(false);
  } else if(state.page === 'results') {
    showResults(false);
  } else if(state.page === 'result-detail' && state.resultId) {
    showResultDetail(state.resultId, false);
  } else if(state.page === 'admitcard') {
    showAdmitCards(false);
  } else if(state.page === 'admitcard-detail' && state.cardId) {
    showAdmitCardDetail(state.cardId, false);
  } else if(state.page === 'blog') {
    showBlogPage(false);
  } else if(state.page === 'blog-detail' && state.blogId) {
    showBlogDetail(state.blogId, false);
  } else if(state.page === 'tool' && state.tool) {
    showTool(state.tool, false);
  } else if(state.page === 'about') {
    showAboutUs(false);
  } else if(state.page === 'privacy') {
    showPrivacyPolicy(false);
  } else if(state.page === 'contact') {
    showContact(false);
  } else if(state.page === 'disclaimer') {
    showDisclaimer(false);
  } else if(state.page === 'coming-soon') {
    showComingSoon(state.name || '');
  } else {
    showHome(false);
  }
});

// ===== INIT =====
(async function init() {
  try {
  // Check if user landed on a direct URL (e.g. /mr/job-slug, /job/slug, /latest-jobs, /results, /result/slug-id, /admit-card, /admit-card/slug-id)
  const rawPath = window.location.pathname || '/';
  const normalizedPath = (rawPath.replace(/\/+$/, '') || '/').toLowerCase();
  const adminAliases = new Set([
    '/admin_panel',
    '/admin_pannel',
    '/admin_pannle',
    '/admin-panel',
    '/adminpanel',
    '/admin'
  ]);

  if(adminAliases.has(normalizedPath)) {
    window.location.replace('/admin_panel.html');
    return;
  }

  const path = rawPath;

  // Direct route handling: do not render homepage first on standalone pages.
  // This prevents About/Contact/Privacy/Disclaimer and thin category pages from being mixed with homepage job cards.
  const earlyResultDetailMatch = path.match(/^\/result\/.*-(\d+)$/);
  const earlyAdmitDetailMatch = path.match(/^\/admit-card\/.*-(\d+)$/);
  const earlyToolMatch = path.match(/^\/tools\/(age|qualification|photo-resizer)$/);
  const earlyRoutes = {
    '/latest-jobs': async () => showLatestJobs(false),
    '/results': async () => showResults(false),
    '/admit-card': async () => showAdmitCards(false),
    '/blog': async () => showBlogPage(false),
    '/about': async () => showAboutUs(false),
    '/privacy': async () => showPrivacyPolicy(false),
    '/contact': async () => showContact(false),
    '/disclaimer': async () => showDisclaimer(false)
  };
  if (earlyRoutes[path]) {
    const pageStateMap = { '/latest-jobs': 'latest', '/admit-card': 'admitcard', '/results': 'results', '/blog': 'blog', '/about': 'about', '/privacy': 'privacy', '/contact': 'contact', '/disclaimer': 'disclaimer' };
    history.replaceState({ page: pageStateMap[path] || 'home' }, document.title || 'NaukriKhoj.in', path || '/');
    await earlyRoutes[path]();
    return;
  }
  if (path.startsWith('/blog/')) {
    const bId = 'blog_' + path.replace('/blog/', '');
    history.replaceState({ page: 'blog-detail', blogId: bId }, document.title || 'NaukriKhoj.in', path || '/');
    await showBlogDetail(bId, false);
    return;
  }
  if (earlyResultDetailMatch) {
    const resultId = 'result_' + earlyResultDetailMatch[1];
    history.replaceState({ page: 'result-detail', resultId }, document.title || 'NaukriKhoj.in', path || '/');
    await showResultDetail(resultId, false);
    return;
  }
  if (earlyAdmitDetailMatch) {
    const cardId = 'ac_' + earlyAdmitDetailMatch[1];
    history.replaceState({ page: 'admitcard-detail', cardId }, document.title || 'NaukriKhoj.in', path || '/');
    await showAdmitCardDetail(cardId, false);
    return;
  }
  if (earlyToolMatch) {
    history.replaceState({ page: 'tool', tool: earlyToolMatch[1] }, document.title || 'NaukriKhoj.in', path || '/');
    showTool(earlyToolMatch[1], false);
    return;
  }

  // ── STEP 1: localStorage cache check ──────────────────────────────────────
  // Agar cache mein jobs hain toh TURANT render karo (zero flicker/jump)
  // Nahi hain toh shimmer skeleton dikhao jab tak Firebase se data aaye
  const cachedJobs = (() => {
    try {
      const parsed = JSON.parse(localStorage.getItem('nkj_jobs') || 'null');
      const arr = Array.isArray(parsed) ? parsed
        : (parsed && typeof parsed === 'object' ? Object.values(parsed) : []);
      return arr.filter(j => j && (j.status === 'live' || j.status === 'expired'));
    } catch { return []; }
  })();

  // Static SEO cards hata do — real render shuru hone wala hai
  const staticSeoJobs = document.getElementById('static-seo-jobs');
  if (staticSeoJobs) staticSeoJobs.remove();

  if (cachedJobs.length > 0) {
    // Cache available — turant render karo, user ko koi jump/flicker nahi dikhega
    renderJobs(cachedJobs);
    renderTicker(cachedJobs);
    renderClosing(cachedJobs);
    updateCounts();
    buildQualDropdown();
  } else {
    // Pehli baar — cache nahi hai, shimmer skeleton dikhao
    showJobShimmer(6);
  }

  // ── STEP 2: Firebase se fresh data fetch karo (background mein) ───────────
  // Cache tha toh bhi Firebase se fresh data fetch karo — quietly update karo
  try { await fetchJobsFromBlob(); } catch(e) { console.warn('Firebase fetch failed:', e); }
  const jobs = getJobs();

  // Firebase data aane ke baad render karo
  // (cache se same hoga toh UI same rahega, naya data hoga toh smoothly update hoga)
  if(!jobs.length) {
    // Firebase se bhi kuch nahi aaya — friendly message dikhao
    const list = document.getElementById('jobs-list');
    if(list) list.innerHTML = `
      <div style="text-align:center;padding:60px 20px;background:#fff;border-radius:16px;border:1.5px solid #E2E8F4;margin:20px 0;">
        <div style="font-size:3rem;margin-bottom:16px;">🔄</div>
        <div style="font-family:'Rajdhani',sans-serif;font-size:1.4rem;font-weight:700;color:#0B1F3A;margin-bottom:10px;">Jobs load ho rahi hain...</div>
        <div style="color:#64748b;font-size:0.92rem;margin-bottom:24px;line-height:1.7;">Server se data fetch ho raha hai.<br>Internet slow hai toh thoda wait karo ya reload karo.</div>
        <button onclick="window.location.reload()" style="background:linear-gradient(135deg,#E8470A,#FF6B2B);color:#fff;border:none;padding:12px 32px;border-radius:10px;font-size:0.95rem;font-weight:700;cursor:pointer;font-family:'DM Sans',sans-serif;box-shadow:0 4px 14px rgba(232,71,10,0.3);">🔄 Reload Karo</button>
      </div>`;
  } else {
    renderJobs(jobs);
  }
  renderTicker(jobs);
  renderClosing(jobs);
  updateCounts();
  buildQualDropdown();
  setTimeout(initPopupListener, 0);

  // Handle direct URL navigation
  const mrMatch = path.match(/^\/mr\/(.+?)(?:-(\d+))?\/?$/);
  const jobMatch = path.match(/^\/job\/(.+?)(?:-(\d+))?\/?$/);
  const resultDetailMatch = path.match(/^\/result\/.*-(\d+)$/);
  const admitDetailMatch = path.match(/^\/admit-card\/.*-(\d+)$/);
  const toolMatch = path.match(/^\/tools\/(age|qualification|photo-resizer)$/);

  let initialState = { page: 'home' };
  if(path === '/latest-jobs') initialState = { page: 'latest' };
  else if(path === '/results') initialState = { page: 'results' };
  else if(path === '/admit-card') initialState = { page: 'admitcard' };
  else if(path === '/blog') initialState = { page: 'blog' };
  else if(path === '/about') initialState = { page: 'about' };
  else if(path === '/privacy') initialState = { page: 'privacy' };
  else if(path === '/contact') initialState = { page: 'contact' };
  else if(path === '/disclaimer') initialState = { page: 'disclaimer' };
  else if(path.startsWith('/blog/')) { const bId = 'blog_' + path.replace('/blog/', ''); initialState = { page: 'blog-detail', blogId: bId }; }
  else if(resultDetailMatch) initialState = { page: 'result-detail', resultId: 'result_' + resultDetailMatch[1] };
  else if(admitDetailMatch) initialState = { page: 'admitcard-detail', cardId: 'ac_' + admitDetailMatch[1] };
  else if(toolMatch) initialState = { page: 'tool', tool: toolMatch[1] };
  else if(mrMatch) {
    const jobs = getJobs();
    const mrId = mrMatch[2] ? `job_${mrMatch[2]}` : null;
    const mrSlug = (mrMatch[1] || '').toLowerCase().replace(/^-|-$/g,'');
    const matched = mrId ? jobs.find(j => j.id === mrId) : jobs.find(j => {
      const t = typeof j.title === 'object' ? j.title.en : j.title;
      const s = String(t || j.id || '').toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'').substring(0,60);
      return s === mrSlug;
    });
    if(matched) initialState = { page: 'marathi', jobId: matched.id };
  }
  else if(jobMatch) {
    const jobs = getJobs();
    const jobId = jobMatch[2] ? `job_${jobMatch[2]}` : null;
    const jobSlug = (jobMatch[1] || '').toLowerCase().replace(/^-|-$/g,'');
    const matched = jobId ? jobs.find(j => j.id === jobId) : jobs.find(j => {
      const t = typeof j.title === 'object' ? j.title.en : j.title;
      const s = String(t || j.id || '').toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'').substring(0,60);
      return s === jobSlug;
    });
    if(matched) initialState = { page: 'detail', jobId: matched.id };
  }

  history.replaceState(initialState, document.title || 'NaukriKhoj.in', path || '/');

  if(initialState.page === 'marathi' && initialState.jobId) {
    await showMarathiPage(initialState.jobId, false);
    return;
  } else if(initialState.page === 'detail' && initialState.jobId) {
    showDetail(initialState.jobId, false);
    return;
  } else if(resultDetailMatch) {
    const resultId = 'result_' + resultDetailMatch[1];
    await showResultDetail(resultId, false);
    return;
  } else if(admitDetailMatch) {
    const cardId = 'ac_' + admitDetailMatch[1];
    await showAdmitCardDetail(cardId, false);
    return;
  } else if(toolMatch) {
    showTool(toolMatch[1], false);
    return;
  } else if(path === '/latest-jobs') {
    await showLatestJobs(false);
    return;
  } else if(path === '/results') {
    await showResults(false);
    return;
  } else if(path === '/admit-card') {
    await showAdmitCards(false);
    return;
  } else if(path === '/blog') {
    await showBlogPage(false);
    return;
  } else if(path.startsWith('/blog/')) {
    const bId = 'blog_' + path.replace('/blog/', '');
    await showBlogDetail(bId, false);
    return;
  } else if(path === '/about') {
    showAboutUs(false);
    return;
  } else if(path === '/privacy') {
    showPrivacyPolicy(false);
    return;
  } else if(path === '/contact') {
    showContact(false);
    return;
  } else if(path === '/disclaimer') {
    showDisclaimer(false);
    return;
  }

  showHome(false);
  } catch(initErr) {
    // Koi bhi JS error aaye — white screen ki jagah home page dikhao
    console.error('NaukriKhoj init error:', initErr);
    try {
      // Shimmer hata do, home page force show karo
      const staticSeoJobs = document.getElementById('static-seo-jobs');
      if (staticSeoJobs) staticSeoJobs.remove();
      const list = document.getElementById('jobs-list');
      if (list) list.innerHTML = `
        <div style="text-align:center;padding:60px 20px;background:#fff;border-radius:16px;border:1.5px solid #E2E8F4;margin:20px 0;">
          <div style="font-size:3rem;margin-bottom:16px;">⚠️</div>
          <div style="font-family:'Rajdhani',sans-serif;font-size:1.4rem;font-weight:700;color:#0B1F3A;margin-bottom:10px;">Jobs load nahi hui</div>
          <div style="color:#64748b;font-size:0.92rem;margin-bottom:24px;line-height:1.7;">Internet check karo aur page reload karo.<br>Agar problem rahe toh thodi der baad try karo.</div>
          <button onclick="window.location.reload()" style="background:linear-gradient(135deg,#E8470A,#FF6B2B);color:#fff;border:none;padding:12px 32px;border-radius:10px;font-size:0.95rem;font-weight:700;cursor:pointer;font-family:'DM Sans',sans-serif;box-shadow:0 4px 14px rgba(232,71,10,0.3);">🔄 Reload Karo</button>
        </div>`;
      document.getElementById('home-page').style.display = 'block';
    } catch(e) {}
  }
})();
</script>
<!-- Alert popup disabled during AdSense review to avoid intrusive UX signals. -->

<script>
// ===== CATEGORY SVG ICON SYSTEM =====
// Har category ke liye ek beautiful SVG icon with color theme

const CAT_ICONS = {
  'Railway': {
    color: '#E8470A',
    bg: 'linear-gradient(135deg,#fff5f0,#ffe8dc)',
    border: 'rgba(232,71,10,0.2)',
    svg: `<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
      <!-- Train body -->
      <rect x="6" y="14" width="36" height="22" rx="6" fill="#E8470A"/>
      <rect x="6" y="14" width="36" height="10" rx="6" fill="#c73d08"/>
      <!-- Windows -->
      <rect x="10" y="16" width="8" height="6" rx="2" fill="#fff" opacity="0.9"/>
      <rect x="21" y="16" width="8" height="6" rx="2" fill="#fff" opacity="0.9"/>
      <rect x="32" y="16" width="8" height="6" rx="2" fill="#fff" opacity="0.9"/>
      <!-- Door -->
      <rect x="20" y="25" width="8" height="10" rx="2" fill="rgba(255,255,255,0.25)"/>
      <!-- Wheels -->
      <circle cx="14" cy="38" r="4" fill="#1a1a2e"/>
      <circle cx="14" cy="38" r="2" fill="#E8470A"/>
      <circle cx="34" cy="38" r="4" fill="#1a1a2e"/>
      <circle cx="34" cy="38" r="2" fill="#E8470A"/>
      <!-- Rails -->
      <line x1="2" y1="42" x2="46" y2="42" stroke="#94a3b8" stroke-width="1.5" stroke-linecap="round"/>
      <line x1="2" y1="44" x2="46" y2="44" stroke="#94a3b8" stroke-width="1.5" stroke-linecap="round"/>
      <!-- Steam -->
      <path d="M26 8 Q27 5 25 3" stroke="#E8470A" stroke-width="2" stroke-linecap="round" fill="none" opacity="0.6"/>
      <path d="M30 10 Q32 6 30 3" stroke="#E8470A" stroke-width="2" stroke-linecap="round" fill="none" opacity="0.5"/>
    </svg>`
  },
  'Bank': {
    color: '#1d4ed8',
    bg: 'linear-gradient(135deg,#eff6ff,#dbeafe)',
    border: 'rgba(29,78,216,0.2)',
    svg: `<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
      <!-- Base -->
      <rect x="4" y="40" width="40" height="4" rx="2" fill="#1e3a8a"/>
      <!-- Steps -->
      <rect x="7" y="36" width="34" height="5" rx="1.5" fill="#1d4ed8"/>
      <!-- Columns -->
      <rect x="10" y="18" width="4" height="18" rx="1.5" fill="#3b82f6"/>
      <rect x="17" y="18" width="4" height="18" rx="1.5" fill="#3b82f6"/>
      <rect x="24" y="18" width="4" height="18" rx="1.5" fill="#3b82f6"/>
      <rect x="31" y="18" width="4" height="18" rx="1.5" fill="#3b82f6"/>
      <!-- Roof -->
      <path d="M4 18 L24 6 L44 18 Z" fill="#1e3a8a"/>
      <!-- Roof highlight -->
      <path d="M9 18 L24 9 L39 18 Z" fill="#2563eb"/>
      <!-- Top ornament -->
      <circle cx="24" cy="6" r="2.5" fill="#fbbf24"/>
      <!-- Coin symbol -->
      <circle cx="24" cy="28" r="5" fill="#fbbf24" opacity="0.9"/>
      <text x="24" y="31.5" text-anchor="middle" font-size="7" font-weight="bold" fill="#1e3a8a">₹</text>
    </svg>`
  },
  'Police': {
    color: '#15803d',
    bg: 'linear-gradient(135deg,#f0fdf4,#dcfce7)',
    border: 'rgba(21,128,61,0.2)',
    svg: `<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
      <!-- Shield body -->
      <path d="M24 4 L40 10 L40 26 Q40 36 24 44 Q8 36 8 26 L8 10 Z" fill="#15803d"/>
      <!-- Shield inner -->
      <path d="M24 8 L37 13 L37 26 Q37 34 24 41 Q11 34 11 26 L11 13 Z" fill="#16a34a"/>
      <!-- Star badge -->
      <polygon points="24,14 25.8,19.5 31.5,19.5 27,23 28.8,28.5 24,25 19.2,28.5 21,23 16.5,19.5 22.2,19.5" fill="#fbbf24"/>
      <!-- Star center -->
      <circle cx="24" cy="22" r="2.5" fill="#fff" opacity="0.9"/>
    </svg>`
  },
  'SSC': {
    color: '#7c3aed',
    bg: 'linear-gradient(135deg,#faf5ff,#ede9fe)',
    border: 'rgba(124,58,237,0.2)',
    svg: `<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
      <!-- Document -->
      <rect x="8" y="4" width="28" height="36" rx="4" fill="#7c3aed"/>
      <!-- Folded corner -->
      <path d="M30 4 L36 10 L30 10 Z" fill="#5b21b6"/>
      <rect x="30" y="4" width="6" height="6" rx="0" fill="#6d28d9"/>
      <!-- Lines -->
      <rect x="13" y="16" width="16" height="2" rx="1" fill="rgba(255,255,255,0.7)"/>
      <rect x="13" y="21" width="13" height="2" rx="1" fill="rgba(255,255,255,0.5)"/>
      <rect x="13" y="26" width="16" height="2" rx="1" fill="rgba(255,255,255,0.5)"/>
      <rect x="13" y="31" width="10" height="2" rx="1" fill="rgba(255,255,255,0.35)"/>
      <!-- Stamp circle -->
      <circle cx="35" cy="36" r="9" fill="#fbbf24"/>
      <path d="M30 36 L33 39 L40 32" stroke="#1e3a8a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
    </svg>`
  },
  'State': {
    color: '#0B1F3A',
    bg: 'linear-gradient(135deg,#f8faff,#e8edf8)',
    border: 'rgba(11,31,58,0.2)',
    svg: `<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
      <!-- Base building -->
      <rect x="6" y="28" width="36" height="16" rx="3" fill="#0B1F3A"/>
      <!-- Main dome/tower -->
      <rect x="18" y="18" width="12" height="14" rx="2" fill="#1e3a8a"/>
      <!-- Dome -->
      <path d="M14 20 Q24 8 34 20 Z" fill="#0B1F3A"/>
      <ellipse cx="24" cy="20" rx="10" ry="3" fill="#2563eb"/>
      <!-- Flag pole -->
      <line x1="24" y1="8" x2="24" y2="4" stroke="#fbbf24" stroke-width="1.5"/>
      <!-- Flag -->
      <path d="M24 4 L31 6 L24 8 Z" fill="#E8470A"/>
      <!-- Windows -->
      <rect x="20" y="21" width="4" height="5" rx="1" fill="#fbbf24" opacity="0.8"/>
      <!-- Side windows -->
      <rect x="9" y="31" width="5" height="7" rx="1" fill="rgba(255,255,255,0.2)"/>
      <rect x="17" y="31" width="5" height="7" rx="1" fill="rgba(255,255,255,0.2)"/>
      <rect x="26" y="31" width="5" height="7" rx="1" fill="rgba(255,255,255,0.2)"/>
      <rect x="34" y="31" width="5" height="7" rx="1" fill="rgba(255,255,255,0.2)"/>
    </svg>`
  },
  'Teaching': {
    color: '#0369a1',
    bg: 'linear-gradient(135deg,#f0f9ff,#e0f2fe)',
    border: 'rgba(3,105,161,0.2)',
    svg: `<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
      <!-- Blackboard -->
      <rect x="4" y="8" width="40" height="26" rx="3" fill="#0c4a6e"/>
      <!-- Board surface -->
      <rect x="7" y="11" width="34" height="20" rx="2" fill="#075985"/>
      <!-- Chalk lines -->
      <text x="12" y="23" font-size="10" fill="rgba(255,255,255,0.9)" font-family="monospace">A B C</text>
      <line x1="12" y1="27" x2="27" y2="27" stroke="rgba(255,255,255,0.4)" stroke-width="1.5" stroke-linecap="round"/>
      <!-- Tray -->
      <rect x="4" y="34" width="40" height="4" rx="1.5" fill="#1e3a8a"/>
      <!-- Chalk pieces -->
      <rect x="10" y="35" width="6" height="2" rx="1" fill="#fff" opacity="0.9"/>
      <rect x="20" y="35" width="4" height="2" rx="1" fill="#fbbf24" opacity="0.9"/>
      <!-- Book -->
      <rect x="14" y="40" width="20" height="6" rx="2" fill="#0369a1"/>
      <line x1="24" y1="40" x2="24" y2="46" stroke="#bae6fd" stroke-width="1"/>
      <!-- Graduation cap -->
      <polygon points="24,6 32,9 24,12 16,9" fill="#0369a1"/>
      <rect x="29" y="9" width="1.5" height="5" fill="#0369a1"/>
      <circle cx="29.75" cy="14" r="2" fill="#fbbf24"/>
    </svg>`
  },
  'Medical': {
    color: '#dc2626',
    bg: 'linear-gradient(135deg,#fff5f5,#fee2e2)',
    border: 'rgba(220,38,38,0.2)',
    svg: `<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
      <!-- Hospital building -->
      <rect x="8" y="16" width="32" height="28" rx="4" fill="#dc2626"/>
      <rect x="8" y="16" width="32" height="10" rx="4" fill="#b91c1c"/>
      <!-- Red cross on building -->
      <rect x="20" y="10" width="8" height="24" rx="2" fill="#fff"/>
      <rect x="12" y="18" width="24" height="8" rx="2" fill="#fff"/>
      <!-- Inner cross -->
      <rect x="21.5" y="11.5" width="5" height="21" rx="1" fill="#dc2626"/>
      <rect x="13.5" y="19.5" width="21" height="5" rx="1" fill="#dc2626"/>
      <!-- Door -->
      <rect x="20" y="34" width="8" height="10" rx="1.5" fill="rgba(255,255,255,0.3)"/>
      <!-- Windows -->
      <rect x="10" y="30" width="5" height="5" rx="1" fill="rgba(255,255,255,0.4)"/>
      <rect x="33" y="30" width="5" height="5" rx="1" fill="rgba(255,255,255,0.4)"/>
    </svg>`
  },
  'Defence': {
    color: '#92400e',
    bg: 'linear-gradient(135deg,#fffbeb,#fef3c7)',
    border: 'rgba(146,64,14,0.2)',
    svg: `<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
      <!-- Military Shield -->
      <path d="M24 3 L41 9 L41 27 Q41 38 24 45 Q7 38 7 27 L7 9 Z" fill="#78350f"/>
      <!-- Shield inner layer -->
      <path d="M24 7 L38 12 L38 27 Q38 36 24 42 Q10 36 10 27 L10 12 Z" fill="#92400e"/>
      <!-- Shield shine -->
      <path d="M24 7 L38 12 L38 19 Q31 16 24 15 Q17 16 10 19 L10 12 Z" fill="#b45309" opacity="0.5"/>
      <!-- Ashoka Chakra (Indian Army inspired) -->
      <circle cx="24" cy="25" r="9" fill="none" stroke="#fbbf24" stroke-width="1.5" opacity="0.9"/>
      <circle cx="24" cy="25" r="3" fill="#fbbf24" opacity="0.9"/>
      <!-- Chakra spokes -->
      <line x1="24" y1="16" x2="24" y2="18" stroke="#fbbf24" stroke-width="1.2" opacity="0.85"/>
      <line x1="24" y1="32" x2="24" y2="34" stroke="#fbbf24" stroke-width="1.2" opacity="0.85"/>
      <line x1="15" y1="25" x2="17" y2="25" stroke="#fbbf24" stroke-width="1.2" opacity="0.85"/>
      <line x1="31" y1="25" x2="33" y2="25" stroke="#fbbf24" stroke-width="1.2" opacity="0.85"/>
      <line x1="17.4" y1="18.4" x2="18.8" y2="19.8" stroke="#fbbf24" stroke-width="1.2" opacity="0.7"/>
      <line x1="29.2" y1="30.2" x2="30.6" y2="31.6" stroke="#fbbf24" stroke-width="1.2" opacity="0.7"/>
      <line x1="30.6" y1="18.4" x2="29.2" y2="19.8" stroke="#fbbf24" stroke-width="1.2" opacity="0.7"/>
      <line x1="18.8" y1="30.2" x2="17.4" y2="31.6" stroke="#fbbf24" stroke-width="1.2" opacity="0.7"/>
      <!-- Stars on top corners -->
      <polygon points="13,8 13.9,10.7 16.7,10.7 14.5,12.4 15.3,15 13,13.3 10.7,15 11.5,12.4 9.3,10.7 12.1,10.7" fill="#fbbf24" opacity="0.9"/>
      <polygon points="35,8 35.9,10.7 38.7,10.7 36.5,12.4 37.3,15 35,13.3 32.7,15 33.5,12.4 31.3,10.7 34.1,10.7" fill="#fbbf24" opacity="0.9"/>
    </svg>`
  },
  'MPSC': {
    color: '#0f766e',
    bg: 'linear-gradient(135deg,#f0fdfa,#ccfbf1)',
    border: 'rgba(15,118,110,0.2)',
    svg: `<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
      <!-- Maharashtra map silhouette simplified -->
      <path d="M8 20 Q12 12 20 10 Q28 8 36 14 Q42 18 40 26 Q38 34 30 38 Q22 42 14 36 Q6 30 8 20 Z" fill="#0f766e"/>
      <path d="M10 21 Q14 14 21 12 Q29 10 36 16 Q41 20 39 27 Q37 34 30 37 Q23 40 16 35 Q8 30 10 21 Z" fill="#0d9488"/>
      <!-- Star of Maharashtra - Ashoka Chakra simplified -->
      <circle cx="24" cy="25" r="7" fill="rgba(255,255,255,0.15)"/>
      <circle cx="24" cy="25" r="5" fill="none" stroke="#fff" stroke-width="1.5" opacity="0.8"/>
      <circle cx="24" cy="25" r="2" fill="#fff" opacity="0.9"/>
      <!-- Spokes -->
      <line x1="24" y1="19" x2="24" y2="20.5" stroke="#fff" stroke-width="1" opacity="0.7"/>
      <line x1="24" y1="29.5" x2="24" y2="31" stroke="#fff" stroke-width="1" opacity="0.7"/>
      <line x1="18" y1="25" x2="19.5" y2="25" stroke="#fff" stroke-width="1" opacity="0.7"/>
      <line x1="28.5" y1="25" x2="30" y2="25" stroke="#fff" stroke-width="1" opacity="0.7"/>
      <!-- MH text -->
      <text x="24" y="11" text-anchor="middle" font-size="6" font-weight="bold" fill="#fbbf24" font-family="Arial">MH</text>
    </svg>`
  },
  'default': {
    color: '#475569',
    bg: 'linear-gradient(135deg,#f8fafc,#f1f5f9)',
    border: 'rgba(71,85,105,0.2)',
    svg: `<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
      <!-- Briefcase -->
      <rect x="6" y="18" width="36" height="26" rx="5" fill="#475569"/>
      <rect x="6" y="18" width="36" height="12" rx="5" fill="#334155"/>
      <!-- Handle -->
      <path d="M16 18 L16 14 Q16 10 24 10 Q32 10 32 14 L32 18" stroke="#94a3b8" stroke-width="3" stroke-linecap="round" fill="none"/>
      <!-- Clasp -->
      <rect x="19" y="26" width="10" height="7" rx="2" fill="#64748b"/>
      <rect x="21" y="28" width="6" height="3" rx="1" fill="#fbbf24"/>
      <!-- Lines -->
      <line x1="6" y1="30" x2="42" y2="30" stroke="rgba(255,255,255,0.1)" stroke-width="1"/>
    </svg>`
  }
};

function getCatIcon(category) {
  if (!category) return CAT_ICONS.default;
  const cat = category.toString().toLowerCase();
  if (cat.includes('railway') || cat.includes('rail')) return CAT_ICONS.Railway;
  if (cat.includes('bank') || cat.includes('finance')) return CAT_ICONS.Bank;
  if (cat.includes('defence') || cat.includes('defense') || cat.includes('navy') || cat.includes('air force') || cat.includes('airforce') || cat.includes('coast guard') || cat.includes('army')) return CAT_ICONS.Defence;
  if (cat.includes('police') || cat.includes('military') || cat.includes('paramilitary')) return CAT_ICONS.Police;
  if (cat.includes('ssc') || cat.includes('upsc') || cat.includes('civil')) return CAT_ICONS.SSC;
  if (cat.includes('state') || cat.includes('government') || cat.includes('zilla') || cat.includes('nagar') || cat.includes('panchayat')) return CAT_ICONS.State;
  if (cat.includes('teach') || cat.includes('education') || cat.includes('school') || cat.includes('college')) return CAT_ICONS.Teaching;
  if (cat.includes('medical') || cat.includes('health') || cat.includes('nurse') || cat.includes('doctor') || cat.includes('hospital')) return CAT_ICONS.Medical;
  if (cat.includes('mpsc') || cat.includes('maharashtra')) return CAT_ICONS.MPSC;
  return CAT_ICONS.default;
}

// ===== UPGRADE CATEGORY CARDS WITH SVG ICONS =====
function upgradeCategoryCards() {
  const ccardIcons = document.querySelectorAll('.ccard-ico');
  ccardIcons.forEach(el => {
    const card = el.closest('.ccard');
    if (!card) return;
    const label = card.querySelector('.ccard-label');
    const catName = label ? label.textContent.trim() : '';
    const iconData = getCatIcon(catName);
    el.innerHTML = iconData.svg;
    el.style.fontSize = 'inherit';
    el.style.width = '56px';
    el.style.height = '56px';
    el.style.display = 'flex';
    el.style.alignItems = 'center';
    el.style.justifyContent = 'center';
    el.style.margin = '0 auto 12px';
    el.style.borderRadius = '16px';
    el.style.padding = '10px';
    el.style.background = iconData.bg;
    el.style.border = '1.5px solid ' + iconData.border;
    el.style.boxShadow = '0 4px 14px ' + iconData.border;
    card.style.transition = 'all 0.28s cubic-bezier(0.4,0,0.2,1)';
  });
}

// ===== UPGRADE JOB CARD DEPT-ICO WITH SVG =====
// MutationObserver se jobs-list monitor karo — render hone ke baad icons upgrade karo
function upgradeJobCardIcons() {
  document.querySelectorAll('.jcard').forEach(card => {
    const deptIco = card.querySelector('.dept-ico');
    if (!deptIco || deptIco.dataset.upgraded) return;
    const tagEl = card.querySelector('.jc-tags .tag');
    const catName = tagEl ? tagEl.textContent.trim() : '';
    const iconData = getCatIcon(catName);
    deptIco.innerHTML = iconData.svg;
    deptIco.style.background = iconData.bg;
    deptIco.style.border = '1.5px solid ' + iconData.border;
    deptIco.style.boxShadow = '0 3px 10px ' + iconData.border;
    deptIco.style.borderRadius = '12px';
    deptIco.style.padding = '8px';
    deptIco.dataset.upgraded = '1';
  });
}

// ===== LATEST JOB TICKER ICON UPGRADE =====
function upgradeLatestJobIcons() {
  document.querySelectorAll('.lj-icon').forEach(el => {
    if (el.dataset.upgraded) return;
    const row = el.closest('.lj-row');
    if (!row) return;
    const titleEl = row.querySelector('.lj-title');
    const catEl = row.querySelector('.lj-cat');
    const catName = catEl ? catEl.textContent.trim() : (titleEl ? titleEl.textContent.trim() : '');
    const iconData = getCatIcon(catName);
    el.innerHTML = `<div style="width:32px;height:32px;border-radius:9px;padding:5px;background:${iconData.bg};border:1px solid ${iconData.border};display:flex;align-items:center;justify-content:center;">${iconData.svg}</div>`;
    el.style.fontSize = 'inherit';
    el.dataset.upgraded = '1';
  });
}

// Run on load and after data loads
document.addEventListener('DOMContentLoaded', () => {
  upgradeCategoryCards();
  // MutationObserver: jab bhi jobs-list mein changes aayein, icons upgrade karo
  const jobsList = document.getElementById('jobs-list');
  if (jobsList) {
    const _jobsObs = new MutationObserver(() => {
      setTimeout(upgradeJobCardIcons, 100);
    });
    _jobsObs.observe(jobsList, { childList: true, subtree: true });
  }
  // Latest job ticker icons
  const ticker = document.getElementById('lj-items');
  if (ticker) {
    const _tickerObs = new MutationObserver(() => {
      upgradeLatestJobIcons();
    });
    _tickerObs.observe(ticker, { childList: true, subtree: true });
  }
  // Upgrade cat cards again after any re-render
  setTimeout(upgradeCategoryCards, 1500);
  setTimeout(upgradeJobCardIcons, 2500);
  setTimeout(upgradeLatestJobIcons, 2000);
});
</script>

<!-- ── QUALIFICATION FILTER POPUP MODAL ── -->
<div id="qual-popup-overlay" role="dialog" aria-modal="true" aria-labelledby="qual-popup-title" onclick="closeQualPopup(event)">
  <div id="qual-popup-box">
    <div id="qual-popup-header">
      <div>
        <div id="qual-popup-title">🎓 Matching Jobs</div>
        <div id="qual-popup-subtitle">Qualification ke hisaab se filtered results</div>
      </div>
      <button id="qual-popup-close" onclick="closeQualPopupDirect()" title="Close" aria-label="Close popup">✕</button>
    </div>
    <div id="qual-popup-body">
      <!-- Filled by JS -->
    </div>
    <div id="qual-popup-footer">
      <span>Sabhi jobs dekhne ke liye scroll karo · Click on any job to view details</span>
    </div>
  </div>
</div>

<!-- ── GO TO TOP BUTTON ── -->
<button id="go-top-btn" onclick="window.scrollTo({top:0,behavior:'smooth'})" title="Go to Top" aria-label="Go to top">
  ↑
</button>

<script>
// ── GO TO TOP — scroll visibility ──
(function(){
  var btn = document.getElementById('go-top-btn');
  if(!btn) return;
  window.addEventListener('scroll', function(){
    if(window.scrollY > 300) btn.classList.add('visible');
    else btn.classList.remove('visible');
  }, {passive:true});
})();

// ── QUALIFICATION POPUP FUNCTIONS ──
function openQualPopup(level) {
  if(!level) return;

  var QUAL_LABELS = {
    '10th':'10th Pass','12th':'12th Pass','iti':'ITI','diploma':'Diploma',
    'graduate':'Graduation (BA/B.Com/BCA/Any Degree)','engineering':'Engineering (BE/B.Tech)',
    'postgraduate':'Post Graduate (MA/MBA/MSc)','law':'Law (LLB/LLM)',
    'medical':'Medical (MBBS/Nursing/Pharmacy)'
  };

  var jobs = typeof getJobs === 'function' ? getJobs().filter(function(j){return j.status==='live';}) : [];
  var matched = typeof sortJobsByDeadlineThenNew === 'function'
    ? sortJobsByDeadlineThenNew(jobs.filter(function(j){return typeof jobMatchesQualification==='function'?jobMatchesQualification(j,level):false;}))
    : [];

  var title = document.getElementById('qual-popup-title');
  var subtitle = document.getElementById('qual-popup-subtitle');
  var body = document.getElementById('qual-popup-body');
  var footer = document.getElementById('qual-popup-footer');

  if(title) title.textContent = '🎓 ' + (QUAL_LABELS[level]||level) + ' Jobs';
  if(subtitle) subtitle.textContent = matched.length + ' matching jobs found in live vacancies';
  if(footer) footer.querySelector('span').textContent = matched.length + ' jobs • Click karo details dekhne ke liye';

  if(body) {
    if(!matched.length) {
      body.innerHTML = '<div class="qpop-empty"><div>🔎</div><div style="font-weight:700;color:var(--navy);margin-bottom:6px;">Abhi direct match nahi mila</div><div style="font-size:0.85rem;line-height:1.7;">Dusri qualification try karo ya home pe saari jobs dekho.</div></div>';
    } else {
      body.innerHTML = matched.map(function(job){
        var title2 = typeof job.title==='object'?job.title.en:job.title;
        var org = typeof job.org==='object'?job.org.en:(job.org||'');
        var location = typeof job.location==='object'?job.location.en:(job.location||'All India');
        var lastDate = typeof job.lastDate==='object'?job.lastDate.en:(job.lastDate||'');
        return '<div class="qpop-job-card" onclick="closeQualPopupDirect();showDetail(\''+job.id+'\')">'+
          '<div class="qpop-title">'+title2+'</div>'+
          '<div class="qpop-meta">'+(org?org+' · ':'')+location+'</div>'+
          '<div class="qpop-tags">'+
            (job.category?'<span class="qpop-tag">'+job.category+'</span>':'')+
            (job.vacancies?'<span class="qpop-tag posts">👥 '+job.vacancies+' Posts</span>':'')+
            (lastDate?'<span class="qpop-tag last-date">📅 Last Date: '+lastDate+'</span>':'')+
          '</div>'+
          '<button class="qpop-view-btn">View Details →</button>'+
        '</div>';
      }).join('');
    }
  }

  var overlay = document.getElementById('qual-popup-overlay');
  if(overlay) {
    overlay.classList.add('open');
    document.body.style.overflow = 'hidden';
    // scroll body to top
    if(body) body.scrollTop = 0;
  }
}

function closeQualPopup(e) {
  // Only close if clicked on the overlay itself (not the box)
  if(e && e.target !== document.getElementById('qual-popup-overlay')) return;
  closeQualPopupDirect();
}

function closeQualPopupDirect() {
  var overlay = document.getElementById('qual-popup-overlay');
  if(overlay) overlay.classList.remove('open');
  document.body.style.overflow = '';
}

// Close on Escape key
document.addEventListener('keydown', function(e){
  if(e.key === 'Escape') closeQualPopupDirect();
});

// ── OVERRIDE sidebar + mobile qual filter to open popup ──
// Wrap original functions to show popup instead of inline results
var _origSidebarQualFilter = window.sidebarQualFilter;
window.sidebarQualFilter = function() {
  var level = document.getElementById('sidebar-qual-select')?.value;
  if(!level) {
    var out = document.getElementById('sidebar-qual-results');
    if(out) out.innerHTML = '';
    return;
  }
  openQualPopup(level);
  // Reset dropdown after short delay for UX
  setTimeout(function(){
    var sel = document.getElementById('sidebar-qual-select');
    if(sel) sel.value = '';
  }, 200);
};

var _origMobileSidebarQualFilter = window.mobileSidebarQualFilter;
window.mobileSidebarQualFilter = function() {
  var level = document.getElementById('mobile-qual-select')?.value;
  if(!level) {
    var out = document.getElementById('mobile-qual-results');
    if(out) out.innerHTML = '';
    return;
  }
  openQualPopup(level);
  setTimeout(function(){
    var sel = document.getElementById('mobile-qual-select');
    if(sel) sel.value = '';
  }, 200);
};
</script>

</body>
</html>
