/* ==========================================================================
   Grade 3 Science - Unit 3: Types of Living Things: Plants
   Textbook-Authentic Interactive Presentation & Learning Simulation
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:ital,wght@0,400;0,700;1,400&family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  --primary-orange: #f37721;
  --secondary-orange: #f89938;
  --light-orange: #fff4ea;
  --pale-orange: #fef8f2;
  --banner-orange: #f28b26;
  
  --sky-blue: #3fa9f5;
  --light-blue: #e8f5fe;
  --header-blue: #72b2d6;
  
  --forest-green: #2e7d32;
  --leaf-green: #4caf50;
  --light-green: #e8f5e9;
  
  --chalk-blue: #1565c0;
  --chalk-dark: #1e293b;
  --ink-gray: #334155;
  --subtle-gray: #64748b;
  --light-gray: #f1f5f9;
  --card-border: #fed7aa;
  
  --page-bg: #fdfaf7;
  --paper-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  --border-radius-page: 20px;
  
  --font-heading: 'Fredoka', 'Nunito', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --font-chalk: 'Comic Neue', cursive, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(135deg, #f0f7f4 0%, #fdf2e9 50%, #e8f4f8 100%);
  color: var(--ink-gray);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Top Teacher Control Bar
   -------------------------------------------------------------------------- */
.teacher-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid #fed7aa;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 1.8rem;
  background: var(--light-green);
  border: 2px solid var(--leaf-green);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--chalk-dark);
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--primary-orange);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Page Navigation Tabs */
.page-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 30px;
  border: 1px solid #e2e8f0;
}

.page-tab-btn {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 7px 15px;
  border-radius: 20px;
  border: none;
  background: transparent;
  color: var(--subtle-gray);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-tab-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--chalk-dark);
}

.page-tab-btn.active {
  background: var(--primary-orange);
  color: #fff;
  box-shadow: 0 2px 10px rgba(243, 119, 33, 0.4);
}

.page-tab-btn .badge-pill {
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.12);
  padding: 2px 6px;
  border-radius: 10px;
}

.page-tab-btn.active .badge-pill {
  background: rgba(255, 255, 255, 0.25);
}

/* Quick Tools */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-tool {
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  color: var(--chalk-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-tool:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-tool.btn-highlight {
  background: var(--primary-orange);
  color: #fff;
  border-color: var(--primary-orange);
  box-shadow: 0 2px 8px rgba(243, 119, 33, 0.3);
}

.btn-tool.btn-highlight:hover {
  background: #e06310;
  border-color: #e06310;
}

.btn-tool.btn-green {
  background: var(--forest-green);
  color: #fff;
  border-color: var(--forest-green);
}

.btn-tool.btn-green:hover {
  background: #256628;
}

/* --------------------------------------------------------------------------
   Main Workspace & Book Container
   -------------------------------------------------------------------------- */
.book-stage {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px 50px;
}

.book-wrapper {
  width: 100%;
  max-width: 880px;
  position: relative;
}

/* Individual Textbook Page Styling */
.textbook-page {
  display: none;
  background: #ffffff;
  border-radius: var(--border-radius-page);
  box-shadow: var(--paper-shadow);
  border: 1.5px solid #fed7aa;
  overflow: hidden;
  position: relative;
  min-height: 1100px;
  padding-bottom: 80px;
  animation: fadeIn 0.3s ease-out;
}

.textbook-page.active-page {
  display: block;
}

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

/* --------------------------------------------------------------------------
   Original Textbook Top Header & Wave Design
   -------------------------------------------------------------------------- */
.page-top-decor {
  position: relative;
  padding: 20px 28px 14px;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
  border-bottom: 2px dashed #fed7aa;
}

.wave-graphic {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 90px;
  pointer-events: none;
  opacity: 0.9;
}

.wave-graphic svg {
  width: 100%;
  height: 100%;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.unit-label {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: #2b7a8a;
  letter-spacing: -0.5px;
}

.unit-title-bubble {
  border: 2px solid #5a4b41;
  border-radius: 40px;
  background: #ffffff;
  padding: 6px 22px;
  box-shadow: 2px 2px 0px rgba(90, 75, 65, 0.2);
  display: inline-flex;
  align-items: center;
}

.unit-title-bubble h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: #382d27;
  letter-spacing: -0.3px;
}

/* Audio Read Button in Header */
.page-speaker-btn {
  margin-left: auto;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.page-speaker-btn:hover {
  background: var(--light-green);
  border-color: var(--leaf-green);
  transform: scale(1.1);
}

.page-speaker-btn.speaking {
  background: #fee2e2;
  border-color: #ef4444;
  animation: pulse 1.2s infinite;
}

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

/* --------------------------------------------------------------------------
   Page Body Content
   -------------------------------------------------------------------------- */
.page-content {
  padding: 26px 40px 40px;
  font-size: 1.2rem;
  line-height: 1.75;
  color: #23272f;
}

/* Textbook Section Pills */
.section-pill-tag {
  display: inline-block;
  padding: 5px 22px;
  border-radius: 20px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 18px 0 10px;
  border: 2px dashed;
}

.pill-blue {
  background: #e1f0f5;
  color: #1f6b80;
  border-color: #8ac0d0;
}

.pill-orange {
  background: #ffede0;
  color: #c45400;
  border-color: #f7a66b;
}

.pill-green {
  background: #eaf5ea;
  color: #2d6e30;
  border-color: #8bc34a;
}

.subheading-dashed {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: #382d27;
  display: inline-block;
  border: 1.5px dashed #fab54d;
  background: #fffbf5;
  padding: 5px 18px;
  border-radius: 16px;
  margin: 16px 0 10px;
}

/* Colored Keywords matching the printed textbook */
.kw-food {
  color: #e05b38;
  font-weight: 700;
}

.kw-air {
  color: #0284c7;
  font-weight: 700;
}

.kw-water {
  color: #0284c7;
  font-weight: 700;
}

.kw-chlorophyll {
  color: #2e7d32;
  font-weight: 700;
}

.kw-seeds {
  color: #d9480f;
  font-weight: 700;
}

.kw-spores {
  color: #8d4f00;
  font-weight: 700;
}

.kw-pollen {
  color: #d97706;
  font-weight: 700;
}

.kw-fruit {
  color: #16a34a;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Real Textbook Photos & Enhanced Educational Graphics
   -------------------------------------------------------------------------- */
.real-photo-card {
  margin: 20px auto;
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
  border: 2.5px solid #fed7aa;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.real-photo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(243, 119, 33, 0.15);
}

.real-photo-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.photo-caption {
  padding: 10px 16px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: #475569;
  background: #fffaf5;
  border-top: 1px solid #fed7aa;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Flower Anatomy Interactive Diagram (Page 20) */
.flower-interactive-wrapper {
  position: relative;
  margin: 20px auto;
  max-width: 650px;
  border-radius: 18px;
  overflow: hidden;
  border: 2.5px solid #fed7aa;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.flower-interactive-wrapper img {
  display: block;
  width: 100%;
  height: auto;
}

/* Flower Interactive Pin Overlay */
.flower-hotspots {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hotspot-pin {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  background: #ffffff;
  color: #1e293b;
  border: 2px solid var(--primary-orange);
  border-radius: 20px;
  padding: 4px 12px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  animation: floatPin 2s infinite ease-in-out;
}

.hotspot-pin:hover, .hotspot-pin.active {
  background: var(--primary-orange);
  color: #ffffff;
  transform: scale(1.12);
  box-shadow: 0 6px 14px rgba(243, 119, 33, 0.4);
}

@keyframes floatPin {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.flower-parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.flower-part-card {
  background: #ffffff;
  border: 1.5px solid #fed7aa;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.flower-part-card:hover {
  border-color: var(--primary-orange);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(243, 119, 33, 0.15);
}

.flower-part-card.active-part {
  background: #fff7ed;
  border-color: var(--primary-orange);
  border-width: 2px;
}

.part-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--chalk-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.part-desc {
  font-size: 0.95rem;
  color: var(--ink-gray);
  margin-top: 4px;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   PAGE 23: 100% Textbook Exact Match & Interactive Questions
   -------------------------------------------------------------------------- */
.activities-title-pill {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: #1f6b80;
  background: #e1f0f5;
  border: 2px solid #8ac0d0;
  border-radius: 30px;
  padding: 6px 28px;
  display: inline-block;
  margin: 20px 0 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.activity-section-num {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: #1f6b80;
  margin-bottom: 16px;
}

.qa-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qa-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 14px 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.qa-card:hover {
  border-color: var(--primary-orange);
  box-shadow: 0 4px 14px rgba(243, 119, 33, 0.14);
  transform: translateY(-2px);
}

.qa-card.revealed {
  border-color: #22c55e;
  background: #fcfdfc;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.14);
}

.qa-question-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.qa-question-text {
  font-size: 1.18rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.5;
}

.qa-letter {
  color: #d97706;
  font-weight: 700;
  margin-right: 4px;
}

.qa-toggle-indicator {
  flex-shrink: 0;
  font-size: 0.88rem;
  font-family: var(--font-heading);
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 5px 14px;
  border-radius: 20px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.qa-card:hover .qa-toggle-indicator {
  background: var(--light-orange);
  color: var(--primary-orange);
  border-color: var(--card-border);
}

.qa-card.revealed .qa-toggle-indicator {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.qa-answer-box {
  display: none;
  margin-top: 12px;
  padding: 14px 18px;
  background: #f0fdf4;
  border-left: 5px solid #22c55e;
  border-radius: 10px;
  animation: slideDown 0.25s ease-out;
}

.qa-card.revealed .qa-answer-box {
  display: block;
}

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

.qa-answer-text {
  font-family: var(--font-chalk);
  font-size: 1.45rem;
  font-weight: 700;
  color: #14532d;
  line-height: 1.5;
  letter-spacing: 0.2px;
}

.qa-copy-note {
  font-size: 0.82rem;
  color: #16a34a;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body);
}

/* --------------------------------------------------------------------------
   PAGE 24: 100% Textbook Exact Match - Fill in blanks & Drawing Areas
   -------------------------------------------------------------------------- */
.fill-blanks-container {
  background: #ffffff;
  border: 2px solid #fed7aa;
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 26px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
}

.blank-item {
  margin-bottom: 20px;
  font-size: 1.22rem;
  line-height: 2.1;
  color: #1e293b;
}

.blank-letter {
  color: #ea580c;
  font-weight: 700;
  margin-right: 4px;
}

/* Interactive Blank Slot */
.blank-slot {
  display: inline-block;
  min-width: 140px;
  padding: 2px 12px;
  margin: 0 4px;
  border-bottom: 3px solid #94a3b8;
  background: #f8fafc;
  border-radius: 6px 6px 0 0;
  text-align: center;
  font-family: var(--font-chalk);
  font-size: 1.45rem;
  font-weight: 700;
  color: #0369a1;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.blank-slot:hover {
  background: #fff7ed;
  border-bottom-color: var(--primary-orange);
}

.blank-slot.revealed {
  background: #e0f2fe;
  border-bottom: 3px solid #0284c7;
  color: #0369a1;
  animation: popIn 0.25s ease-out;
}

.blank-slot .hidden-word {
  opacity: 0;
  visibility: hidden;
}

.blank-slot.revealed .hidden-word {
  opacity: 1;
  visibility: visible;
}

.blank-slot .blank-dots {
  color: #94a3b8;
  letter-spacing: 2.5px;
}

.blank-slot.revealed .blank-dots {
  display: none;
}

@keyframes popIn {
  0% { transform: scale(0.9); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Drawing Sections (Questions 3 & 4) */
.draw-section {
  margin-bottom: 28px;
}

.draw-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.draw-title .draw-num {
  color: #1f6b80;
  background: #e1f0f5;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  font-size: 1.05rem;
}

/* Exact Dotted Box from Textbook */
.draw-dotted-box {
  border: 2.5px dashed #94a3b8;
  border-radius: 18px;
  background: #fafaf9;
  min-height: 250px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}

.draw-dotted-box:hover {
  border-color: #64748b;
}

/* Canvas Toolbar */
.canvas-toolbar {
  background: #ffffff;
  border-bottom: 1.5px dashed #cbd5e1;
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.canvas-tools-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #cbd5e1;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.color-swatch:hover, .color-swatch.active {
  transform: scale(1.25);
  box-shadow: 0 0 0 2px #3b82f6;
}

.btn-canvas {
  font-size: 0.82rem;
  font-family: var(--font-heading);
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-canvas:hover {
  background: #e2e8f0;
}

.btn-canvas.btn-guide {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
  font-weight: 700;
}

.btn-canvas.btn-guide:hover {
  background: #fde68a;
}

.interactive-canvas {
  width: 100%;
  height: 230px;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

/* Model Drawing Guide Overlay with Real Illustrations */
.model-drawing-overlay {
  display: none;
  position: absolute;
  top: 45px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(4px);
  z-index: 10;
  padding: 14px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: fadeIn 0.2s ease-out;
}

.model-drawing-overlay.active {
  display: flex;
}

.model-drawing-overlay img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 12px;
  border: 2px solid #fed7aa;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  object-fit: contain;
}

.model-note {
  font-family: var(--font-chalk);
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-top: 8px;
}

.model-close-btn {
  margin-top: 8px;
  font-size: 0.82rem;
  padding: 5px 14px;
  border-radius: 12px;
  background: #e2e8f0;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Scalloped Page Number Badges
   -------------------------------------------------------------------------- */
.page-number-footer {
  position: absolute;
  bottom: 18px;
  display: flex;
  align-items: center;
  z-index: 5;
}

.page-footer-right {
  right: 28px;
}

.page-footer-left {
  left: 28px;
}

.scallop-badge {
  position: relative;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scallop-badge svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.page-num-text {
  position: relative;
  z-index: 2;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: #2b3a4a;
}

/* --------------------------------------------------------------------------
   Interactive Modal for Fruit Sorter Game
   -------------------------------------------------------------------------- */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-window {
  background: #ffffff;
  border-radius: 24px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border: 3px solid #fed7aa;
  padding: 24px;
  position: relative;
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f1f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: all 0.2s;
}

.modal-close-icon:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Interactive Mini-Lab Box */
.interactive-activity-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
  border: 2px dashed #38bdf8;
  border-radius: 18px;
  padding: 16px 22px;
  margin: 22px 0 16px;
}

.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.activity-badge {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.98rem;
  background: #0284c7;
  color: #ffffff;
  padding: 4px 14px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* --------------------------------------------------------------------------
   Page 19 Multiple Choice Quiz Widget (7 Questions)
   -------------------------------------------------------------------------- */
.quiz-widget-card {
  margin-top: 30px;
  background: #ffffff;
  border: 2px solid #bae6fd;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.08);
}

.quiz-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 2px dashed #e2e8f0;
  margin-bottom: 20px;
}

.quiz-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: #0369a1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiz-score-badge {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  background: #fef08a;
  color: #854d0e;
  border: 1.5px solid #facc15;
  padding: 5px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.quiz-q-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
  transition: all 0.25s ease;
}

.quiz-q-box.correct {
  border-color: #86efac;
  background: #f0fdf4;
}

.quiz-q-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.quiz-q-num {
  background: #0284c7;
  color: #ffffff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.quiz-options-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-opt-btn {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  color: #334155;
}

.quiz-opt-btn:hover:not(:disabled) {
  border-color: #0284c7;
  background: #f0f9ff;
  transform: translateX(4px);
}

.quiz-opt-btn.opt-correct {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
  color: #15803d !important;
  font-weight: 700;
}

.quiz-opt-btn.opt-wrong {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
  animation: shake 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.quiz-q-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
}

.quiz-feedback-msg {
  font-family: var(--font-chalk);
  font-weight: 700;
  font-size: 1.05rem;
}


/* Responsive adjustments */
@media (max-width: 768px) {
  .teacher-navbar {
    padding: 8px 12px;
  }
  
  .page-tabs {
    order: 3;
    width: 100%;
    justify-content: space-around;
  }
  
  .page-tab-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  
  .page-content {
    padding: 18px 20px 30px;
    font-size: 1.05rem;
  }
}
