﻿/* PwnHero design system v3.1 (dark/light theme) */

/* Font fallback to prevent CLS - size-adjust approximates Inter metrics */
@font-face {
  font-family: 'Inter-fallback';
  src: local('Arial');
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}

/* CSS Custom Properties - Dark Theme (Default) */
:root {
  /* Dark Theme Colors */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --bg-card: #111111;
  --bg-card-hover: #1a1a1a;

  /* Text Colors - Light on Dark */
  --text-primary: #fafafa;
  --text-secondary: #a1a1a1;
  --text-muted: #737373;

  /* Accent Colors - Clean, no purple */
  --accent-primary: #fafafa;
  --accent-secondary: #3b82f6;
  --accent-success: #22c55e;
  --accent-warning: #f97316;
  --accent-danger: #ef4444;

  /* Borders */
  --border-color: #262626;
  --border-light: #1a1a1a;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* Typography */
  --font-main: 'Inter', 'Inter-fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* Light Theme Override - Softer, warmer tones */
[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #f0f0f0;
  --bg-tertiary: #e8e8e8;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f5f5;

  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #6a6a6a;

  --accent-primary: #1a1a1a;
  --accent-secondary: #2563eb;

  --border-color: #ddd;
  --border-light: #e8e8e8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* BASE STYLES */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  /* Theme Transition - Unified for smooth switching */
  transition: background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

/* Apply smooth transitions to all major themeable elements */
.header,
.footer,
.card,
.module-card,
.feature-card,
.cert-card,
.btn,
input,
select,
textarea,
.preview-code,
.preview-header,
.preview-question,
.preview-tab,
.nav-link {
  transition: background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

/* Fix theme sync for text elements */
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
a,
li,
strong,
b,
em,
i,
.card-title,
.card-description,
.logo,
.logo-icon {
  transition: color var(--transition-normal), background-color var(--transition-normal);
}

/* TYPOGRAPHY */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
}

/* Prevent deprecated UA stylesheet h1 resizing in sectioning elements */
section h1,
article h1,
aside h1,
nav h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

a:hover {
  opacity: 0.8;
}

code {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

/* CONTAINER & LAYOUT */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* HEADER / NAVIGATION */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-md) 0;
  transition: background-color var(--transition-normal);
}

[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.9);
}

@media (max-width: 768px) {
  .header {
    border-bottom: none;
    box-shadow: none;
  }
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon {
  font-size: 1.5rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color var(--transition-fast);
  text-decoration: none;
  /* CLS prevention: explicit display and min-width */
  display: inline-block;
  min-width: max-content;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  opacity: 1;
}

/* BUTTONS */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  /* Performance: Removed transition: all */
  transition: opacity var(--transition-normal), transform var(--transition-normal), background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
  text-decoration: none;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.btn-primary {
  will-change: transform, opacity;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--text-primary);
  background: var(--bg-secondary);
}

.btn-sm {
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.875rem;
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: 1.125rem;
}

/* HERO SECTION */

.hero {
  padding: calc(80px + var(--space-4xl)) 0 var(--space-4xl);
  position: relative;
  overflow: hidden;
}

.hero-content {
  display: grid;
  grid-template-columns: 40fr 60fr;
  gap: var(--space-3xl);
  align-items: center;
}

.hero-text {
  max-width: 600px;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Hero Preview Card */
.hero-preview {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.preview-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.preview-dot.red {
  background: #ef4444;
}

.preview-dot.yellow {
  background: #f59e0b;
}

.preview-dot.green {
  background: #22c55e;
}

.preview-tabs {
  display: flex;
  gap: var(--space-md);
  margin-left: var(--space-lg);
}

.preview-tab {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}

.preview-tab.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.preview-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 300px;
}

.preview-question {
  padding: var(--space-xl);
  border-right: 1px solid var(--border-color);
}

.preview-question h4 {
  font-size: 1rem;
  margin-bottom: var(--space-md);
}

.preview-question p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.preview-code {
  background: #0a0a0a;
  padding: var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: #e5e5e5;
  overflow-x: auto;
}

[data-theme="light"] .preview-code {
  background: #1e293b;
}

.preview-code .keyword {
  color: #f472b6;
}

.preview-code .function {
  color: #60a5fa;
}

.preview-code .string {
  color: #4ade80;
}

.preview-code .number {
  color: #fb923c;
}

/* FEATURES SECTION */

.section {
  padding: var(--space-4xl) 0;
  contain: layout style;
}

/* Modules section - CLS prevention */
#modules {
  min-height: 600px;
}

#modules .section-header {
  min-height: 100px;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-3xl);
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  margin-bottom: var(--space-md);
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  /* Performance: Removed transition: all */
  transition: transform var(--transition-normal), background-color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.feature-card {
  will-change: transform;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--text-muted);
}

.feature-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  font-size: 2rem;
  margin-bottom: var(--space-lg);
}

.feature-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.feature-text {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* MODULES GRID */

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-xl);
  min-height: 400px;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  /* Performance: Removed transition: all */
  transition: transform var(--transition-normal), background-color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  cursor: pointer;
}

.module-card {
  will-change: transform;
}

.module-card:hover {
  transform: translateY(-4px);
  border-color: var(--text-muted);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  justify-content: space-between;
}

.card-header-intro {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.card-header-addons {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
}

.question-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  /* Performance: Removed transition: all */
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.module-card:hover .question-count-badge {
  border-color: var(--text-muted);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  font-size: 1.75rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0;
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: var(--space-lg);
}

.card-meta {
  display: flex;
  gap: var(--space-lg);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.card-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Progress Bar */
.module-progress {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.progress-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.progress-fill {
  height: 100%;
  background: var(--accent-secondary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* SHOW MORE MODULES BUTTON */

.show-more-container {
  display: flex;
  justify-content: center;
  padding: var(--space-2xl) 0;
  margin-top: var(--space-lg);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.show-more-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-2xl);
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 1.125rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  will-change: transform;
}

.show-more-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.45);
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

.show-more-btn:active {
  transform: translateY(-1px) scale(0.99);
}

.show-more-icon {
  font-size: 1.25rem;
}

.show-more-text {
  font-weight: 600;
}

.show-more-count {
  opacity: 0.85;
  font-weight: 500;
  font-size: 1rem;
  margin-left: var(--space-xs);
}

/* Light theme adjustments */
[data-theme="light"] .show-more-btn {
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.25);
}

[data-theme="light"] .show-more-btn:hover {
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.35);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .show-more-container {
    padding: var(--space-xl) var(--space-md);
  }
  
  .show-more-btn {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }
  
  .show-more-icon {
    font-size: 1.125rem;
  }
}

/* CERTIFICATIONS CAROUSEL SECTION */

.certifications-section {
  background: var(--bg-secondary);
  padding: var(--space-4xl) 0;
  overflow: hidden;
  contain: layout style;
}

.certifications-section .section-header {
  min-height: 90px;
}

.certifications-section .section-title {
  font-size: 2.5rem;
}

.certifications-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: var(--space-lg) 0;
}

/* Fade edges for seamless look */
.certifications-carousel::before,
.certifications-carousel::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 150px;
  z-index: 2;
  pointer-events: none;
}

.certifications-carousel::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-secondary), transparent);
}

.certifications-carousel::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-secondary), transparent);
}

.certifications-track {
  display: flex;
  gap: var(--space-lg);
  animation: scroll-certifications 40s linear infinite;
  width: max-content;
}

.certifications-track:hover {
  animation-play-state: paused;
}

@keyframes scroll-certifications {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.cert-card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 180px;
  height: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  /* Performance: Removed transition: all, added will-change for GPU compositing */
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  will-change: transform;
}

/* Subtle gradient overlay */
.cert-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cert-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(59, 130, 246, 0.1);
}

.cert-card:hover::before {
  opacity: 1;
}

.cert-provider {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.cert-name {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Light theme adjustments */
[data-theme="light"] .certifications-carousel::before {
  background: linear-gradient(to right, var(--bg-secondary), transparent);
}

[data-theme="light"] .certifications-carousel::after {
  background: linear-gradient(to left, var(--bg-secondary), transparent);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .certifications-section .section-header {
    min-height: 100px;
  }

  .certifications-section .section-title {
    font-size: 2rem;
  }

  .cert-card {
    width: 150px;
    height: 100px;
  }

  .cert-name {
    font-size: 1.25rem;
  }

  .certifications-carousel::before,
  .certifications-carousel::after {
    width: 60px;
  }
}

/* COMPARISON TABLE */

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.comparison-table th,
.comparison-table td {
  padding: var(--space-lg);
  text-align: center;
}

.comparison-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.comparison-table td {
  border-bottom: 1px solid var(--border-color);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table .feature-name {
  text-align: left;
  font-weight: 500;
}

.check-icon {
  color: var(--accent-success);
}

.cross-icon {
  color: var(--text-muted);
}

/* THEME TOGGLE */

.theme-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: var(--space-xs);
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  font-size: 1rem;
}

.theme-btn:hover {
  color: var(--text-primary);
}

.theme-btn.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* FOOTER */

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-2xl) 0;
  margin-top: var(--space-4xl);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.footer-link {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--text-primary);
  opacity: 1;
}

/* QUIZ PAGE STYLES */

.quiz-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(80px + var(--space-2xl)) var(--space-lg) var(--space-2xl);
}

.quiz-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.quiz-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: var(--space-sm);
}

.quiz-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.progress-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
}

.question-number {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.question-text {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-xl);
  line-height: 1.5;
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.option {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.option:hover:not(.disabled) {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

.option.selected {
  border-color: var(--accent-secondary);
  background: rgba(59, 130, 246, 0.1);
}

.option.correct {
  border-color: var(--accent-success);
  background: rgba(34, 197, 94, 0.1);
}

.option.incorrect {
  border-color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.1);
}

.option.disabled {
  cursor: default;
}

.option-letter {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
}

.option.selected .option-letter {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
  color: white;
}

.option.correct .option-letter {
  background: var(--accent-success);
  border-color: var(--accent-success);
  color: white;
}

.option.incorrect .option-letter {
  background: var(--accent-danger);
  border-color: var(--accent-danger);
  color: white;
}

/* Explanation */
.explanation-box {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid var(--accent-secondary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Mobile optimizations for questions and explanations */
@media (max-width: 768px) {
  .quiz-container {
    padding-left: 4px;
    padding-right: 4px;
  }

  .question-card,
  .explanation-tab-content {
    /* Edge-to-edge on mobile */
    padding: 0 !important;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .explanation-box {
    /* Keep some padding inside the box text, but allow box to fill width */
    padding: var(--space-md) !important;
    margin-top: var(--space-sm);
    border-radius: 0;
    border-left-width: 3px;
    margin-left: 0;
    margin-right: 0;
  }
}

.explanation-title {
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--accent-secondary);
}

.explanation-text {
  color: var(--text-secondary);
  margin: 0;
}

/* Quiz Actions */
.quiz-actions {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-color);
}

/* Results */
.results-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  padding: var(--space-3xl);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.results-score {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: var(--space-md);
}

.results-score.excellent {
  color: var(--accent-success);
}

.results-score.good {
  color: var(--accent-secondary);
}

.results-score.average {
  color: var(--accent-warning);
}

.results-score.low {
  color: var(--accent-danger);
}

.results-message {
  font-size: 1.5rem;
  margin-bottom: var(--space-2xl);
}

.results-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-3xl);
  margin-bottom: var(--space-2xl);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* AUTH PAGES */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(80px + var(--space-2xl)) var(--space-lg);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-title {
  font-size: 1.75rem;
  margin-bottom: var(--space-sm);
}

.auth-subtitle {
  color: var(--text-secondary);
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--text-muted);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* CODE VIEWER */

.code-viewer {
  background: #0a0a0a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.code-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: #111111;
  border-bottom: 1px solid #262626;
}

.code-language {
  color: #60a5fa;
  font-size: 0.8125rem;
  font-weight: 500;
}

.code-content {
  padding: var(--space-lg);
  overflow-x: auto;
  line-height: 1.7;
}

.code-line {
  display: flex;
}

.line-number {
  color: #525252;
  text-align: right;
  padding-right: var(--space-lg);
  min-width: 40px;
  user-select: none;
}

.line-content {
  color: #e5e5e5;
}

/* Syntax highlighting */
.syntax-keyword {
  color: #f472b6;
}

.syntax-function {
  color: #60a5fa;
}

.syntax-string {
  color: #4ade80;
}

.syntax-comment {
  color: #525252;
  font-style: italic;
}

.syntax-number {
  color: #fb923c;
}

.syntax-type {
  color: #22d3ee;
}

.syntax-operator {
  color: #f472b6;
}

/* MODAL */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: var(--space-lg);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.modal-title {
  font-size: 1.25rem;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* UTILITIES */

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.text-success {
  color: var(--accent-success);
}

.text-danger {
  color: var(--accent-danger);
}

.mb-sm {
  margin-bottom: var(--space-sm);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.mb-xl {
  margin-bottom: var(--space-xl);
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mt-xl {
  margin-top: var(--space-xl);
}

/* ANIMATIONS */

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.animate-slide-up {
  animation: slideUp 0.5s ease forwards;
}

/* RESPONSIVE */

@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
  }

  .hero-preview {
    display: none;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .rankings-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-wrap: wrap;
    gap: var(--space-md);
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: var(--space-md);
  }

  .hero-actions {
    flex-direction: column;
  }

  .footer-content {
    flex-direction: column;
    gap: var(--space-lg);
    text-align: center;
  }

  .results-stats {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .quiz-actions {
    flex-direction: column;
    gap: var(--space-md);
  }
}

/* DIFFICULTY STARS */

.difficulty-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.difficulty-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.difficulty-stars {
  display: flex;
  gap: 2px;
}

.difficulty-star {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--bg-tertiary);
  transition: background-color var(--transition-fast);
}

.difficulty-star.filled {
  background: var(--star-color, var(--accent-secondary));
}

/* Difficulty color gradients */
.difficulty-1 .difficulty-star.filled,
.difficulty-2 .difficulty-star.filled {
  --star-color: #22c55e;
}

/* Green - Easy */

.difficulty-3 .difficulty-star.filled,
.difficulty-4 .difficulty-star.filled {
  --star-color: #84cc16;
}

/* Lime - Medium Easy */

.difficulty-5 .difficulty-star.filled,
.difficulty-6 .difficulty-star.filled {
  --star-color: #eab308;
}

/* Yellow - Medium */

.difficulty-7 .difficulty-star.filled,
.difficulty-8 .difficulty-star.filled {
  --star-color: #f97316;
}

/* Orange - Hard */

.difficulty-9 .difficulty-star.filled,
.difficulty-10 .difficulty-star.filled {
  --star-color: #ef4444;
}

/* Red - Expert */

/* QUESTION IMAGE */

.question-image {
  width: 100%;
  max-width: 600px;
  margin: var(--space-lg) auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.question-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* QUESTION CODE VIEWER */

.question-code {
  background: #0d1117;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-lg) 0;
  border: 1px solid var(--border-color);
}

.question-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: #161b22;
  border-bottom: 1px solid #30363d;
}

.question-code-lang {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #7d8590;
  text-transform: uppercase;
}

.question-code-content {
  padding: var(--space-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: #e6edf3;
}

.question-code-content pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Code syntax colors */
.question-code .keyword {
  color: #ff7b72;
}

.question-code .string {
  color: #a5d6ff;
}

.question-code .function {
  color: #d2a8ff;
}

.question-code .comment {
  color: #8b949e;
}

.question-code .number {
  color: #79c0ff;
}

/* FOOTER */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-xl) 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--text-primary);
}

/* Theme Toggle Buttons */
.theme-toggle {
  display: flex;
  gap: var(--space-xs);
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: var(--radius-full);
}

.theme-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  color: var(--text-secondary);
  will-change: transform;
}

.theme-btn:hover {
  background: var(--bg-card);
  transform: scale(1.1);
}

.theme-btn.active {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

/* QUIZ OPTIONS */
.option-btn {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  padding: var(--space-lg);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
  text-align: left;
  margin-bottom: var(--space-md);
}

.option-btn:hover:not(:disabled) {
  border-color: var(--text-muted);
  background: var(--bg-secondary);
}

.option-btn.selected {
  border-color: var(--accent-secondary);
  background: rgba(37, 99, 235, 0.1);
}

.option-btn.correct {
  border-color: var(--accent-success);
  background: rgba(34, 197, 94, 0.1);
}

.option-btn.incorrect {
  border-color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.1);
}

.option-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.option-btn.selected .option-letter {
  background: var(--accent-secondary);
  color: white;
}

.option-btn.correct .option-letter {
  background: var(--accent-success);
  color: white;
}

.option-btn.incorrect .option-letter {
  background: var(--accent-danger);
  color: white;
}

/* LEGAL PAGES (Terms, Privacy) */

.legal-page {
  padding: calc(80px + var(--space-3xl)) 0 var(--space-4xl);
  min-height: 100vh;
}

.legal-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.legal-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: var(--space-md);
}

.legal-updated {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
}

.legal-section {
  margin-bottom: var(--space-3xl);
}

.legal-section h2 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
}

.legal-section p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.legal-section ul {
  list-style: disc;
  padding-left: var(--space-lg);
  margin: 0 0 var(--space-md) 0;
}

.legal-section li {
  position: static;
  padding-left: 0;
  margin-bottom: var(--space-sm);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.legal-section li::before {
  content: none;
}

.legal-section li strong {
  color: var(--text-primary);
}

.legal-section a {
  color: var(--accent-secondary);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--transition-fast);
}

.legal-section a:hover {
  text-decoration-color: var(--accent-secondary);
  opacity: 1;
}

/* FOOTER GRID (New Design) */

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-3xl);
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--border-color);
}

.footer-section h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-tagline {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-top: var(--space-md);
  margin-bottom: 0;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-list li {
  margin-bottom: var(--space-sm);
}

.footer-list a {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color var(--transition-fast);
  text-decoration: none;
}

.footer-list a:hover {
  color: var(--text-primary);
  opacity: 1;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Footer grid responsive */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    text-align: center;
  }

  .footer-section .logo {
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-md);
  }
}

/* DONATION MODAL STYLES */

.donation-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.donation-overlay.active {
  display: flex;
}

.donation-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-2xl);
}

.donation-icon {
  font-size: 3.5rem;
  margin-bottom: var(--space-lg);
  display: inline-block;
  animation: bounce 2s infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.donation-title {
  font-size: 1.75rem;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
  font-weight: 800;
}

.donation-text {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
  font-size: 1rem;
}

.highlight-text {
  color: var(--accent-success);
  font-weight: 700;
}

.top-donors {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-xl);
  max-height: 200px;
  overflow-y: auto;
  text-align: left;
}

.top-donors h4 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
  text-align: center;
}

.donor-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.donor-item:last-child {
  border-bottom: none;
}

.donor-name {
  font-weight: 600;
  color: var(--text-primary);
}

.donor-item:nth-child(2) .donor-name::before {
  content: '\1F947 ';
}

.donor-item:nth-child(3) .donor-name::before {
  content: '\1F948 ';
}

.donor-item:nth-child(4) .donor-name::before {
  content: '\1F949 ';
}

.donor-amount {
  color: var(--accent-success);
  font-family: var(--font-mono);
  font-weight: 700;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  color: white;
  transition: transform 0.2s, box-shadow 0.2s;
}

.contact-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0.9;
}

.contact-link.discord {
  background: #5865F2;
}

.contact-link.reddit {
  background: #FF4500;
}

.modal-close-btn {
  margin-top: var(--space-lg);
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: color 0.2s, border-color 0.2s;
}

.modal-close-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

/* MOBILE NAVIGATION & RESPONSIVENESS */

.mobile-menu-toggle {
  display: none;
}

@media (max-width: 768px) {

  /* Reduce side padding for mobile containers to fix 'extra space' look */
  .container {
    padding: 0 var(--space-md);
  }

  /* Header Adjustments */
  .header {
    padding: 0.5rem 0;
  }

  .header-content {
    position: relative;
    padding: 0 var(--space-md);
  }

  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 44px;
    /* Standard touch target */
    height: 44px;
    /* Standard touch target */
    padding: 10px 7px;
    /* Center the 30px content horizontally */
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 2005;
    /* Higher than CTA and Logo */
    order: 3;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    pointer-events: auto;
  }

  .mobile-menu-toggle .bar {
    width: 30px;
    /* Force width */
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    will-change: transform;
  }

  /* Hamburger to X Animation - Adjusted for 10px padding */
  .mobile-menu-toggle.active .bar:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
  }

  .mobile-menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
  }


  .logo {
    z-index: 2002;
    /* Allow clicking logo when menu is open */
    position: relative;
  }

  /* Navigation Overlay - Dropdown Style */
  .nav {
    position: fixed;
    top: 60px;
    /* Approximate header height */
    left: 0;
    right: 0;
    bottom: auto;
    /* Allow auto height */
    height: auto;
    /* Fit content */
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    /* Strong shadow for float effect */

    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: var(--space-xl) var(--space-md);

    /* Animation - Slide Down */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;

    z-index: 1000;
    /* Behind the header (1000) so it slides from under? No, header is 1000. Nav needs to be on top or under? 
                      If nav is IN header, z-index context is tricky. 
                      Let's put it at 999 to slide BEHIND header? 
                      Or 1001 to overlap? 
                      User said "drop down below". 
                      Fixed header is z-1000. 
                      If I set this to fixed top:60px, it visually appears below. */
  }

  /* Ensure solid background in both themes */
  .nav {
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
  }

  [data-theme='light'] .nav {
    background-color: rgba(255, 255, 255, 0.95);
  }

  /* Active State */
  .nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    font-size: 1.75rem;
    font-weight: 700;
  }

  /* Force buttons (like Logout) to be visible in mobile menu, but let links (like Profile) stay hidden if they are moved to CTA */
  .nav button {
    display: flex !important;
    width: 100%;
    margin-top: var(--space-md);
    padding: var(--space-md);
    font-size: 1rem;
    justify-content: center;
  }

  /* Hero Section Mobile Fixes */
  .hero {
    padding-top: 100px;
    padding-bottom: var(--space-xl);
    text-align: center;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    text-align: center;
  }

  .hero-text {
    margin: 0 auto;
    width: 100%;
  }

  .hero-title {
    font-size: 2.25rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.2;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-preview {
    margin-top: var(--space-lg);
  }

  /* Grid Fixes - Force full width cards */
  .features-grid,
  .modules-grid,
  .donate-stats-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
  }

  /* CLS prevention: Reserve space for modules on mobile */
  #modules {
    min-height: 800px;
  }

  .modules-grid {
    min-height: 600px;
  }

  .module-card,
  .feature-card {
    width: 100%;
    margin: 0;
  }

  .preview-content {
    grid-template-columns: 1fr;
  }

  .preview-question {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    text-align: center;
  }

  .footer-section h4::after {
    margin: 0.5rem auto 0;
  }

  /* Quiz Mobile Optimization */
  .quiz-container {
    padding-top: 80px;
    /* Reduced top padding */
  }

  .quiz-header {
    margin-bottom: var(--space-sm);
    padding: 0;
  }

  .question-card .card-tabs {
    padding: 0 var(--space-sm);
  }

  .tab-btn {
    padding: var(--space-md) var(--space-sm);
    font-size: 0.8rem;
  }

  .quiz-module-name {
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
  }

  .quiz-question-count {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    min-width: 36px;
  }

  .question-text {
    font-size: 1.1rem !important;
    /* Force smaller size on mobile */
    padding: var(--space-md) var(--space-lg) !important;
    line-height: 1.4;
  }

  .options-list {
    padding: 0 var(--space-lg) var(--space-lg) !important;
    display: grid;
    gap: var(--space-sm);
  }

  .option-btn {
    padding: var(--space-md);
    margin-bottom: 0;
    /* Remove bottom margin in favor of grid gap */
    font-size: 0.9rem;
    min-height: auto;
  }

  .difficulty-container {
    padding: var(--space-md) var(--space-lg) 0 !important;
    margin-bottom: var(--space-xs);
  }

  .question-number {
    padding: 0 var(--space-lg) !important;
    font-size: 0.8rem;
  }

  /* Fix explanation cramping */
  .explanation-box {
    margin: 0 var(--space-lg) var(--space-xl) !important;
    padding: var(--space-md) !important;
  }

  .explanation-text {
    font-size: 0.95rem;
    padding: 0;
  }

  /* Optimize Report Button placement in tabs */
  .report-btn {
    padding: 0.4rem;
    /* Smaller padding */
    width: 32px;
    height: 32px;
    justify-content: center;
    border-radius: 50%;
    /* Circle shape */
    gap: 0;
  }

  .report-text-label {
    display: none;
  }

  /* Report Modal Improvements */
  .modal-overlay {
    padding: var(--space-md);
    align-items: flex-start;
    /* Allow scrolling from top */
    overflow-y: auto;
  }

  .modal-content {
    margin: 20px auto;
    padding: var(--space-lg);
    max-height: none;
    overflow: visible;
  }

  .report-textarea {
    min-height: 120px;
    /* Increase height */
    font-size: 1rem;
    /* Prevent zoom on input */
  }

  .report-options {
    gap: 0.5rem;
  }

  .report-option {
    padding: 0.5rem 0.75rem;
  }
}

/* Hide Mobile CTA by default (Desktop) */
.mobile-cta {
  display: none !important;
}

@media (max-width: 768px) {

  /* Mobile CTA Button (Get Started / Profile) */
  .mobile-cta {
    display: inline-flex !important;
    order: 2;
    margin-left: auto;
    /* Push to right */
    margin-right: var(--space-sm);
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    height: 32px;
    min-height: 0;
    align-items: center;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
  }

  /* Ensure header handles the extra item correctly */
  .header-content {
    display: flex;
    align-items: center;
    /* justify-content: space-between; already set */
  }

  /* Hide the BUTTON inside the nav menu on mobile since it's now in the header */
  /* We specifically target buttons or the auth button */
  .nav .btn {
    display: none;
  }
}

/* BRANDING & WATERMARKS */

/* Background Watermark for Certification Pages */
.certification-detail-page {
  position: relative;
  overflow: hidden;
  /* Prevent overflow from rotated text if necessary */
}

.certification-detail-page::before {
  content: "PWNHERO.COM";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 15vw;
  font-weight: 900;
  color: var(--text-primary);
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
  white-space: nowrap;
  user-select: none;
  font-family: var(--font-main);
}

/* "Written by Aotrx" Signature */
.cert-detail-header {
  position: relative;
}

.cert-detail-header::after {
  content: "Written by Aotrx";
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-secondary);
  font-family: var(--font-mono);
  opacity: 0.9;
  letter-spacing: 0.05em;
  background: rgba(59, 130, 246, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

