/*
Theme Name: JRU Tools Portal
Theme URI: https://jobresultupdates.com
Author: JRU Team
Description: Dedicated Free Tools Theme — Age Calculator, Salary Calculator, Cut-off Checker, Photo Tools, CSC Status Check, Certificate Tool (28 States). Built for sarkari job seekers.
Version: 1.0
Requires at least: 5.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: jru-tools-theme
*/

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --primary:        #1565C0;
  --primary-dark:   #0D47A1;
  --primary-light:  #1976D2;
  --accent:         #FF6F00;
  --accent-light:   #FFA000;
  --success:        #2E7D32;
  --danger:         #C62828;
  --warn:           #F57F17;
  --bg:             #F0F4FA;
  --surface:        #FFFFFF;
  --border:         #DDE6F0;
  --text:           #0F1E38;
  --muted:          #4A6080;
  --shadow:         0 4px 24px rgba(13,71,161,.13);
  --shadow-sm:      0 2px 8px rgba(13,71,161,.09);
  --radius:         14px;
  --radius-sm:      8px;
  --font:           'Noto Sans','Noto Sans Devanagari',sans-serif;
  --header-h:       64px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1,h2,h3,h4 { font-weight: 700; line-height: 1.3; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: var(--font); }

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  height: var(--header-h);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(13,71,161,.25);
}
.header-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  flex-shrink: 0;
  text-decoration: none;
}
.logo-badge {
  width: 42px; height: 42px;
  background: rgba(255,255,255,.18);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,.25);
}
.logo-text { line-height: 1.25; }
.logo-sub { font-size: .6rem; opacity: .75; font-weight: 400; }

.header-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.header-nav::-webkit-scrollbar { display: none; }
.header-nav a {
  color: rgba(255,255,255,.8);
  font-size: .78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  transition: all .2s;
  border: 1.5px solid transparent;
}
.header-nav a:hover,
.header-nav a.active {
  color: #fff;
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.25);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.tools-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #1a237e 100%);
  color: #fff;
  padding: 32px 20px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.tools-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.tools-hero h1 {
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 8px;
  position: relative;
}
.tools-hero p {
  opacity: .8;
  font-size: .9rem;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}
.hero-badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
  position: relative;
}
.hero-badge {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
  font-size: .72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

/* ============================================================
   MAIN TABS
   ============================================================ */
.main-tabs-wrap {
  background: var(--primary-dark);
  position: sticky;
  top: var(--header-h);
  z-index: 900;
}
.main-tabs {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 2px;
}
.main-tabs::-webkit-scrollbar { display: none; }
.mtab-btn {
  padding: 12px 18px;
  font-size: .82rem;
  font-weight: 700;
  background: none;
  border: none;
  color: rgba(255,255,255,.65);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all .2s;
  font-family: var(--font);
  display: flex;
  align-items: center;
  gap: 5px;
}
.mtab-btn:hover { color: #fff; background: rgba(255,255,255,.07); }
.mtab-btn.active {
  color: #fff;
  border-bottom-color: var(--accent);
  background: rgba(255,255,255,.1);
}

/* ============================================================
   CONTENT AREA
   ============================================================ */
.content-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
.tool-page { display: none; }
.tool-page.active { display: block; }

/* Section header */
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.section-head h2 {
  font-size: 1.05rem;
  color: var(--primary);
}
.section-head p {
  font-size: .82rem;
  color: var(--muted);
  margin: 0;
}
.sh-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* ============================================================
   TOOL CARDS GRID
   ============================================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 13px;
  margin-bottom: 6px;
}
.tool-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 14px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .22s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transition: transform .22s;
  transform-origin: left;
}
.tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.tool-card:hover::before { transform: scaleX(1); }
.tool-card .tc-ic {
  font-size: 1.9rem;
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
}
.tool-card .tc-name { font-size: .82rem; font-weight: 700; color: var(--text); }
.tool-card .tc-desc { font-size: .68rem; color: var(--muted); margin-top: 3px; }

/* Certificate type cards — slightly larger */
.cert-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 13px;
  margin-bottom: 20px;
}
.cert-type-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: all .22s;
}
.cert-type-card:hover,
.cert-type-card.selected {
  border-color: var(--primary);
  background: #EFF6FF;
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   CSC PORTAL GRID
   ============================================================ */
.csc-portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.csc-portal-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: all .2s;
  text-decoration: none;
}
.csc-portal-card:hover {
  border-color: #00897B;
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  color: #00695C;
}
.csc-portal-card .cp-icon { font-size: 1.5rem; flex-shrink: 0; }
.csc-portal-card .cp-name { font-size: .875rem; font-weight: 700; }
.csc-portal-card .cp-desc { font-size: .7rem; color: var(--muted); }
.csc-portal-card .cp-arrow { margin-left: auto; color: #00897B; }

/* ============================================================
   MODAL OVERLAY
   ============================================================ */
.jru-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5,15,40,.65);
  z-index: 9999;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  backdrop-filter: blur(3px);
}
.jru-overlay.show { display: flex; }
.jru-modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  margin: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  animation: modalIn .24s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalIn {
  from { transform: scale(.88) translateY(24px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-head {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-head.csc-head {
  background: linear-gradient(135deg, #00695C, #00897B);
}
.modal-head h3 { color: #fff; font-size: .95rem; }
.modal-close {
  background: rgba(255,255,255,.18);
  border: none;
  color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.modal-close:hover { background: rgba(255,255,255,.35); }
.modal-body {
  padding: 20px;
  max-height: 75vh;
  overflow-y: auto;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.fg { margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.flbl {
  display: block;
  font-size: .76rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text);
  letter-spacing: .01em;
}
.flbl .req { color: var(--danger); margin-left: 2px; }
.finp, .fsel, .ftxt {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  outline: none;
  transition: border-color .2s, background .2s;
}
.finp:focus, .fsel:focus, .ftxt:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(21,101,192,.1);
}
.ftxt { resize: vertical; min-height: 70px; }
.fhint { font-size: .69rem; color: var(--muted); margin-top: 3px; }
.fsep {
  font-size: .74rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 18px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--border);
}

/* ============================================================
   INFO BOXES
   ============================================================ */
.info-box {
  background: #E8F0FE;
  border-left: 3px solid var(--primary);
  padding: 11px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .81rem;
  color: #1a47a0;
  margin-bottom: 14px;
}
.warn-box {
  background: #FFF8E1;
  border-left: 3px solid var(--warn);
  padding: 10px 13px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .76rem;
  color: #5D4037;
  margin-top: 10px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 700;
  font-family: var(--font);
  border: 2px solid transparent;
  transition: all .2s;
  cursor: pointer;
  width: 100%;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(21,101,192,.3);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(21,101,192,.45); transform: translateY(-1px); }
.btn-success {
  background: linear-gradient(135deg, #2E7D32, #1B5E20);
  color: #fff;
  box-shadow: 0 2px 8px rgba(46,125,50,.3);
}
.btn-success:hover { box-shadow: 0 4px 16px rgba(46,125,50,.4); }
.btn-accent {
  background: linear-gradient(135deg, var(--accent), #E65100);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,111,0,.3);
}
.btn-csc {
  background: linear-gradient(135deg, #00695C, #00897B);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,105,92,.3);
}
.btn-csc:hover { box-shadow: 0 4px 16px rgba(0,105,92,.4); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--border);
  margin-bottom: 8px;
  justify-content: space-between;
}
.btn-outline:hover { border-color: var(--primary); background: #EFF6FF; }
.btn-group {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.btn-group .btn { flex: 1; min-width: 100px; }

/* RANGE */
input[type=range] { width: 100%; accent-color: var(--primary); }

/* ============================================================
   RESULT BOX
   ============================================================ */
.result-box {
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  margin-top: 14px;
  display: none;
  background: #EFF6FF;
  animation: fadeUp .2s ease;
}
.result-box.show { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.result-val { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.result-lbl { font-size: .76rem; color: var(--muted); margin-top: 4px; }

/* Link button row (CSC redirect) */
.link-btns { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 13px; border-radius: 7px;
  font-weight: 700; font-size: .79rem;
  text-decoration: none; color: #fff;
  transition: opacity .15s;
}
.link-btn:hover { opacity: .88; color: #fff; }

/* ============================================================
   INNER TABS (inside modals)
   ============================================================ */
.inner-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 0;
}
.itab {
  padding: 8px 14px;
  font-size: .79rem;
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: var(--font);
  transition: color .15s;
}
.itab.active { color: var(--primary); border-bottom-color: var(--primary); }
.ipane { display: none; }
.ipane.active { display: block; }

/* Certificate inner tabs */
.cert-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  background: var(--bg);
}
.ctab {
  padding: 10px 16px;
  font-size: .8rem;
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: var(--font);
  transition: all .15s;
}
.ctab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--surface); }
.cpane { display: none; padding: 20px; }
.cpane.active { display: block; }

/* ============================================================
   PORTAL TABLE (28 states)
   ============================================================ */
.ptable-wrap { overflow-x: auto; }
.ptable { width: 100%; border-collapse: collapse; font-size: .8rem; }
.ptable th {
  background: var(--primary);
  color: #fff;
  padding: 9px 12px;
  text-align: left;
  font-weight: 700;
}
.ptable td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.ptable tr:nth-child(even) td { background: #F8FAFF; }
.ptable tr:hover td { background: #EFF6FF; }
.ptable a { color: var(--primary); font-weight: 600; font-size: .76rem; }
.badge-online  { display:inline-block; padding:2px 8px; border-radius:10px; font-size:.65rem; font-weight:700; background:#E8F5E9; color:#2E7D32; }
.badge-offline { display:inline-block; padding:2px 8px; border-radius:10px; font-size:.65rem; font-weight:700; background:#FFF3E0; color:#FF6F00; }
.badge-partial { display:inline-block; padding:2px 8px; border-radius:10px; font-size:.65rem; font-weight:700; background:#F3E5F5; color:#6A1B9A; }

/* ============================================================
   CERTIFICATE PREVIEW
   ============================================================ */
.cert-preview-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: none;
  margin-top: 18px;
}
.cert-preview-wrap.visible { display: block; }
.cert-form-hdr {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.cert-form-hdr h2 { color: #fff; font-size: .95rem; }
.cert-doc {
  padding: 28px;
  font-size: .86rem;
  line-height: 1.9;
  font-family: 'Noto Sans Devanagari', 'Noto Sans', serif;
}
.cert-doc .ch { text-align: center; border-bottom: 3px double var(--primary); padding-bottom: 14px; margin-bottom: 16px; }
.cert-doc .ct { font-size: 1.1rem; font-weight: 800; text-align: center; color: var(--primary); margin: 12px 0; text-decoration: underline; text-underline-offset: 4px; }
.cert-doc .cf { margin-top: 26px; display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px; padding-top: 13px; border-top: 1px solid var(--border); }
.seal-circle { width: 88px; height: 88px; border: 2px dashed var(--muted); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .62rem; color: var(--muted); text-align: center; }
.watermark { position: relative; }
.watermark::after { content: "DRAFT"; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-35deg); font-size: 4.5rem; color: rgba(197,32,32,.07); font-weight: 800; pointer-events: none; }

/* Steps & Checklist */
.steps-list { counter-reset: s; list-style: none; padding: 0; }
.steps-list li { counter-increment: s; display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .83rem; align-items: flex-start; }
.steps-list li:last-child { border: none; }
.steps-list li::before { content: counter(s); background: var(--primary); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800; flex-shrink: 0; margin-top: 2px; }
.checklist { list-style: none; padding: 0; }
.checklist li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .83rem; }
.checklist li:last-child { border: none; }
.checklist li::before { content: "📎"; flex-shrink: 0; }

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.7);
  padding: 24px 20px;
  text-align: center;
  font-size: .8rem;
  margin-top: 20px;
}
.site-footer a { color: rgba(255,255,255,.85); text-decoration: underline; }
.footer-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.footer-links a { text-decoration: none; color: rgba(255,255,255,.8); font-size: .78rem; font-weight: 600; }
.footer-links a:hover { color: #fff; }

/* ============================================================
   PRINT CSS — Certificate PDF ke liye
   ============================================================ */
@media print {
  .site-header, .main-tabs-wrap, .tools-hero,
  .cert-tabs, .btn-group, .cert-cards-grid { display: none !important; }
  .cert-preview-wrap { display: block !important; border: none !important; }
  .cpane { display: block !important; }
  @page { margin: 10mm; size: A4; }
  .cert-doc { padding: 15px !important; }
  .watermark::after { font-size: 3rem !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .tools-grid { grid-template-columns: repeat(2,1fr); }
  .row2, .row3 { grid-template-columns: 1fr; }
  .btn-group { flex-direction: column; }
  .csc-portal-grid { grid-template-columns: 1fr; }
  .tools-hero h1 { font-size: 1.4rem; }
  .header-nav { display: none; }
  .cert-cards-grid { grid-template-columns: repeat(2,1fr); }
}
