/* ==========================================================================
   AQA GCSE Computer Science (8525/1B) — Paper 1 Set 1 (v2) Shared Site Shell
   Provides unified Carbon UI Shell nav, cross-page progress indicators,
   prev/next pagination, shared dark theme tokens, and global utility fixes.
   ========================================================================== */

/* Global utility & bugfix safeguards across all pages */
[hidden] {
  display: none !important;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm, 0.5rem);
}

.tag--primary {
  background: var(--primary-container, #d0e2ff);
  color: var(--on-primary-container, #161616);
}

.coach-note--warning {
  background: var(--warning-container, #fcf4d6);
  color: var(--on-warning-container, #4d3800);
  border-left-color: var(--warning, #8e6a00);
}

/* Fix WCAG AA contrast for filename labels inside dark code headers */
.code-header .label-mono,
.code-panel .code-header .label-mono {
  color: var(--on-code-muted, #c6c6c6);
}

/* Unified Carbon Dark Mode tokens for Skills 1-7 & Index Hub */
html[data-theme="dark"] {
  color-scheme: dark;

  --background: #161616;
  --surface-container-low: #202020;
  --surface-container: #262626;
  --surface-container-high: #393939;
  --surface-code: #0b0b0b;
  --surface-code-highlight: #262626;
  --surface-code-active: #002d9c;

  --on-surface: #f4f4f4;
  --on-surface-variant: #c6c6c6;
  --on-surface-code: #f4f4f4;
  --on-code: #f4f4f4;
  --on-code-muted: #a8a8a8;

  --outline: #8d8d8d;
  --outline-variant: #393939;
  --outline-code: #525252;

  --primary: #78a9ff;
  --primary-hover: #a6c8ff;
  --on-primary: #161616;
  --primary-container: #002d9c;
  --on-primary-container: #edf5ff;
  --secondary: #a8a8a8;
  --tertiary: #42be65;
  --tertiary-container: #073b1a;
  --error: #ff8389;
  --on-error: #161616;

  --positive: #42be65;
  --positive-container: #073b1a;
  --on-positive-container: #defbe6;
  --warning: #f1c21b;
  --warning-container: #3b2e04;
  --on-warning-container: #fcf4d6;
  --error-container: #490d14;
  --on-error-container: #ffd7d9;
  --discarded-surface: #2d2d2d;
  --focus: #78a9ff;

  --data-1: #78a9ff;
  --data-2: #be95ff;
  --data-3: #3ddbd9;
  --data-4: #ff7eb6;
  --data-context: #6f6f6f;
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background-color: var(--surface-container-low);
  color: var(--on-surface);
  border-color: var(--outline);
}

html[data-theme="dark"] .btn--secondary,
html[data-theme="dark"] .btn-secondary {
  color: var(--on-surface);
}

html[data-theme="dark"] .fc-svg-box svg rect,
html[data-theme="dark"] .fc-svg-box svg polygon,
html[data-theme="dark"] .fc-svg-box svg ellipse {
  fill: var(--surface-container);
  stroke: var(--outline);
}

/* ==========================================================================
   Top Shared Carbon UI Shell Navigation Bar
   ========================================================================== */
.aqa-shell-bar {
  background: #161616;
  color: #f4f4f4;
  border-bottom: 1px solid #393939;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.875rem;
  line-height: 1.4;
  width: 100%;
  position: relative;
  z-index: 100;
}

.aqa-shell-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.aqa-shell-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.625rem 0;
  white-space: nowrap;
}

.aqa-shell-brand:hover {
  color: #a6c8ff;
}

.aqa-shell-brand-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: #a6c8ff;
  background: #002d9c;
  padding: 0.125rem 0.45rem;
  letter-spacing: 0.05em;
}

.aqa-shell-links {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.aqa-shell-links li {
  display: flex;
  align-items: stretch;
}

.aqa-shell-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 0.75rem;
  color: #c6c6c6;
  text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  border-bottom: 2px solid transparent;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}

.aqa-shell-link:hover {
  background: #262626;
  color: #ffffff;
}

.aqa-shell-link.is-active {
  color: #ffffff;
  background: #262626;
  border-bottom-color: #0f62fe;
}

html[data-theme="dark"] .aqa-shell-link.is-active {
  border-bottom-color: #78a9ff;
}

.aqa-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #525252;
  display: inline-block;
  flex-shrink: 0;
}

.aqa-status-dot.is-started {
  background: #78a9ff;
}

.aqa-status-dot.is-mastered {
  background: #42be65;
}

.aqa-shell-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
}

.aqa-progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem;
  background: #262626;
  border: 1px solid #393939;
  color: #f4f4f4;
  text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.aqa-progress-pill:hover {
  background: #393939;
  border-color: #78a9ff;
}

.aqa-progress-pill-bar {
  width: 44px;
  height: 4px;
  background: #393939;
  overflow: hidden;
  display: inline-block;
}

.aqa-progress-pill-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #78a9ff;
  transition: width 200ms ease;
}

.aqa-progress-pill-fill.is-mastered {
  background: #42be65;
}

.aqa-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 32px;
  padding: 0.25rem 0.65rem;
  background: transparent;
  color: #f4f4f4;
  border: 1px solid #525252;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.aqa-theme-btn:hover {
  background: #262626;
  border-color: #8d8d8d;
}

.aqa-theme-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ==========================================================================
   Bottom Previous / Hub / Next Pagination Bar
   ========================================================================== */
.aqa-pager {
  max-width: 1200px;
  margin: 0 auto 2.5rem;
  padding: 1.5rem 1.5rem 0;
  border-top: 1px solid var(--outline-variant, #e0e0e0);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0.75rem;
  font-family: 'IBM Plex Sans', sans-serif;
}

.aqa-pager-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.875rem 1rem;
  background: var(--surface-container, #f4f4f4);
  color: var(--on-surface, #161616);
  text-decoration: none;
  border: 1px solid var(--outline-variant, #e0e0e0);
  transition: background-color 120ms ease, border-color 120ms ease;
}

.aqa-pager-link:hover {
  background: var(--surface-container-high, #e0e0e0);
  border-color: var(--primary, #0f62fe);
}

.aqa-pager-link--next {
  text-align: right;
  align-items: flex-end;
}

.aqa-pager-link--hub {
  text-align: center;
  align-items: center;
  min-width: 130px;
}

.aqa-pager-dir {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-surface-variant, #525252);
}

.aqa-pager-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--primary, #0f62fe);
}

.aqa-pager-spacer {
  display: block;
}

@media (max-width: 720px) {
  .aqa-shell-inner {
    padding: 0.25rem 1rem;
  }
  .aqa-pager {
    grid-template-columns: 1fr;
  }
  .aqa-pager-link--next {
    text-align: left;
    align-items: flex-start;
  }
  .aqa-pager-spacer {
    display: none;
  }
}

@media print {
  .aqa-shell-bar,
  .aqa-pager {
    display: none !important;
  }
}
