/* Custom fonts and base styles */
:root {
  --primary-color: #ff6b35;
  --secondary-color: #f7931e;
  --accent-color: #ffd23f;
  --success-color: #06d6a0;
  --info-color: #118ab2;
  --purple-color: #8e44ad;
  --pink-color: #e91e63;
  --green-color: #4caf50;
  --blue-color: #2196f3;
  --orange-color: #ff9800;
  --red-color: #f44336;
  --dark-color: #2c3e50;
  --light-color: #ecf0f1;
  --gradient-primary: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  --gradient-secondary: linear-gradient(
    135deg,
    var(--info-color) 0%,
    var(--purple-color) 100%
  );
  --gradient-accent: linear-gradient(
    135deg,
    var(--pink-color) 0%,
    var(--orange-color) 100%
  );
  /* Footer-only mid blue, per UAT. Its own token rather than a change to
     --gradient-secondary, which .tile-2 in the hero also uses. Deep enough to
     carry white text, which is what the footer markup already asks for across
     every page — see .custom-footer below.
     White on #3476b2 is 4.79:1, over the 4.5:1 minimum but with almost no room
     to spare: any off-white (Bootstrap's .text-white-50 included) drops under
     AA, so the whole footer is pure white and the hierarchy comes from size and
     weight instead of from fading the ink. */
  --footer-bg: #3476b2;
  --footer-ink: #ffffff; /* 4.79:1 on #3476b2 — AA */
  --footer-ink-soft: #ffffff; /* no dimming — see the note above */
  --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
  --shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Fredoka", sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  overflow-x: hidden;
}

/* Custom Navbar */
.custom-navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-light);
  transition: all 0.3s ease;
}

.navbar-brand img {
  transition: transform 0.3s ease;
}

.navbar-brand:hover img {
  transform: scale(1.1);
}

.nav-link {
  font-weight: 500;
  color: var(--dark-color) !important;
  margin: 0 10px;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--primary-color) !important;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 50%;
  background: var(--gradient-primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 100%;
}

/* Header utility group — legal links + social icons, between the main nav and
   the auth buttons. It lives inside .navbar-collapse so it folds into the
   burger menu on mobile rather than overflowing the bar. Set smaller and
   quieter than .nav-link on purpose: these are secondary to the section links,
   and at nav-link size they crowded the bar onto two rows on laptops.

   The two rows sit stacked rather than side by side: side by side they measured
   359px, which left the expanded bar 32px short of fitting and wrapped both
   "About Us" and the Sign In / Sign Up buttons onto second lines. Stacked, the
   group is as wide as its widest row and still shorter than the 70px logo. */
.navbar-utility {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

/* Stacked, not "Privacy Policy · Terms of Use" on one line: inline the row is
   168px, and on a 1280px screen that was the difference between the bar fitting
   and the section links wrapping. */
.navbar-legal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: nowrap;
}

.navbar-legal a {
  color: #55636d; /* 5.5:1 against the navbar's near-white — AA */
  text-decoration: none;
  transition: color 0.25s ease;
}

.navbar-legal a:hover,
.navbar-legal a:focus-visible {
  color: var(--primary-color);
  text-decoration: underline;
}

/* The header carried a social icon row until 5 August. It was removed: the marks
   belong in the footer, and dropping them also retires the 992-1200px rule that
   had to hide them to stop the bar wrapping onto two lines. */

/* Admin dark navbar: keep link text white (overrides the light-navbar .nav-link
   color rule above, which forces dark text and would otherwise dim these). */
.navbar-dark .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link.active {
  color: #fff !important;
}

.navbar-dark .nav-link.active {
  font-weight: 600;
}

.navbar-dark .navbar-brand {
  color: #fff !important;
}

/* Shared story-collage backdrop.
   Built from ChanzoPlay's own book covers by build_hero_collage.php, replacing
   the stock cupcake-and-burger artwork. Re-run that script after adding books.
   Used by the hero and by the sign-in/sign-up pages, which previously each
   duplicated this declaration inline. */
.story-backdrop {
  /* Scrim is a variable so the hero can weight it towards the text side
     without having to repeat the image declaration below. */
  --scrim: linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.72));
  background-color: #2c3e50; /* shows while the image loads */
  background-image: var(--scrim), url("static/images/hero-collage.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* WebP where supported; the JPEG rule above remains the fallback. */
@supports (background-image: image-set(url("x.webp") type("image/webp"))) {
  .story-backdrop {
    background-image: var(--scrim),
      image-set(
        url("static/images/hero-collage.webp") type("image/webp"),
        url("static/images/hero-collage.jpg") type("image/jpeg")
      );
  }
}

/* Hero Section */
.hero-section {
  position: relative;
  padding: 80px 0 20px;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

/* Weight the scrim towards the headline on the left, so the cover art on the
   right stays legible instead of being flattened to near-black. */
.hero-section.story-backdrop {
  --scrim: linear-gradient(
    100deg,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.78) 40%,
    rgba(0, 0, 0, 0.5) 70%,
    rgba(0, 0, 0, 0.38) 100%
  );
}

/* Below the lg breakpoint the hero columns stack, so the text spans the full
   width and a left-weighted scrim leaves the headline sitting over bright
   cover art. Go back to an even, slightly stronger scrim. */
@media (max-width: 991.98px) {
  .hero-section.story-backdrop {
    --scrim: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8));
  }
}

/* Modala portrait — a foreground element, not part of the backdrop, so the
   scrim never dulls him or greys his white hair.

   He is a direct child of the section rather than of the right-hand column, so
   he centres on the banner itself. No panel and no box-shadow now that the PNG
   is a cutout: a rectangular shadow behind a transparent image draws a box
   around nothing. drop-shadow follows his silhouette instead, which is what
   keeps him readable against the busy cover collage. */
.hero-modala {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(200px, 40%);
  height: auto;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55));
  pointer-events: none;
  z-index: 1;
}

/* Stacked columns: the headline now owns the middle of the banner, so drop him
   back to the bottom, where the (empty) image column leaves room. */
@media (max-width: 991.98px) {
  .hero-modala {
    top: auto;
    bottom: 0;
    transform: translateX(-50%);
    width: min(200px, 55%);
  }
}

/* Tiles float in front of the portrait. */
.floating-tiles {
  z-index: 2;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1" fill="rgba(255,255,255,0.08)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.06)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: white;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease;
}

.hero-title .highlight {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  opacity: 0.9;
  animation: fadeInUp 1s ease 0.2s both;
}

.hero-description {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.8;
  animation: fadeInUp 1s ease 0.4s both;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  animation: fadeInUp 1s ease 0.6s both;
}

.stat-item {
  text-align: center;
}

.stat-item h3 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.stat-item p {
  font-size: 1rem;
  opacity: 0.8;
}

/* Download Buttons */
.download-buttons {
  display: flex;
  gap: 1rem;
  align-items: center;
  animation: fadeInUp 1s ease 0.8s both;
}

.download-btn {
  display: inline-block;
  transition: all 0.3s ease;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.download-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-medium);
}

.download-btn img {
  height: 50px;
  width: auto;
  display: block;
  transition: all 0.3s ease;
}

/* Floating Tiles Animation */
.hero-image {
  position: relative;
  height: 500px;
}

.floating-tiles {
  position: relative;
  width: 100%;
  height: 100%;
}

.tile {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  animation: float 6s ease-in-out infinite;
  box-shadow: var(--shadow-medium);
}

.tile-1 {
  background: var(--gradient-primary);
  top: 10%;
  left: 20%;
  animation-delay: 0s;
}

.tile-2 {
  background: var(--gradient-secondary);
  top: 20%;
  right: 10%;
  animation-delay: 1s;
}

/* tile-3 and tile-5 are the two nearest the left edge of .hero-image, which is
   the page centre — and that is where Modala now stands. Their old 10% / 2%
   insets put them on his cheek and chin, so both are held back past his edge. */
.tile-3 {
  background: var(--gradient-accent);
  top: 50%;
  left: 28%;
  animation-delay: 2s;
}

.tile-4 {
  background: linear-gradient(
    135deg,
    var(--success-color) 0%,
    var(--green-color) 100%
  );
  top: 60%;
  right: 20%;
  animation-delay: 3s;
}

.tile-5 {
  background: linear-gradient(
    135deg,
    var(--blue-color) 0%,
    var(--info-color) 100%
  );
  bottom: 24%;
  left: 34%;
  animation-delay: 4s;
}

.tile-6 {
  background: linear-gradient(
    135deg,
    var(--accent-color) 0%,
    var(--orange-color) 100%
  );
  bottom: 12%;
  right: 2%;
  animation-delay: 5s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(10deg);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Styles */
.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.2rem;
  color: #6c757d;
  margin-bottom: 0;
}

.about-section {
  background: var(--light-color);
}

.feature-card {
  background: white;
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  box-shadow: var(--shadow-light);
  transition: all 0.3s ease;
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-medium);
}

.feature-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: white;
}

/* Three identical orange discs on a light grey background read as one repeated
   blob and the icons were hard to pick out. A distinct colour per card carries
   more meaning and more contrast. */
.feature-icon--books {
  background: linear-gradient(135deg, #0d6e8c 0%, var(--info-color) 100%);
}

.feature-icon--puzzles {
  background: linear-gradient(135deg, #05a87d 0%, var(--success-color) 100%);
}

.feature-icon--games {
  background: linear-gradient(135deg, #6c3483 0%, var(--purple-color) 100%);
}

.feature-card h4 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

/* Stories Section */
.stories-section {
  background: white;
}

.section-header {
  margin-bottom: 3rem;
}

.section-nav {
  display: flex;
  gap: 1rem;
}

.section-nav .btn {
  border-radius: 25px;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
}

.story-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
  transition: all 0.2s ease;
  cursor: pointer;
}

.story-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.story-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.story-card h5 {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 1rem 1rem 0.5rem;
  margin: 0;
  line-height: 1.3;
}

.language-tag {
  display: block;
  background: var(--primary-color);
  color: white;
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
  margin: 0 1rem 1rem;
  border-radius: 15px;
  text-align: center;
  font-weight: 500;
}

.language-tag.traditional {
  background: var(--purple-color);
}

/* Traditional Tales Section
   The approved design reference (attached_assets/Screenshot 2025-09-03 224226)
   shows this section on a near-white background, not the pink/salmon gradient
   that shipped. A very light warm tint separates it from the white Latest
   Stories section above without competing with the cover art. */
.traditional-section {
  background: linear-gradient(180deg, #ffffff 0%, #fbf7f2 100%);
}

.story-card.traditional {
  border: 2px solid var(--purple-color);
}

/* Puzzles Section */
.puzzles-section {
  background: var(--light-color);
}

.puzzle-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
  transition: all 0.3s ease;
  cursor: pointer;
}

.puzzle-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-heavy);
}

.puzzle-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.puzzle-info {
  padding: 1.5rem;
}

.puzzle-info h5 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.puzzle-info p {
  color: #6c757d;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.puzzle-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pieces {
  color: var(--info-color);
  font-weight: 500;
  font-size: 0.9rem;
}

.difficulty {
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--success-color);
  color: white;
}

/* Contact Section */
.contact-section {
  background: white;
}

.contact-info h4 {
  color: var(--dark-color);
  margin-bottom: 1rem;
  font-weight: 600;
}

.address {
  color: #6c757d;
  margin: 0;
  line-height: 1.8;
}

/* Map Styling */
.map-container {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-medium);
  transition: all 0.3s ease;
}

.map-container:hover {
  box-shadow: var(--shadow-heavy);
  transform: translateY(-2px);
}

.map-wrapper {
  position: relative;
  width: 100%;
  height: 400px;
}

.map-wrapper iframe {
  border-radius: 15px;
  transition: all 0.3s ease;
}

.map-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 49%,
    rgba(255, 107, 53, 0.1) 51%
  );
  pointer-events: none;
  z-index: 1;
  border-radius: 15px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.map-container:hover .map-wrapper::before {
  opacity: 1;
}

.contact-form {
  background: var(--light-color);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: var(--shadow-light);
}

.form-control,
.form-select {
  border-radius: 10px;
  border: 2px solid #e9ecef;
  padding: 0.75rem 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.25);
}

.btn-primary {
  background: var(--gradient-primary);
  border: none;
  border-radius: 15px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  border-radius: 15px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background: var(--gradient-primary);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* Footer */
.custom-footer {
  background: var(--footer-bg);
  margin-top: 5rem;
  color: var(--footer-ink);
}

/* Every page's footer markup uses Bootstrap's .text-white / .text-white-50.
   .text-white-50 is white at 50% opacity, which on #3476b2 measures 2.1:1 —
   under the 4.5:1 minimum — so it is promoted to solid white here rather than
   edited out of the same markup in four files. */
.custom-footer,
.custom-footer h5,
.custom-footer p,
.custom-footer small {
  color: var(--footer-ink);
}

.custom-footer .text-white,
.custom-footer .text-white-50 {
  color: var(--footer-ink) !important;
}

.custom-footer a.text-white-50 {
  color: var(--footer-ink-soft) !important;
  transition: color 0.2s ease;
}

.custom-footer a.text-white-50:hover,
.custom-footer a.text-white-50:focus-visible {
  color: var(--footer-ink) !important;
  text-decoration: underline !important;
}

.custom-footer hr {
  border-top-color: rgba(255, 255, 255, 0.35);
  opacity: 1;
}

/* Social icons. Each link is rendered only when its CMS setting holds a URL,
   so the row is never a set of dead "#" links. */
.footer-social {
  display: flex;
  gap: 0.65rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* Bare white glyphs, no filled disc: the brand marks that need a container
   (Facebook, YouTube, LinkedIn) already carry their own in the glyph, so adding
   five identical discs behind them only makes the strip read heavier than the
   rule above it. */
.footer-social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.3rem;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.25s ease;
}

.footer-social a:hover,
.footer-social a:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-3px);
  color: #ffffff;
}

/* site-content.js strips the href of any mark whose CMS URL is still blank, so
   the icon shows but leads nowhere. No hover affordance on those — they must not
   look clickable. */
.footer-social a.social-unset {
  cursor: default;
}

.footer-social a.social-unset:hover {
  background: transparent;
  transform: none;
}

/* Bottom strip: social marks hard left, contact/legal links hard right. */
.footer-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-top: 1.75rem;
}

/* The 34px hit areas are wider than the glyphs they centre, so the first icon
   would sit ~7px in from the copyright line above it. Pull the row back out. */
.footer-bottom-bar .footer-social {
  margin-top: 0;
  margin-left: -7px;
  gap: 0.9rem;
}

/* margin-left rather than the bar's space-between alone: with the social row
   stripped out (no CMS URLs yet) space-between would leave these links sitting
   at the left edge instead of holding the right. */
.footer-bottom-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;
  gap: 0.75rem 2rem;
}

.footer-bottom-links a {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-bottom-links a:hover,
.footer-bottom-links a:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

/* Stacked, the two halves have no edges to sit against, so centre them. */
@media (max-width: 575.98px) {
  .footer-bottom-bar {
    justify-content: center;
  }

  .footer-bottom-bar .footer-social,
  .footer-bottom-links {
    justify-content: center;
    margin-left: 0;
    width: 100%;
  }
}

/* The two short footers (privacy, terms) centre everything already. */
.footer-bottom-bar--center {
  justify-content: center;
  gap: 0.75rem 2.5rem;
}

.footer-bottom-bar--center .footer-social,
.footer-bottom-bar--center .footer-bottom-links {
  margin-left: 0;
}

/* Footer logo on a white panel. The wordmark is white with a thin red outline,
   which reads poorly straight on the footer colour; a white card restores the
   contrast the mark was drawn for. content-box so the padding grows the panel
   rather than shrinking the logo (the global reset sets border-box). */
.custom-footer .footer-logo {
  box-sizing: content-box;
  height: 56px;
  width: auto;
  margin-bottom: 1rem;
  background: #fff;
  padding: 10px 18px;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.5rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .download-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

  .floating-tiles {
    display: none;
  }

  .section-header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .section-nav {
    justify-content: center;
  }

  .story-card h5 {
    font-size: 0.8rem;
  }

  .puzzle-details {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .tile {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  /* Mobile-specific adjustments */
  .navbar-brand img {
    height: 50px !important;
  }
  .hero-section {
    padding-top: 120px;
  }

  /* Hero stats mobile layout */
  .hero-stats {
    flex-direction: row !important;
    justify-content: space-between;
    gap: 10px;
  }

  .stat-item {
    text-align: center;
    flex: 1;
  }

  .stat-item h3 {
    font-size: 1.2rem !important;
    margin-bottom: 0.25rem;
  }

  .stat-item p {
    font-size: 0.75rem !important;
    margin-bottom: 0;
  }

  /* Download buttons mobile layout */
  .download-buttons {
    display: flex;
    flex-direction: row !important;
    gap: 10px;
    justify-content: center;
  }

  .download-btn img {
    height: 40px !important;
  }
}

/* Loading animations */
.fade-in {
  animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Lazy loading placeholder */
img[loading="lazy"] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

img[loading="lazy"].loaded {
  animation: none;
  background: none;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .navbar,
  .floating-tiles,
  .contact-form {
    display: none;
  }

  /* .story-backdrop carries the image now, so it needs the override too. */
  .hero-section,
  .story-backdrop {
    background: white;
    background-image: none;
    color: black;
  }
}

/* Book Modal Styles */
.book-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.book-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.book-modal-content {
  position: relative;
  background: white;
  border-radius: 25px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease;
  z-index: 10000;
}

.book-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10001;
  box-shadow: var(--shadow-medium);
}

.book-modal-close:hover {
  background: var(--secondary-color);
  transform: rotate(90deg) scale(1.1);
}

.book-modal-body {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  padding: 2rem;
}

.book-modal-image {
  flex: 0 0 300px;
}

.book-modal-image img {
  width: 100%;
  height: auto;
  border-radius: 15px;
  box-shadow: var(--shadow-medium);
}

.book-modal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.book-modal-info h2 {
  color: var(--dark-color);
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  padding-right: 40px;
}

/* Language Selector Styles */
.language-selector-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #fff5f0 0%, #fff0eb 100%);
  border-radius: 16px;
  border: 2px solid rgba(255, 107, 53, 0.2);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.08);
}

.language-selector-container:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.15);
  transform: translateY(-1px);
}

.language-label {
  font-weight: 600;
  color: var(--dark-color);
  font-size: 0.95rem;
  margin: 0;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.language-label i {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.language-dropdown {
  flex: 1;
  padding: 12px 45px 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--dark-color);
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6b35' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  min-width: 160px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.language-dropdown:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.12);
}

.language-dropdown:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.15);
}

.language-dropdown option {
  font-weight: 500;
  padding: 12px;
  background: white;
  color: var(--dark-color);
}

.language-dropdown option:hover {
  background: var(--primary-color);
  color: white;
}

.book-modal-audio {
  width: 100%;
}

.book-modal-audio audio {
  width: 100%;
  border-radius: 15px;
  outline: none;
}

.book-modal-text {
  flex: 1;
  overflow-y: auto;
}

.book-modal-text p {
  color: #6c757d;
  font-size: 1.1rem;
  line-height: 1.8;
  margin: 0;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mobile responsive modal */
@media (max-width: 768px) {
  .book-modal-body {
    flex-direction: column;
    padding: 1.5rem;
  }

  .book-modal-image {
    flex: 0 0 auto;
  }

  .book-modal-info h2 {
    font-size: 1.5rem;
  }

  .book-modal-content {
    max-height: 95vh;
    width: 95%;
  }
}

@media (max-width: 576px) {
  .book-modal-body {
    padding: 1rem;
  }

  .book-modal-info h2 {
    font-size: 1.3rem;
    padding-right: 35px;
  }

  .book-modal-text p {
    font-size: 1rem;
  }

  .book-modal-close {
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
  
  /* Language selector mobile styles */
  .language-selector-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }
  
  .language-label {
    justify-content: center;
  }
  
  .language-dropdown {
    width: 100%;
    min-width: unset;
    text-align: center;
  }
}

/* Play Button Overlay for Story Cards */
.play-button-overlay {
  position: absolute;
  top: 50%;
  left: calc(50% + 30px);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 5;
}

.play-button-overlay i {
  color: white;
  font-size: 25px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
  transition: all 0.3s ease;
}

.story-card:hover .play-button-overlay i {
  transform: scale(1.2);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.8));
}

/* Animation for play button pulse */
@keyframes pulse-play {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.play-button-overlay i {
  animation: pulse-play 2s ease-in-out infinite;
}

/* User Profile Navbar Styles */
#user-profile-nav {
  align-items: center;
}

#user-profile-nav .dropdown-toggle {
  color: var(--dark-color);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 50px;
  background: rgba(255, 107, 53, 0.1);
  transition: all 0.3s ease;
}

#user-profile-nav .dropdown-toggle:hover {
  background: rgba(255, 107, 53, 0.2);
  color: var(--primary-color);
}

#user-profile-nav .dropdown-toggle::after {
  margin-left: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar i {
  font-size: 28px;
  color: var(--primary-color);
}

.user-name {
  font-weight: 600;
  color: var(--dark-color);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#user-profile-nav .dropdown-menu {
  border: none;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 10px;
  min-width: 200px;
  margin-top: 10px;
}

#user-profile-nav .dropdown-item {
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 500;
  transition: all 0.2s ease;
}

#user-profile-nav .dropdown-item:hover {
  background: rgba(255, 107, 53, 0.1);
  color: var(--primary-color);
}

#user-profile-nav .dropdown-item i {
  width: 20px;
  color: var(--primary-color);
}

#user-profile-nav .dropdown-divider {
  margin: 8px 16px;
  border-color: rgba(0, 0, 0, 0.08);
}

/* Mobile responsive for user profile */
@media (max-width: 991px) {
  #user-profile-nav {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  #user-profile-nav .dropdown {
    width: 100%;
  }

  #user-profile-nav .dropdown-toggle {
    width: 100%;
    justify-content: center;
  }

  #user-profile-nav .dropdown-menu {
    position: static !important;
    transform: none !important;
    width: 100%;
    margin-top: 10px;
    box-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
  }
}

/* Custom Modal Styles (Winner/Try Again) */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.custom-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.custom-modal-content {
  position: relative;
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 450px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
  overflow: hidden;
}

.celebration-content {
  background: linear-gradient(135deg, #ffffff 0%, #fff9f0 100%);
  border: 4px solid #FFD23F;
}

.custom-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #888;
  transition: all 0.2s;
  z-index: 10;
}

.custom-modal-close:hover {
  color: #333;
  transform: rotate(90deg);
}

.modal-icon-wrapper {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 40px;
  color: white;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.winner-icon {
  background: linear-gradient(135deg, #FFD23F 0%, #F7931E 100%);
  animation: bounce 2s infinite;
}

.try-again-icon {
  background: linear-gradient(135deg, #118AB2 0%, #2196f3 100%);
}

.custom-modal h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: #2c3e50;
}

.modal-message {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 20px;
}

.modal-instruction {
  font-size: 0.95rem;
  color: #888;
  margin-top: 15px;
  font-style: italic;
}

.vip-perks {
  text-align: left;
  background: rgba(255, 210, 63, 0.1);
  padding: 15px 20px;
  border-radius: 10px;
  margin: 15px 0;
}

.perk {
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

.perk i {
  color: #06D6A0;
  margin-right: 10px;
}

/* Confetti Animation */
.confetti {
  position: fixed;
  top: -10px;
  width: 10px;
  height: 20px;
  z-index: 10001;
  animation: fall linear forwards;
}

@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}
