/* ================================================================
   ACCESSIBILITY MODE — AI Mastery Platform
   Three independent body classes:
     .a11y-dyslexia  — dyslexia font + cream background
     .a11y-focus     — focus timer bar + break prompts
     .a11y-dyspraxia — larger targets + stronger focus rings
   ================================================================ */

@import url('https://fonts.cdnfonts.com/css/opendyslexic');

/* ================================================================
   NAV TOGGLE BUTTON
   ================================================================ */
.a11y-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  padding: 6px 14px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 36px;
}
.a11y-toggle-btn:hover {
  border-color: rgba(124,111,255,0.5);
  color: #7c6fff;
}
.a11y-toggle-btn.active {
  background: rgba(124,111,255,0.15);
  border-color: #7c6fff;
  color: #7c6fff;
}
.a11y-toggle-btn .a11y-icon { font-size: 14px; }

/* ================================================================
   READING SUPPORT PANEL
   ================================================================ */
.a11y-panel {
  display: none;
  position: fixed;
  z-index: 10001;
  background: #1a1a24;
  border: 1px solid rgba(124,111,255,0.3);
  border-radius: 14px;
  padding: 18px;
  width: 300px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  font-family: 'Space Mono', monospace;
}
.a11y-panel.show { display: block; }

.a11y-panel-title {
  font-size: 12px;
  color: #7c6fff;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: 0.05em;
}

.a11y-panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.a11y-panel-mode {
  font-size: 12px;
  color: #f0f0f8;
  margin-bottom: 3px;
}
.a11y-panel-desc {
  font-size: 10px;
  color: #5a5a70;
  line-height: 1.4;
}

.a11y-mode-toggle {
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 5px 14px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 48px;
  min-height: 32px;
}
.a11y-mode-toggle:hover {
  border-color: rgba(124,111,255,0.4);
  color: #7c6fff;
}
.a11y-mode-toggle.on {
  background: rgba(124,111,255,0.2);
  border-color: #7c6fff;
  color: #7c6fff;
  font-weight: 700;
}

/* ================================================================
   DYSLEXIA SUPPORT
   ================================================================ */
body.a11y-dyslexia {
  font-family: 'OpenDyslexic', 'Comic Sans MS', sans-serif !important;
  background: #f8f4e8 !important;
  color: #1a1a1a !important;
  line-height: 2.0 !important;
  letter-spacing: 0.05em !important;
}
body.a11y-dyslexia * {
  font-family: 'OpenDyslexic', 'Comic Sans MS', sans-serif !important;
  letter-spacing: 0.05em !important;
}
body.a11y-dyslexia .nav,
body.a11y-dyslexia .lesson-card,
body.a11y-dyslexia .card,
body.a11y-dyslexia .concept-card,
body.a11y-dyslexia .quiz-option,
body.a11y-dyslexia [class*="section"],
body.a11y-dyslexia [class*="card"],
body.a11y-dyslexia [class*="panel"],
body.a11y-dyslexia [class*="box"],
body.a11y-dyslexia [class*="container"] {
  background: #ffffff !important;
  color: #1a1a1a !important;
  border-color: rgba(0,0,0,0.12) !important;
}
body.a11y-dyslexia .nav {
  background: rgba(248,244,232,0.95) !important;
  border-bottom-color: rgba(0,0,0,0.1) !important;
}
body.a11y-dyslexia h1, body.a11y-dyslexia h2, body.a11y-dyslexia h3,
body.a11y-dyslexia h4, body.a11y-dyslexia h5, body.a11y-dyslexia h6 {
  color: #1a1a1a !important;
  line-height: 1.4 !important;
}
body.a11y-dyslexia p, body.a11y-dyslexia li,
body.a11y-dyslexia span, body.a11y-dyslexia div, body.a11y-dyslexia label {
  color: #1a1a1a !important;
}
body.a11y-dyslexia [style*="color:var(--text2)"],
body.a11y-dyslexia [style*="color: var(--text2)"] { color: #444 !important; }
body.a11y-dyslexia p, body.a11y-dyslexia li { max-width: 68ch; }

/* ================================================================
   FOCUS MODE (ADHD)
   ================================================================ */
.a11y-focus-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 32px;
  background: rgba(124,111,255,0.08);
  border-bottom: 1px solid rgba(124,111,255,0.2);
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: #7c6fff;
  position: fixed;
  top: 64px;
  left: 0; right: 0;
  z-index: 99;
}
body.a11y-focus .a11y-focus-bar { display: flex; }

.a11y-focus-label { font-weight: 700; }
.a11y-focus-timer { opacity: 0.8; }

body.a11y-focus .progress-track-nav {
  width: 140px !important;
  height: 8px !important;
}
body.a11y-focus .progress-fill-nav {
  height: 8px !important;
  background: #7c6fff !important;
}

/* Break prompt */
.a11y-break-prompt {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  background: #fff;
  border: 3px solid #7c6fff;
  border-radius: 16px;
  padding: 40px 48px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 400px;
  width: 90%;
}
.a11y-break-prompt.show { display: block; }
.a11y-break-title {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 12px;
}
.a11y-break-body {
  font-size: 15px;
  color: #444;
  margin-bottom: 24px;
  line-height: 1.6;
}
.a11y-break-btn {
  background: #7c6fff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}

/* ================================================================
   DYSPRAXIA SUPPORT
   ================================================================ */
body.a11y-dyspraxia button,
body.a11y-dyspraxia .btn,
body.a11y-dyspraxia .quiz-option,
body.a11y-dyspraxia [role="button"],
body.a11y-dyspraxia input[type="submit"],
body.a11y-dyspraxia input[type="button"],
body.a11y-dyspraxia a.btn {
  min-height: 52px !important;
  min-width: 52px !important;
  padding: 14px 26px !important;
  cursor: pointer !important;
}
body.a11y-dyspraxia *:focus-visible {
  outline: 3px solid #7c6fff !important;
  outline-offset: 4px !important;
}
body.a11y-dyspraxia input,
body.a11y-dyspraxia textarea,
body.a11y-dyspraxia select {
  min-height: 52px !important;
  padding: 14px 16px !important;
  font-size: 16px !important;
  border: 2px solid rgba(255,255,255,0.2) !important;
  border-radius: 8px !important;
}

/* ================================================================
   CONFETTI CANVAS
   ================================================================ */
#a11y-confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  display: none;
}
body.a11y-dyslexia #a11y-confetti-canvas,
body.a11y-focus #a11y-confetti-canvas,
body.a11y-dyspraxia #a11y-confetti-canvas { display: block; }

/* Offset content when focus bar is showing */
body.a11y-focus .hero,
body.a11y-focus .page-content,
body.a11y-focus main { padding-top: 48px; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  .a11y-focus-bar { padding: 8px 16px; font-size: 11px; flex-wrap: wrap; gap: 8px; }
  .a11y-toggle-btn { padding: 6px 10px; font-size: 10px; }
  .a11y-panel { width: calc(100vw - 16px); right: 8px !important; }
}
