/* =========================================================================
   TLDEDU — Government Exams Knowledge Hub
   ========================================================================= */

:root {
  --navy: #10395c;
  --navy-dark: #0a2740;
  --blue: #1f6fb2;
  --blue-light: #eaf3fb;
  --orange: #b35a0e;
  --bg: #f6f8fb;
  --card-bg: #ffffff;
  --text: #1c2733;
  --text-muted: #5b6b7c;
  --border: #e1e8f0;
  --shadow: 0 2px 10px rgba(16, 57, 92, 0.06);
  --shadow-lg: 0 16px 40px rgba(16, 57, 92, 0.16);
  --radius: 12px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 { line-height: 1.25; margin: 0; }

/* --------------------------------------------------------------- Nav --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  text-decoration: none;
  color: var(--navy);
}
.logo span { color: var(--blue); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--blue); }

.nav-cta {
  background: var(--navy);
  color: #fff !important;
  padding: 9px 18px;
  border-radius: 8px;
}
.nav-cta:hover { background: var(--blue) !important; color: #fff !important; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  margin: 5px 0;
  border-radius: 2px;
}

/* ------------------------------------------------------------- Hero --- */
.hero {
  background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy) 55%, var(--blue) 130%);
  color: #fff;
  padding: 64px 0 56px;
}
.hero__eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: 100px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 800;
  max-width: 760px;
  margin-bottom: 16px;
}
.hero p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

.hero-search {
  display: flex;
  max-width: 560px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-search input {
  flex: 1;
  border: none;
  padding: 15px 18px;
  font-size: 0.98rem;
  outline: none;
  color: var(--text);
}
.hero-search button {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 0 22px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
}
.hero-search button:hover { background: #96490b; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: 40px;
}
.hero-stats .stat-num {
  font-size: 1.9rem;
  font-weight: 800;
  display: block;
}
.hero-stats .stat-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

/* --------------------------------------------------------- Section --- */
section { padding: 56px 0; }
.section-head {
  margin-bottom: 32px;
  max-width: 700px;
}
.section-head .eyebrow {
  color: var(--blue);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--navy);
  margin-top: 8px;
}
.section-head p {
  color: var(--text-muted);
  margin-top: 10px;
}

/* ------------------------------------------------------------- Hub --- */
.hub { background: var(--bg); }

.hub-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 28px;
}
.search-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.search-row input {
  flex: 1;
  max-width: 420px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.95rem;
  outline: none;
  background: #fff;
}
.search-row input:focus { border-color: var(--blue); }
.result-count {
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  --chip-color: var(--blue);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--chip-color); color: var(--chip-color); }
.chip.active {
  background: var(--chip-color);
  border-color: var(--chip-color);
  color: #fff;
}

/* ---------------------------------------------------------- Grid --- */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.exam-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
}
.exam-card:hover,
.exam-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--blue);
  outline: none;
}

.badge {
  --chip-color: var(--blue);
  display: inline-block;
  background: color-mix(in srgb, var(--chip-color) 12%, white);
  color: var(--chip-color);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}
.badge--sm { font-size: 0.68rem; padding: 3px 9px; }

.exam-card__title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 14px;
}

.exam-card__meta {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}
.exam-card__meta > div { display: flex; flex-direction: column; gap: 2px; }
.exam-card__meta dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  font-weight: 600;
}
.exam-card__meta dd {
  margin: 0;
  font-size: 0.87rem;
  color: var(--text);
}

.exam-card__stages {
  font-size: 0.83rem;
  color: var(--blue);
  font-weight: 600;
  background: var(--blue-light);
  padding: 8px 10px;
  border-radius: 7px;
  margin: 0 0 14px;
}

.exam-card__cta {
  margin-top: auto;
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--orange);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* ------------------------------------------------------------ Modal --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
}
.modal.open { display: flex; }
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 30, 50, 0.55);
}
.modal-panel {
  position: relative;
  background: #fff;
  width: min(760px, 94vw);
  margin: 4vh auto;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 32px 28px 34px;
}
body.modal-open { overflow: hidden; }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}
.modal-close:hover { background: var(--blue-light); color: var(--blue); }

.modal-title {
  font-size: 1.4rem;
  color: var(--navy);
  margin: 4px 0 20px;
  padding-right: 30px;
}

.quickfacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  background: var(--blue-light);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 28px;
}
.quickfacts__item { display: flex; flex-direction: column; gap: 3px; }
.qf-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--blue);
  font-weight: 700;
}
.qf-value { font-size: 0.88rem; color: var(--text); font-weight: 600; }

.section-title {
  font-size: 1rem;
  color: var(--navy);
  margin: 26px 0 10px;
  font-weight: 700;
  border-left: 3px solid var(--blue);
  padding-left: 10px;
}

.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 480px;
}
table.detail-table th {
  background: var(--navy);
  color: #fff;
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  white-space: nowrap;
}
table.detail-table td {
  padding: 9px 12px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}
table.detail-table tbody tr:nth-child(even) { background: #fafbfd; }
table.detail-table tr.row-total td {
  background: var(--blue-light);
  font-weight: 700;
  color: var(--navy);
}

.keynotes {
  margin-top: 24px;
  background: #fdf3ea;
  border-left: 3px solid var(--orange);
  border-radius: 8px;
  padding: 14px 16px;
}
.keynotes strong {
  display: block;
  color: var(--orange);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.keynotes p { margin: 0; font-size: 0.88rem; color: var(--text); }

/* --------------------------------------------------------- Compare --- */
.compare { background: #fff; }
.compare-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table#compareTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  font-size: 0.87rem;
}
table#compareTable thead th {
  background: var(--navy);
  color: #fff;
  text-align: left;
  padding: 12px 14px;
  position: sticky;
  top: 0;
  white-space: nowrap;
}
table#compareTable tbody td {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
table#compareTable tbody tr { cursor: pointer; transition: background 0.12s ease; }
table#compareTable tbody tr:hover,
table#compareTable tbody tr:focus-visible { background: var(--blue-light); outline: none; }
.compare-name { font-weight: 600; color: var(--navy); min-width: 220px; }

/* ------------------------------------------------------------ About --- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.about-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.about-card h3 { color: var(--navy); font-size: 1.02rem; margin-bottom: 8px; }
.about-card p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

.disclaimer {
  margin-top: 28px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

/* ------------------------------------------------------------ Footer --- */
footer {
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.75);
  padding: 36px 0;
  font-size: 0.86rem;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
footer .logo { color: #fff; }
footer .logo span { color: #7fb6e8; }

/* --------------------------------------------------------- Back top --- */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 40;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--blue); }

/* -------------------------------------------------------- Responsive --- */
@media (max-width: 760px) {
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px 22px;
    border-bottom: 1px solid var(--border);
    display: none;
    gap: 16px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .hero-search { flex-direction: column; box-shadow: none; }
  .hero-search input { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
  .hero-search button { border-radius: 8px; padding: 13px; }
  .search-row { flex-direction: column; align-items: stretch; }
  .search-row input { max-width: none; }
}
