/* Material for MkDocs - Page Styles */

/* Navigation Bar */

.nav {
  position: sticky;
  top: 0;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.nav__brand:hover {
  color: var(--primary-colour-hover);
}

.nav__menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav__link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
}

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

.nav__link--active {
  color: var(--primary);
}

.nav__link--active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary);
}

/* Breadcrumb navigation */
.nav__breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 500;
}

.nav__breadcrumb-section {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav__breadcrumb-section:hover {
  color: var(--primary);
}

.nav__breadcrumb-separator {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.nav__breadcrumb-active {
  color: var(--primary);
  font-weight: 600;
}

/* Main Layout */

main {
  min-height: calc(100vh - 60px);
  padding: 2rem;
}

.main {
  padding: 1rem 0;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

.container--wide {
  max-width: 1200px;
}

/* Home Page Styles */

.home-header {
  margin-bottom: 2.5rem;
}

.home-header .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.home-title {
  font-size: 2.6rem;
  line-height: 1.2;
  border: none;
  padding: 0;
  margin-bottom: 0.75rem;
}

.home-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 720px;
}

/* Login Page Layout */

.login-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1.05fr);
  gap: 2rem;
  align-items: start;
  width: 100%;
  max-width: 1100px;
}

.login-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.login-feature-panel {
  background: linear-gradient(135deg, rgba(64, 81, 181, 0.08), rgba(0, 191, 165, 0.12));
  border: 1px solid rgba(64, 81, 181, 0.2);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.login-feature-panel::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  background: rgba(64, 81, 181, 0.15);
  border-radius: 50%;
}

.login-feature-panel h2 {
  border: none;
  padding: 0;
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.login-feature-grid {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.login-feature-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.login-feature-card h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.login-highlight {
  background-color: rgba(0, 191, 165, 0.12);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.login-highlight h4 {
  margin-bottom: 0.25rem;
}

@media (max-width: 900px) {
  .login-layout {
    grid-template-columns: 1fr;
  }
}

.home-hero {
  background-color: rgba(64, 81, 181, 0.04);
  border-color: rgba(64, 81, 181, 0.2);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  align-items: center;
}

.hero-stats {
  display: grid;
  gap: 1rem;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--primary);
}

.stat-label {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.section-title {
  border: none;
  padding-bottom: 0.25rem;
  margin-bottom: 1rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 48px;
  height: 3px;
  background-color: var(--accent);
  border-radius: 999px;
}

/* Page Header */

.header {
  margin-bottom: 2rem;
}

.header h1 {
  margin: 0 0 0.5rem 0;
  border: none;
  padding: 0;
  font-size: 2rem;
}

.header p {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin: 0;
}

.page-header {
  margin-bottom: 3rem;
}

.page-header h1 {
  margin: 0 0 0.5rem 0;
  border: none;
  padding: 0;
}

.page-header__subtitle {
  color: var(--text-muted);
  font-size: 1.125rem;
}

/* Grid Layout */

.grid {
  display: grid;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Card Grid */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.card-grid--2col {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.card-grid--3col {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Module Sections */

.module-section {
  margin-bottom: 3rem;
}

.module-section h2 {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.module-section__icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(64, 81, 181, 0.1);
  border-radius: 6px;
  color: var(--primary);
  font-weight: 600;
}

/* Tables */

.table-wrapper {
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-surface);
}

.table thead {
  background-color: var(--surface-colour);
  border-bottom: 2px solid var(--border);
}

.table th {
  padding: 1rem;
  text-align: left;
  font-weight: 500;
  color: var(--text-main);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

.table tr:hover {
  background-color: rgba(64, 81, 181, 0.02);
}

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

/* List Styles */

.list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.list__item {
  padding: 1rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.list__item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.list__item-title {
  font-weight: 500;
  color: var(--text-main);
}

.list__item-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Dashboard Grid */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

#modules-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dashboard-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.dashboard-card__title {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.dashboard-card__value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.dashboard-card__meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Tabs */

.tabs-container {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--bg-muted);
  padding-bottom: 0;
}

.tab-btn {
  padding: 1rem 1.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: var(--primary);
  background-color: rgba(64, 81, 181, 0.05);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background-color: transparent;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

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

/* Modal & Overlay */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(33, 33, 33, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal--active {
  display: flex !important;
}

.modal-content, .modal__content {
  background-color: var(--bg-surface);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

.modal__header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__title {
  margin: 0;
  font-size: 1.5rem;
}

.modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s ease;
  padding: 0.5rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__close:hover {
  color: var(--primary);
  background-color: rgba(64, 81, 181, 0.1);
  border-radius: var(--radius);
}

.close {
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s ease;
  padding: 0.5rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  float: right;
}

.close:hover {
  color: var(--primary);
  background-color: rgba(64, 81, 181, 0.1);
  border-radius: var(--radius);
}

.modal__footer {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Loading State */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.loading::after {
  content: '';
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Empty State */

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state__title {
  margin-bottom: 0.5rem;
}

.empty-state__description {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Responsive */

@media (max-width: 768px) {
  main {
    padding: 1rem;
  }

  .nav {
    flex-wrap: wrap;
  }

  .nav__menu {
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
    flex-wrap: wrap;
  }

  .card-grid,
  .dashboard-grid,
  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }

  .modal__content {
    width: 95%;
    padding: 1.5rem;
  }

  .page-header {
    margin-bottom: 2rem;
  }

  .module-section {
    margin-bottom: 2rem;
  }
}

@media (max-width: 480px) {
  .nav {
    padding: 1rem;
  }

  .nav__brand {
    font-size: 1.1rem;
  }

  main {
    padding: 0.75rem;
  }

  .table {
    font-size: 0.875rem;
  }

  .table th,
  .table td {
    padding: 0.75rem 0.5rem;
  }

  .dashboard-card__value {
    font-size: 1.75rem;
  }
}

/* Animation */

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

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

.slide-in {
  animation: slideIn 0.3s ease;
}

/* Flexbox Utilities */

.flex {
  display: flex;
}

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

.flex--center {
  align-items: center;
  justify-content: center;
}

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

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

/* Text Utilities */

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

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

.text-muted {
  color: var(--text-muted);
}

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

.text-success {
  color: #10b981;
}

.text-error {
  color: #ef4444;
}

.text-warning {
  color: #f59e0b;
}

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

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

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

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

/* Padding Utilities */

.p-sm { padding: 0.5rem; }
.p-md { padding: 1rem; }
.p-lg { padding: 1.5rem; }
.p-xl { padding: 2rem; }
.p-2xl { padding: 2rem; }
.p-3xl { padding: 3rem; }

.px-sm { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-md { padding-left: 1rem; padding-right: 1rem; }
.px-lg { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-sm { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-md { padding-top: 1rem; padding-bottom: 1rem; }
.py-lg { padding-top: 1.5rem; padding-bottom: 1.5rem; }

/* Margin Utilities */

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mt-xl { margin-top: 2rem; }
.mt-2xl { margin-top: 3rem; }
.mt-3xl { margin-top: 4rem; }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.mb-xl { margin-bottom: 2rem; }
.mb-2xl { margin-bottom: 3rem; }
.mb-3xl { margin-bottom: 4rem; }

.mr-sm { margin-right: 0.5rem; }
.mr-md { margin-right: 1rem; }
.mr-lg { margin-right: 1.5rem; }
.mr-xl { margin-right: 2rem; }

.ml-sm { margin-left: 0.5rem; }
.ml-md { margin-left: 1rem; }
.ml-lg { margin-left: 1.5rem; }
.ml-xl { margin-left: 2rem; }
.ml-auto { margin-left: auto; }

/* Gap Utilities */

.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.gap-xl { gap: 2rem; }

/* Analytics Dashboard Styles */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card.stat-card--success {
  border-left: 4px solid var(--success);
}

.stat-card.stat-card--danger {
  border-left: 4px solid var(--error);
}

.stat-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.stat-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card__header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.filter-group {
  display: flex;
  gap: 0.75rem;
}

.filter-group select {
  min-width: 150px;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.action-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.action-item:hover {
  background: var(--bg-surface);
  border-color: var(--primary);
  transform: translateX(4px);
}

.action-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.action-text {
  font-weight: 500;
}

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

.question-table th,
.question-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.question-table th {
  background: var(--bg-body);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.question-table tr:hover {
  background: var(--bg-body);
}

.question-table .topic-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.question-table .difficulty-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.difficulty-badge.difficulty-easy {
  background: var(--success);
  color: white;
}

.difficulty-badge.difficulty-medium {
  background: var(--warning);
  color: white;
}

.difficulty-badge.difficulty-hard {
  background: var(--error);
  color: white;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.pagination button {
  padding: 0.5rem 1rem;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination .page-info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Width Utilities */

.w-full {
  width: 100%;
}

.w-half {
  width: 50%;
}

/* Display Utilities */

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
/* Animation for modal entrance */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}