/* ==========================================================================
   Storybook Styles — Sheldon's Big Rainforest Smile (Ages 2–5)
   ========================================================================== */

.storybook-hero {
  text-align: center;
  padding: 2.2rem 1rem 1.4rem;
  background: linear-gradient(180deg, rgba(232, 245, 233, 0.7) 0%, rgba(255, 248, 225, 0.4) 100%);
  border-bottom: 2px dashed #a5d6a7;
  margin-bottom: 2rem;
}

.storybook-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #2e7d32;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 14px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(46, 125, 50, 0.25);
  margin-bottom: 0.8rem;
}

.storybook-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: #1b5e20;
  margin: 0.2rem 0 0.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.storybook-hero .subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: #386641;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Book Container Frame */
.book-wrapper {
  max-width: 920px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

.book-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: #ffffff;
  border: 2px solid #a5d6a7;
  border-radius: 16px;
  padding: 0.75rem 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 4px 12px rgba(27, 94, 32, 0.08);
}

.book-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.book-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f1f8e9;
  border: 2px solid #81c784;
  color: #1b5e20;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.book-tool-btn:hover {
  background: #81c784;
  color: #ffffff;
  transform: translateY(-1px);
}

.book-tool-btn.active {
  background: #2e7d32;
  color: #ffffff;
  border-color: #1b5e20;
}

.page-indicator-text {
  font-weight: 700;
  color: #2e7d32;
  font-size: 0.95rem;
}

/* The Book Card */
.book-stage {
  position: relative;
  background: #ffffff;
  border: 3px solid #81c784;
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(27, 94, 32, 0.15), 0 2px 6px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease;
}

.book-page {
  display: none;
  animation: pageFadeIn 0.35s ease-out forwards;
}

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

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

/* Page Layout */
.page-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: stretch;
  min-height: 480px;
}

@media (max-width: 768px) {
  .page-grid {
    grid-template-columns: 1fr;
  }
}

/* Illustration Box */
.page-illustration-box {
  background: linear-gradient(135deg, #e8f5e9 0%, #fffde7 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-right: 2px solid #e0e0e0;
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  .page-illustration-box {
    border-right: none;
    border-bottom: 2px solid #e0e0e0;
    padding: 1.2rem;
  }
}

.page-img-frame {
  width: 100%;
  max-width: 440px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border: 3px solid #ffffff;
  position: relative;
}

.page-img-frame img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

/* Interactive Overlay Hotspots on Illustration */
.interactive-prompt-badge {
  margin-top: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid #81c784;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  color: #1b5e20;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.2s ease;
}

.interactive-prompt-badge:hover {
  background: #81c784;
  color: #ffffff;
  transform: scale(1.03);
}

/* Page Text & Content Box */
.page-text-box {
  padding: 2.2rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
}

@media (max-width: 768px) {
  .page-text-box {
    padding: 1.4rem 1.2rem;
  }
}

.page-chapter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f57f17;
  background: #fff8e1;
  padding: 3px 10px;
  border-radius: 999px;
  align-self: flex-start;
  margin-bottom: 0.6rem;
}

.page-title {
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  color: #1b5e20;
  margin: 0 0 1rem;
  font-weight: 800;
  line-height: 1.25;
}

.page-narrative {
  font-size: clamp(1.1rem, 2vw, 1.28rem);
  line-height: 1.65;
  color: #263238;
  margin-bottom: 1.2rem;
  font-family: -apple-system, BlinkMacSystemFont, "Nunito", "Segoe UI", Roboto, sans-serif;
}

.page-narrative p {
  margin: 0 0 0.8rem;
}

.page-narrative strong {
  color: #1b5e20;
}

.page-narrative em {
  color: #d84315;
  font-style: normal;
  font-weight: 700;
}

/* Sound Effect Badges / Tap Action inside text */
.sound-badge {
  display: inline-block;
  background: #fff3e0;
  border: 1.5px dashed #ff9800;
  color: #e65100;
  font-weight: 800;
  font-size: 0.95em;
  padding: 2px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.sound-badge:hover, .sound-badge:active {
  transform: scale(1.08);
  background: #ffe0b2;
}

/* Parent Tip Box */
.parent-tip {
  background: #f1f8e9;
  border-left: 4px solid #66bb6a;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
}

.parent-tip-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2e7d32;
  margin-bottom: 0.2rem;
}

.parent-tip p {
  font-size: 0.88rem;
  color: #425244;
  margin: 0;
  line-height: 1.45;
}

/* Big Navigation Buttons */
.book-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #f9fbf9;
  border-top: 2px solid #e8f5e9;
  gap: 1rem;
}

.book-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: 999px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  min-height: 52px;
  user-select: none;
}

.book-nav-btn.prev {
  background: #ffffff;
  color: #2e7d32;
  border-color: #81c784;
}

.book-nav-btn.prev:hover:not(:disabled) {
  background: #e8f5e9;
  transform: translateX(-3px);
}

.book-nav-btn.next {
  background: #2e7d32;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(46, 125, 50, 0.3);
}

.book-nav-btn.next:hover:not(:disabled) {
  background: #1b5e20;
  transform: translateX(3px);
  box-shadow: 0 6px 18px rgba(46, 125, 50, 0.4);
}

.book-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Page Indicator Dots */
.page-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.page-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #c8e6c9;
  border: 2px solid #81c784;
  cursor: pointer;
  transition: all 0.25s ease;
}

.page-dot.active {
  background: #2e7d32;
  transform: scale(1.3);
  border-color: #1b5e20;
}

/* Interactive SVG Scene Elements */
.svg-scene-container {
  width: 100%;
  max-width: 440px;
  height: auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border: 3px solid #ffffff;
  background: #ffffff;
}

.clickable-interactive {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.clickable-interactive:hover {
  transform: scale(1.04);
}

/* Meet the Tools Grid */
.tools-showcase {
  background: #ffffff;
  border: 2px solid #81c784;
  border-radius: 24px;
  padding: 2.2rem 1.8rem;
  box-shadow: 0 8px 24px rgba(27, 94, 32, 0.08);
  margin-bottom: 3rem;
}

.tools-showcase h2 {
  text-align: center;
  color: #1b5e20;
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0 0 0.4rem;
}

.tools-showcase .tools-lead {
  text-align: center;
  color: #536b56;
  max-width: 640px;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.tool-card {
  background: linear-gradient(135deg, #f9fbf9 0%, #f1f8e9 100%);
  border: 2px solid #c8e6c9;
  border-radius: 18px;
  padding: 1.4rem;
  text-align: center;
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: #66bb6a;
  box-shadow: 0 10px 22px rgba(46, 125, 50, 0.14);
}

.tool-card-icon {
  font-size: 2.6rem;
  display: inline-block;
  margin-bottom: 0.5rem;
  transition: transform 0.25s ease;
}

.tool-card:hover .tool-card-icon {
  transform: scale(1.15) rotate(6deg);
}

.tool-card-kidname {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1b5e20;
  margin-bottom: 0.2rem;
}

.tool-card-realname {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f57f17;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.tool-card-desc {
  font-size: 0.92rem;
  color: #37474f;
  line-height: 1.45;
  margin: 0;
}

.tool-card-soundbtn {
  margin-top: 0.8rem;
  background: #ffffff;
  border: 1.5px solid #81c784;
  color: #2e7d32;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

.tool-card-soundbtn:hover {
  background: #81c784;
  color: #ffffff;
}

/* Coloring Page Printable Section */
.coloring-section {
  background: linear-gradient(135deg, #fffde7 0%, #fff8e1 100%);
  border: 2.5px dashed #ffb300;
  border-radius: 24px;
  padding: 2.2rem 1.8rem;
  margin-bottom: 3rem;
  text-align: center;
}

.coloring-section h2 {
  color: #e65100;
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  margin: 0 0 0.4rem;
}

.coloring-sheet-preview {
  max-width: 600px;
  margin: 1.5rem auto;
  background: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

/* Sparkle Animation */
@keyframes starPop {
  0% { transform: scale(0) rotate(0deg); opacity: 0; }
  50% { transform: scale(1.4) rotate(180deg); opacity: 1; }
  100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

.sparkle-effect {
  animation: starPop 0.4s ease-out forwards;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .book-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .book-toolbar-controls {
    justify-content: center;
  }
  .book-nav-bar {
    padding: 0.8rem 1rem;
  }
  .book-nav-btn {
    padding: 0.65rem 1.1rem;
    font-size: 1rem;
  }
}
