/* ================================================
   SciLab Virtual — Design System
   Premium Science Lab Theme
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  /* Background layers */
  --bg-primary: #111827;
  --bg-secondary: #1f2937;
  --bg-card: rgba(31, 41, 55, 0.7);
  --bg-card-hover: rgba(31, 41, 55, 0.9);
  --bg-glass: rgba(17, 24, 39, 0.85);
  --bg-input: rgba(55, 65, 81, 0.5);
  --bg-overlay: rgba(0, 0, 0, 0.6);

  /* Accent colors */
  --accent-amber: #f59e0b;
  --accent-amber-light: #fbbf24;
  --accent-amber-glow: rgba(245, 158, 11, 0.15);
  --accent-gold: #ffc947;
  --accent-teal: #14b8a6;
  --accent-teal-light: #2dd4bf;
  --accent-teal-glow: rgba(20, 184, 166, 0.15);

  /* Subject colors */
  --physics-color: #60a5fa;
  --physics-bg: rgba(96, 165, 250, 0.1);
  --physics-border: rgba(96, 165, 250, 0.3);
  --chemistry-color: #a78bfa;
  --chemistry-bg: rgba(167, 139, 250, 0.1);
  --chemistry-border: rgba(167, 139, 250, 0.3);
  --biology-color: #34d399;
  --biology-bg: rgba(52, 211, 153, 0.1);
  --biology-border: rgba(52, 211, 153, 0.3);

  /* Text */
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-accent: var(--accent-amber);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --border-medium: rgba(255, 255, 255, 0.15);

  /* Status */
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow-amber: 0 0 20px rgba(245, 158, 11, 0.15);
  --shadow-glow-teal: 0 0 20px rgba(20, 184, 166, 0.15);

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle background texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(245, 158, 11, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(20, 184, 166, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: 2.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.875rem; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }

p { color: var(--text-secondary); line-height: 1.7; }

a {
  color: var(--accent-amber);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-amber-light); }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  position: relative;
  z-index: 1;
}

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

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: var(--space-xl) 0;
}

/* ---- Navigation Bar ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-md) 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.navbar-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-teal));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--bg-primary);
  font-family: var(--font-heading);
}

.navbar-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.navbar-title span {
  color: var(--accent-amber);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  list-style: none;
}

.navbar-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.navbar-nav a.active {
  color: var(--accent-amber);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-xs);
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-physics { border-left: 3px solid var(--physics-color); }
.card-physics:hover { box-shadow: 0 4px 20px rgba(96, 165, 250, 0.1); }

.card-chemistry { border-left: 3px solid var(--chemistry-color); }
.card-chemistry:hover { box-shadow: 0 4px 20px rgba(167, 139, 250, 0.1); }

.card-biology { border-left: 3px solid var(--biology-color); }
.card-biology:hover { box-shadow: 0 4px 20px rgba(52, 211, 153, 0.1); }

/* ---- Subject Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-physics {
  background: var(--physics-bg);
  color: var(--physics-color);
  border: 1px solid var(--physics-border);
}

.badge-chemistry {
  background: var(--chemistry-bg);
  color: var(--chemistry-color);
  border: 1px solid var(--chemistry-border);
}

.badge-biology {
  background: var(--biology-bg);
  color: var(--biology-color);
  border: 1px solid var(--biology-border);
}

.badge-difficulty {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-normal {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-hard {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-amber), #e08e0b);
  color: var(--bg-primary);
  box-shadow: var(--shadow-glow-amber);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.25);
  color: var(--bg-primary);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber);
}

.btn-outline:hover {
  background: var(--accent-amber-glow);
  color: var(--accent-amber-light);
}

.btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ---- Progress Bar ---- */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent-amber), var(--accent-gold));
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-bar-fill.teal {
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-teal-light));
}

/* ---- Experiment Page Layout ---- */
.experiment-header {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-xl);
}

.experiment-header .breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.experiment-header .breadcrumb a {
  color: var(--text-secondary);
}

.experiment-header .breadcrumb .separator {
  color: var(--text-muted);
}

.experiment-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: var(--space-xl);
  overflow-x: auto;
}

.tab {
  flex: 1;
  min-width: fit-content;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-align: center;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.tab.active {
  color: var(--text-primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

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

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

/* ---- Simulation Canvas Area ---- */
.simulation-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  position: relative;
}

.simulation-canvas {
  width: 100%;
  border-radius: var(--radius-md);
  background: #0d1117;
  display: block;
}

.simulation-controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0 0;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.control-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.control-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-amber);
  min-width: 48px;
  text-align: right;
}

/* Custom Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  min-width: 120px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-amber);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-amber);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
  cursor: pointer;
  border: none;
}

/* ---- Observation Table ---- */
.observation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: var(--space-md) 0;
}

.observation-table thead th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-light);
  font-size: 0.85rem;
  white-space: nowrap;
}

.observation-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.observation-table tbody tr:hover {
  background: var(--bg-card);
}

.observation-table .value-cell {
  font-family: var(--font-mono);
  color: var(--accent-amber);
  font-weight: 500;
}

.observation-table input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  width: 100%;
  max-width: 120px;
  transition: border-color var(--transition-fast);
}

.observation-table input:focus {
  outline: none;
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 2px var(--accent-amber-glow);
}

/* ---- Quiz Section ---- */
.quiz-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.quiz-question {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
}

.quiz-question:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.quiz-question-text {
  font-weight: 600;
  margin-bottom: var(--space-md);
  display: flex;
  gap: var(--space-sm);
}

.quiz-question-number {
  color: var(--accent-amber);
  font-family: var(--font-mono);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}

.quiz-option:hover {
  border-color: var(--border-medium);
  background: var(--bg-card);
}

.quiz-option.selected {
  border-color: var(--accent-amber);
  background: var(--accent-amber-glow);
}

.quiz-option.correct {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.quiz-option.incorrect {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.quiz-option input[type="radio"] {
  display: none;
}

.quiz-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-medium);
  flex-shrink: 0;
  transition: all var(--transition-fast);
  position: relative;
}

.quiz-option.selected .quiz-radio {
  border-color: var(--accent-amber);
}

.quiz-option.selected .quiz-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: var(--accent-amber);
  border-radius: 50%;
}

.quiz-option.correct .quiz-radio {
  border-color: var(--success);
  background: var(--success);
}

.quiz-option.correct .quiz-radio::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  background: none;
}

.quiz-explanation {
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: none;
}

.quiz-explanation.show {
  display: block;
}

.quiz-explanation.correct-exp {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border-left: 3px solid var(--success);
}

.quiz-explanation.incorrect-exp {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-left: 3px solid var(--error);
}

.quiz-score {
  text-align: center;
  padding: var(--space-xl);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  margin-top: var(--space-lg);
}

.quiz-score-value {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent-amber);
}

.quiz-score-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: var(--space-xs);
}

/* ---- Theory Section ---- */
.theory-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.theory-section h3 {
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.theory-section h3 .icon {
  font-size: 1.2rem;
}

.theory-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.theory-list li {
  display: flex;
  gap: var(--space-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.theory-list li::before {
  content: '→';
  color: var(--accent-amber);
  flex-shrink: 0;
  font-weight: 600;
}

.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.material-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.material-item .icon {
  font-size: 1.1rem;
}

/* ---- Video Section ---- */
.video-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.video-container h3 {
  margin-bottom: var(--space-md);
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ---- Status Indicators ---- */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.completed { background: var(--success); }
.status-dot.in-progress { background: var(--warning); }
.status-dot.pending { background: var(--text-muted); }

.completion-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.completion-check.done {
  background: var(--success);
  color: white;
}

.completion-check.pending {
  background: var(--bg-input);
  border: 2px solid var(--border-medium);
}

/* ---- Grid Layouts ---- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

/* ---- Utility Classes ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-amber { color: var(--accent-amber); }
.text-teal { color: var(--accent-teal); }
.font-mono { font-family: var(--font-mono); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.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); }

.w-full { width: 100%; }
.hidden { display: none !important; }

/* ---- Section Headers ---- */
.section-header {
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  margin-bottom: var(--space-xs);
}

.section-header p {
  font-size: 0.95rem;
}

/* ---- Stat Cards ---- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-amber);
  line-height: 1;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: var(--space-xs);
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fadeIn { animation: fadeIn 0.4s ease; }
.animate-fadeInUp { animation: fadeInUp 0.5s ease; }
.animate-slideInLeft { animation: slideInLeft 0.4s ease; }
.animate-scaleIn { animation: scaleIn 0.3s ease; }

/* Stagger children animation */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr; }

  .container { padding: 0 var(--space-md); }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }

  .navbar-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: var(--space-md);
  }

  .navbar-nav.open { display: flex; }

  .menu-toggle { display: block; }

  .tabs { gap: 0; }
  .tab { padding: 8px 12px; font-size: 0.8rem; }

  .simulation-controls { flex-direction: column; align-items: flex-start; }

  .experiment-title-row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  :root {
    --space-lg: 16px;
    --space-xl: 24px;
  }

  .card { padding: var(--space-md); }
  .theory-section { padding: var(--space-md); }
  .quiz-container { padding: var(--space-md); }
  .materials-grid { grid-template-columns: 1fr; }
}

/* ---- Scrollbar Styling ---- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-input);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---- Print Styles ---- */
@media print {
  body { background: white; color: black; }
  .navbar, .btn, .tabs, .simulation-controls { display: none; }
  .card, .theory-section, .quiz-container { border: 1px solid #ddd; background: white; }
}
