:root {
  --primary-color: #1E3A8A;
  --secondary-color: #2563EB;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --white: #ffffff;
  --bg-color: #F8FAFC;
  --border-color: #e2e8f0;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #f59e0b;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
  --radius: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

html {
  scroll-behavior: smooth;
}

#categories,
.categories-section,
#subcategoriesSection,
.subcategories-section,
.latest-mcqs,
#latestMcqsList,
.hero {
  scroll-margin-top: 85px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Poppins', sans-serif;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

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

/* Navbar */
.navbar {
  background-color: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 15px 0;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo i {
  color: var(--secondary-color);
}

.site-logo {
  height: 40px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.highlight {
  color: var(--secondary-color);
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-light);
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--secondary-color);
}

.admin-link {
  background-color: var(--secondary-color);
  color: var(--white) !important;
  padding: 8px 16px;
  border-radius: var(--radius);
}

.admin-link:hover {
  background-color: var(--primary-color);
}

.mobile-menu {
  display: none;
  font-size: 24px;
  cursor: pointer;
}

/* Secondary Navbar */
.secondary-navbar {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 12px 0;
  overflow-x: auto;
  white-space: nowrap;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}

.secondary-navbar::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari and Opera */
}

.secondary-navbar .container {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
}

.secondary-nav-links {
  display: flex;
  gap: 25px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.secondary-nav-links a {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: var(--transition);
}

.secondary-nav-links a:hover,
.secondary-nav-links a.active {
  color: var(--white);
}

@media (max-width: 992px) {
  .secondary-navbar .container {
    justify-content: flex-start;
  }
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--white) 0%, #e2e8f0 100%);
  padding: 80px 0;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.hero h1 {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero p {
  font-size: 18px;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto 40px;
}

/* Native Hero Search Box */
.search-box-container {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: 50px;
  padding: 6px 8px 6px 22px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  border: 2px solid transparent;
  transition: var(--transition);
  position: relative;
}

.search-box:focus-within {
  border-color: var(--secondary-color);
  box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.2), 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.search-icon {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-right: 12px;
  transition: color 0.2s ease;
}

.search-box:focus-within .search-icon {
  color: var(--secondary-color);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text-dark);
  background: transparent;
  padding: 10px 5px;
  min-width: 0;
}

.search-box input::placeholder {
  color: #94a3b8;
  font-size: 0.95rem;
}

.clear-search-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1rem;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.clear-search-btn:hover {
  color: var(--danger);
}

.clear-search-btn.hidden {
  display: none !important;
}

.search-btn {
  border-radius: 50px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
  cursor: pointer;
  white-space: nowrap;
}

.search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.4);
}

.search-suggestions-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.suggestion-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 5px;
}

.suggestion-label i {
  color: #f59e0b;
}

.search-chip {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-color);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.search-chip:hover {
  background: var(--white);
  border-color: var(--secondary-color);
  color: var(--secondary-color);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.15);
}

@media (max-width: 600px) {
  .search-box {
    padding: 4px 6px 4px 14px;
    border-radius: 12px;
  }
  .search-box input {
    font-size: 0.9rem;
    padding: 8px 2px;
  }
  .search-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
    border-radius: 8px;
  }
  .search-chip {
    font-size: 0.78rem;
    padding: 4px 10px;
  }
}

/* Categories Section */
.categories-section {
  padding: 60px 0;
}

.subcategories-section {
  margin-top: 40px;
  background-color: var(--white);
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  text-align: center;
  border: 1px solid var(--border-color);
}

.subcategories-section.hidden {
  display: none;
}

.subcategories-section h3 {
  margin-bottom: 20px;
  color: var(--primary-color);
}

.subcategories-chips {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
}

.subcategories-chips::-webkit-scrollbar {
  width: 8px;
}

.subcategories-chips::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 4px;
}

.subcategories-chips::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.subcategories-chips::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.subcategory-chip {
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--card-shadow);
  width: 100%;
}

.subcategory-chip::after {
  content: '→';
  opacity: 0;
  transform: translateX(-10px);
  transition: var(--transition);
}

.subcategory-chip:hover,
.subcategory-chip.active {
  transform: translateY(-2px);
  box-shadow: var(--hover-shadow);
  filter: brightness(1.1);
}

.subcategory-chip:hover::after,
.subcategory-chip.active::after {
  opacity: 1;
  transform: translateX(0);
}

.latest-mcqs {
  padding: 60px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 32px;
  color: var(--primary-color);
}

.underline {
  height: 4px;
  width: 60px;
  background-color: var(--secondary-color);
  margin: 10px auto 0;
  border-radius: 2px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
}

.category-card {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 25px;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
  border-color: var(--secondary-color);
}

.category-card.active {
  border-color: var(--secondary-color);
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.25);
  transform: translateY(-4px);
}

.category-card.active::before {
  content: '✓ Active';
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--secondary-color);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.category-icon {
  font-size: 38px;
  color: var(--secondary-color);
  margin-bottom: 15px;
  transition: var(--transition);
}

.category-card:hover .category-icon,
.category-card.active .category-icon {
  transform: scale(1.1);
}

.category-card h3 {
  font-size: 19px;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.category-card p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 15px;
}

.category-stats-badge {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.category-stats-badge span {
  background-color: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.topic-search-input {
  width: 100%;
  max-width: 400px;
  padding: 10px 16px;
  margin: 15px auto 20px auto;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
  display: block;
}

.topic-search-input:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Complete Questions List / Cards */
.mcqs-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.question-card {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.question-card:hover {
  box-shadow: var(--hover-shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
}

.category-badge {
  background: var(--bg-color);
  color: var(--primary-color);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border-color);
}

.difficulty-badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.difficulty-Medium {
  background-color: #fef3c7;
  color: var(--warning);
}

.difficulty-Easy {
  background-color: #d1fae5;
  color: var(--success);
}

.difficulty-Hard {
  background-color: #fee2e2;
  color: var(--danger);
}

.question-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 25px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 25px;
}

.option-item {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: pointer;
  font-size: 16px;
}

.options-list:not(.answered) .option-item:hover {
  background-color: var(--bg-color);
  border-color: var(--secondary-color);
  transform: translateX(4px);
}

.option-item.correct {
  background-color: #ecfdf5;
  border-color: var(--success);
  color: #065f46;
}

.option-item.correct .option-letter {
  background-color: var(--success);
  color: var(--white);
  border-color: var(--success);
}

.option-item.incorrect {
  background-color: #fef2f2;
  border-color: var(--danger);
  color: #991b1b;
}

.option-item.incorrect .option-letter {
  background-color: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}

.options-list.answered .option-item {
  cursor: default;
}

.option-letter {
  font-weight: 700;
  width: 30px;
  height: 30px;
  background-color: var(--bg-color);
  border-radius: 50%;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  color: var(--text-light);
  transition: var(--transition);
}

.option-text {
  flex: 1;
}

.action-buttons {
  display: flex;
  justify-content: flex-end;
}

.btn-show-answer {
  background-color: transparent;
  color: var(--secondary-color);
  border: 1px solid var(--secondary-color);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.btn-show-answer:hover {
  background-color: var(--secondary-color);
  color: var(--white);
}

.answer-section {
  margin-top: 20px;
  padding: 20px;
  background-color: var(--bg-color);
  border-radius: var(--radius);
  display: none;
  border-left: 4px solid var(--primary-color);
}

.answer-section.show {
  display: block;
  animation: fadeIn 0.4s ease forwards;
}

.correct-answer-text {
  font-weight: 700;
  color: var(--success);
  margin-bottom: 10px;
}

/* Footer */
footer {
  background-color: var(--white);
  padding: 40px 0 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-light);
}

/* Forms */
.form-container {
  max-width: 500px;
  margin: 50px auto;
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  outline: none;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-primary {
  background-color: var(--secondary-color);
  color: var(--white);
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  font-size: 16px;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.btn-primary:hover {
  background-color: var(--primary-color);
}

/* Utility */
.loading {
  text-align: center;
  padding: 20px;
  color: var(--text-light);
  font-style: italic;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* Pagination controls */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 40px;
}

.page-btn {
  background-color: var(--secondary-color);
  color: var(--white);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  box-shadow: var(--card-shadow);
}

.page-btn.disabled {
  background-color: #cbd5e1;
  color: var(--text-light);
  cursor: not-allowed;
  box-shadow: none;
}

.page-btn:not(.disabled):hover {
  background-color: var(--primary-color);
}

.page-info {
  font-weight: 600;
  color: var(--text-dark);
}

/* Comments section */
.comments-section {
  background-color: transparent;
}

.comment-item {
  background-color: var(--white);
  padding: 12px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  margin-bottom: 10px;
}

.comment-date {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 5px;
}

.comment-text {
  font-size: 0.95rem;
  color: var(--text-dark);
  line-height: 1.4;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .navbar .container {
    position: relative;
  }

  .mobile-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    color: var(--primary-color);
    font-size: 22px;
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    transition: var(--transition);
  }

  .mobile-menu:hover,
  .mobile-menu.active {
    background-color: #f1f5f9;
    color: var(--secondary-color);
    border-color: var(--border-color);
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background-color: var(--white);
    flex-direction: column;
    gap: 0;
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-bottom: 2px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                transform 0.25s ease,
                visibility 0.35s;
    z-index: 1001;
  }

  .nav-links.nav-open {
    max-height: 400px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    padding: 10px 0 15px 0;
  }

  .nav-links a {
    display: flex;
    align-items: center;
    padding: 13px 25px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
    border-bottom: 1px solid #f8fafc;
    transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background-color: #f1f5f9;
    color: var(--secondary-color);
    padding-left: 32px;
  }

  .nav-links .admin-link {
    margin: 12px 25px 5px 25px;
    display: block;
    text-align: center;
    background-color: var(--secondary-color);
    color: var(--white) !important;
    border-radius: var(--radius);
    padding: 10px 16px;
  }

  .nav-links .admin-link:hover {
    background-color: var(--primary-color);
    padding-left: 16px;
  }

  .hero h1 {
    font-size: 36px;
  }
}


/* ============================================================
   DARK MODE
   ============================================================ */

/* Anti-FOUC: also target html.dark-mode (set before CSS loads) */
html.dark-mode body,
body.dark-mode {
  --primary-color: #3b82f6;
  --secondary-color: #1e3a5f;
  --text-dark: #e2e8f0;
  --text-light: #94a3b8;
  --white: #1e293b;
  --bg-color: #0f172a;
  --border-color: #334155;
  --card-shadow: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.3);
  --hover-shadow: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -2px rgba(0,0,0,0.3);
  color-scheme: dark;
}

html.dark-mode body,
body.dark-mode {
  background-color: var(--bg-color);
  color: var(--text-dark);
}

html.dark-mode .navbar,
body.dark-mode .navbar {
  background-color: #1e293b;
  border-bottom: 1px solid #334155;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

html.dark-mode .secondary-navbar,
body.dark-mode .secondary-navbar {
  background-color: #0f172a;
  border-bottom: 1px solid #334155;
}

html.dark-mode .secondary-nav-links a,
body.dark-mode .secondary-nav-links a {
  color: #94a3b8;
}

html.dark-mode .secondary-nav-links a:hover,
body.dark-mode .secondary-nav-links a:hover {
  color: #3b82f6;
  background-color: rgba(59,130,246,0.1);
}

html.dark-mode .hero,
body.dark-mode .hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
}

html.dark-mode .hero h1,
body.dark-mode .hero h1 {
  color: #e2e8f0;
}

html.dark-mode .search-box,
body.dark-mode .search-box {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

html.dark-mode .search-box input,
body.dark-mode .search-box input {
  background: transparent;
  color: #e2e8f0;
}

html.dark-mode .search-box input::placeholder,
body.dark-mode .search-box input::placeholder {
  color: #64748b;
}

html.dark-mode .search-chip,
body.dark-mode .search-chip {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

html.dark-mode .search-chip:hover,
body.dark-mode .search-chip:hover {
  background: rgba(59,130,246,0.15);
  border-color: #3b82f6;
  color: #3b82f6;
}

html.dark-mode .categories-section,
body.dark-mode .categories-section {
  background-color: var(--bg-color);
}

html.dark-mode .category-card,
body.dark-mode .category-card {
  background: #1e293b;
  border-color: #334155;
}

html.dark-mode .category-card:hover,
body.dark-mode .category-card:hover {
  background: #263447;
  border-color: #3b82f6;
}

html.dark-mode .latest-mcqs,
body.dark-mode .latest-mcqs {
  background-color: var(--bg-color);
}

html.dark-mode .question-card,
body.dark-mode .question-card {
  background: #1e293b;
  border-color: #334155;
}

html.dark-mode .option-item,
body.dark-mode .option-item {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

html.dark-mode .option-item:hover,
body.dark-mode .option-item:hover {
  background: rgba(59,130,246,0.1);
  border-color: #3b82f6;
}

html.dark-mode .answer-section,
body.dark-mode .answer-section {
  background: #0f172a;
  border-color: #334155;
}

html.dark-mode .subcategories-section,
body.dark-mode .subcategories-section {
  background: #1e293b;
  border-color: #334155;
}

html.dark-mode .subcategory-chip,
body.dark-mode .subcategory-chip {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

html.dark-mode .subcategory-chip:hover,
body.dark-mode .subcategory-chip:hover {
  background: rgba(59,130,246,0.15);
  border-color: #3b82f6;
}

html.dark-mode footer,
body.dark-mode footer {
  background: #0f172a;
  border-top: 1px solid #334155;
  color: #64748b;
}

html.dark-mode .nav-links a,
body.dark-mode .nav-links a {
  color: #94a3b8;
}

html.dark-mode .nav-links a:hover,
html.dark-mode .nav-links a.active,
body.dark-mode .nav-links a:hover,
body.dark-mode .nav-links a.active {
  color: #3b82f6;
}

html.dark-mode .logo span,
body.dark-mode .logo span {
  color: #e2e8f0;
}

html.dark-mode .topic-search-input,
body.dark-mode .topic-search-input {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

/* Mobile nav in dark mode */
@media (max-width: 768px) {
  html.dark-mode .nav-links,
  body.dark-mode .nav-links {
    background-color: #1e293b;
    border-top: 1px solid #334155;
  }
}

/* ---- Dark Mode Toggle Button ---- */
.dark-mode-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-light);
  font-size: 1rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.dark-mode-toggle:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background: rgba(59,130,246,0.08);
}

/* Switch icon to sun when dark mode is active */
html.dark-mode .dark-mode-toggle i,
body.dark-mode .dark-mode-toggle i {
  font-weight: 900;
}

html.dark-mode .dark-mode-toggle i::before,
body.dark-mode .dark-mode-toggle i::before {
  content: "\f185"; /* fa-sun */
}

/* ============================================================
   BOOKMARKS
   ============================================================ */

/* Toolbar above the MCQ list */
.mcqs-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* "My Bookmarks" button */
.btn-bookmarks {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: transparent;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-bookmarks:hover,
.btn-bookmarks.active {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245,158,11,0.08);
}

.btn-bookmarks.active .fa-bookmark {
  font-weight: 900; /* solid bookmark when active */
}

.bookmark-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

/* Small secondary button */
.btn-sm {
  padding: 7px 14px;
  font-size: 0.85rem;
}

/* Bookmark icon button on each question card */
.bookmark-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 1.1rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: var(--transition);
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.bookmark-btn:hover {
  color: #f59e0b;
  background: rgba(245,158,11,0.1);
}

.bookmark-btn.bookmarked {
  color: #f59e0b;
}

.bookmark-btn.bookmarked i {
  font-weight: 900; /* solid */
}

/* Empty-state for bookmarks view */
.bookmarks-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.bookmarks-empty i {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
  color: #f59e0b;
  opacity: 0.5;
}

.bookmarks-empty h3 {
  margin-bottom: 8px;
  color: var(--text-dark);
}


/* Dark mode overrides for Quiz Simulator, Admin Dashboard & About page */
html.dark-mode .setup-card,
body.dark-mode .setup-card,
html.dark-mode .quiz-header,
body.dark-mode .quiz-header,
html.dark-mode .quiz-card,
body.dark-mode .quiz-card,
html.dark-mode .results-card,
body.dark-mode .results-card {
  background: #1e293b;
  border: 1px solid #334155;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

html.dark-mode .form-control,
body.dark-mode .form-control {
  background-color: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

html.dark-mode .quiz-option,
body.dark-mode .quiz-option {
  background: #0f172a;
  border-color: #334155;
}

html.dark-mode .quiz-option:hover,
body.dark-mode .quiz-option:hover,
html.dark-mode .quiz-option.selected,
body.dark-mode .quiz-option.selected {
  background: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
}

html.dark-mode .option-letter,
body.dark-mode .option-letter {
  background: #1e293b;
  color: #e2e8f0;
}

html.dark-mode .progress-bar-bg,
body.dark-mode .progress-bar-bg {
  background: #334155;
}

html.dark-mode .score-metric.primary,
body.dark-mode .score-metric.primary {
  background: #1e3a5f;
  color: #93c5fd;
}

html.dark-mode .score-metric.warning,
body.dark-mode .score-metric.warning {
  background: #451a03;
  color: #fcd34d;
}

html.dark-mode .score-metric.info,
body.dark-mode .score-metric.info {
  background: #164e63;
  color: #67e8f9;
}

html.dark-mode .score-metric.dark,
body.dark-mode .score-metric.dark {
  background: #0f172a;
  color: #cbd5e1;
}

html.dark-mode .review-item,
body.dark-mode .review-item {
  background: #0f172a;
  border: 1px solid #334155;
}

html.dark-mode .review-opt-correct,
body.dark-mode .review-opt-correct {
  background: #064e3b;
  color: #6ee7b7;
}

html.dark-mode .review-opt-wrong,
body.dark-mode .review-opt-wrong {
  background: #7f1d1d;
  color: #fca5a5;
}

html.dark-mode .review-explanation,
body.dark-mode .review-explanation {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

/* Admin Dashboard in Dark Mode */
html.dark-mode .sidebar,
body.dark-mode .sidebar {
  background: #1e293b;
  border-color: #334155;
}

html.dark-mode .sidebar-menu li a,
body.dark-mode .sidebar-menu li a {
  color: #94a3b8;
}

html.dark-mode .sidebar-menu li a:hover,
body.dark-mode .sidebar-menu li a:hover,
html.dark-mode .sidebar-menu li a.active,
body.dark-mode .sidebar-menu li a.active {
  background: #0f172a;
  color: #3b82f6;
  border-left-color: #3b82f6;
}

html.dark-mode .main-content,
body.dark-mode .main-content {
  background: #0f172a;
}

html.dark-mode .stat-card,
body.dark-mode .stat-card,
html.dark-mode .admin-section,
body.dark-mode .admin-section {
  background: #1e293b;
  border: 1px solid #334155;
}

html.dark-mode .data-table th,
body.dark-mode .data-table th {
  background: #0f172a;
  color: #e2e8f0;
  border-bottom: 1px solid #334155;
}

html.dark-mode .data-table td,
body.dark-mode .data-table td {
  border-bottom: 1px solid #334155;
  color: #cbd5e1;
}

html.dark-mode #loginOverlay .form-container,
body.dark-mode #loginOverlay .form-container {
  background: #1e293b !important;
  color: #e2e8f0;
  border: 1px solid #334155;
}

/* About Page in Dark Mode */
html.dark-mode .about-container,
body.dark-mode .about-container {
  background: #1e293b;
  border-color: #334155;
}

html.dark-mode .mission-box,
body.dark-mode .mission-box {
  background-color: #064e3b;
  color: #d1fae5;
  border-left-color: #10b981;
}


/* ============================================================
   STUDY RESOURCES SECTION
   ============================================================ */
.study-resources-section {
  padding: 60px 0;
  background: var(--bg-color);
}

.study-resources-section .section-subtitle {
  color: var(--text-light);
  font-size: 1rem;
  margin-top: 10px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.resource-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  gap: 16px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.resource-card:hover {
  box-shadow: var(--hover-shadow);
  transform: translateY(-3px);
  border-color: var(--secondary-color);
}

.resource-icon {
  font-size: 2.4rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 4px;
}

.resource-content {
  flex: 1;
  min-width: 0;
}

.resource-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
  line-height: 1.4;
}

.resource-content p {
  font-size: 0.875rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 12px;
}

.resource-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.resource-meta span {
  font-size: 0.75rem;
  background: #EFF6FF;
  color: var(--secondary-color);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
  border: 1px solid #BFDBFE;
}

.resource-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--secondary-color);
  color: var(--white);
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.resource-btn:hover {
  background: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.resource-btn i {
  font-size: 0.8rem;
}

/* Dark mode for resources */
html.dark-mode .study-resources-section,
body.dark-mode .study-resources-section {
  background: #0f172a;
}

html.dark-mode .resource-card,
body.dark-mode .resource-card {
  background: #1e293b;
  border-color: #334155;
}

html.dark-mode .resource-content h3,
body.dark-mode .resource-content h3 {
  color: #e2e8f0;
}

html.dark-mode .resource-content p,
body.dark-mode .resource-content p {
  color: #94a3b8;
}

html.dark-mode .resource-meta span,
body.dark-mode .resource-meta span {
  background: #1e3a5f;
  color: #93c5fd;
  border-color: #1e40af;
}

html.dark-mode .study-resources-section .section-subtitle,
body.dark-mode .study-resources-section .section-subtitle {
  color: #94a3b8;
}

/* Responsive */
@media (max-width: 600px) {
  .resources-grid {
    grid-template-columns: 1fr;
  }
  .resource-card {
    flex-direction: column;
  }
  .resource-icon {
    font-size: 2rem;
  }
}


/* ==========================================================================
   Interesting Facts Section Styles
   ========================================================================== */
.interesting-facts-section {
  padding: 80px 0;
  background-color: var(--white);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.facts-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  margin-bottom: 35px;
}

.facts-search-wrapper {
  position: relative;
  width: 100%;
  max-width: 550px;
}

.facts-search-wrapper i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 16px;
}

.facts-search-input {
  width: 100%;
  padding: 12px 20px 12px 48px;
  border-radius: 50px;
  border: 2px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-dark);
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.facts-search-input:focus {
  border-color: var(--secondary-color);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.facts-filter-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.fact-pill-btn {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fact-pill-btn:hover {
  border-color: var(--secondary-color);
  color: var(--secondary-color);
  transform: translateY(-1px);
}

.fact-pill-btn.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.2);
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.fact-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.fact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hover-shadow);
  border-color: var(--secondary-color);
  background: var(--white);
}

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

.fact-card-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: transform 0.3s ease;
}

.fact-card:hover .fact-card-icon-wrap {
  transform: scale(1.1);
  background: var(--secondary-color);
  color: #ffffff;
}

.fact-card-badge {
  font-size: 12px;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

html.dark-mode .fact-card-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.fact-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
  line-height: 1.4;
}

.fact-card-body {
  font-size: 14px;
  color: var(--text-dark);
  line-height: 1.6;
  margin-bottom: 16px;
  flex-grow: 1;
}

.fact-card-highlight {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  color: #065f46;
  border-left: 3px solid var(--success);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
}

html.dark-mode .fact-card-highlight {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.facts-footer-cta {
  text-align: center;
  margin-top: 20px;
}

.facts-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--secondary-color);
  color: #ffffff;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.facts-cta-btn:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 58, 138, 0.3);
}

@media (max-width: 768px) {
  .facts-grid {
    grid-template-columns: 1fr;
  }
}


/* ========================================================
   Exam Preparation Guide Styles (FIA, NAB, CSS, PMS, Customs, etc.)
   ======================================================== */
.exam-guide-section {
  padding: 60px 0;
  background-color: var(--bg-color);
  scroll-margin-top: 85px;
}

.exam-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 30px;
}

.exam-tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--card-shadow);
}

.exam-tab-pill:hover {
  border-color: var(--secondary-color);
  color: var(--secondary-color);
  transform: translateY(-2px);
}

.exam-tab-pill.active {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.exam-card-wrapper {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--hover-shadow);
  transition: var(--transition);
}

.exam-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.exam-title-group h3 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.exam-title-group p {
  color: var(--text-light);
  font-size: 0.95rem;
}

.exam-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exam-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
}

.badge-fpsc { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.badge-bs17 { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.badge-bs16 { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.badge-ppsc { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.badge-negative { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.exam-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.exam-box {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
}

.exam-box h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.exam-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.exam-box ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-dark);
}

.exam-box ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--success);
  font-weight: bold;
}

.exam-box.tactics li::before {
  content: "★";
  color: var(--warning);
}

.exam-box.books li::before {
  content: "📖";
}

.exam-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.exam-links-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-exam-practice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--secondary-color);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: var(--transition);
}

.btn-exam-practice:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
}

.btn-exam-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--secondary-color);
  border: 1.5px solid var(--secondary-color);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: var(--transition);
}

.btn-exam-outline:hover {
  background: rgba(37, 99, 235, 0.08);
}

/* Master Guide Page Specific Styles */
.guide-hero {
  background: linear-gradient(135deg, #1e3a8a, #1e1b4b);
  color: #ffffff;
  padding: 60px 0 40px;
  text-align: center;
}

.guide-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.guide-hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 800px;
  margin: 0 auto 24px;
}

.guide-search-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.guide-search-input {
  width: 100%;
  padding: 14px 20px 14px 45px;
  border-radius: 50px;
  border: none;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.guide-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 1.1rem;
}

.comparison-table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--white);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.comparison-table th {
  background: var(--primary-color);
  color: #ffffff;
  padding: 14px 16px;
  font-weight: 600;
}

.comparison-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
}

.comparison-table tr:hover td {
  background: rgba(37, 99, 235, 0.04);
}

/* Dark mode overrides for exam guide */
body.dark-mode .exam-tab-pill {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-mode .exam-tab-pill.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
}

body.dark-mode .exam-card-wrapper {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .exam-box {
  background: #0f172a;
  border-color: #334155;
}

body.dark-mode .btn-exam-outline {
  color: #38bdf8;
  border-color: #38bdf8;
}

body.dark-mode .btn-exam-outline:hover {
  background: rgba(56, 189, 248, 0.1);
}

body.dark-mode .comparison-table-wrapper {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .comparison-table th {
  background: #0f172a;
}

body.dark-mode .comparison-table td {
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-mode .comparison-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}


/* ========================================================
   Written Examination & Essay Preparation Styles
   ======================================================== */
.written-prep-section {
  padding: 60px 0;
  background-color: var(--white);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  scroll-margin-top: 85px;
}

.written-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
  color: #ffffff;
  padding: 65px 0 45px;
  text-align: center;
  position: relative;
}

.written-hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 14px;
  line-height: 1.25;
}

.written-hero p {
  font-size: 1.15rem;
  max-width: 840px;
  margin: 0 auto 26px;
  opacity: 0.92;
  line-height: 1.6;
}

.written-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 30px 0 25px;
}

.written-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--card-shadow);
}

.written-tab-btn:hover {
  color: var(--secondary-color);
  border-color: var(--secondary-color);
  transform: translateY(-2px);
}

.written-tab-btn.active {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

/* Thesis Callout Block */
.thesis-box {
  background: rgba(37, 99, 235, 0.06);
  border-left: 5px solid var(--secondary-color);
  border-radius: 8px;
  padding: 18px 22px;
  margin: 18px 0;
}

.thesis-box strong {
  color: var(--primary-color);
  font-size: 1.05rem;
  display: block;
  margin-bottom: 6px;
}

.thesis-box p {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--text-dark);
  font-style: italic;
}

/* Essay Outline Styling */
.essay-outline-wrapper {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 26px;
  margin: 20px 0;
  font-family: inherit;
}

.outline-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.outline-roman {
  font-weight: 700;
  color: var(--primary-color);
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 1rem;
}

.outline-alpha {
  padding-left: 22px;
  margin: 6px 0;
  color: var(--text-dark);
  font-size: 0.93rem;
  line-height: 1.5;
}

.outline-numeric {
  padding-left: 44px;
  margin: 4px 0;
  color: var(--text-light);
  font-size: 0.88rem;
}

/* PEEL Argument Formula Cards */
.peel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.peel-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  border-top: 4px solid var(--secondary-color);
}

.peel-card h4 {
  font-size: 1.05rem;
  color: var(--secondary-color);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.peel-card p {
  font-size: 0.9rem;
  color: var(--text-dark);
  line-height: 1.5;
  margin: 0;
}

/* Do's and Don'ts Grid */
.dos-donts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
  margin: 24px 0;
}

.do-card {
  background: rgba(16, 185, 129, 0.04);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 24px;
}

.do-card h3 {
  color: var(--success);
  font-size: 1.2rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dont-card {
  background: rgba(239, 68, 68, 0.04);
  border: 1.5px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 24px;
}

.dont-card h3 {
  color: var(--danger);
  font-size: 1.2rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.do-card ul, .dont-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.do-card ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-dark);
}

.do-card ul li::before {
  content: "✔";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--success);
  font-weight: bold;
}

.dont-card ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-dark);
}

.dont-card ul li::before {
  content: "✖";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--danger);
  font-weight: bold;
}

/* Précis & Comprehension Box */
.precis-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.precis-original {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  font-size: 0.93rem;
  line-height: 1.65;
  color: var(--text-dark);
}

.precis-solution {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  padding: 20px;
  font-size: 0.93rem;
  line-height: 1.65;
  color: var(--text-dark);
}

.precis-meta-badge {
  display: inline-block;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--secondary-color);
  font-weight: 600;
  margin-bottom: 10px;
}

/* Interactive Checklist Styles */
.eval-checklist-box {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 26px;
  margin: 24px 0;
}

.eval-category-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 16px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.eval-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.eval-check-item:hover {
  background: rgba(37, 99, 235, 0.03);
  border-color: var(--secondary-color);
}

.eval-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  cursor: pointer;
  accent-color: var(--secondary-color);
}

.eval-check-item label {
  font-size: 0.92rem;
  color: var(--text-dark);
  line-height: 1.45;
  cursor: pointer;
  flex: 1;
}

/* Descriptive Model Answer Blocks */
.model-answer-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 30px;
  margin: 24px 0;
  box-shadow: var(--card-shadow);
}

.model-question-header {
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.model-question-header h3 {
  font-size: 1.35rem;
  color: var(--text-dark);
  line-height: 1.4;
  margin-bottom: 8px;
}

.model-answer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
}

.model-answer-content h4 {
  color: var(--primary-color);
  font-size: 1.1rem;
  margin: 20px 0 8px;
}

.model-answer-content p {
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--text-dark);
  margin-bottom: 14px;
}

/* Dark mode overrides for written prep */
body.dark-mode .written-prep-section {
  background-color: var(--bg-color);
  border-color: #334155;
}

body.dark-mode .written-tab-btn {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-mode .written-tab-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
}

body.dark-mode .essay-outline-wrapper,
body.dark-mode .peel-card,
body.dark-mode .precis-original,
body.dark-mode .eval-checklist-box,
body.dark-mode .model-answer-card {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .thesis-box {
  background: rgba(56, 189, 248, 0.08);
}

body.dark-mode .thesis-box strong {
  color: #38bdf8;
}

body.dark-mode .outline-roman {
  color: #38bdf8;
}

body.dark-mode .precis-solution {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.4);
}

body.dark-mode .eval-check-item {
  background: #0f172a;
  border-color: #334155;
}

body.dark-mode .model-answer-content h4 {
  color: #38bdf8;
}


/* ========================================================
   English Grammar Rules & Handbook Styles
   ======================================================== */
.grammar-section {
  padding: 60px 0;
  background-color: var(--bg-color);
  scroll-margin-top: 85px;
}

.grammar-hero {
  background: linear-gradient(135deg, #042f2e 0%, #115e59 50%, #0f766e 100%);
  color: #ffffff;
  padding: 65px 0 45px;
  text-align: center;
  position: relative;
}

.grammar-hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 14px;
  line-height: 1.25;
}

.grammar-hero p {
  font-size: 1.15rem;
  max-width: 860px;
  margin: 0 auto 26px;
  opacity: 0.92;
  line-height: 1.6;
}

.grammar-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 25px 0 35px;
}

.grammar-tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--card-shadow);
}

.grammar-tab-pill:hover {
  color: #0f766e;
  border-color: #0f766e;
  transform: translateY(-2px);
}

.grammar-tab-pill.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
}

.grammar-rule-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 25px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.grammar-rule-card:hover {
  box-shadow: var(--hover-shadow);
}

.rule-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.rule-header h3 {
  font-size: 1.35rem;
  color: var(--text-dark);
  margin: 0;
}

.rule-formula-box {
  background: rgba(15, 118, 110, 0.06);
  border-left: 4px solid #0f766e;
  border-radius: 6px;
  padding: 14px 18px;
  margin: 14px 0;
  font-family: inherit;
  font-size: 0.96rem;
  color: var(--text-dark);
}

.rule-formula-box strong {
  color: #0f766e;
  display: block;
  margin-bottom: 4px;
}

/* Grammar Table */
.grammar-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin: 18px 0;
  background: var(--white);
}

.grammar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

.grammar-table th {
  background: #0f766e;
  color: #ffffff;
  padding: 12px 16px;
  font-weight: 600;
}

.grammar-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
}

.grammar-table tr:hover td {
  background: rgba(15, 118, 110, 0.04);
}

/* Linguistic Sentence Breakdown Tokenizer Widget */
.sentence-breakdown-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  margin: 20px 0;
}

.sentence-full-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-color);
}

.token-stream {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.word-token-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: var(--card-shadow);
}

.token-word {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.token-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-noun { background: #dbeafe; color: #1e40af; }
.badge-verb { background: #fee2e2; color: #b91c1c; }
.badge-adj { background: #fef3c7; color: #b45309; }
.badge-adv { background: #e0e7ff; color: #4338ca; }
.badge-prep { background: #dcfce7; color: #15803d; }
.badge-pron { background: #f3e8ff; color: #6b21a8; }
.badge-conj { background: #ffedd5; color: #c2410c; }
.badge-art { background: #f1f5f9; color: #475569; }

/* Fixed Prepositions Grid */
.fixed-prep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.fixed-prep-item {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.fixed-prep-item:hover {
  border-color: #0f766e;
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.fixed-prep-bold {
  font-weight: 700;
  color: #0f766e;
}

/* Practice Drills Accordion */
.grammar-drill-item {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 14px;
}

.drill-question {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.drill-reveal-btn {
  background: transparent;
  border: 1px solid #0f766e;
  color: #0f766e;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.drill-reveal-btn:hover {
  background: #0f766e;
  color: #ffffff;
}

.drill-solution {
  margin-top: 12px;
  padding: 12px;
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid var(--success);
  border-radius: 4px;
  font-size: 0.92rem;
  color: var(--text-dark);
  display: none;
}

/* Dark mode overrides for grammar handbook */
body.dark-mode .grammar-section {
  background-color: var(--bg-color);
}

body.dark-mode .grammar-tab-pill {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-mode .grammar-tab-pill.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}

body.dark-mode .grammar-rule-card,
body.dark-mode .sentence-breakdown-card,
body.dark-mode .grammar-table-wrapper,
body.dark-mode .grammar-drill-item {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .grammar-table th {
  background: #042f2e;
}

body.dark-mode .grammar-table td {
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-mode .rule-formula-box {
  background: rgba(15, 118, 110, 0.12);
  color: #cbd5e1;
}

body.dark-mode .rule-formula-box strong {
  color: #2dd4bf;
}

body.dark-mode .word-token-unit,
body.dark-mode .fixed-prep-item {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-mode .fixed-prep-bold {
  color: #2dd4bf;
}

body.dark-mode .token-word {
  color: #e2e8f0;
}

body.dark-mode .drill-reveal-btn {
  color: #2dd4bf;
  border-color: #2dd4bf;
}

body.dark-mode .drill-reveal-btn:hover {
  background: #0f766e;
  color: #ffffff;
}


/* ═══════════════════════════════════════════════════════
   CATEGORIZED NAVIGATION — MEGA MENU + CATEGORY STRIP
   ═══════════════════════════════════════════════════════ */

/* ── Dropdown trigger button ── */
#mainNav.nav-links {
  align-items: center;
  gap: 14px;
}

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
  font-family: 'Inter', sans-serif;
  padding: 6px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-dropdown-btn:hover,
.nav-dropdown:hover .nav-dropdown-btn {
  color: var(--secondary-color);
  background: rgba(37, 99, 235, 0.07);
}

.nav-caret {
  font-size: 0.65rem;
  transition: transform 0.25s;
}

.nav-dropdown:hover .nav-caret,
.nav-dropdown-btn[aria-expanded="true"] .nav-caret {
  transform: rotate(180deg);
}

/* ── Mega-menu panel ── */
.mega-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);
  padding: 22px 24px;
  z-index: 2000;
  min-width: 680px;
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  animation: megaFadeIn 0.18s ease;
}

@keyframes megaFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.nav-dropdown:hover .mega-menu,
.nav-dropdown-btn[aria-expanded="true"] + .mega-menu {
  display: grid;
}

/* Keep panel open when hovering into it */
.mega-menu:hover {
  display: grid;
}

.mega-col h4 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mega-col a {
  display: block;
  font-size: 0.82rem;
  color: var(--text-dark);
  padding: 5px 6px;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.mega-col a:hover {
  background: rgba(37,99,235,0.07);
  color: var(--secondary-color);
}

/* ── CTA button in nav ── */
.nav-cta-btn {
  background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
  color: #fff !important;
  padding: 7px 14px !important;
  border-radius: 7px !important;
  font-weight: 700 !important;
  font-size: 0.84rem !important;
  transition: opacity 0.2s !important;
}
.nav-cta-btn:hover { opacity: 0.88 !important; }

/* ── Category Quick-Strip ── */
.category-strip {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 61px;
  z-index: 900;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.category-strip::-webkit-scrollbar { display: none; }

.cat-strip-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  white-space: nowrap;
}

.cat-strip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  padding: 6px 12px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.cat-strip-btn:hover {
  background: rgba(37,99,235,0.08);
  color: var(--secondary-color);
  border-color: rgba(37,99,235,0.15);
}
.cat-strip-btn.active {
  background: rgba(37,99,235,0.1);
  color: var(--secondary-color);
  border-color: rgba(37,99,235,0.2);
}
.cat-strip-highlight {
  color: #7c3aed !important;
  border-color: rgba(124,58,237,0.25) !important;
  background: rgba(124,58,237,0.06) !important;
}
.cat-strip-highlight:hover {
  background: rgba(124,58,237,0.12) !important;
}

/* ── Tools Hub Section ── */
.tools-hub-section {
  padding: 56px 0 40px;
  background: var(--bg-color);
}

.hub-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 24px 0 32px;
}

.hub-pill {
  background: #fff;
  border: 1.5px solid var(--border-color);
  color: var(--text-dark);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.hub-pill:hover, .hub-pill.active {
  background: var(--secondary-color);
  color: #fff;
  border-color: var(--secondary-color);
}

.hub-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.hub-category-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
}
.hub-category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--hover-shadow);
}
.hub-category-card.hidden { display: none; }

.hub-cat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  color: #fff;
}
.hub-cat-header i {
  font-size: 1.8rem;
  opacity: 0.9;
  flex-shrink: 0;
}
.hub-cat-header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  font-family: 'Poppins', sans-serif;
  line-height: 1.3;
}
.hub-cat-header p {
  font-size: 0.72rem;
  opacity: 0.85;
  margin: 2px 0 0;
}

.hub-cat-links {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hub-cat-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-dark);
  padding: 6px 8px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.hub-cat-links a:hover {
  background: rgba(37,99,235,0.07);
  color: var(--secondary-color);
}
.hub-cat-links a i {
  width: 16px;
  text-align: center;
  opacity: 0.65;
  font-size: 0.78rem;
}

.badge-new {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  background: #e11d48;
  color: #fff;
  letter-spacing: 0.03em;
  margin-left: auto;
}

/* ═══ DARK MODE ═══ */
html.dark-mode .mega-menu {
  background: #1e293b;
  border-color: #334155;
}
html.dark-mode .mega-col h4 {
  color: #94a3b8;
  border-color: #334155;
}
html.dark-mode .mega-col a,
html.dark-mode .nav-dropdown-btn {
  color: #e2e8f0;
}
html.dark-mode .mega-col a:hover,
html.dark-mode .nav-dropdown-btn:hover {
  background: rgba(96,165,250,0.1);
  color: #60a5fa;
}
html.dark-mode .category-strip {
  background: #0f172a;
  border-color: #1e293b;
}
html.dark-mode .cat-strip-btn { color: #94a3b8; }
html.dark-mode .cat-strip-btn:hover, html.dark-mode .cat-strip-btn.active {
  background: rgba(96,165,250,0.1);
  color: #60a5fa;
}
html.dark-mode .tools-hub-section { background: #0f172a; }
html.dark-mode .hub-category-card {
  background: #1e293b;
  border-color: #334155;
}
html.dark-mode .hub-cat-links a { color: #e2e8f0; }
html.dark-mode .hub-cat-links a:hover {
  background: rgba(96,165,250,0.08);
  color: #60a5fa;
}
html.dark-mode .hub-pill {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
html.dark-mode .hub-pill:hover, html.dark-mode .hub-pill.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

/* ═══ MOBILE MEGA-MENU ═══ */
@media (max-width: 1024px) {
  .mega-menu {
    position: fixed;
    top: 0; left: 0; right: 0;
    transform: none;
    min-width: unset;
    width: 100%;
    border-radius: 0;
    max-height: 85vh;
    overflow-y: auto;
    padding: 16px;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-dropdown { display: none; } /* hidden on mobile, use mobile drawer instead */
  .nav-cta-btn { display: none; }
  .hub-cards-grid { grid-template-columns: 1fr; }
  .hub-filter-pills { gap: 6px; }
  .hub-pill { font-size: 0.75rem; padding: 5px 12px; }
  .cat-strip-btn { font-size: 0.74rem; padding: 5px 10px; }
}

/* ── Scroll-margin for new hub ── */
#tools-hub {
  scroll-margin-top: 110px;
}


/* ═══════════════════════════════════════════════════════
   MOBILE MEGA-MENU (< 768px)
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Allow mobile drawer to be taller */
  .nav-links.nav-open {
    max-height: 92vh !important;
    overflow-y: auto;
  }

  /* Show dropdowns in mobile drawer as collapsible groups */
  .nav-dropdown {
    display: block !important;
    width: 100%;
  }

  .nav-dropdown-btn {
    width: 100%;
    padding: 13px 25px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 1px solid #f8fafc;
    justify-content: space-between;
  }

  .nav-dropdown-btn:hover {
    background: #f1f5f9;
    color: var(--secondary-color);
    border-radius: 0;
  }

  /* Mega-menu becomes an accordion panel on mobile */
  .mega-menu {
    position: static !important;
    transform: none !important;
    min-width: unset !important;
    width: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    border-top: 1px dashed var(--border-color) !important;
    box-shadow: none !important;
    padding: 10px 20px 16px !important;
    animation: none !important;
    background: #f8fafc !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .nav-dropdown:hover .mega-menu {
    display: none; /* don't auto-open on hover on mobile */
  }

  .mega-col h4 {
    margin-top: 12px;
    font-size: 0.7rem;
  }

  .mega-col a {
    font-size: 0.84rem;
    padding: 7px 8px;
    white-space: normal;
  }

  .nav-cta-btn {
    display: block !important;
    margin: 10px 20px;
    text-align: center;
    padding: 10px 16px !important;
  }

  /* Dark mode mobile drawer */
  html.dark-mode .mega-menu {
    background: #1e293b !important;
    border-top-color: #334155 !important;
  }

  html.dark-mode .nav-dropdown-btn {
    color: #e2e8f0;
    border-bottom-color: #1e293b;
  }
}
