/* =====================================================
   Kids Stories — Apple-Level Premium UI
   Light / Dim / Dark
   ===================================================== */

/* ================= ROOT TOKENS ================= */
:root {
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;

  --ease: cubic-bezier(.22,.61,.36,1);

  --gold: #bfa742;
  --accent: #8b8fa8;

  --shadow-light:
    0 1px 2px rgba(0,0,0,.04),
    0 10px 30px rgba(0,0,0,.08);

  --shadow-hover:
    0 20px 45px rgba(0,0,0,.18);

  --blur: saturate(180%) blur(18px);
}

/* ================= BASE ================= */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont,
               "SF Pro Text", "Poppins",
               system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  transition: background-color .35s var(--ease),
              color .35s var(--ease);
}

.no-copy {
  user-select: none;
  -webkit-user-select: none;
}

/* ================= THEMES ================= */
body.light {
  background: #f6f7f9;
  color: #1d1d1f;
}

body.dark {
  background: #02071f;
  color: #f5f5f7;
}

body.dim {
  background: #111827;
  color: #d1d5db;
}

/* ================= HEADER ================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;

  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0 24px;
  backdrop-filter: var(--blur);

  background: rgba(255,255,255,.72);
  border-bottom: 1px solid rgba(0,0,0,.06);
}

body.dark .app-header,
body.dim .app-header {
  background: rgba(15,23,42,.75);
  border-bottom-color: rgba(255,255,255,.08);
}

.app-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.app-title span {
  color: var(--gold);
}

.header-icon {
  position: absolute;
  font-size: 1.25rem;
  cursor: pointer;
  transition: transform .25s var(--ease),
              color .25s var(--ease);
}

.header-icon:hover {
  transform: scale(1.15);
  color: var(--gold);
}

.home-btn { left: 22px; }
.theme-btn {
  right: 22px;
  background: none;
  border: none;
  color: inherit;
}

/* ================= HERO ================= */
.kids-hero {
  padding: clamp(48px, 8vw, 72px) 20px 40px;
  text-align: center;
}

.kids-hero-title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.kids-hero-subtitle {
  max-width: 640px;
  margin: 14px auto 0;
  font-size: 1rem;
  color: #6e6e73;
}

body.dark .kids-hero-subtitle,
body.dim .kids-hero-subtitle {
  color: #9ca3af;
}

/* ================= LIBRARY ================= */
.kids-library {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px 96px;
}

/* ================= SHELF ================= */
.kids-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 26px;
}

/* ================= BOOK CARD ================= */
.kids-book-card {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;

  border-radius: var(--radius-xl);
  overflow: hidden;

  background: #fff;
  box-shadow: var(--shadow-light);

  transition:
    transform .45s var(--ease),
    box-shadow .45s var(--ease);
}

body.dark .kids-book-card {
  background: #0c1227;
}

body.dim .kids-book-card {
  background: #1a2235;
}

.kids-book-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

/* ================= COVER ================= */
.kids-book-cover {
  aspect-ratio: 3.7 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;

  background:
    linear-gradient(
      135deg,
      #ffffff 0%,
      #f1f3f7 60%,
      #e6eaf2 100%
    );
}

body.dark .kids-book-cover {
  background:
    linear-gradient(
      135deg,
      #0b1020 0%,
      #050e34 100%
    );
}

body.dim .kids-book-cover {
  background:
    linear-gradient(
      135deg,
      #111827 0%,
      #1a2235 100%
    );
}

/* ================= TITLES ================= */
.kids-book-title {
  text-align: center;
}

.title-en {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 6px;
}

.title-ur {
  font-family: "Amiri Quran", serif;
  font-size: 1rem;
  direction: rtl;
  letter-spacing: .02em;
  margin: 0;
}

/* ================= META ================= */
.kids-book-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 12px 16px 14px;
  font-size: .75rem;
}

.meta-age {
  color: #6e6e73;
}

.meta-theme {
  font-weight: 500;
  color: var(--accent);
}

body.dark .meta-age,
body.dim .meta-age {
  color: #9ca3af;
}

/* ================= HOVER OVERLAY ================= */
.hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background .45s var(--ease);
  pointer-events: none;
}

.kids-book-card:hover .hover-overlay {
  background: rgba(0,0,0,.04);
}

body.dark .kids-book-card:hover .hover-overlay,
body.dim .kids-book-card:hover .hover-overlay {
  background: rgba(255,255,255,.06);
}

/* ================= FOOTER ================= */


.kids-footer {
  text-align: center;
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.story-note {
  color: #b45309; /* Warm Amber */
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.disclaimer {
  color: #6b7280; /* Soft Gray */
  font-size: 0.8rem;
  font-style: italic;
  line-height: 1.5;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 640px) {
  .kids-shelf {
    gap: 18px;
  }

  .kids-book-card:hover {
    transform: none;
  }
}











/* ================= SEARCH ================= */
.kids-search {
  padding: 12px 20px 36px;
  display: flex;
  justify-content: center;
}

.kids-search-inner {
  position: relative;
  width: 100%;
  max-width: 520px;
}

.kids-search input {
  width: 100%;
  height: 52px;

  padding: 0 52px 0 18px;
  border-radius: 999px;

  font-size: 0.95rem;
  font-family: inherit;

  background: rgba(255,255,255,.85);
  border: 1px solid rgba(0,0,0,.08);

  box-shadow:
    0 6px 18px rgba(0,0,0,.08);

  outline: none;

  transition:
    box-shadow .35s var(--ease),
    background .35s var(--ease),
    border .35s var(--ease);
}

.kids-search input::placeholder {
  color: #9ca3af;
}

/* Focus — ChatGPT feel */
.kids-search input:focus {
  background: #fff;
  border-color: rgba(191,167,66,.45);
  box-shadow:
    0 12px 30px rgba(191,167,66,.25);
}

/* Icon */
.search-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: .6;
  pointer-events: none;
}

/* DARK / DIM */
body.dark .kids-search input,
body.dim .kids-search input {
  background: rgba(15,23,42,.9);
  border-color: rgba(255,255,255,.12);
  color: #f5f5f7;
}

body.dark .kids-search input:focus,
body.dim .kids-search input:focus {
  box-shadow:
    0 14px 32px rgba(191,167,66,.28);
}

/* MOBILE */
@media (max-width: 640px) {
  .kids-search input {
    height: 48px;
  }
}

/* ================= MOBILE GRID FIX ================= */
@media (max-width: 640px) {
  .kids-shelf {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .kids-library {
    padding-left: 14px;
    padding-right: 14px;
  }

  .kids-book-cover {
    padding: 12px;
  }

  .title-en {
    font-size: 0.85rem;
  }

  .title-ur {
    font-size: 0.9rem;
  }
}



/* =========================================================
   KIDS HERO — MATCHED TO RAMADAN THEME
   ========================================================= */

.kids-hero {
  position: relative;
  max-width: 920px;
  margin: 2.5rem auto;
  padding: 4rem 2rem;
  text-align: center;
  
  /* Uses your theme's elevated background and gold glow */
  background: 
    radial-gradient(circle at top, var(--gold-soft), transparent 70%),
    var(--bg-elevated);
  
  backdrop-filter: var(--blur-lg);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.kids-hero-overlay {
  position: absolute;
  inset: 0;
  background-image: url("https://www.transparenttextures.com/patterns/arabesque.png");
  opacity: 0.05;
  pointer-events: none;
}

.kids-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 650px;
  margin: 0 auto;
}

.kids-hero-sparkle {
  color: var(--gold-main);
  opacity: 0.3;
  font-size: 3rem;
  position: absolute;
  top: -20px;
  right: -10px;
}

.kids-hero-arabic {
  font-family: "Amiri", serif;
  color: var(--gold-main);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

.kids-hero-title {
  font-family: "Poppins", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  line-height: 1.2;
}

.kids-hero-title .gold-text {
  color: var(--gold-main);
}

.kids-hero-divider {
  width: 50px;
  height: 3px;
  background: var(--gold-main);
  margin: 1.5rem auto;
  border-radius: 999px;
}

.kids-hero-subtitle {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-soft);
  font-style: italic;
}

.kids-hero-urdu {
  font-family: "Noto Nastaliq Urdu", serif;
  color: var(--gold-main);
  margin-top: 1.5rem;
  font-size: 1.2rem;
  direction: rtl;
}

/* =========================================================
   RESPONSIVE (MOBILE & TABLET)
   ========================================================= */

@media (max-width: 768px) {
  .kids-hero {
    margin: 1.5rem 1.25rem;
    padding: 3rem 1.5rem;
  }

  .kids-hero-title {
    font-size: 1.8rem;
  }
  
  .kids-hero-arabic {
    font-size: 1.5rem;
    color: var(--gold);
  }
}

@media (max-width: 480px) {
  .kids-hero-title {
    font-size: 1.5rem;
  }

  .kids-hero-subtitle {
    font-size: 0.95rem;
  }

  .kids-hero-sparkle {
    font-size: 2rem;
    top: -10px;
  }
}
