/* 
  Kinds of Plants - Grade 2 Science Interactive Simulation
  Aesthetic Design System: Kid-friendly, vibrant, crisp, modern glassmorphism
*/

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Quicksand:wght@500;600;700&family=Patrick+Hand&family=Comic+Neue:wght@700&display=swap');

:root {
  --primary: #2e7d32;
  --primary-light: #4caf50;
  --primary-soft: #e8f5e9;
  --primary-dark: #1b5e20;
  
  --secondary: #0288d1;
  --secondary-light: #4fc3f7;
  --secondary-soft: #e1f5fe;
  
  --accent-sun: #fbc02d;
  --accent-orange: #ff9800;
  --accent-pink: #ec407a;
  --accent-purple: #8e24aa;
  
  --bg-gradient: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 50%, #fef3c7 100%);
  --book-bg: #ffffff;
  --book-border: #90caf9;
  
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --answer-color: #0d47a1;
  --highlight-bg: #fff9c4;
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 40px rgba(46,125,50,0.15);
  
  --font-main: 'Fredoka', 'Quicksand', sans-serif;
  --font-handwriting: 'Patrick Hand', 'Comic Neue', cursive;
  --font-body: 'Quicksand', sans-serif;
}

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

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

/* Background floating cute nature bubbles */
.bg-decorations {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-bubble {
  position: absolute;
  border-radius: 50%;
  opacity: 0.25;
  filter: blur(40px);
  animation: floatSlow 18s ease-in-out infinite alternate;
}

.bubble-1 {
  width: 350px;
  height: 350px;
  background: #a7f3d0;
  top: -100px;
  left: -80px;
}

.bubble-2 {
  width: 400px;
  height: 400px;
  background: #bae6fd;
  bottom: 50px;
  right: -100px;
  animation-delay: -6s;
}

.bubble-3 {
  width: 250px;
  height: 250px;
  background: #fde68a;
  top: 40%;
  left: 60%;
  animation-delay: -12s;
}

@keyframes floatSlow {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 40px) scale(1.1); }
  100% { transform: translate(-20px, 25px) scale(0.95); }
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 3px solid #86efac;
  box-shadow: var(--shadow-sm);
  padding: 10px 24px;
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 2.2rem;
  background: var(--primary-soft);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 2px solid #86efac;
  animation: pulseLogo 3s infinite ease-in-out;
}

@keyframes pulseLogo {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.logo-text h1 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-text .badge-grade {
  background: #fef08a;
  color: #854d0e;
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 700;
  border: 1px solid #fde047;
}

.logo-text p {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Header Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.star-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fef9c3;
  border: 2px solid #facc15;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 700;
  color: #713f12;
  font-size: 1.05rem;
  box-shadow: 0 2px 6px rgba(250, 204, 21, 0.2);
}

.star-counter .star-icon {
  animation: spinStar 8s linear infinite;
  display: inline-block;
}

@keyframes spinStar {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.btn-pill {
  font-family: var(--font-main);
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.btn-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

.btn-pill:active {
  transform: translateY(0);
}

.btn-sound {
  background: #eff6ff;
  color: #1d4ed8;
  border: 2px solid #bfdbfe;
}

.btn-voice {
  background: #faf5ff;
  color: #7e22ce;
  border: 2px solid #e9d5ff;
}

.btn-teacher {
  background: #fdf2f8;
  color: #be185d;
  border: 2px solid #fbcfe8;
}

/* Main Navigation Tabs */
.main-nav {
  background: white;
  padding: 10px 16px;
  border-bottom: 2px solid #e2e8f0;
  position: sticky;
  top: 73px;
  z-index: 90;
}

.nav-tabs-wrapper {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.nav-tab {
  font-family: var(--font-main);
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  background: var(--primary-soft);
  border-color: #86efac;
  color: var(--primary-dark);
}

.nav-tab.active {
  background: var(--primary);
  border-color: var(--primary-dark);
  color: white;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.25);
  transform: scale(1.03);
}

.nav-tab.tab-highlight {
  background: #eff6ff;
  border-color: #60a5fa;
  color: #1d4ed8;
}

.nav-tab.tab-highlight.active {
  background: #2563eb;
  border-color: #1d4ed8;
  color: white;
}

/* Main App Container */
.main-container {
  max-width: 1300px;
  margin: 24px auto 80px;
  padding: 0 20px;
  position: relative;
  z-index: 10;
}

/* Tab Views */
.tab-content {
  display: none;
  animation: fadeIn 0.35s ease-out;
}

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

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

/* SECTION HEADERS */
.section-banner {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  margin-bottom: 24px;
  border: 2px solid #bbf7d0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 16px;
}

.banner-title-box h2 {
  font-size: 1.6rem;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-title-box p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 4px;
}

.banner-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ========================================================
   LESSON MODULE 1: WHAT PLANTS NEED (Page 19)
======================================================== */
.lesson-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .lesson-grid-2 {
    grid-template-columns: 1fr;
  }
}

.card-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 2px solid #e2e8f0;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.card-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 14px;
  border: 1px solid #86efac;
}

/* Needs of a plant interactive simulator */
.sim-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: linear-gradient(180deg, #dbeafe 0%, #f0fdf4 70%, #dcfce7 100%);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  border: 2px dashed #93c5fd;
  position: relative;
  overflow: hidden;
}

.sun-display {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 3rem;
  transition: all 0.5s ease;
  filter: drop-shadow(0 0 10px #facc15);
}

.sun-display.active {
  animation: sunGlow 2s infinite alternate;
}

@keyframes sunGlow {
  0% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 12px #facc15); }
  100% { transform: scale(1.2) rotate(15deg); filter: drop-shadow(0 0 25px #f59e0b); }
}

.plant-stage {
  height: 240px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  width: 100%;
}

.pot-plant-graphic {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animated-leaf {
  transition: all 0.5s ease;
}

.pot-plant-graphic.watered .leaf-sprout {
  fill: #22c55e !important;
  transform: scale(1.15);
}

.bubbles-photosynthesis {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.oxygen-bubble {
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid #60a5fa;
  border-radius: 50%;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: riseUp 2.5s ease-out infinite;
  opacity: 0;
}

@keyframes riseUp {
  0% { transform: translateY(50px) scale(0.6); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(-120px) scale(1.1); opacity: 0; }
}

.need-buttons-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.btn-need {
  padding: 10px 18px;
  border-radius: var(--radius-full);
  border: 2px solid #cbd5e1;
  background: white;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-need:hover {
  transform: translateY(-2px);
  border-color: #3b82f6;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
}

.btn-need.active {
  background: #3b82f6;
  color: white;
  border-color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

.btn-need.water-active {
  background: #0284c7;
  color: white;
  border-color: #0369a1;
}

.btn-need.sun-active {
  background: #eab308;
  color: #713f12;
  border-color: #ca8a04;
}

.btn-need.air-active {
  background: #10b981;
  color: white;
  border-color: #047857;
}

.need-feedback {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-dark);
  text-align: center;
  min-height: 28px;
}

/* Textbook Points Card (Page 19) */
.textbook-points-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.point-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #f8fafc;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border-left: 6px solid var(--primary);
  font-size: 1.1rem;
  font-weight: 600;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.point-item:hover {
  background: var(--primary-soft);
  transform: translateX(6px);
}

.point-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.read-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--secondary);
  transition: transform 0.2s;
  padding: 2px 6px;
  margin-left: auto;
}

.read-btn:hover {
  transform: scale(1.25);
}

/* ========================================================
   LESSON MODULE 2: PARTS OF A PLANT & TREES/SHRUBS (Page 20)
======================================================== */
.plant-interactive-diagram-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 30px;
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 2px solid #bbf7d0;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.diagram-image-col {
  flex: 1 1 360px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 16px;
  border: 2px dashed #86efac;
}

.diagram-image-col img {
  max-width: 100%;
  max-height: 440px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.diagram-pins-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.diagram-pin {
  pointer-events: auto;
  position: absolute;
  transform: translate(-50%, -50%);
  background: #f43f5e;
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.4);
  cursor: pointer;
  border: 2px solid white;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.diagram-pin:hover, .diagram-pin.active {
  transform: translate(-50%, -50%) scale(1.18);
  background: #0284c7;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.5);
}

.diagram-info-col {
  flex: 1 1 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.part-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 14px;
}

.part-card:hover {
  background: var(--primary-soft);
  border-color: #86efac;
  transform: translateX(6px);
}

.part-card.active {
  background: #ecfdf5;
  border-color: #10b981;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

.part-badge-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: white;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
}

.part-card.flower-card .part-badge-circle { border-color: #f472b6; background: #fdf2f8; }
.part-card.leaf-card .part-badge-circle { border-color: #4ade80; background: #f0fdf4; }
.part-card.stem-card .part-badge-circle { border-color: #38bdf8; background: #f0f9ff; }
.part-card.roots-card .part-badge-circle { border-color: #f97316; background: #fff7ed; }

.part-text h3 {
  font-size: 1.15rem;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.part-text p {
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-top: 2px;
}

/* Trees vs Shrubs Cards */
.compare-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.plant-type-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

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

.type-card-img {
  height: 220px;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.type-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.plant-type-card:hover .type-card-img img {
  transform: scale(1.08);
}

.type-card-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}

.type-tag {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tag-tree { background: #dcfce7; color: #166534; }
.tag-shrub { background: #fce7f3; color: #9d174d; }
.tag-herb { background: #e0e7ff; color: #3730a3; }
.tag-moss { background: #fef3c7; color: #92400e; }

.type-card-body h3 {
  font-size: 1.3rem;
  color: var(--text-dark);
}

.type-card-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 1rem;
  color: #334155;
}

.type-card-body ul li {
  position: relative;
  padding-left: 20px;
}

.type-card-body ul li::before {
  content: '🌿';
  position: absolute;
  left: 0;
  top: 1px;
  font-size: 0.85rem;
}

/* ========================================================
   LESSON MODULE 3: PLANT TUBES SIMULATOR (Page 21)
======================================================== */
.tubes-sim-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 2px solid #86efac;
  box-shadow: var(--shadow-md);
  margin-top: 24px;
}

.tubes-canvas-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.tube-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-tube {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-water-tube {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}

.btn-water-tube.active {
  background: #0284c7;
  color: white;
  border-color: #0369a1;
}

.btn-food-tube {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde047;
}

.btn-food-tube.active {
  background: #eab308;
  color: #713f12;
  border-color: #ca8a04;
}

/* ========================================================
   LESSON MODULE 4: SPECIAL PLANTS LAB (Page 22)
======================================================== */
.special-plants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

.special-plant-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 2px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

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

.special-card-img {
  height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.special-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.special-plant-card:hover .special-card-img img {
  transform: scale(1.06);
}

.interactive-touch-area {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.touch-hint-pill {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 6px;
  animation: bounceHint 2s infinite ease-in-out;
}

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

.special-card-body h3 {
  font-size: 1.25rem;
  color: var(--primary-dark);
}

.special-card-body p {
  font-size: 1rem;
  color: #334155;
  font-weight: 500;
}

/* ========================================================
   TEXTBOOK PAGES 23 & 24 (100% IDENTICAL BOOK REPLICA)
======================================================== */
.book-replica-wrapper {
  max-width: 960px;
  margin: 0 auto;
}

.book-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-bottom: 20px;
  border: 2px solid #93c5fd;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 12px;
}

.mode-toggle-group {
  display: flex;
  gap: 8px;
}

.btn-book-mode {
  font-family: var(--font-main);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  background: #f1f5f9;
  color: #475569;
  transition: all 0.2s ease;
}

.btn-book-mode.active {
  background: #2563eb;
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-reveal-all {
  background: #fef08a;
  color: #854d0e;
  border: 2px solid #facc15;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s;
}

.btn-reveal-all:hover {
  transform: translateY(-2px);
}

/* The physical page paper simulation */
.textbook-sheet {
  background: #ffffff;
  border-radius: 20px;
  border: 3px solid #60a5fa;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0,0,0,0.06);
  padding: 36px 42px;
  position: relative;
  min-height: 1000px;
  margin-bottom: 40px;
  background-image: 
    radial-gradient(#e0f2fe 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Top curved header matching textbook wave */
.book-header-wave {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #bae6fd;
  padding-bottom: 16px;
  margin-bottom: 24px;
  position: relative;
}

.book-unit-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 8px 24px;
  border-radius: 20px 20px 20px 4px;
  font-size: 1.35rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
  letter-spacing: 0.5px;
}

.book-title-pill {
  border: 2.5px solid #0284c7;
  padding: 6px 28px;
  border-radius: var(--radius-full);
  font-size: 1.45rem;
  font-weight: 800;
  color: #0369a1;
  background: #f0f9ff;
  letter-spacing: 0.5px;
}

/* Page puzzle number badge */
.page-puzzle-badge {
  position: absolute;
  bottom: 24px;
  left: 36px;
  width: 60px;
  height: 60px;
  background: #bae6fd;
  border: 3px solid #0284c7;
  border-radius: 50% 50% 12px 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  color: #0369a1;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.page-24-badge {
  left: auto;
  right: 36px;
  border-radius: 50% 50% 50% 12px;
}

/* Activity Section Layout (100% Match) */
.activity-section {
  margin-bottom: 30px;
}

.activity-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.activity-num-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #22c55e;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
  flex-shrink: 0;
}

.activity-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e293b;
}

/* Diagram Labeling Box (Page 23 - Question 1) */
.label-diagram-container {
  border: 3px dashed #93c5fd;
  border-radius: 20px;
  padding: 24px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin-bottom: 24px;
}

.diagram-interactive-canvas-wrap {
  position: relative;
  max-width: 520px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.diagram-canvas-img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
}

/* Label pointers and dropboxes */
.diagram-label-slot {
  position: absolute;
  cursor: pointer;
  background: #ffffff;
  border: 2px solid #0284c7;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  min-width: 100px;
  text-align: center;
  font-family: var(--font-handwriting);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--answer-color);
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transition: all 0.25s ease;
  user-select: none;
}

.diagram-label-slot:hover {
  transform: scale(1.08);
  border-color: #22c55e;
  box-shadow: 0 6px 14px rgba(34, 197, 94, 0.3);
}

.diagram-label-slot.revealed {
  background: #fef08a;
  border-color: #eab308;
  color: #854d0e;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Leader lines */
.pointer-line {
  position: absolute;
  border-top: 2px solid #0284c7;
  pointer-events: none;
}

/* Positions for Page 23 Diagram */
.slot-flower {
  top: 10%;
  left: 2%;
}

.slot-leaf {
  top: 36%;
  right: 2%;
}

.slot-stem {
  top: 58%;
  left: 4%;
}

.slot-roots {
  bottom: 8%;
  right: 6%;
}

/* Page 23 - Question 2: Fill in the dotted blanks */
.qa-book-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.qa-book-item {
  cursor: pointer;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.qa-book-item:hover {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.qa-book-item.active-item {
  background: #f0fdf4;
  border-color: #86efac;
}

.qa-question-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qa-question-text .q-letter {
  color: #ea580c;
}

.qa-answer-line-wrap {
  margin-top: 8px;
  font-size: 1.3rem;
  font-family: var(--font-handwriting);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  color: #1e293b;
}

.book-lead-text {
  font-family: var(--font-main);
  font-size: 1.15rem;
  font-weight: 700;
  color: #334155;
}

.book-dotted-blank {
  position: relative;
  flex-grow: 1;
  min-width: 250px;
  border-bottom: 2px dotted #94a3b8;
  padding: 0 10px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.book-answer-text {
  display: none;
  color: var(--answer-color);
  font-family: var(--font-handwriting);
  font-size: 1.5rem;
  font-weight: 700;
  background: #fef08a;
  padding: 2px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(250, 204, 21, 0.3);
  animation: popIn 0.25s ease-out;
}

.book-answer-text.revealed {
  display: inline-block;
}

.click-hint-badge {
  font-family: var(--font-main);
  font-size: 0.75rem;
  color: #0284c7;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: auto;
  border: 1px solid #bae6fd;
}

/* ========================================================
   PAGE 24: YES/NO & PLANT NAMES IDENTIFICATION
======================================================== */
.yesno-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.yesno-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-wrap: wrap;
}

.yesno-item:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.yesno-statement {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.yesno-statement .item-letter {
  color: #7c3aed;
}

.yesno-blank-answer {
  border-bottom: 2px dotted #64748b;
  min-width: 120px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yesno-tag {
  display: none;
  font-family: var(--font-handwriting);
  font-size: 1.6rem;
  font-weight: 800;
  padding: 2px 16px;
  border-radius: 8px;
  animation: popIn 0.25s ease-out;
}

.yesno-tag.revealed {
  display: inline-flex;
}

.yesno-tag.tag-yes {
  background: #dcfce7;
  color: #15803d;
  border: 1.5px solid #86efac;
}

.yesno-tag.tag-no {
  background: #fee2e2;
  color: #b91c1c;
  border: 1.5px solid #fca5a5;
}

/* Page 24 - Question 4: Plant Name Cards */
.plant-name-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 700px) {
  .plant-name-cards-grid {
    grid-template-columns: 1fr;
  }
}

.plant-id-card {
  border: 3px dashed #93c5fd;
  border-radius: var(--radius-lg);
  padding: 20px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.plant-id-card:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  transform: translateY(-4px);
}

.plant-id-img-wrap {
  width: 100%;
  height: 220px;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e2e8f0;
}

.plant-id-img-wrap img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.plant-id-card:hover .plant-id-img-wrap img {
  transform: scale(1.08);
}

.plant-name-line-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
}

.plant-name-blank {
  flex-grow: 1;
  border-bottom: 2px dotted #94a3b8;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.plant-name-revealed {
  display: none;
  font-family: var(--font-handwriting);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--answer-color);
  background: #fef08a;
  padding: 2px 14px;
  border-radius: 8px;
  border: 1px solid #facc15;
  animation: popIn 0.25s ease-out;
}

.plant-name-revealed.revealed {
  display: inline-block;
}

/* ========================================================
   FUN QUIZ & MINI GAMES TAB
======================================================== */
.quiz-container {
  background: white;
  border-radius: var(--radius-lg);
  padding: 30px;
  border: 2px solid #86efac;
  box-shadow: var(--shadow-md);
  max-width: 800px;
  margin: 0 auto;
}

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

.quiz-progress-bar-wrap {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 24px;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #10b981);
  width: 20%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.quiz-question-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quiz-q-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #1e293b;
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .quiz-options-grid {
    grid-template-columns: 1fr;
  }
}

.quiz-opt-btn {
  font-family: var(--font-main);
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 1.15rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.quiz-opt-btn:hover {
  background: var(--primary-soft);
  border-color: #86efac;
  transform: translateY(-2px);
}

.quiz-opt-btn.correct {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
  color: #15803d !important;
  animation: celebrationPulse 0.4s ease;
}

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

@keyframes celebrationPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.quiz-feedback-box {
  margin-top: 20px;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 1.15rem;
  font-weight: 700;
  display: none;
}

/* Certificate */
.certificate-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.certificate-modal.active {
  display: flex;
}

.certificate-card {
  background: white;
  max-width: 700px;
  width: 100%;
  border-radius: 24px;
  border: 8px solid #facc15;
  padding: 36px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  position: relative;
  background-image: radial-gradient(#fef9c3 1.5px, transparent 1.5px);
  background-size: 20px 20px;
}

.certificate-card h2 {
  font-size: 2.2rem;
  color: #1e3a8a;
}

.certificate-card p {
  font-size: 1.2rem;
  color: #475569;
  margin-top: 10px;
}

.student-name-input {
  font-family: var(--font-handwriting);
  font-size: 1.8rem;
  text-align: center;
  padding: 8px 16px;
  border: none;
  border-bottom: 3px solid #2563eb;
  background: transparent;
  width: 80%;
  margin: 16px auto;
  color: #1d4ed8;
  outline: none;
}

/* Confetti canvas */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 300;
}

/* Floating speech bubble indicator */
.speaker-bubble {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  color: #2563eb;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.speaker-bubble:hover {
  background: #2563eb;
  color: white;
  transform: scale(1.15);
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .textbook-sheet {
    padding: 24px 16px;
  }
  .book-header-wave {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .app-header {
    padding: 10px 14px;
  }
  .logo-text h1 {
    font-size: 1.2rem;
  }
  .page-puzzle-badge {
    position: static;
    margin-top: 20px;
  }
}
