/* SSCiEX Careers Portal — styled to match ssciex.org.my */

:root {
  --navy: #0b2545;
  --navy-dark: #081b35;
  --blue: #1a6fbd;
  --blue-dark: #145a99;
  --bg: #f5f7fa;
  --text: #1d2433;
  --muted: #667085;
  --border: #e3e7ed;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  font-family: 'Poppins', -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.6;
  overflow-x: hidden;
}
h1, h2, h3 { font-weight: 600; }
a { color: var(--blue); }
.container { max-width: 960px; margin: 0 auto; padding: 32px 20px; }

/* ── Public site header/footer, matching the WordPress site ── */
.site-header {
  background: var(--navy); padding: 14px 24px; display: flex;
  align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.site-header .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.site-header .brand img { height: 42px; }
.site-header .brand span { color: #fff; font-weight: 600; font-size: 15px; letter-spacing: .3px; }
.site-header .back-link { color: #cfe0f2; font-size: 13px; text-decoration: none; }
.site-header .back-link:hover { color: #fff; text-decoration: underline; }

/* ── Simple listing banner (marketing content lives on the WP career page) ── */
.listing-banner {
  background: linear-gradient(135deg, var(--navy) 0%, #123a68 100%);
  color: #fff; padding: 36px 20px; text-align: center;
}
.listing-banner h1 { color: #fff; margin: 0 0 6px; font-size: clamp(22px, 4vw, 28px); }
.listing-banner p { color: #cfe0f2; margin: 0; font-size: 14px; }

@media (max-width: 560px) {
  .listing-banner { padding: 28px 16px; }
}

.site-footer {
  background: var(--navy-dark); color: #b7c3d6; text-align: center;
  padding: 20px; font-size: 13px; margin-top: 48px;
}
.site-footer a { color: #cfe0f2; }

/* ── Auth (admin login/setup) ── */
.auth-box {
  max-width: 380px; margin: 80px auto; background: #fff; padding: 32px;
  border-radius: 10px; box-shadow: 0 2px 10px rgba(11,37,69,0.10);
  border-top: 4px solid var(--navy);
}
.auth-box h1 { font-size: 20px; color: var(--navy); }

/* ── Forms ── */
form label { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 600; color: var(--text); }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,111,189,0.12); }
.row { display: flex; gap: 16px; }
.row > label { flex: 1; }

.btn, button[type="submit"] {
  display: inline-block; background: var(--blue); color: #fff; border: none;
  padding: 11px 20px; border-radius: 6px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; font-family: inherit;
}
.btn:hover, button[type="submit"]:hover { background: var(--blue-dark); }
.link-btn {
  background: none; border: none; color: var(--blue); cursor: pointer;
  padding: 0; font-size: 14px; text-decoration: underline; font-family: inherit;
}
.link-btn.danger { color: #c0392b; }

.error { color: #c0392b; font-weight: 600; }
.success { color: #1e8449; font-weight: 600; background: #e6f7ec; padding: 12px 16px; border-radius: 6px; }

/* ── Admin nav ── */
.admin-nav {
  background: var(--navy); color: #fff; display: flex; align-items: center;
  justify-content: space-between; padding: 14px 24px; flex-wrap: wrap; gap: 10px;
}
.admin-nav .nav-brand { font-weight: 600; letter-spacing: .3px; }
.admin-nav nav a { color: #cfe0f2; margin-right: 18px; text-decoration: none; font-size: 14px; }
.admin-nav nav a:hover { color: #fff; }
.nav-user { color: #93a6c2; font-size: 13px; margin-right: 18px; }

.stats { display: flex; gap: 16px; margin: 24px 0; flex-wrap: wrap; }
.stat-card {
  background: #fff; border-radius: 8px; padding: 20px; flex: 1; min-width: 140px;
  text-align: center; box-shadow: 0 1px 4px rgba(11,37,69,0.08); border-top: 3px solid var(--blue);
}
.stat-num { display: block; font-size: 28px; font-weight: 700; color: var(--navy); }

.bar-chart { background: #fff; border-radius: 8px; padding: 20px 24px; margin: 16px 0 28px; box-shadow: 0 1px 4px rgba(11,37,69,0.08); }
.bar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-label { flex: 0 0 200px; font-size: 13.5px; color: var(--text); text-align: right; }
.bar-track { flex: 1; background: #eef2f7; border-radius: 5px; height: 18px; overflow: hidden; }
.bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--blue) 0%, var(--navy) 100%);
  border-radius: 5px; width: var(--w, 0); animation: bar-grow .8s ease-out;
}
.bar-count { flex: 0 0 28px; font-size: 13px; font-weight: 600; color: var(--muted); }

@keyframes bar-grow { from { width: 0; } to { width: var(--w, 0); } }

@media (max-width: 640px) {
  .bar-label { flex-basis: 110px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .bar-fill { animation: none; }
}

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: #eef2f7; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
td .actions a, td .actions form { margin-right: 10px; display: inline-block; }

.badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.badge-open, .badge-new { background: #eaf2fd; color: var(--blue); }
.badge-closed, .badge-rejected { background: #fdeaea; color: #c0392b; }
.badge-shortlisted, .badge-reviewed { background: #fff6e0; color: #a5730a; }
.badge-hired { background: #e6f7ec; color: #1e8449; }

.page-header { display: flex; justify-content: space-between; align-items: center; }

.filter-bar {
  display: flex; align-items: flex-end; gap: 20px; margin: 16px 0 8px;
  flex-wrap: wrap;
}
.filter-bar label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .3px; margin: 0;
}
.filter-bar select { margin-top: 4px; min-width: 180px; }
.filter-bar .link-btn { margin-bottom: 10px; }

/* ── Job listings / detail (public) ── */
.job-list { display: grid; gap: 16px; margin-top: 24px; }
.job-card {
  background: #fff; padding: 22px; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(11,37,69,0.08); border-left: 4px solid var(--blue);
}
.job-card h2 { margin: 0 0 4px; color: var(--navy); font-size: 18px; }
.job-card .meta { color: var(--muted); font-size: 13px; margin: 0 0 10px; }

.meta { color: var(--muted); font-size: 13px; }

/* ── Success modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(11,37,69,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
  animation: overlay-in .2s ease-out;
}
.modal-overlay.is-closing { animation: overlay-out .18s ease-in forwards; }
.modal-box {
  background: #fff; border-radius: 14px; padding: 32px 28px; text-align: center;
  max-width: 380px; width: 100%; box-shadow: 0 20px 50px rgba(11,37,69,0.3);
  animation: modal-in .25s ease-out;
}
.modal-overlay.is-closing .modal-box { animation: modal-out .18s ease-in forwards; }
.modal-icon {
  width: 56px; height: 56px; border-radius: 50%; background: #e6f7ec;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.modal-box h2 { color: var(--navy); font-size: 19px; margin: 0 0 10px; }
.modal-box p { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlay-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes modal-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.96); } }

@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .modal-box, .modal-overlay.is-closing, .modal-overlay.is-closing .modal-box {
    animation: none;
  }
}
