@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;600&display=swap');

/* ===================================================================
   1. DESIGN SYSTEM & COLOR TOKENS
   =================================================================== */
:root {
  /* Matching LaunchIt Palette */
  --bg-main:         #dcd7c4;
  --bg-surface:      #FFFFFF;
  --bg-hero:         #1C1014;
  --bg-hero-alt:     #32151F;
  
  --primary-indigo:  #9F1239;
  --primary-hover:   #881337;
  --coral-accent:    #BE185D;
  --coral-hover:     #9D174D;
  --teal-free:       #0D9488;
  --amber-tag:       #B45309;

  --text-main:       #0F172A;
  --text-muted:      #64748B;
  --text-light:      #FCF8F9;
  --line-color:      #E2E8F0;

  /* Typography */
  --font-heading:    'Plus Jakarta Sans', sans-serif;
  --font-body:       'Inter', sans-serif;
  --font-mono:       'JetBrains Mono', monospace;

  /* Radii & Shadows */
  --radius-sm:       6px;
  --radius-md:       12px;
  --radius-lg:       18px;

  --shadow-sm:       0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md:       0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg:       0 12px 28px rgba(15, 23, 42, 0.12);
  --shadow-glow:     0 0 20px rgba(190, 24, 93, 0.25);

  --transition:      all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===================================================================
   2. GLOBAL RESETS
   =================================================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

/* ===================================================================
   3. NAVIGATION BAR
   =================================================================== */
.topbar {
  background: var(--bg-hero);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.topbar .logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 22px;
  color: var(--text-light);
}

.topbar .logo span {
  color: var(--coral-accent);
}

.topbar .nav-group {
  display: flex;
  align-items: center;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.topbar nav a {
  color: #94A3B8;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.topbar nav a:hover {
  color: var(--text-light);
}

.account-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 24px;
  transition: var(--transition);
}

.account-btn:hover {
  background: var(--coral-accent);
  border-color: var(--coral-accent);
  color: #FFFFFF;
  transform: translateY(-2px);
}

/* ===================================================================
   4. LAYOUT & CATEGORIES
   =================================================================== */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.section-title {
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  color: var(--text-main);
  margin-top: 50px;
  margin-bottom: 8px;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 36px;
}

/* Filter Bar */
.class-filter-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-surface);
  border: 1px solid var(--line-color);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 20px;
  border-radius: 24px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
  border-color: var(--coral-accent);
  color: var(--coral-accent);
}

.filter-btn.active {
  background: var(--coral-accent);
  color: #FFFFFF;
  border-color: var(--coral-accent);
  box-shadow: var(--shadow-glow);
}

/* Category Containers */
.test-category-group {
  margin-bottom: 48px;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
}

.category-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.category-indicator {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-practice {
  background: #FFE4E6;
  color: #BE185D;
}

.icon-revision {
  background: #FEF3C7;
  color: #B45309;
}

.icon-full {
  background: #CCFBF1;
  color: #0D9488;
}

.category-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.category-header p {
  font-size: 13.5px;
  color: var(--text-muted);
}

.category-count {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-surface);
  border: 1px solid var(--line-color);
  padding: 4px 12px;
  border-radius: 20px;
  color: var(--text-muted);
}

/* ===================================================================
   5. TEST CARDS
   =================================================================== */
.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.test-card {
  background: var(--bg-surface);
  border: 1px solid var(--line-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
}

.test-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.test-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.test-class-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: #F1F5F9;
  padding: 2px 8px;
  border-radius: 4px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag-free {
  background: #CCFBF1;
  color: var(--teal-free);
}

.tag-premium {
  background: #FFE4E6;
  color: var(--primary-indigo);
}

.test-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.3;
}

.test-subject {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.test-meta {
  display: flex;
  justify-content: space-between;
  background: var(--bg-main);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-top: auto;
  margin-bottom: 18px;
}

.btn-test {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hero);
  color: var(--text-light);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13.5px;
  transition: var(--transition);
}

.btn-test:hover {
  background: var(--coral-accent);
  color: #FFFFFF;
  box-shadow: var(--shadow-glow);
}

/* ===================================================================
   6. SITE FOOTER
   =================================================================== */
.site-footer {
  background: var(--bg-hero);
  color: #94A3B8;
  padding-top: 50px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand .logo {
  font-size: 20px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.footer-brand p {
  font-size: 13.5px;
  max-width: 340px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hero);
  color: var(--text-light);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
  /* border: 1px solid rgba(255, 255, 255, 0.2); */
}

.btn:hover {
  background: var(--coral-accent);
  border-color: var(--coral-accent);
  color: #FFFFFF;
}

.footer-bottom {
  background: #120A0D;
  padding: 20px 0;
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 10px;
}

.footer-legal a {
  margin-left: 20px;
  transition: var(--transition);
}

.footer-legal a:hover {
  color: var(--text-light);
}

.footer-disclaimer {
  font-size: 11.5px;
  color: #7C6970;
  text-align: center;
  line-height: 1.5;
}

/* ===================================================================
   7. RESPONSIVE MEDIA QUERIES
   =================================================================== */
@media (max-width: 768px) {
  .category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .category-count {
    align-self: flex-start;
  }

  .test-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner, .footer-bottom-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}