/* ============================================
   MODERN EXAM EXPLORER - REDESIGNED CSS
   Professional Layout with Sidebar
   ============================================ */

/* Base brand colors provided by custom-base.css */
:root {
  --primary-color: var(--primary);
  --secondary-color: #00d4ff;
  --accent-blue: #3498db;

  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Semantic Colors */
  --surface-primary: var(--white);
  --surface-secondary: var(--gray-50);
  --surface-tertiary: var(--gray-100);
  --border-light: var(--gray-200);
  --border-medium: var(--gray-300);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-tertiary: var(--gray-500);

  /* Gradients */
  --primary-gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #0891b2 100%);
  --warning-gradient: linear-gradient(135deg, #ffc107 0%, #e6850e 100%);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Shadows */
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Layout */
  --sidebar-width: 280px;
  --header-height: 80px;
}

/* ============================================
   BASE STYLES
   ============================================ */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--text-primary);
  line-height: 1.6;
}

.app-loaded {
  overflow-x: hidden;
}

/* ============================================
   LAYOUT STRUCTURE
   ============================================ */
.exam-explorer-layout {
  position: relative;
  min-height: 100vh;
  padding-top: var(--header-height);
}

/* ============================================
   SIDEBAR — fixed panel, independent scroll
   ============================================ */
.exam-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--white);
  border-right: 1px solid var(--border-light);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  z-index: 20;
  padding: var(--space-8) 0 var(--space-6);
  transition: transform var(--transition-base), width var(--transition-base);
}

.sidebar-section {
  margin-bottom: var(--space-8);
}

.sidebar-header {
  padding: 0 var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-4);
}

.sidebar-header h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-item {
  margin-bottom: var(--space-1);
}

.category-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.75rem var(--space-6);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
  font-weight: 500;
  font-size: 0.9rem;
}

.category-link:hover {
  background: var(--gray-50);
  color: var(--primary-color);
}

.category-link.active {
  background: rgba(44, 76, 123, 0.08);
  color: var(--primary-color);
  font-weight: 600;
}

.category-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary-color);
}

.category-link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.category-count {
  margin-left: auto;
  background: var(--gray-100);
  color: var(--text-secondary);
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.category-link.active .category-count {
  background: var(--primary-color);
  color: var(--white);
}

/* Sidebar scrollbar */
.exam-sidebar::-webkit-scrollbar {
  width: 6px;
}

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

.exam-sidebar::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

.exam-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.exam-main-content {
  margin-left: var(--sidebar-width);
  min-width: 0;
  padding: var(--space-8);
  transition: margin-left var(--transition-base);
}

/* Breadcrumb */
.content-breadcrumb {
  margin-bottom: var(--space-6);
}

.breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

.breadcrumb-item {
  color: var(--text-secondary);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--gray-400);
}

/* Page Header Section - New Combined Design */
.page-header-section {
  margin-bottom: var(--space-6);
  background: var(--white);
  border-radius: 14px;
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-sm);
}

.page-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.page-title-wrapper {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  flex: 1;
  min-width: 0;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-1);
}

.page-title-wrapper h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.page-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

/* Subtle results pill (replaces the big "20 Exams" badge) */
.results-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 10px;
  background: var(--primary-subtle, rgba(57, 73, 171, 0.08));
  color: var(--primary-color);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.results-pill .results-count {
  font-size: 0.85rem;
  font-weight: 700;
}
.results-pill .results-label {
  text-transform: lowercase;
  opacity: 0.85;
}

/* Search Bar in Content */
.header-search {
  width: 100%;
}

.search-input-container {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 3rem 0.75rem 3rem;
  font-size: 0.95rem;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  background: var(--gray-50);
  transition: all var(--transition-base);
  outline: none;
}

.search-input:focus {
  background: var(--white);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(44, 76, 123, 0.1);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 1rem;
  pointer-events: none;
}

#clearSearch {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
  transition: color var(--transition-fast);
}

#clearSearch:hover {
  color: var(--danger-color);
}

/* Search Suggestions */
.search-suggestions {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.suggestion-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition-fast);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item:focus {
  background: var(--gray-50);
}

.suggestion-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.suggestion-category {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.suggestion-highlight {
  background: rgba(44, 76, 123, 0.15);
  color: var(--primary-color);
  font-weight: 700;
  padding: 0 2px;
  border-radius: 2px;
}

/* Legacy results badge — kept inert in case any view still emits it */
.results-badge { display: none !important; }

/* Mobile Sidebar Toggle Button */
.mobile-sidebar-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  box-shadow: var(--shadow-xl);
  cursor: pointer;
  transition: all var(--transition-base);
  z-index: 95;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.mobile-sidebar-toggle:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.mobile-sidebar-toggle.active {
  background: var(--danger-color);
}

.mobile-sidebar-toggle.active i::before {
  content: "\f00d"; /* FontAwesome times icon */
}

/* ============================================
   EXAM GRID
   ============================================ */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.exam-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: var(--space-6);
  transition: all var(--transition-base);
  text-decoration: none;
  display: block;
  height: 100%;
}

.exam-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
  text-decoration: none;
}

.exam-info {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.exam-icon,
.exam-card img {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: contain;
}

.exam-icon-gradient {
  background: var(--warning-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
}

.exam-details {
  flex: 1;
  min-width: 0;
}

.category-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-1);
  line-height: 1.3;
}

.category-description {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exam-arrow {
  color: var(--gray-400);
  transition: all var(--transition-base);
}

.exam-card:hover .exam-arrow {
  color: var(--primary-color);
  transform: translateX(4px);
}

/* Exam Stats */
.exam-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.stat-box {
  background: var(--gray-50);
  border-radius: 10px;
  padding: var(--space-3);
  text-align: center;
}

.stat-box h6 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 var(--space-1);
  color: var(--primary-color);
}

.stat-box.success h6 {
  color: var(--success-color);
}

.stat-box small {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: var(--space-8);
}

.pagination {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--white);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.pagination-btn:hover:not(.disabled):not(.active) {
  background: var(--gray-50);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.pagination-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
}

.pagination-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: var(--space-12);
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border-light);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-6);
  background: var(--gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon i {
  font-size: 2rem;
  color: var(--gray-400);
}

.empty-state-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-3);
}

.empty-state-description {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0 0 var(--space-6);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}

.cta-button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============================================
   LOADING STATES
   ============================================ */
#loadingIndicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--white);
  padding: var(--space-6);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  z-index: 1000;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .exam-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0;
  }

  /* Hide the desktop collapse button on mobile */
  .sidebar-collapse-btn {
    display: none !important;
  }

  .exam-sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    box-shadow: none;
    z-index: 1050;
    width: 280px;
    top: var(--header-height);                 /* start below header */
    height: calc(100vh - var(--header-height));
    padding-top: var(--space-6);
  }

  .exam-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  /* Overlay when sidebar is open — placed as sibling so it doesn't sit
     under the sidebar's z-index */
  .exam-explorer-layout.sidebar-mobile-open::after {
    content: '';
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1040;
  }

  .exam-main-content {
    margin-left: 0;
    max-width: 100%;
    padding: var(--space-4);
  }

  .mobile-sidebar-toggle {
    display: flex;
    z-index: 1060;                             /* always above sidebar */
  }
  .mobile-sidebar-toggle.active {
    /* shift slightly right when sidebar is open so it sits at the edge
       of the open drawer instead of being hidden behind content */
    right: 16px;
    bottom: 16px;
  }
  
  .page-header-section {
    padding: var(--space-4);
  }
  
  .page-header-top {
    flex-direction: column;
    gap: var(--space-4);
  }
  
  .page-title-wrapper h2 {
    font-size: 1.5rem;
  }
  
  .results-badge {
    width: 100%;
    justify-content: center;
  }
  
  .exam-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

@media (max-width: 480px) {
  .page-title-wrapper h2 {
    font-size: 1.25rem;
  }
  
  .page-description {
    font-size: 0.9rem;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.d-none {
  display: none !important;
}

.focus-visible:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.back-to-top,
.scroll-to-top,
#backToTop,
[class*="back-top"],
[class*="scroll-top"] {
  display: none !important;
}

footer {
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-base);
}

@media (max-width: 768px) {
  footer {
    margin-left: 0;
  }
}
/* ============================================
   COMPACT EXAM CARD MODIFICATIONS
   Add these styles to your explore_all_exams.css
   ============================================ */

/* More compact exam card */
.exam-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: var(--space-5); /* Reduced from space-6 */
  transition: all var(--transition-base);
  text-decoration: none;
  display: block;
  height: 100%;
}

.exam-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
  text-decoration: none;
}

/* More compact info section */
.exam-info {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3); /* Reduced from space-4 */
  margin-bottom: var(--space-4); /* Reduced from space-5 */
}

/* Smaller icon */
.exam-icon,
.exam-card img {
  width: 44px; /* Reduced from 50px */
  height: 44px; /* Reduced from 50px */
  border-radius: 10px; /* Slightly reduced */
  flex-shrink: 0;
  object-fit: contain;
}

.exam-icon-gradient {
  background: var(--warning-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 0.8rem; /* Reduced from 0.9rem */
  box-shadow: var(--shadow-md);
}

.exam-details {
  flex: 1;
  min-width: 0;
}

/* Smaller title */
.category-title {
  font-size: 1rem; /* Reduced from 1.1rem */
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-1);
  line-height: 1.3;
}

/* Smaller description */
.category-description {
  font-size: 0.8rem; /* Reduced from 0.85rem */
  color: var(--text-tertiary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exam-arrow {
  color: var(--gray-400);
  transition: all var(--transition-base);
  font-size: 0.9rem; /* Slightly smaller */
}

.exam-card:hover .exam-arrow {
  color: var(--primary-color);
  transform: translateX(4px);
}

/* Compact Stats - Single Line Layout */
.exam-stats {
  display: flex; /* Changed from grid to flex */
  gap: var(--space-2); /* Reduced gap */
  align-items: stretch;
}

.stat-box {
  flex: 1; /* Equal width for both boxes */
  background: var(--gray-50);
  border-radius: 8px; /* Reduced from 10px */
  padding: var(--space-2) var(--space-3); /* Reduced padding */
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0; /* Allow shrinking */
}

.stat-box h6 {
  font-size: 1.1rem; /* Reduced from 1.25rem */
  font-weight: 700;
  margin: 0;
  color: var(--primary-color);
  line-height: 1.2;
  white-space: nowrap; /* Prevent wrapping */
}

.stat-box.success h6 {
  color: var(--success-color);
}

.stat-box small {
  font-size: 0.7rem; /* Reduced from 0.75rem */
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em; /* Reduced from 0.05em */
  margin-top: 2px;
  white-space: nowrap; /* Prevent wrapping */
}

/* Adjust grid for better spacing with compact cards */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Slightly reduced from 320px */
  gap: var(--space-5); /* Reduced from space-6 */
  margin-bottom: var(--space-8);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .exam-card {
    padding: var(--space-4); /* Even more compact on mobile */
  }
  
  .exam-info {
    gap: var(--space-2);
    margin-bottom: var(--space-3);
  }
  
  .exam-icon,
  .exam-card img {
    width: 40px;
    height: 40px;
  }
  
  .category-title {
    font-size: 0.95rem;
  }
  
  .stat-box {
    padding: var(--space-2);
  }
  
  .stat-box h6 {
    font-size: 1rem;
  }
  
  .stat-box small {
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .exam-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}


/* ============================================
   PROFESSIONAL REDESIGN — FINAL OVERRIDES
   Slim cards, inline meta row, footer fix
   ============================================ */

/* Slimmer, calmer card */
.exam-card {
  padding: var(--space-4) var(--space-5);
  border-radius: 12px;
  border-color: var(--border-light);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.exam-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(57, 73, 171, 0.10);
  border-color: rgba(57, 73, 171, 0.25);
}

.exam-info {
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  align-items: center;
}

.exam-icon,
.exam-card img.exam-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
}
.exam-icon-gradient {
  background: var(--gradient-primary);
  font-size: 0.78rem;
  box-shadow: none;
}

.category-title {
  font-size: 0.98rem;
  font-weight: 650;
  margin-bottom: 2px;
  line-height: 1.25;
}
.category-description {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.exam-arrow {
  font-size: 0.8rem;
  color: var(--gray-300);
}

/* Inline meta row replaces the chunky two-stat-box block */
.exam-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--gray-100);
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.exam-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.exam-meta .meta-item i {
  font-size: 0.78rem;
  color: var(--primary-color);
  opacity: 0.8;
}
.exam-meta .meta-item strong {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.85rem;
}
.exam-meta .meta-label {
  color: var(--text-tertiary);
  font-weight: 500;
}
.exam-meta .meta-divider {
  width: 1px;
  height: 14px;
  background: var(--gray-200);
}

/* Hide any remaining old stat-box markup (defensive) */
.exam-card .exam-stats { display: none !important; }

/* Tighter grid */
.exam-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

@media (max-width: 768px) {
  .exam-card { padding: var(--space-3) var(--space-4); }
  .exam-icon, .exam-card img.exam-icon { width: 36px; height: 36px; }
  .category-title { font-size: 0.92rem; }
  .exam-meta { font-size: 0.75rem; gap: var(--space-2); }
  .exam-meta .meta-item strong { font-size: 0.8rem; }
}

/* ============================================
   FOOTER FIX
   Sidebar is now position: sticky inside the flex layout, so it
   scrolls with content and naturally ends above the footer instead
   of overlapping it. Footer just needs to be full width.
   ============================================ */
footer.footer {
  margin-left: 0 !important;
  width: 100%;
  position: relative;
  z-index: 10;
  background: #fff;
}
footer.footer .container {
  max-width: 100%;
  width: 100%;
  padding-left: clamp(24px, 4vw, 60px);
  padding-right: clamp(24px, 4vw, 60px);
}

/* ============================================
   SIDEBAR — POPULAR / RECENTLY ADDED
   ============================================ */
.sidebar-exam-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-exam-list li + li {
  border-top: 1px solid var(--gray-100);
}
.sidebar-exam-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 8px 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.sidebar-exam-link:hover {
  background: var(--gray-50);
  color: var(--primary-color);
  text-decoration: none;
}
.sidebar-exam-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-exam-meta {
  flex-shrink: 0;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  font-weight: 600;
  padding: 2px 6px;
  background: var(--gray-100);
  border-radius: 999px;
  line-height: 1;
}
.sidebar-exam-link:hover .sidebar-exam-meta {
  background: var(--primary-subtle, rgba(57, 73, 171, 0.08));
  color: var(--primary-color);
}

/* ============================================
   COLLAPSIBLE SIDEBAR SECTIONS (<details>)
   ============================================ */
.sidebar-collapsible {
  margin-bottom: var(--space-6);
}
.sidebar-collapsible > summary.sidebar-header {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.sidebar-collapsible > summary.sidebar-header::-webkit-details-marker {
  display: none;
}
.sidebar-collapsible > summary.sidebar-header h3 {
  margin: 0;
}
.sidebar-collapsible .sidebar-chevron {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-right: var(--space-6);
  transition: transform var(--transition-base);
}
.sidebar-collapsible[open] .sidebar-chevron {
  transform: rotate(180deg);
}
.sidebar-collapsible > summary.sidebar-header:hover .sidebar-chevron {
  color: var(--primary-color);
}

/* Hide the trailing meta pill (counts) on sidebar lists — names only */
.sidebar-exam-meta {
  display: none !important;
}

/* ============================================
   HEADER FIX
   The shared site header is transparent at top of page until
   scrolled. The sticky sidebar shows through it. Force a solid
   white header on this page so the sidebar slides cleanly under
   a defined band, and offset the sidebar's sticky top to clear it.
   ============================================ */
.header-page,
.header-page .header-nav,
.header-page .scroll-sticky,
.header-fixed {
  background: #fff !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

/* Sit the sticky sidebar just below the header band */
.exam-sidebar {
  top: calc(var(--header-height) + var(--space-3)) !important;
  max-height: calc(100vh - var(--header-height) - var(--space-4)) !important;
}

/* ============================================
   COLLAPSIBLE WHOLE SIDEBAR (desktop)
   ============================================ */
.exam-explorer-layout {
  position: relative;
}

.sidebar-collapse-btn {
  position: fixed;
  top: calc(var(--header-height) + var(--space-4));
  left: calc(var(--sidebar-width) - 14px);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  font-size: 0.7rem;
  transition: left var(--transition-base), color var(--transition-fast), background var(--transition-fast);
}
.sidebar-collapse-btn:hover {
  color: var(--primary-color);
  background: var(--primary-subtle, rgba(57, 73, 171, 0.08));
}
.sidebar-collapse-btn i {
  transition: transform var(--transition-base);
}

/* Sidebar slides off-screen left; main reclaims full width */
.exam-explorer-layout.sidebar-collapsed .exam-sidebar {
  transform: translateX(-100%);
  pointer-events: none;
}
.exam-explorer-layout.sidebar-collapsed .exam-main-content {
  margin-left: 0;
}
.exam-explorer-layout.sidebar-collapsed .sidebar-collapse-btn {
  left: 8px;
}
.exam-explorer-layout.sidebar-collapsed .sidebar-collapse-btn i {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  /* On mobile the existing mobile-sidebar-toggle handles things */
  .sidebar-collapse-btn { display: none; }
}
