/* Add Google Fonts Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* Core Variables */
:root {
  --primary: #111;
  --secondary: #222;
  --bg: #fff;
  --card-bg: #fff;
  --text: #111;
  --muted: #666;
  --border: #e0e0e0;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.04);
  --sidebar-width: 260px;
  --code-bg: #f4f4f4;
  --code-text: #111;
}

html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  word-break: break-word;
  transition: background 0.3s, color 0.3s;
}

/* Header & Navbar */
.main-header, .doc-header {
  background: var(--primary);
  color: var(--text);
  padding: 0.5rem 0;
  box-shadow: var(--shadow);
  transition: background 0.3s, color 0.3s;
}
.navbar, .doc-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  background: transparent;
}
.brand {
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 2px;
  color: var(--text);
  text-decoration: none;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}
.nav-links li a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}
.nav-links li a:hover {
  color: var(--secondary);
}
.nav-links.open {
  background: var(--primary);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 5rem 2rem 3rem 2rem;
  background: linear-gradient(120deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--text);
  animation: fadeIn 1s;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: background 0.3s, color 0.3s;
}
.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1.1;
  word-break: break-word;
}
.hero p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  background: var(--secondary);
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
  transition: background var(--transition), transform var(--transition);
  cursor: pointer;
}
.btn.primary {
  background: #fff;
  color: var(--primary);
}
.btn.secondary {
  background: var(--primary);
  color: #fff;
}
.btn.small {
  padding: 0.4rem 1rem;
  font-size: 1rem;
}
.btn:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px) scale(1.04);
}

/* Features Section */
.features {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}
.features h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2.2rem;
  line-height: 1.2;
}
.feature-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}
.feature-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  flex: 1 1 220px;
  max-width: 300px;
  min-width: 220px;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--border);
  animation: fadeInUp 0.8s;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 220px;
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.feature-card h3 {
  margin-top: 0;
  margin-bottom: 0.7em;
  font-size: 1.3rem;
}
.feature-card p {
  font-size: 1.05rem;
  line-height: 1.5;
}
.feature-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 8px 32px rgba(45,108,223,0.15);
}

/* CTA Section */
.cta {
  background: var(--primary);
  color: var(--text);
  text-align: center;
  padding: 3rem 2rem;
  border-radius: var(--radius);
  margin: 3rem 2rem;
  box-shadow: var(--shadow);
  animation: fadeIn 1.2s;
  transition: background 0.3s, color 0.3s;
}
.cta h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.cta p {
  font-size: 1.15rem;
  margin-bottom: 2rem;
}

/* Footer */
.main-footer, .doc-footer {
  background: #181c22;
  color: var(--text);
  text-align: center;
  padding: 1.2rem 0;
  margin-top: 3rem;
  font-size: 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: background 0.3s, color 0.3s;
}

/* Documentation Layout */
.doc-header {
  position: sticky;
  top: 0;
  z-index: 100;
}
.sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - 64px);
  background: #fff;
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 12px rgba(45,108,223,0.04);
  padding: 2rem 1rem 1rem 1rem;
  overflow-y: auto;
  transition: transform var(--transition);
}
.sidebar nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar nav ul li {
  margin-bottom: 1.2rem;
}
.sidebar nav ul li a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  transition: color var(--transition);
}
.sidebar nav ul li a:hover, .sidebar nav ul li a.active {
  color: var(--secondary);
}
.doc-main {
  margin-left: var(--sidebar-width);
  padding: 2.5rem 2rem 2rem 2rem;
  max-width: 900px;
  min-height: 100vh;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}
.doc-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2.5rem;
  padding: 2rem 1.5rem;
  border: 1px solid var(--border);
  animation: fadeInUp 0.8s;
  overflow-wrap: break-word;
  line-height: 1.7;
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.doc-section h2 {
  margin-top: 0;
}

/* Code Blocks */
pre, code {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 8px;
  padding: 0.5em 1em;
  font-family: 'Fira Mono', 'Consolas', monospace;
  font-size: 1em;
  overflow-x: auto;
  word-break: break-all;
  white-space: pre-wrap;
}
pre {
  margin: 1em 0;
  margin-top: 1em;
  margin-bottom: 1em;
}

/* Back to Top Button */
#backToTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 2rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition), background var(--transition);
  z-index: 200;
  display: none;
}
#backToTop.show {
  display: block;
  opacity: 1;
}
#backToTop:hover {
  background: var(--secondary);
  opacity: 1;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: none; }
}

/* Responsive Design */
@media (max-width: 900px) {
  .doc-main {
    margin-left: 0;
    padding: 1rem 0.2rem;
    max-width: 100vw;
  }
  .sidebar {
    display: none;
  }
  .floating-toc {
    display: block;
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    max-width: 95vw;
    z-index: 1000;
  }
  .navbar, .doc-navbar {
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .features {
    padding: 2rem 0.5rem;
  }
  .feature-cards {
    flex-direction: column;
    gap: 1.2rem;
  }
  .feature-card {
    max-width: 100%;
    min-width: 0;
  }
  .cta {
    margin: 2rem 0.5rem;
    padding: 2rem 1rem;
  }
  .doc-section {
    padding: 0.7rem 0.3rem;
    font-size: 1rem;
  }
}
@media (max-width: 600px) {
  .doc-navbar {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0.5rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .features {
    padding: 2rem 0.5rem;
  }
  .feature-cards {
    flex-direction: column;
    gap: 1.2rem;
  }
  .feature-card {
    max-width: 100%;
    min-width: 0;
  }
  .cta {
    margin: 2rem 0.5rem;
    padding: 2rem 1rem;
  }
  .doc-section {
    padding: 0.7rem 0.3rem;
    font-size: 1rem;
  }
  .tip, .analogy, .best-practice, .memory-hook, .why-matters {
    padding: 0.7em 0.6em;
    font-size: 0.98em;
  }
  .cheat-sheet, .quick-quiz {
    padding: 0.7em 0.6em;
    font-size: 0.98em;
  }
  pre, code {
    font-size: 0.95em;
    padding: 0.3em 0.5em;
  }
}

/* Callout Boxes */
.tip, .analogy, .best-practice, .memory-hook, .why-matters {
  display: flex;
  align-items: flex-start;
  gap: 0.7em;
  border-radius: 10px;
  padding: 1em 1.2em;
  margin: 1.2em 0;
  font-size: 1.05em;
  box-shadow: 0 2px 12px rgba(45,108,223,0.07);
  border-left: 6px solid;
  overflow-wrap: break-word;
  line-height: 1.7;
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.tip {
  background: #1e2b3a;
  color: #ffe082;
  border-color: #ffb400;
}
.tip::before {
  content: '💡';
  font-size: 1.4em;
}
.analogy {
  background: #2d3642;
  color: #ffecb3;
  border-color: #ffb400;
}
.analogy::before {
  content: '🔄';
  font-size: 1.4em;
}
.best-practice {
  background: #232a36;
  color: #2ecc40;
  border-color: #2ecc40;
}
.best-practice::before {
  content: '✔️';
  font-size: 1.4em;
}

/* Memory/Why/Practice Callouts */
.memory-hook {
  background: #232a36;
  color: #b39ddb;
  border-color: #7e57c2;
}
.memory-hook::before {
  content: '🧠';
  font-size: 1.4em;
}
.why-matters {
  background: #1e2b3a;
  color: #00bfae;
  border-color: #00bfae;
}
.why-matters::before {
  content: '❓';
  font-size: 1.4em;
}
.best-practice {
  border-color: #2ecc40;
  background: #e7ffe7;
}
.best-practice::before {
  content: '✔️';
  font-size: 1.4em;
}

/* Ensure vertical spacing between callouts and sections */
.analogy + .memory-hook,
.memory-hook + .why-matters,
.why-matters + .best-practice,
.best-practice + .cheat-sheet,
.cheat-sheet + .quick-quiz,
.quick-quiz + .analogy,
.analogy + .analogy,
.memory-hook + .memory-hook,
.why-matters + .why-matters,
.best-practice + .best-practice {
  margin-top: 1.1em;
}

.doc-section > *:not(:last-child) {
  margin-bottom: 1.3em;
}

/* Cheat Sheet & Quick Quiz */
.cheat-sheet, .quick-quiz {
  background: var(--code-bg);
  border-radius: 12px;
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 10px rgba(45,108,223,0.05);
  margin: 2em 0 1em 0;
  padding: 1.2em 1.5em;
  overflow-wrap: break-word;
  line-height: 1.7;
  background: var(--code-bg);
  color: var(--code-text);
  border-color: var(--border);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.cheat-sheet h4, .quick-quiz h4 {
  margin-top: 0;
  margin-bottom: 0.7em;
  color: var(--primary);
}
.cs-key {
  font-weight: bold;
  color: var(--secondary);
}
.quick-quiz ol {
  padding-left: 1.2em;
}

/* Floating Table of Contents */
.floating-toc {
  display: none;
  z-index: 1000;
}
@media (max-width: 900px) {
  .floating-toc {
    display: block;
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 300;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(45,108,223,0.13);
    padding: 0.5em 1em;
    transition: box-shadow var(--transition);
  }
  .floating-toc .toc-toggle {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5em;
    cursor: pointer;
    margin-bottom: 0.5em;
  }
  .floating-toc ul {
    display: none;
    flex-direction: column;
    gap: 0.7em;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .floating-toc.open ul {
    display: flex;
  }
  .floating-toc ul li a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1em;
    transition: color var(--transition);
  }
  .floating-toc ul li a:hover {
    color: var(--secondary);
  }
}

/* Collapsible Sidebar for Mobile */
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
}

/* Code Block Copy Button */
pre {
  position: relative;
}
.copy-btn {
  position: absolute;
  top: 0.5em;
  right: 0.7em;
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.2em 0.7em;
  font-size: 0.95em;
  cursor: pointer;
  opacity: 0.8;
  transition: background var(--transition), opacity var(--transition);
  z-index: 10;
}
.copy-btn:hover {
  background: var(--primary);
  opacity: 1;
}

/* Section Reveal Animations */
.doc-section {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(.4,0,.2,1), transform 0.7s cubic-bezier(.4,0,.2,1);
}
.doc-section.visible {
  opacity: 1;
  transform: none;
}

/* Last Updated */
.last-updated {
  color: var(--muted);
  font-size: 0.95em;
  margin-top: 0.5em;
} 

/* 6. Misc: Remove horizontal scroll on mobile */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

/* 5. Ensure headings and code blocks never overlap */
h1, h2, h3, h4, h5, h6 {
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  line-height: 1.2;
  word-break: break-word;
}

pre {
  margin-top: 1em;
  margin-bottom: 1em;
} 

/* --- Enhanced Colorful Homepage Styles --- */
:root {
  --primary: #2563eb;
  --secondary: #00c9a7;
  --accent: #ff6f61;
  --cta-bg: #f7faff;
  --feature1: #e3f2fd;
  --feature2: #e0f7fa;
  --feature3: #fce4ec;
  --feature4: #fff3e0;
  --footer-bg: #181a1b;
  --footer-text: #f3f4f6;
  --card-radius: 18px;
  --card-shadow: 0 4px 24px rgba(45,108,223,0.08);
}
.hero {
  text-align: center;
  padding: 5rem 2rem 3rem 2rem;
  background: linear-gradient(120deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  animation: fadeIn 1s;
  border-radius: 0 0 var(--card-radius) var(--card-radius);
  box-shadow: 0 8px 32px rgba(45,108,223,0.10);
  position: relative;
}
.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1.1;
  word-break: break-word;
  letter-spacing: 1px;
}
.hero p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  line-height: 1.5;
  color: #2563eb !important;
}
.btn {
  display: inline-block;
  padding: 0.85rem 2.2rem;
  border-radius: var(--card-radius);
  background: var(--accent);
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  font-size: 1.15rem;
  box-shadow: var(--card-shadow);
  transition: background 0.2s, transform 0.2s, filter 0.2s;
  cursor: pointer;
  margin: 0.3em 0.5em;
}
.btn.primary {
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
}
.btn.secondary {
  background: var(--accent);
  color: #fff;
}
.btn:hover, .btn:focus {
  filter: brightness(1.08) saturate(1.2);
  transform: scale(1.04);
  box-shadow: 0 8px 32px rgba(45,108,223,0.18);
}
.features {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  background: var(--cta-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}
.features h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2.2rem;
  line-height: 1.2;
  color: var(--primary);
}
.feature-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}
.feature-card {
  background: var(--feature1);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 2rem 1.5rem;
  flex: 1 1 220px;
  max-width: 300px;
  min-width: 220px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  border: 1px solid #e0e6ed;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 220px;
  color: #222;
  margin-bottom: 1em;
}
.feature-card:nth-child(2) { background: var(--feature2); }
.feature-card:nth-child(3) { background: var(--feature3); }
.feature-card:nth-child(4) { background: var(--feature4); }
.feature-card h3 {
  margin-top: 0;
  margin-bottom: 0.7em;
  font-size: 1.3rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.feature-card p {
  font-size: 1.05rem;
  line-height: 1.5;
  color: #444;
}
.feature-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 12px 36px rgba(45,108,223,0.15);
  background: #fffbe7;
}
.cta {
  background: linear-gradient(90deg, #fffbe7 0%, #e0f7fa 100%);
  color: #222;
  text-align: center;
  padding: 3rem 2rem;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  margin: 2rem auto;
  max-width: 900px;
}
.cta h2 {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1rem;
}
.cta p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: #444;
}
.main-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 2rem 1rem 1rem 1rem;
  border-top: 2px solid var(--primary);
  margin-top: 2rem;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
}
.main-footer nav {
  margin: 1em 0 0.5em 0;
}
.main-footer a {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 500;
  margin: 0 0.7em;
  transition: color 0.2s;
}
.main-footer a:hover, .main-footer a:focus {
  color: var(--accent);
  text-decoration: underline;
}
.footer-link {
  color: var(--secondary);
  font-weight: 500;
  margin: 0 0.7em;
}
@media (max-width: 900px) {
  .feature-cards {
    flex-direction: column;
    align-items: center;
  }
  .feature-card {
    max-width: 95vw;
    min-width: 0;
    width: 100%;
  }
}
@media (max-width: 600px) {
  .hero {
    padding: 3rem 0.7rem 2rem 0.7rem;
    border-radius: 0 0 12px 12px;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .features {
    padding: 2rem 0.7rem;
    border-radius: 12px;
  }
  .cta {
    padding: 2rem 0.7rem;
    border-radius: 12px;
  }
  .main-footer {
    padding: 1.2rem 0.5rem 0.7rem 0.5rem;
    border-radius: 12px 12px 0 0;
  }
}
/* Add icons to feature cards (optional, if you want to use emoji icons) */
.feature-card:nth-child(1) h3::before { content: '📚 '; }
.feature-card:nth-child(2) h3::before { content: '🧠 '; }
.feature-card:nth-child(3) h3::before { content: '📱 '; }
.feature-card:nth-child(4) h3::before { content: '🎓 '; } 

/* Hamburger menu styles */
.hamburger {
  display: none;
  background: none;
  border: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  cursor: pointer;
  z-index: 1200;
}
.hamburger span {
  display: block;
  width: 28px;
  height: 3px;
  margin: 4px 0;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}

@media (max-width: 900px) {
  .hamburger {
    display: flex;
  }
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    width: 100vw;
    padding: 1.2rem 0 1.2rem 0;
    box-shadow: 0 8px 32px rgba(45,108,223,0.13);
    z-index: 1100;
    display: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .nav-links.open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
  }
}

/* Animate hamburger to X when open (optional, for polish) */
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
} 

/* Dark toggle button */
.dark-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  margin-left: 0.7rem;
  cursor: pointer;
  transition: color 0.3s;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dark-toggle:focus {
  outline: 2px solid var(--secondary);
}
.dark-toggle:hover {
  color: var(--secondary);
  background: rgba(255,255,255,0.08);
} 

/* Skip to main content link */
.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  background: var(--secondary);
  color: #222;
  padding: 0.7em 1.2em;
  z-index: 2000;
  border-radius: 0 0 8px 0;
  font-weight: bold;
  transform: translateY(-120%);
  transition: transform 0.2s;
  outline: none;
  text-decoration: none;
}
.skip-link:focus {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  outline: 3px solid var(--primary);
}
/* Strong focus ring for accessibility */
a:focus, button:focus, .btn:focus, input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
  z-index: 1000;
}
.skip-link {
  color: #181c22;
  background: #ffe082;
}
a:focus, button:focus, .btn:focus, input:focus, select:focus, textarea:focus {
  outline: 3px solid #ffe082;
} 

/* Documentation search bar */
.doc-search {
  margin-left: 1rem;
  padding: 0.5em 1em;
  border-radius: 24px;
  border: 1.5px solid var(--border);
  font-size: 1.05rem;
  background: var(--card-bg);
  color: var(--text);
  transition: border 0.2s, background 0.3s, color 0.3s;
  outline: none;
  min-width: 220px;
  max-width: 320px;
  box-shadow: 0 2px 8px rgba(45,108,223,0.04);
}
.doc-search:focus {
  border: 2px solid var(--secondary);
  background: #fffbe7;
}
.doc-search {
  background: #232a36;
  color: #ffe082;
}
@media (max-width: 900px) {
  .doc-search {
    min-width: 0;
    width: 100%;
    max-width: 100vw;
    margin: 0.7rem 0 0.7rem 0;
    font-size: 1rem;
  }
}
/* Highlight for search results */
.search-highlight {
  background: #fffbe7;
  color: #d35400;
  border-radius: 4px;
  padding: 0 2px;
  transition: background 0.2s, color 0.2s;
}
.search-highlight {
  background: #2d3642;
  color: #ffb400;
} 

/* Interactive quiz styles */
.quiz-input {
  display: block;
  margin: 0.5em 0 0.2em 0;
  padding: 0.4em 0.8em;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 1em;
  background: var(--card-bg);
  color: var(--text);
  width: 100%;
  max-width: 340px;
  transition: border 0.2s, background 0.3s, color 0.3s;
}
.quiz-input:focus {
  border: 2px solid var(--secondary);
  outline: none;
}
.quiz-check-btn {
  margin-top: 1em;
  padding: 0.5em 1.5em;
  border-radius: 8px;
  background: var(--secondary);
  color: #222;
  font-weight: bold;
  border: none;
  font-size: 1.05em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(45,108,223,0.07);
  transition: background 0.2s, color 0.2s;
}
.quiz-check-btn:hover, .quiz-check-btn:focus {
  background: var(--primary);
  color: #fff;
}
.quiz-feedback {
  display: inline-block;
  margin-left: 0.5em;
  font-weight: bold;
  font-size: 1em;
  min-width: 80px;
}
.quiz-feedback.correct {
  color: #2ecc40;
}
.quiz-feedback.incorrect {
  color: #e74c3c;
}
@media (max-width: 600px) {
  .quiz-input, .quiz-check-btn {
    width: 100%;
    max-width: 100vw;
    font-size: 1em;
  }
  .quiz-check-btn {
    margin-top: 0.7em;
  }
} 

/* Quiz progress bar and completion message */
.quiz-progress {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5em;
  margin: 2.2em 0 1.5em 0;
  padding: 1em 1.2em;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(45,108,223,0.05);
  border: 1.5px solid var(--border);
}
.quiz-progress-text {
  font-size: 1.1em;
  font-weight: bold;
  color: var(--primary);
}
.quiz-progress-bar {
  width: 100%;
  height: 16px;
  background: #e0e6ed;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 0.2em;
}
.quiz-progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%);
  width: 0%;
  border-radius: 8px;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
}
.quiz-progress-bar {
  background: #232a36;
}
.quiz-complete-message {
  display: block;
  margin: 1.5em 0 2em 0;
  padding: 1.2em 1.5em;
  background: linear-gradient(90deg, #ffe082 0%, #2ecc40 100%);
  color: #222;
  font-size: 1.2em;
  font-weight: bold;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(45,108,223,0.13);
  text-align: center;
  letter-spacing: 1px;
  animation: fadeIn 1s;
}
.quiz-complete-message {
  background: linear-gradient(90deg, #ffb400 0%, #2ecc40 100%);
  color: #181c22;
}
@media (max-width: 600px) {
  .quiz-progress {
    padding: 0.7em 0.5em;
    font-size: 1em;
  }
  .quiz-complete-message {
    font-size: 1em;
    padding: 0.7em 0.5em;
  }
} 

/* Certificate form styles */
.certificate-form {
  margin-top: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  align-items: flex-start;
}
.certificate-form label {
  font-weight: 500;
  color: var(--primary);
}
.certificate-name-input {
  padding: 0.5em 1em;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 1.1em;
  background: var(--card-bg);
  color: var(--text);
  width: 100%;
  max-width: 320px;
}
.certificate-name-input:focus {
  border: 2px solid var(--secondary);
  outline: none;
}
.certificate-download-btn {
  margin-top: 0.5em;
  padding: 0.6em 1.6em;
  border-radius: 8px;
  background: var(--secondary);
  color: #222;
  font-weight: bold;
  border: none;
  font-size: 1.1em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(45,108,223,0.07);
  transition: background 0.2s, color 0.2s;
}
.certificate-download-btn:hover, .certificate-download-btn:focus {
  background: var(--primary);
  color: #fff;
}
/* Printable certificate */
.certificate-printout {
  width: 100%;
  max-width: 700px;
  margin: 2em auto;
  padding: 2.5em 2em;
  background: #fffbe7;
  color: #222;
  border: 4px solid #ffb400;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(45,108,223,0.13);
  text-align: center;
  font-family: 'Georgia', serif;
  position: relative;
}
.certificate-printout h1 {
  font-size: 2.2em;
  margin-bottom: 0.5em;
  color: #2d6cdf;
}
.certificate-printout .cert-name {
  font-size: 1.5em;
  font-weight: bold;
  margin: 1.2em 0 0.7em 0;
  color: #d35400;
}
.certificate-printout .cert-date {
  font-size: 1.1em;
  color: #666;
  margin-top: 1.5em;
}
.certificate-printout .cert-badge {
  font-size: 2.5em;
  margin-bottom: 0.5em;
}
@media print {
  body *:not(.certificate-printout):not(.certificate-printout *) {
    display: none !important;
  }
  .certificate-printout {
    box-shadow: none;
    border: 2px solid #ffb400;
    margin: 0 auto;
    page-break-after: avoid;
  }
  html, body {
    background: #fff !important;
  }
} 

/* Fix certificate and quiz-complete-message text visibility */
.quiz-complete-message, .certificate-form, .quiz-congrats-text {
  color: var(--text) !important;
  background: none;
}
.quiz-complete-message {
  color: var(--text) !important;
}
.certificate-form {
  color: var(--text) !important;
}
.quiz-congrats-text {
  color: var(--text) !important;
}
.certificate-name-input, .certificate-download-btn {
  color: var(--text) !important;
  background: var(--card-bg) !important;
}
.certificate-name-input {
  color: var(--text) !important;
}
.certificate-download-btn {
  color: var(--text) !important;
}
.certificate-printout {
  color: #222 !important;
  background: #fff !important;
}
@media print {
  .certificate-printout {
    color: #000 !important;
    background: #fff !important;
  }
} 

/* Multiple-choice quiz styles */
.quiz-mc {
  margin-right: 0.5em;
  accent-color: var(--primary);
  width: 1.1em;
  height: 1.1em;
  vertical-align: middle;
}
.quick-quiz label {
  display: inline-block;
  margin: 0.3em 0 0.3em 0.2em;
  font-size: 1em;
  cursor: pointer;
  color: var(--text);
  background: none;
  border-radius: 6px;
  padding: 0.1em 0.4em;
  transition: background 0.2s, color 0.2s;
}
.quick-quiz label:has(.quiz-mc:checked) {
  background: #eaf6ff;
  color: var(--primary);
}
@media (max-width: 600px) {
  .quick-quiz label {
    font-size: 0.98em;
    padding: 0.1em 0.2em;
  }
} 

/* Badge and motivation area styles */
.badge-motivation {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7em;
  margin: 1.2em 0 1.5em 0;
  padding: 0.7em 1.2em;
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(45,108,223,0.04);
  border: 1.5px solid var(--border);
}
.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7em;
  align-items: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  background: #ffe082;
  color: #222;
  border-radius: 16px;
  padding: 0.3em 1em 0.3em 0.7em;
  font-size: 1em;
  font-weight: bold;
  box-shadow: 0 1px 4px rgba(45,108,223,0.07);
  border: 1.5px solid #ffb400;
  transition: background 0.2s, color 0.2s;
}
.motivation-message {
  font-size: 1.08em;
  color: var(--primary);
  font-style: italic;
  margin-top: 0.2em;
  min-height: 1.5em;
}
@media (max-width: 600px) {
  .badge-motivation {
    padding: 0.5em 0.5em;
    font-size: 0.98em;
  }
  .badge {
    font-size: 0.98em;
    padding: 0.2em 0.7em 0.2em 0.5em;
  }
} 

/* Glassmorphism for cards and nav */
.main-header, .doc-header, .feature-card, .cta, .main-footer {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

/* Premium gradient for hero and CTAs */
.hero {
  background: var(--bg);
  color: var(--text);
  border-radius: 0 0 var(--radius) var(--radius);
  transition: background 0.3s, color 0.3s;
  animation: none;
}

.btn, .btn.primary, .btn.secondary {
  background: var(--primary);
  color: #fff;
  font-weight: 500;
  box-shadow: var(--shadow);
  border: none;
  border-radius: var(--radius);
  transition: background var(--transition), transform var(--transition);
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
}

.btn:hover, .btn:focus {
  background: var(--secondary);
  color: #fff;
  transform: translateY(-2px) scale(1.03);
}

/* Shimmer animation for premium badges */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.badge.premium, #exam-result-section .pass {
  background: var(--primary);
  color: #fff;
  animation: none;
  box-shadow: var(--shadow);
}

/* Slide/fade in for cards */
@keyframes fadeInUpPremium {
  0% { opacity: 0; transform: translateY(40px) scale(0.98); }
  100% { opacity: 1; transform: none; }
}
.feature-card, .cta {
  animation: none;
}

/* Accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
} 

/* Set all text to black for white theme */
.main-header, .doc-header, .main-footer, .doc-footer, .cta,
.brand, .nav-links li a {
  color: #111;
}

body, .sidebar, .feature-card, .hero, .btn, .btn.primary, .btn.secondary, .cta, .main-footer, .doc-footer {
  color: #111;
}

/* For .sidebar (white bg), use black text */
.sidebar {
  background: #fff;
  color: #111;
} 

/* DARK BACKGROUND: white text */
.main-header, .doc-header, .main-footer, .doc-footer, .nav-links.open, .tip, .analogy, .best-practice, .memory-hook, .why-matters, .quiz-complete-message, .badge.premium, #exam-result-section .pass {
  color: #fff !important;
}

/* LIGHT BACKGROUND: black text */
body, .feature-card, .cta, .doc-section, .sidebar, .certificate-printout, .badge, .quiz-complete-message, .quiz-input, .certificate-form, .certificate-download-btn, .exam-container, .exam-footer .footer-link, .exam-options label, .exam-nav-header, .exam-footer, .exam-header, .exam-question, .exam-nav button, #exam-result-section, #exam-result-section .fail {
  color: #111 !important;
}

/* Remove dark-toggle button styles */
.dark-toggle { display: none !important; }

/* Mobile nav links when open (dark bg) */
.nav-links.open li a { color: #fff !important; }

/* Ensure .sidebar links are dark on white bg */
.sidebar nav ul li a { color: #111 !important; } 