/* =========================================================
   GPACal Design System — Pure CSS (No Build Step)
   Heading Font: Plus Jakarta Sans
   Body Font: Inter
   Icons: Lucide via CDN
   ========================================================= */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400&family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  /* Brand: navy #0B3D91 — kept under --purple-* names so existing usages cascade */
  --purple-50: #EEF3FB;
  --purple-100: #D6E0F4;
  --purple-200: #AEC1E9;
  --purple-300: #7A95D6;
  --purple-400: #4D70C8;
  --purple-500: #1F4BB9;
  --purple-600: #0B3D91;
  --purple-700: #082E6D;
  --brand-50: #EEF3FB;
  --brand-100: #D6E0F4;
  --brand-500: #1F4BB9;
  --brand-600: #0B3D91;
  --brand-700: #082E6D;
  --teal-50: #E6F1F8;
  --teal-100: #CDE3F2;
  --teal-500: #2B6FB8;
  --teal-600: #1F58A0;
  --teal-700: #174686;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;
  --white: #FFFFFF;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
  --shadow-purple: 0 8px 24px rgba(11, 61, 145, 0.22);
  --shadow-teal: 0 8px 24px rgba(31, 88, 160, 0.18);
  --shadow-brand: 0 8px 24px rgba(11, 61, 145, 0.22);
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --radius-2xl: 2rem;
  --navbar-height: 68px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-700);
  background: var(--white);
  line-height: 1.7;
  font-size: 1.125rem;
  /* 18px base */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
}

/* ---------- Layout ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-lg {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6rem 0;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5 {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.75rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.08;
}

h2 {
  font-size: clamp(2rem, 3.5vw, 2.875rem);
  font-weight: 800;
  line-height: 1.12;
}

h3 {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
}

.gradient-text {
  background: linear-gradient(135deg, var(--purple-600) 20%, var(--teal-500) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8125rem 1.875rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--purple-600), var(--purple-700));
  color: var(--white);
  font-weight: 700;
  font-size: 0.9375rem;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  letter-spacing: -0.01em;
  border: none;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: var(--shadow-purple);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(11, 61, 145, 0.32);
  background: linear-gradient(135deg, var(--purple-700), #3b0f8c);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8125rem 1.875rem;
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--purple-600);
  font-weight: 700;
  font-size: 0.9375rem;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  letter-spacing: -0.01em;
  border: 2px solid var(--purple-200);
  cursor: pointer;
  transition: all 0.22s ease;
}

.btn-secondary:hover {
  background: var(--purple-50);
  border-color: var(--purple-400);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.375rem;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.9375rem;
  border: 1.5px solid var(--gray-200);
  cursor: pointer;
  transition: all 0.22s ease;
}

.btn-ghost:hover {
  border-color: var(--purple-300);
  color: var(--purple-600);
  background: var(--purple-50);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  background: #FEF2F2;
  color: #DC2626;
  font-weight: 500;
  font-size: 0.875rem;
  border: 1.5px solid #FECACA;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: #FEE2E2;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.badge-purple {
  background: var(--purple-100);
  color: var(--purple-700);
}

.badge-teal {
  background: var(--teal-100);
  color: var(--teal-700);
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-600);
}

.badge-green {
  background: #DCFCE7;
  color: #15803D;
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--gray-100);
  padding: 1.875rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  align-self: start;
  /* ← shrinks to content height */
  height: auto;
  /* never forced full-height */
}

.card:hover {
  border-color: rgba(11, 61, 145, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.09), 0 4px 16px rgba(11, 61, 145, 0.07);
  transform: translateY(-5px);
}

/* Stretch variant – use when explicit equal heights needed */
.card-stretch {
  align-self: stretch;
  height: 100%;
}

.glass-card {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.10);
}

/* ---------- Form Elements ---------- */
.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-800);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

.input-field:focus {
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px rgba(31, 75, 185, 0.1);
}

.input-field::placeholder {
  color: var(--gray-400);
}

.select-field {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-800);
  font-size: 0.9375rem;
  font-family: inherit;
  appearance: none;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
}

.select-field:focus {
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px rgba(31, 75, 185, 0.1);
}

textarea.input-field {
  resize: vertical;
  min-height: 120px;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

/* ---------- Calculator Result ---------- */
.calc-result {
  background: linear-gradient(135deg, var(--purple-50) 0%, var(--teal-50) 100%);
  border: 1.5px solid rgba(31, 75, 185, 0.2);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  margin-top: 1.5rem;
}

.calc-result-value {
  font-size: 3rem;
  font-weight: 900;
  color: var(--purple-600);
  line-height: 1;
}

.calc-result-label {
  color: var(--gray-500);
  font-size: 0.9375rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* ---------- Navigation ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gray-100);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-height);
  padding: 0 1rem;
}

/* Mobile menu: positioned absolutely so it doesn't disrupt the flex layout */
.mobile-menu-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--navbar-height);
}

.nav-logo {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.625rem;
  text-decoration: none;
}

.nav-logo img {
  margin-left: -15px
}

.nav-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--purple-600), var(--teal-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.nav-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all 0.18s ease;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--purple-600);
  background: var(--purple-50);
}

.nav-link.active {
  color: var(--purple-600);
  background: var(--purple-50);
  font-weight: 600;
}

.nav-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-actions {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.nav-mobile-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  background: transparent;
  cursor: pointer;
  color: var(--gray-600);
  transition: all 0.2s;
}

.nav-mobile-btn:hover {
  border-color: var(--purple-300);
  color: var(--purple-600);
  background: var(--purple-50);
}

/* ---------- Mobile Menu — Smooth Slide Animation ---------- */
.mobile-menu-panel {
  max-height: 0;
  overflow: hidden;
  background: var(--white);
  border-top: 1px solid var(--gray-100);
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s ease,
    padding 0.35s ease;
  opacity: 0;
}

.mobile-menu-panel.open {
  max-height: 420px;
  opacity: 1;
  padding: 1rem 1.5rem 1.5rem;
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all 0.18s;
  margin-bottom: 0.25rem;
}

.mobile-menu-link:hover {
  color: var(--purple-600);
  background: var(--purple-50);
}

.mobile-menu-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Hamburger→X animation */
.hamburger-icon {
  width: 20px;
  height: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.nav-mobile-btn.active .hamburger-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-mobile-btn.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-mobile-btn.active .hamburger-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(circle at 10% 20%, rgba(11, 61, 145, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(31, 88, 160, 0.08) 0%, transparent 45%),
    var(--white);
  padding: 6rem 0 5rem;
  position: relative;
  overflow: hidden;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}

/* ---------- Stats Bar ---------- */
.stats-bar {
  background: var(--white);
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  padding: 2rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 900;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-weight: 500;
  margin-top: 0.25rem;
}

/* ---------- Tool Cards Grid ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  align-items: start;
  /* cards shrink to content, never forced full-height */
}

.tool-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--gray-100);
  padding: 1.875rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  align-self: start;
  height: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(11, 61, 145, 0.04), rgba(31, 88, 160, 0.04));
  opacity: 0;
  transition: opacity 0.28s;
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card:hover {
  border-color: rgba(11, 61, 145, 0.2);
  box-shadow: 0 12px 40px rgba(11, 61, 145, 0.10), 0 4px 16px rgba(0, 0, 0, 0.06);
  transform: translateY(-6px);
}

.tool-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple-50), var(--teal-50));
  color: var(--purple-600);
  margin-bottom: 1.125rem;
}

.tool-icon svg {
  width: 24px;
  height: 24px;
}

.tool-card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.tool-card-desc {
  font-size: 0.9375rem;
  color: var(--gray-500);
  line-height: 1.6;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1.125rem;
  border-top: 1px solid var(--gray-100);
}

/* ---------- Category Cards ---------- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
}

.cat-card {
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all 0.28s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.cat-card:hover {
  transform: translateY(-6px);
}

.cat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.cat-icon svg {
  width: 26px;
  height: 26px;
}

.cat-name {
  font-weight: 700;
  font-size: 0.9375rem;
}

.cat-count {
  font-size: 0.8125rem;
  opacity: 0.75;
}

/* ---------- Blog Cards — Clean Bento ---------- */
/* 3-col grid. First card of every 6 spans 2 rows (tall feature).
   All other cards are 1×1. Row height is driven by content so nothing stretches. */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* equal-height rows so cards align neatly */
  grid-auto-rows: 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

/* Homepage 3-card preview: symmetric row, no tall feature */
.blog-grid.is-compact {
  grid-template-columns: repeat(3, 1fr);
}

.blog-grid.is-compact>* {
  grid-row: auto;
}

.blog-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--gray-100);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease, border-color 0.3s ease;
  height: 100%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
}

.blog-card:hover {
  border-color: rgba(11, 61, 145, 0.22);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.10), 0 4px 16px rgba(11, 61, 145, 0.10);
  transform: translateY(-4px);
}

/* Image / placeholder — fixed aspect for regular cards, keeps cards short */
.blog-card-img,
.blog-card-img-placeholder {
  width: 100%;
  height: 180px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.blog-card-img-placeholder {
  background: linear-gradient(135deg, var(--purple-600), var(--purple-500));
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  letter-spacing: -0.01em;
  font-size: 1.375rem;
  line-height: 1.2;
}


.blog-card-body {
  padding: 1.25rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.blog-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  align-self: flex-start;
  padding: 0.2rem 0.625rem;
  border-radius: 9999px;
  background: var(--purple-50);
  color: var(--purple-700);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.blog-card-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.35;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-excerpt {
  font-size: 0.875rem;
  color: var(--gray-500);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.875rem;
  border-top: 1px solid var(--gray-100);
}

/* Responsive */
@media (max-width: 1024px) {

  .blog-grid,
  .blog-grid.is-compact {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .blog-grid>*:nth-child(6n + 1) {
    grid-row: auto;
  }

  .blog-grid>*:nth-child(6n + 1) .blog-card-title {
    font-size: 1rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}

@media (max-width: 640px) {

  .blog-grid,
  .blog-grid.is-compact {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .blog-card-img,
  .blog-card-img-placeholder {
    height: 160px;
  }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--gray-900);
  color: var(--gray-400);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding: 4rem 0;
}

.footer-link {
  color: var(--gray-400);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color 0.2s;
  display: block;
  margin-bottom: 0.625rem;
}

.footer-link:hover {
  color: var(--white);
}

.footer-heading {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
}

/* ---------- Article Body Typography ---------- */
.article-body {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article-body .article-section {
  margin-bottom: 1.75rem;
}

.article-section img {
  object-fit: cover;
  height: 100%;
  width: 100%;
}

/* Headings inside article */
.article-body h2 {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--gray-900);
  margin: 2.25rem 0 0.875rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--purple-100);
}

.article-body h3 {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 1.75rem 0 0.75rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.article-body h4 {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 1.5rem 0 0.625rem;
  line-height: 1.35;
}

.article-body h5 {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--gray-700);
  margin: 1.25rem 0 0.5rem;
  line-height: 1.4;
}

/* Paragraphs */
.article-body p {
  margin-bottom: 1.125rem;
  line-height: 1.85;
}

.article-body p:last-child {
  margin-bottom: 0;
}

/* Bold / Italic / Underline */
.article-body strong,
.article-body b {
  font-weight: 700;
  color: var(--gray-800);
}

.article-body em,
.article-body i {
  font-style: italic;
}

.article-body u {
  text-decoration: underline;
  text-decoration-color: var(--purple-300);
  text-underline-offset: 3px;
}

.article-body s {
  text-decoration: line-through;
  color: var(--gray-400);
}

/* Unordered Lists */
.article-body ul {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0 1.5rem;
}

.article-body ul li {
  position: relative;
  padding-left: 1.625rem;
  margin-bottom: 0.5rem;
  line-height: 1.75;
}

.article-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-500), var(--teal-500));
}

/* Ordered Lists */
.article-body ol {
  list-style: none;
  padding-left: 0;
  margin: 1rem 0 1.5rem;
  counter-reset: article-counter;
}

.article-body ol li {
  position: relative;
  padding-left: 2.25rem;
  margin-bottom: 0.625rem;
  line-height: 1.75;
  counter-increment: article-counter;
}

.article-body ol li::before {
  content: counter(article-counter);
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-50), var(--teal-50));
  color: var(--purple-600);
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--purple-200);
}

/* Nested lists */
.article-body ul ul,
.article-body ol ol,
.article-body ul ol,
.article-body ol ul {
  margin: 0.5rem 0 0.5rem 0.5rem;
}

/* Blockquotes */
.article-body blockquote {
  border-left: 4px solid var(--purple-400);
  background: linear-gradient(135deg, var(--purple-50) 0%, rgba(245, 243, 255, 0.5) 100%);
  padding: 1.125rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--gray-600);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.article-body blockquote p {
  margin-bottom: 0.5rem;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Links */
.article-body a {
  color: var(--purple-600);
  text-decoration: underline;
  text-decoration-color: var(--purple-200);
  text-underline-offset: 3px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.article-body a:hover {
  color: var(--purple-700);
  text-decoration-color: var(--purple-500);
}

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid var(--gray-200);
}

.article-body thead {
  background: linear-gradient(135deg, var(--purple-50), var(--teal-50));
}

.article-body th {
  padding: 0.875rem 1.125rem;
  text-align: left;
  font-weight: 700;
  color: var(--gray-800);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--gray-200);
}

.article-body td {
  padding: 0.75rem 1.125rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.article-body tbody tr:last-child td {
  border-bottom: none;
}

.article-body tbody tr:hover td {
  background: var(--gray-50);
}

/* First heading in a section shouldn't have top margin */
.article-body .article-section>h2:first-child,
.article-body .article-section>h3:first-child,
.article-body .article-section>h4:first-child,
.article-body .article-section>h5:first-child {
  margin-top: 0;
}



/* ---------- Admin ---------- */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background: var(--gray-900);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  /* Custom scrollbar for dark sidebar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.admin-sidebar::-webkit-scrollbar {
  width: 4px;
}

.admin-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.admin-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}



.admin-nav {
  padding: 1rem;
  flex: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--gray-400);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.2s;
  margin-bottom: 0.25rem;
}

.admin-nav-item:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.admin-nav-item.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--purple-600), var(--purple-700));
}

.admin-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.admin-main {
  margin-left: 260px;
  flex: 1;
  min-width: 0;
  background: var(--gray-50);
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-content {
  padding: 2rem;
}

.admin-page-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--gray-900);
}

/* Admin mobile elements — hidden on desktop */
.admin-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  padding: 0.25rem;
}

.admin-sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
}

.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.admin-sidebar-overlay.open {
  opacity: 1;
}

.admin-live-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--purple-600);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--purple-200);
  background: var(--purple-50);
  transition: all 0.2s;
}

.admin-live-btn:hover {
  background: var(--purple-100);
}

/* Admin sidebar header flex layout for close button */
.admin-sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 768px) {
  .admin-hamburger {
    display: flex;
  }

  .admin-sidebar-close {
    display: flex;
  }

  .admin-sidebar-overlay {
    display: block;
    pointer-events: none;
  }

  .admin-sidebar-overlay.open {
    pointer-events: auto;
  }

  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
  }

  .admin-topbar {
    padding: 0 1rem;
  }

  .admin-content {
    padding: 1rem;
  }

  .admin-live-btn span {
    display: none;
  }
}

/* Stat cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--gray-100);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-icon svg {
  width: 24px;
  height: 24px;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--gray-900);
}

.stat-card-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-weight: 500;
  margin-top: 0.125rem;
}

/* Admin data table */
.data-table-wrap {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--gray-100);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--gray-50);
}

.data-table th {
  text-align: left;
  padding: 1rem 1.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--gray-100);
}

.data-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.9375rem;
  color: var(--gray-700);
}

.data-table tbody tr:hover td {
  background: var(--gray-50);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-100);
}

/* Admin form */
.admin-form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--gray-100);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.admin-form-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-100);
}

.form-group {
  margin-bottom: 1.25rem;
}

/* ---------- Alerts ---------- */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.alert-success {
  background: #DCFCE7;
  color: #166534;
  border: 1.5px solid #BBF7D0;
}

.alert-error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1.5px solid #FECACA;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.page-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  transition: all 0.2s;
}

.page-link:hover {
  border-color: var(--purple-300);
  color: var(--purple-600);
  background: var(--purple-50);
}

.page-link.active {
  background: var(--purple-600);
  color: var(--white);
  border-color: var(--purple-600);
  font-weight: 700;
}

.page-link.disabled {
  color: var(--gray-300);
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- Animations ---------- */
@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-12px);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(11, 61, 145, 0.4);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 12px rgba(11, 61, 145, 0);
  }

  100% {
    transform: scale(0.9);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-fade-in {
  animation: fadeInUp 0.6s ease-out both;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Utilities ---------- */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.flex {
  display: flex;
}

.block {
  display: block;
}

.inline-flex {
  display: inline-flex;
}

.grid {
  display: grid;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.gap-1 {
  gap: 0.25rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mt-6 {
  margin-top: 1.5rem;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-5 {
  margin-bottom: 1.25rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.p-4 {
  padding: 1rem;
}

.w-full {
  width: 100%;
}

.w-8 {
  width: 2rem;
}

.h-8 {
  height: 2rem;
}

.min-w-0 {
  min-width: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rounded-lg {
  border-radius: 0.5rem;
}

/* ---------- Calculator Grid (12-col system) ---------- */
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-12 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.col-span-1 {
  grid-column: span 1 / span 1;
}

.col-span-2 {
  grid-column: span 2 / span 2;
}

.col-span-3 {
  grid-column: span 3 / span 3;
}

.col-span-4 {
  grid-column: span 4 / span 4;
}

.col-span-5 {
  grid-column: span 5 / span 5;
}

.col-span-6 {
  grid-column: span 6 / span 6;
}

/* Space-y utility */
.space-y-4>*+* {
  margin-top: 1rem;
}

/* ---------- Calculator Typography ---------- */
.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.text-base {
  font-size: 1rem;
  line-height: 1.5rem;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.text-xl {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}

.text-4xl {
  font-size: 2.25rem;
  line-height: 2.5rem;
}

.text-5xl {
  font-size: 3rem;
  line-height: 1;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.font-extrabold {
  font-weight: 800;
}

.uppercase {
  text-transform: uppercase;
}

.tracking-wide {
  letter-spacing: 0.025em;
}

.leading-none {
  line-height: 1;
}

/* ---------- Calculator Colors ---------- */
.text-gray-400 {
  color: var(--gray-400);
}

.text-gray-500 {
  color: var(--gray-500);
}

.text-gray-600 {
  color: var(--gray-600);
}

.text-gray-700 {
  color: var(--gray-700);
}

.text-gray-800 {
  color: var(--gray-800);
}

.text-primary-600 {
  color: var(--purple-600);
}

/* maps purple to "primary" */
.text-red-400 {
  color: #F87171;
}

.text-teal-600 {
  color: var(--teal-600);
}

.text-teal-500 {
  color: var(--teal-500);
}

.text-white {
  color: white;
}

/* ---------- Calculator Delete Button ---------- */
.bg-red-50 {
  background-color: #FEF2F2;
}

.hover\:bg-red-100:hover {
  background-color: #FEE2E2;
}

.hover\:text-gray-600:hover {
  color: var(--gray-600);
}

.transition-colors {
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

/* Delete row button — standalone style */
button.w-8.h-8 {
  border: none;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

button.w-8.h-8:hover {
  background-color: #FEE2E2;
  color: #DC2626;
}

/* ---------- Responsive grid for calculators ---------- */
@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Calculator rows — mobile fix ----------
   On narrow screens, a 12-col row for Subject/Credits/Grade/Delete crushes inputs.
   Stack into two rows: text input full-width, then credits + grade + delete in one row. */
@media (max-width: 640px) {

  #subjects-container .grid.grid-cols-12,
  .subject-row.grid.grid-cols-12 {
    grid-template-columns: repeat(12, 1fr);
    row-gap: 0.5rem;
  }

  /* Column-header row: hide on mobile — each field shows its own floating label */
  #subjects-container>.grid.grid-cols-12:first-child {
    display: none;
  }

  /* Stack subject input full-width on top */
  .subject-row.grid>.col-span-4:first-child {
    grid-column: span 12;
  }

  /* Below: Credits (5) + Grade (5) + Delete (2) */
  .subject-row.grid>.col-span-3 {
    grid-column: span 5;
  }

  .subject-row.grid>.col-span-4:not(:first-child) {
    grid-column: span 5;
  }

  .subject-row.grid>.col-span-1 {
    grid-column: span 2;
  }

  /* Floating-style labels above each mobile field */
  .subject-row.grid>.col-span-4:first-child::before {
    content: 'Subject';
  }

  .subject-row.grid>.col-span-3::before {
    content: 'Credits';
  }

  .subject-row.grid>.col-span-4:not(:first-child)::before {
    content: 'Grade';
  }

  .subject-row.grid>.col-span-4:first-child::before,
  .subject-row.grid>.col-span-3::before,
  .subject-row.grid>.col-span-4:not(:first-child)::before {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-bottom: 0.3rem;
  }

  /* Separate each subject row visually */
  .subject-row.grid {
    padding: 0.875rem;
    border: 1.5px solid var(--gray-100);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    margin-bottom: 0.75rem;
  }

  /* Tighten inputs inside calc cards */
  .input-field,
  .select-field {
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
  }

  .select-field {
    padding-right: 2rem;
  }

  /* Calculator result value reads smaller on tight screens */
  .calc-result {
    padding: 1.25rem;
  }

  .calc-result-value,
  .text-5xl {
    font-size: 2.25rem !important;
  }

  /* Stack calculator action buttons full width */
  .card .flex.gap-3.mb-6 {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .card .flex.gap-3.mb-6>button {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* =========================================================
   Admin + Extended Utility Classes
   (replaces Tailwind classes used in admin views)
   ========================================================= */

/* --- Border radius --- */
.rounded {
  border-radius: 0.25rem;
}

.rounded-xl {
  border-radius: 0.75rem;
}

.rounded-2xl {
  border-radius: 1rem;
}

.rounded-full {
  border-radius: 9999px;
}

/* --- Shadows --- */
.shadow-soft {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
}

.shadow-sm {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* --- Backgrounds --- */
.bg-white {
  background-color: #ffffff;
}

.bg-gray-50 {
  background-color: var(--gray-50);
}

.bg-gray-100 {
  background-color: var(--gray-100);
}

.bg-gray-200 {
  background-color: var(--gray-200);
}

.bg-primary-50 {
  background-color: var(--purple-50);
}

.bg-primary-100 {
  background-color: var(--purple-100);
}

/* --- Borders --- */
.border {
  border: 1px solid var(--gray-200);
}

.border-b {
  border-bottom: 1px solid var(--gray-200);
}

.border-t {
  border-top: 1px solid var(--gray-200);
}

.border-gray-50 {
  border-color: var(--gray-50);
}

.border-gray-100 {
  border-color: var(--gray-100);
}

.border-red-400 {
  border-color: #F87171;
}

.overflow-hidden {
  overflow: hidden;
}

/* --- Text alignment --- */
.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

/* --- Text colours (extended) --- */
.text-primary-500 {
  color: var(--purple-500);
}

.text-primary-600 {
  color: var(--purple-600);
}

.text-primary-700 {
  color: var(--purple-700);
}

.text-red-500 {
  color: #EF4444;
}

/* --- Padding (extended) --- */
.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.py-1\.5 {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.pb-3 {
  padding-bottom: 0.75rem;
}

.pb-4 {
  padding-bottom: 1rem;
}

.p-6 {
  padding: 1.5rem;
}

/* --- Margin (extended) --- */
.mt-0\.5 {
  margin-top: 0.125rem;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mb-5 {
  margin-bottom: 1.25rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

/* --- Sizing (extended) --- */
.w-4 {
  width: 1rem;
}

.h-4 {
  height: 1rem;
}

.w-12 {
  width: 3rem;
}

.h-12 {
  height: 3rem;
}

.max-w-xs {
  max-width: 20rem;
}

.max-w-sm {
  max-width: 24rem;
}

.max-w-3xl {
  max-width: 48rem;
}

/* --- Spacing --- */
.space-y-5>*+* {
  margin-top: 1.25rem;
}

.space-y-6>*+* {
  margin-top: 1.5rem;
}

/* --- Whitespace --- */
.whitespace-nowrap {
  white-space: nowrap;
}

.resize-none {
  resize: none;
}

.resize-y {
  resize: vertical;
}

/* --- Alignment (extended) --- */
.justify-end {
  justify-content: flex-end;
}

.last\:border-0>*:last-child {
  border: none;
}

/* --- Hover states for admin buttons --- */
.hover\:bg-gray-50:hover {
  background-color: var(--gray-50);
}

.hover\:bg-gray-100:hover {
  background-color: var(--gray-100);
}

.hover\:bg-gray-200:hover {
  background-color: var(--gray-200);
}

.hover\:bg-primary-100:hover {
  background-color: var(--purple-100);
}

.hover\:underline:hover {
  text-decoration: underline;
}

.hover\:text-primary-700:hover {
  color: var(--purple-700);
}

/* --- Table utilities --- */
.divide-y>*+* {
  border-top: 1px solid var(--gray-100);
}

.divide-gray-50>*+* {
  border-color: var(--gray-50);
}

/* --- Gradient card backgrounds (admin stat cards) --- */
.bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, var(--tw-from, #0B3D91), var(--tw-to, #082E6D));
}

.from-primary-500 {
  --tw-from: var(--purple-500);
}

.to-purple-600 {
  --tw-to: var(--purple-600);
}

.from-teal-500 {
  --tw-from: var(--teal-500);
}

.to-green-500 {
  --tw-to: #22C55E;
}

.from-amber-500 {
  --tw-from: #F59E0B;
}

.to-orange-500 {
  --tw-to: #F97316;
}

.from-pink-500 {
  --tw-from: #EC4899;
}

.to-rose-500 {
  --tw-to: #F43F5E;
}

/* Stat icon gradients (direct fix for admin dashboard) */
.from-primary-500.to-purple-600 {
  background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
}

.from-teal-500.to-green-500 {
  background: linear-gradient(135deg, var(--teal-500), #22C55E);
}

.from-amber-500.to-orange-500 {
  background: linear-gradient(135deg, #F59E0B, #F97316);
}

.from-pink-500.to-rose-500 {
  background: linear-gradient(135deg, #EC4899, #F43F5E);
}

/* --- File input (admin post form) --- */
input[type="file"] {
  display: block;
  width: 100%;
  font-size: 0.875rem;
  color: var(--gray-500);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin-right: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--purple-50);
  color: var(--purple-600);
  cursor: pointer;
  transition: background 0.15s;
}

input[type="file"]::file-selector-button:hover {
  background: var(--purple-100);
}

/* Checkbox */
input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--purple-600);
  cursor: pointer;
}

/* --- Responsive grids (admin) --- */
@media (min-width: 640px) {
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(31, 75, 185, 0.25);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--purple-500);
}


/* ==========================================================================
   RESPONSIVE — Mobile-First, All Breakpoints
   ========================================================================== */

/* --- Responsive helper classes for inline grids --- */
.responsive-hero-grid {
  display: flex;
  flex-direction: row;
  gap: 4rem;
  align-items: center;
}

.responsive-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.responsive-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

.responsive-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

.responsive-contact-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2.5rem;
  align-items: start;
}

.responsive-tool-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2.5rem;
  align-items: start;
}

.responsive-blog-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 3rem;
}

/* 1200px — Hide mega menu CTA panel */
@media (max-width: 1200px) {
  .mega-body {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .mega-cta {
    display: none;
  }
}

/* 1024px — Tablet */
@media (max-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
  }

  .stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .responsive-tool-layout {
    grid-template-columns: 1fr;
  }

  .responsive-hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .responsive-compare-grid {
    grid-template-columns: 1fr;
  }
}

/* Tablet fine-tune */
@media (max-width: 900px) {
  .responsive-hero-grid {
    gap: 2rem;
  }

  #hero-calc {
    max-width: 520px;
  }
}

/* 768px — Mobile breakpoint */
@media (max-width: 768px) {

  /* Navigation */
  .nav-links {
    display: none;
  }

  .nav-actions .btn-primary {
    display: none;
  }

  .nav-mobile-btn {
    display: flex;
  }

  .mega-menu {
    display: none !important;
  }

  /* Grids */
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 3rem 0;
  }

  .footer-grid>div:first-child {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 0.5rem;
  }

  .footer-grid>div:first-child div:first-child {
    justify-content: center;
  }

  .footer-grid>div:first-child p {
    margin-left: auto;
    margin-right: auto;
  }

  .footer-heading {
    margin-bottom: 0.875rem;
    font-size: 0.75rem;
  }

  .footer-link {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
  }

  .stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section {
    padding: 3.5rem 0;
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }

  .admin-sidebar {
    display: none;
  }

  .admin-main {
    margin-left: 0;
  }

  /* Hero grid */
  .responsive-hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Steps grid */
  .responsive-steps-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Info cards grid */
  .responsive-info-grid {
    grid-template-columns: 1fr;
  }

  /* Compare grid */
  .responsive-compare-grid {
    grid-template-columns: 1fr;
  }

  /* Contact page grid */
  .responsive-contact-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Tool show page layout */
  .responsive-tool-layout {
    grid-template-columns: 1fr;
  }

  /* Blog header */
  .responsive-blog-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* Typography adjustments */
  h1 {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
  }

  h2 {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  h3 {
    font-size: 1.125rem;
  }

  /* Card padding on mobile */
  .card {
    padding: 1.25rem;
  }

  /* Footer bottom on smaller screens */
  .footer-bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
    padding: 1.25rem 0;
  }

  .footer-bottom span {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.625rem;
  }

  .footer-bottom .footer-link {
    font-size: 0.8125rem;
  }

  /* Calc result value on mobile */
  .calc-result-value {
    font-size: 2.25rem;
  }

  /* table overflow */
  .article-body table {
    font-size: 0.8125rem;
  }

  .article-body th,
  .article-body td {
    padding: 0.625rem 0.75rem;
  }
}

/* 480px — Small phones */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  /* Hero buttons stack evenly */
  .hero-btns {
    flex-wrap: wrap !important;
  }

  .hero-btns>* {
    flex: 1 1 100%;
    justify-content: center;
  }

  /* Article body tighter */
  .article-body {
    font-size: 1rem;
    line-height: 1.7;
  }

  .article-body h2 {
    font-size: 1.25rem;
  }

  .article-body h3 {
    font-size: 1.125rem;
  }

  .article-page-container {
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
  }

  .article-title {
    font-size: 1.5rem !important;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-cards {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 2.5rem 0;
    text-align: center;
  }

  .footer-grid>div:first-child {
    margin-bottom: 0.25rem;
  }

  .footer-heading {
    margin-bottom: 0.75rem;
  }

  .footer-link {
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
  }

  .section {
    padding: 2.5rem 0;
  }

  .hero {
    padding: 2rem 0 1.5rem;
  }

  /* Buttons stack on small screens */
  .btn-primary,
  .btn-secondary,
  .btn-ghost {
    font-size: 0.8125rem;
    padding: 0.6875rem 1.25rem;
  }

  /* Category cards tighter */
  .cat-card {
    padding: 1rem 0.5rem;
  }

  .cat-icon {
    width: 44px;
    height: 44px;
  }

  .cat-icon svg {
    width: 20px;
    height: 20px;
  }

  .cat-name {
    font-size: 0.8125rem;
  }

  .cat-count {
    font-size: 0.6875rem;
  }

  /* Tool card compact */
  .tool-card {
    padding: 1.25rem;
  }

  .tool-icon {
    width: 42px;
    height: 42px;
  }

  .tool-icon svg {
    width: 20px;
    height: 20px;
  }

  .tool-card-title {
    font-size: 0.9375rem;
  }

  .tool-card-desc {
    font-size: 0.8125rem;
  }

  /* Blog card compact */
  .blog-card-img {
    height: 160px;
  }

  .blog-card-body {
    padding: 1.125rem;
  }

  .blog-card-title {
    font-size: 0.9375rem;
  }

  .blog-card-excerpt {
    font-size: 0.8125rem;
  }
}


/* =========================================================
   FAQ Accordion
   ========================================================= */
.faq-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-lg);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.faq-item:hover {
  border-color: var(--gray-200);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.faq-item.faq-open {
  background: white;
  border-color: var(--purple-200);
  box-shadow: 0 4px 20px rgba(11, 61, 145, 0.08);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  text-align: left;
  line-height: 1.5;
  transition: color 0.2s;
}

.faq-question:hover {
  color: var(--purple-700);
}

.faq-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 0.625rem;
  background: linear-gradient(135deg, var(--purple-50), var(--teal-50));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-500);
  transition: all 0.3s;
}

.faq-item.faq-open .faq-icon {
  background: linear-gradient(135deg, var(--purple-600), var(--teal-600));
  color: white;
}

.faq-chevron {
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
}

.faq-item.faq-open .faq-chevron {
  transform: rotate(180deg);
  color: var(--purple-500);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Native <details>-based FAQ accordions (e.g. blog posts) manage their own
   open/closed state, so the answer must never be clipped by the max-height:0
   rule above. Without this, open answers render at zero height. */
details[open] > .faq-answer,
details.faq-item[open] .faq-answer {
  max-height: none;
  overflow: visible;
}

.faq-answer-inner {
  padding: 0 1.5rem 1.25rem 4.875rem;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--gray-500);
}

@media (max-width: 768px) {
  .faq-question {
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
  }

  .faq-answer-inner {
    padding: 0 1.25rem 1rem 1.25rem;
  }

  .faq-icon {
    display: none;
  }
}

/* ---------- Search Button ---------- */
.nav-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  background: transparent;
  cursor: pointer;
  color: var(--gray-500);
  transition: all 0.2s ease;
}

.nav-search-btn:hover {
  border-color: var(--purple-300);
  color: var(--purple-600);
  background: var(--purple-50);
  transform: scale(1.05);
}

/* ---------- Search Popup / Modal ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.search-overlay.open {
  opacity: 1;
  visibility: visible;
}

.search-popup {
  width: 100%;
  max-width: 640px;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transform: translateY(-16px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-overlay.open .search-popup {
  transform: translateY(0) scale(1);
}

.search-popup-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.5rem 0.25rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
}

.search-input-icon {
  width: 20px;
  height: 20px;
  color: var(--gray-400);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.0625rem;
  font-family: inherit;
  color: var(--gray-800);
  padding: 1rem 0;
  font-weight: 500;
}

.search-input::placeholder {
  color: var(--gray-400);
  font-weight: 400;
}

.search-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 0.375rem;
  border-radius: 4px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: inherit;
  flex-shrink: 0;
}

.search-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--gray-400);
  transition: all 0.15s;
  flex-shrink: 0;
}

.search-close-btn:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* Results area */
.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-empty,
.search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.search-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--purple-500);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-bottom: 0.75rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.search-group-label {
  padding: 0.625rem 1rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--gray-700);
  transition: all 0.15s ease;
}

.search-result-item:hover {
  background: var(--purple-50);
  color: var(--purple-700);
}

.search-result-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--purple-50), var(--teal-50));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--purple-500);
}

.search-result-icon svg {
  width: 18px;
  height: 18px;
}

.search-result-text {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-item:hover .search-result-title {
  color: var(--purple-700);
}

.search-result-desc {
  font-size: 0.8125rem;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.125rem;
}

.search-result-arrow {
  width: 16px;
  height: 16px;
  color: var(--gray-300);
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.15s;
}

.search-result-item:hover .search-result-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--purple-500);
}

/* Search responsive */
@media (max-width: 768px) {
  .search-overlay {
    padding-top: 2rem;
    padding: 1rem;
    align-items: flex-start;
  }

  .search-popup {
    max-width: 100%;
    border-radius: var(--radius-lg);
  }

  .search-kbd {
    display: none;
  }
}