/* ============================================
   MIGHTY OAKS HYBRID LMS - STYLES
   Modern & Colorful Design
   ============================================ */

:root {
  /* Primary Colors */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;

  /* Accent Colors */
  --coral: #f97316;
  --coral-light: #fed7aa;
  --teal: #14b8a6;
  --teal-light: #ccfbf1;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;

  /* Neutrals */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Status Colors */
  --success: #22c55e;
  --success-light: #dcfce7;
  --warning: #eab308;
  --warning-light: #fef9c3;
  --error: #ef4444;
  --error-light: #fee2e2;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-50);
  min-height: 100vh;
}

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

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: var(--space-md); }

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

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

/* Header */
.header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

.logo-icon {
  font-size: 2rem;
}

.nav {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.nav-link {
  color: var(--gray-600);
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
  text-decoration: none;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  color: white;
  padding: var(--space-2xl) 0;
  text-align: center;
}

.hero h1 {
  color: white;
  margin-bottom: var(--space-md);
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

/* Main Content */
.main {
  flex: 1;
  padding: var(--space-2xl) 0;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-lg);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.card-icon.blue { background: var(--primary-light); }
.card-icon.coral { background: var(--coral-light); }
.card-icon.teal { background: var(--teal-light); }
.card-icon.purple { background: var(--purple-light); }

.card-title {
  font-size: 1.25rem;
  margin: 0;
}

.card-description {
  color: var(--gray-600);
  margin-bottom: var(--space-md);
}

/* Grid */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

.btn-coral {
  background: var(--coral);
  color: white;
}

.btn-coral:hover {
  background: #ea580c;
}

.btn-teal {
  background: var(--teal);
  color: white;
}

.btn-teal:hover {
  background: #0d9488;
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 1.125rem;
}

.btn-block {
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--gray-700);
}

.form-input {
  width: 100%;
  padding: var(--space-md);
  font-size: 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder {
  color: var(--gray-400);
}

textarea.form-input {
  min-height: 120px;
  resize: vertical;
}

/* Alerts */
.alert {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.alert-success {
  background: var(--success-light);
  color: #166534;
}

.alert-error {
  background: var(--error-light);
  color: #991b1b;
}

.alert-warning {
  background: var(--warning-light);
  color: #854d0e;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: var(--space-2xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-xl);
}

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-2xl) + 4px);
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--dot-color, var(--gray-300)); /* Custom color for science, default for history */
  border: 3px solid white;
  box-shadow: var(--shadow);
}

.timeline-dot.completed {
  background: var(--success);
}

.timeline-dot.current {
  background: var(--primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
}

.timeline-content {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-lg);
}

.timeline-date {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: var(--space-sm);
}

.timeline-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

/* Lesson Components */
.lesson-section {
  margin-bottom: var(--space-xl);
}

.lesson-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
}

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

.reading-content {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border-left: 4px solid var(--primary);
}

.reading-content h5 {
  color: var(--gray-700);
  margin-bottom: var(--space-md);
}

.reading-content blockquote {
  background: white;
  border-left: 3px solid var(--coral);
  padding: var(--space-md);
  margin: var(--space-md) 0;
  font-style: italic;
  color: var(--gray-700);
}

.question-card {
  background: var(--purple-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.question-number {
  display: inline-block;
  background: var(--purple);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  text-align: center;
  line-height: 28px;
  font-weight: 600;
  margin-right: var(--space-sm);
}

.question-text {
  font-weight: 500;
  margin-bottom: var(--space-md);
}

/* Progress Bar */
.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal) 0%, var(--primary) 100%);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-success {
  background: var(--success-light);
  color: #166534;
}

.badge-warning {
  background: var(--warning-light);
  color: #854d0e;
}

.badge-info {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.3s;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: var(--space-sm);
}

.modal-close:hover {
  color: var(--gray-600);
}

.modal-body {
  padding: var(--space-lg);
}

/* Admin Styles */
.admin-sidebar {
  width: 250px;
  background: var(--gray-800);
  color: white;
  min-height: 100vh;
  padding: var(--space-lg);
}

.admin-nav-link {
  display: block;
  padding: var(--space-md);
  color: var(--gray-300);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xs);
  transition: all 0.2s;
}

.admin-nav-link:hover,
.admin-nav-link.active {
  background: var(--gray-700);
  color: white;
  text-decoration: none;
}

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

.admin-layout {
  display: flex;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

.stat-label {
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* Table */
.table-container {
  overflow-x: auto;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: var(--space-md);
  border-bottom: 1px solid var(--gray-200);
}

th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
}

tr:hover td {
  background: var(--gray-50);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

.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); }

.hidden { display: none !important; }

.flex { display: flex; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

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

  .hero {
    padding: var(--space-xl) 0;
  }

  .hero p {
    font-size: 1rem;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    min-height: auto;
  }
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Celebration Animation */
.celebration {
  animation: celebrate 0.5s ease;
}

@keyframes celebrate {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 1000;
}

.toast {
  background: var(--gray-800);
  color: white;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-top: var(--space-sm);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   FINAL PRESENTATION SECTION
   ============================================ */

.final-presentation-card {
  border: 2px solid var(--primary);
  overflow: hidden;
}

.final-presentation-card .card-header {
  padding: var(--space-lg);
}

.final-presentation-card .card-header:hover {
  filter: brightness(1.05);
}

.final-presentation-card .card-body {
  padding: var(--space-xl);
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
  opacity: 1;
}

.final-presentation-card .card-body.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

.book-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

.book-option-card {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--gray-200);
}

.book-option-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.book-resources {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--gray-200);
}

.book-resources ul {
  list-style: none;
}

.book-resources li {
  padding: var(--space-xs) 0;
}

.book-resources a {
  color: var(--primary);
  text-decoration: none;
}

.book-resources a:hover {
  text-decoration: underline;
}

.project-types {
  border-top: 1px solid var(--gray-200);
  padding-top: var(--space-xl);
}

.project-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.project-option {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: all 0.2s ease;
}

.project-option:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.project-option strong {
  color: var(--gray-800);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .book-options-grid {
    grid-template-columns: 1fr;
  }

  .project-options-grid {
    grid-template-columns: 1fr 1fr;
  }

  .final-presentation-card .card-body {
    padding: var(--space-lg);
  }
}

/* ============================================
   SCIENCE COURSE STYLES
   ============================================ */

/* Science Color Palette */
:root {
  --science-green: #22c55e;
  --science-green-light: #dcfce7;
  --science-blue: #0ea5e9;
  --science-blue-light: #e0f2fe;
  --science-amber: #f59e0b;
  --science-amber-light: #fef3c7;
}

/* Chapter Tabs Navigation */
.chapter-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  padding: var(--space-sm);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.chapter-tab {
  flex: 1;
  min-width: 150px;
  padding: var(--space-md) var(--space-lg);
  background: var(--gray-100);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.chapter-tab:hover {
  background: var(--science-green-light);
  color: var(--science-green);
}

.chapter-tab.active {
  background: var(--science-green);
  color: white;
  border-color: var(--science-green);
}

.chapter-content {
  display: none;
}

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

/* Week Tabs Navigation */
.week-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  padding: var(--space-sm);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.week-tab {
  flex: 1;
  min-width: 80px;
  padding: var(--space-md) var(--space-lg);
  background: var(--gray-100);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.week-tab:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.week-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.week-content {
  display: none;
}

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

/* Days Grid */
.days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

/* Day Card */
.day-card {
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all 0.2s ease;
}

.day-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.day-card.completed {
  opacity: 0.8;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
}

.day-date {
  display: flex;
  flex-direction: column;
}

.day-name {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  font-weight: 600;
}

.day-num {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
}

.day-icon {
  font-size: 1.5rem;
}

.day-title {
  margin: 0 0 var(--space-md) 0;
  font-size: 1rem;
  color: var(--gray-800);
}

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

/* Activity Item */
.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-md);
  gap: var(--space-sm);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.activity-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.activity-type {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
}

.activity-desc {
  font-size: 0.875rem;
  color: var(--gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.activity-actions .btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
}

/* Question Card */
.question-card {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

/* Section Cards */
.section-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-lg);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.section-card:hover {
  box-shadow: var(--shadow-lg);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  background: linear-gradient(135deg, var(--science-green) 0%, var(--teal) 100%);
  color: white;
  cursor: pointer;
}

.section-header h3 {
  color: white;
  margin: 0;
  font-size: 1.25rem;
}

.section-header .section-pages {
  font-size: 0.875rem;
  opacity: 0.9;
}

.section-toggle {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.section-toggle.expanded {
  transform: rotate(180deg);
}

.section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.section-body.expanded {
  max-height: 5000px;
}

.section-body-inner {
  padding: var(--space-lg);
}

.section-content {
  padding: var(--space-lg);
  border-top: 1px solid var(--gray-200);
}

/* Section Summary */
.section-summary {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  border-left: 4px solid var(--science-green);
}

.section-summary h4 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  color: var(--gray-700);
}

/* Multi-Modal Input Tabs */
.input-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  padding: var(--space-xs);
  background: var(--gray-100);
  border-radius: var(--radius-md);
}

.input-tab {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

.input-tab:hover {
  background: white;
  color: var(--gray-800);
}

.input-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.input-content,
.input-mode {
  display: block;
}

.input-content.hidden,
.input-mode.hidden {
  display: none;
}

/* Photo Upload Area */
.photo-upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.photo-upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.photo-upload-area.dragover {
  border-color: var(--science-green);
  background: var(--science-green-light);
}

.photo-upload-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.photo-preview {
  max-width: 100%;
  max-height: 300px;
  margin-top: var(--space-md);
  border-radius: var(--radius-md);
}

/* Audio Recording */
.audio-controls {
  text-align: center;
  padding: var(--space-lg);
}

.record-btn {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--error);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
}

.record-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.record-btn.recording {
  animation: recordPulse 1.5s infinite;
}

@keyframes recordPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
}

.transcript-preview {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  min-height: 100px;
  text-align: left;
}

.transcript-preview.empty {
  color: var(--gray-400);
  font-style: italic;
}

/* File Upload */
.file-upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-upload-area:hover {
  border-color: var(--science-blue);
  background: var(--science-blue-light);
}

.file-list {
  margin-top: var(--space-md);
  text-align: left;
}

.file-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-xs);
}

.file-item .remove-file {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
}

/* Experiment Cards */
.experiments-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 2px solid var(--gray-200);
}

.experiments-section h3 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  color: var(--science-amber);
}

.experiment-card {
  background: linear-gradient(135deg, var(--science-amber-light) 0%, white 100%);
  border: 2px solid var(--science-amber);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.experiment-card h4 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--gray-800);
  margin-bottom: var(--space-sm);
}

.experiment-card .experiment-pages {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: var(--space-md);
}

.experiment-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Experiment Modal */
.experiment-modal {
  max-width: 800px;
}

.supplies-list {
  background: var(--science-amber-light);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.supplies-list h4 {
  margin-bottom: var(--space-md);
  color: var(--gray-800);
}

.supplies-list ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-sm);
}

.supplies-list li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.supplies-list li::before {
  content: '✓';
  color: var(--science-green);
  font-weight: bold;
}

/* Step-by-Step Instructions */
.experiment-steps {
  counter-reset: step;
}

.step-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  position: relative;
  padding-left: 70px;
}

.step-card::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: var(--science-blue);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.step-card.warning {
  background: var(--warning-light);
  border-color: var(--warning);
}

.step-card.warning::before {
  background: var(--warning);
}

.step-card.note {
  background: var(--science-blue-light);
  border-color: var(--science-blue);
}

/* Lab Report Modal */
.lab-report-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.lab-report-form .form-section {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.lab-report-form .form-section h4 {
  margin-bottom: var(--space-md);
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Review & Test Sections */
.review-section,
.test-section {
  background: var(--purple-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-xl);
}

.review-section h3,
.test-section h3 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--purple);
  margin-bottom: var(--space-md);
}

/* Test Question Styles */
.test-question {
  background: white;
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.test-question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
}

.test-question-number {
  background: var(--purple);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.test-question-points {
  font-size: 0.875rem;
  color: var(--gray-500);
}

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

.test-option {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.test-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.test-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

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

.test-option .option-indicator {
  width: 24px;
  height: 24px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.test-option.selected .option-indicator {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Test Results */
.test-results {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
}

.test-score {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.test-score.excellent { color: var(--success); }
.test-score.good { color: var(--science-blue); }
.test-score.needs-work { color: var(--warning); }
.test-score.struggling { color: var(--error); }

.test-feedback {
  font-size: 1.25rem;
  color: var(--gray-600);
  margin-bottom: var(--space-lg);
}

/* Classroom TV Mode */
.classroom-mode {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gray-900);
  z-index: 2000;
  display: none;
}

.classroom-mode.active {
  display: flex;
  flex-direction: column;
}

.classroom-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) var(--space-xl);
  background: var(--gray-800);
}

.classroom-header h2 {
  color: white;
  margin: 0;
}

.classroom-exit {
  background: var(--error);
  color: white;
  border: none;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
}

.classroom-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

.classroom-step-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 900px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.classroom-step-number {
  font-size: 1.5rem;
  color: var(--gray-500);
  margin-bottom: var(--space-md);
}

.classroom-step-text {
  font-size: 2.5rem;
  line-height: 1.4;
  color: var(--gray-800);
  margin-bottom: var(--space-xl);
}

.classroom-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--gray-800);
}

.classroom-nav button {
  padding: var(--space-md) var(--space-2xl);
  font-size: 1.25rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.classroom-nav .prev-btn {
  background: var(--gray-600);
  color: white;
}

.classroom-nav .next-btn {
  background: var(--science-green);
  color: white;
}

.classroom-nav button:hover {
  transform: scale(1.05);
}

.classroom-nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.classroom-progress {
  display: flex;
  gap: var(--space-xs);
  justify-content: center;
  margin-top: var(--space-md);
}

.classroom-progress-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--gray-600);
  transition: all 0.2s ease;
}

.classroom-progress-dot.active {
  background: var(--science-green);
  transform: scale(1.2);
}

.classroom-progress-dot.completed {
  background: var(--teal);
}

/* Comprehension Check Styles */
.comprehension-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--gray-200);
}

.comprehension-section h4 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  color: var(--purple);
}

.comprehension-question {
  background: var(--purple-light);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.comprehension-question .question-text {
  margin-bottom: var(--space-md);
  font-weight: 500;
}

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.video-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-card .video-title {
  padding: var(--space-md);
  font-weight: 600;
  color: var(--gray-700);
}

/* Mobile Responsive for Science */
@media (max-width: 768px) {
  .chapter-tabs {
    flex-direction: column;
  }

  .chapter-tab {
    min-width: 100%;
  }

  .input-tabs {
    flex-wrap: wrap;
  }

  .input-tab {
    min-width: calc(50% - var(--space-xs));
  }

  .step-card {
    padding-left: var(--space-lg);
    padding-top: 60px;
  }

  .step-card::before {
    left: 50%;
    top: var(--space-md);
    transform: translateX(-50%);
  }

  .classroom-step-text {
    font-size: 1.5rem;
  }

  .supplies-list ul {
    grid-template-columns: 1fr;
  }
}
