/* ===== HADJITEK MADJITEK — UPGRADED DESIGN v2 ===== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Amiri:ital,wght@0,400;0,700;1,400;1,700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Noto+Sans+Arabic:wght@300;400;500;600;700&display=swap');

/* ===== VARIABLES ===== */
:root {
  --green-dark:    #08291a;
  --green-deep:    #0d3520;
  --green-main:    #1a6640;
  --green-light:   #2d8f58;
  --green-bright:  #3aad6e;
  --gold:          #c9a84c;
  --gold-light:    #e8c97a;
  --gold-bright:   #f5d87e;
  --gold-dark:     #8a6820;
  --gold-deep:     #6b5018;
  --cream:         #f8f0d8;
  --cream-mid:     #f0e4bc;
  --cream-dark:    #e0ccA0;
  --parchment:     #f4e8c8;
  --brown:         #4a2e0e;
  --brown-mid:     #6b4020;
  --brown-light:   #8b5e35;
  --text-dark:     #2a1a08;
  --white:         #ffffff;
  --shadow-sm:     0 4px 16px rgba(0,0,0,0.35);
  --shadow:        0 8px 32px rgba(0,0,0,0.5);
  --shadow-deep:   0 20px 60px rgba(0,0,0,0.65);
  --shadow-gold:   0 0 40px rgba(201,168,76,0.25);
  --radius:        18px;
  --radius-sm:     10px;
  --ease:          cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Amiri', 'Noto Sans Arabic', Georgia, serif;
  background: var(--green-dark);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== BACKGROUND LAYERS ===== */
.page-bg {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(180deg,
      rgba(12,8,4,0.18) 0%,
      rgba(200,140,40,0.04) 40%,
      rgba(6,12,6,0.28) 100%
    ),
    url('../bg.jpg');
  background-size: cover;
  background-position: center top;
}

/* Atmospheric vignette */
.page-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 90% 90% at 50% 50%, transparent 55%, rgba(4,12,8,0.5) 100%);
}

/* CSS-only fallback */
.page-bg-fallback {
  position: fixed; inset: 0; z-index: 0;
  /* Matches the warm orange-gold Algerian sunset palette of bg.jpg */
  background:
    radial-gradient(ellipse 160% 80% at 60% 35%,
      #e8b84a 0%, #d09030 12%, #9a6018 25%,
      #4a2c0a 42%, #1a3822 58%, #0a1e14 78%, #060e0a 100%);
}
.page-bg-fallback::before {
  content: '';
  position: absolute; inset: 0;
  background:
    /* warm sun glow centre-right */
    radial-gradient(ellipse 55% 65% at 65% 28%, rgba(240,175,60,0.55) 0%, transparent 55%),
    /* teal door hint left */
    radial-gradient(ellipse 25% 60% at 4%  40%, rgba(60,110,80,0.30) 0%, transparent 50%),
    /* horizon brightness */
    radial-gradient(ellipse 90% 18% at 50% 52%, rgba(230,175,80,0.28) 0%, transparent 55%),
    /* dark bottom ground */
    radial-gradient(ellipse 100% 30% at 50% 100%, rgba(4,10,6,0.9) 0%, transparent 55%);
}
.page-bg-fallback::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(55deg,  rgba(255,210,80,0.02) 0px, rgba(255,210,80,0.02) 1px, transparent 1px, transparent 10px),
    repeating-linear-gradient(-55deg, rgba(0,0,0,0.022) 0px, rgba(0,0,0,0.022) 1px, transparent 1px, transparent 10px);
}

/* ===== ANIMATED FLOATING PARTICLES ===== */
.particles {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(201,168,76,0.55);
  animation: floatUp linear infinite;
  filter: blur(0.5px);
}
.particle:nth-child(1)  { width:3px;  height:3px;  left:8%;   animation-duration:18s; animation-delay:0s;    opacity:.6; }
.particle:nth-child(2)  { width:2px;  height:2px;  left:22%;  animation-duration:24s; animation-delay:4s;    opacity:.4; }
.particle:nth-child(3)  { width:4px;  height:4px;  left:38%;  animation-duration:20s; animation-delay:8s;    opacity:.5; }
.particle:nth-child(4)  { width:2px;  height:2px;  left:55%;  animation-duration:28s; animation-delay:2s;    opacity:.35; }
.particle:nth-child(5)  { width:3px;  height:3px;  left:70%;  animation-duration:22s; animation-delay:12s;   opacity:.5; }
.particle:nth-child(6)  { width:2px;  height:2px;  left:84%;  animation-duration:26s; animation-delay:6s;    opacity:.4; }
.particle:nth-child(7)  { width:5px;  height:5px;  left:15%;  animation-duration:30s; animation-delay:14s;   opacity:.3; }
.particle:nth-child(8)  { width:2px;  height:2px;  left:45%;  animation-duration:16s; animation-delay:9s;    opacity:.6; }
.particle:nth-child(9)  { width:3px;  height:3px;  left:65%;  animation-duration:32s; animation-delay:3s;    opacity:.4; }
.particle:nth-child(10) { width:2px;  height:2px;  left:90%;  animation-duration:19s; animation-delay:17s;   opacity:.5; }
@keyframes floatUp {
  0%   { transform: translateY(110vh) rotate(0deg);   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: .6; }
  100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* ===== ISLAMIC GEOMETRIC BORDER (SVG pattern via CSS) ===== */
.geo-border-top, .geo-border-bottom {
  position: absolute;
  left: 0; right: 0;
  height: 28px;
  z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='28'%3E%3Cpath d='M20 2 L38 14 L20 26 L2 14 Z' fill='none' stroke='%23c9a84c' stroke-width='0.8' opacity='0.5'/%3E%3Cpath d='M20 7 L33 14 L20 21 L7 14 Z' fill='none' stroke='%23c9a84c' stroke-width='0.5' opacity='0.3'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 40px 28px;
  pointer-events: none;
}
.geo-border-top    { top: 0; }
.geo-border-bottom { bottom: 0; transform: scaleY(-1); }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 24px;
  background: rgba(6, 20, 10, 0.30);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid rgba(201,168,76,0.22);
  transition: background 0.4s var(--ease);
}
.navbar::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 5%; right: 5%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(201,168,76,0.5), transparent);
}
.navbar.scrolled {
  background: rgba(6,18,10,0.70);
}

.nav-hamburger {
  background: none;
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--gold-light);
  font-size: 18px;
  transition: all 0.25s var(--ease);
  flex-shrink: 0;
}
.nav-hamburger:hover {
  background: rgba(201,168,76,0.15);
  border-color: var(--gold);
  transform: scale(1.05);
}

/* Search pill */
.nav-search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.92);
  border-radius: 30px;
  padding: 5px 15px;
  gap: 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  border: 1px solid rgba(201,168,76,0.2);
  transition: box-shadow 0.25s;
}
.nav-search:focus-within {
  box-shadow: 0 2px 10px rgba(0,0,0,0.3), 0 0 0 2px rgba(201,168,76,0.4);
}
.nav-search input {
  border: none; outline: none;
  background: transparent;
  font-family: 'Amiri', serif;
  font-size: 14px;
  color: var(--text-dark);
  width: 130px;
}
.nav-search input::placeholder { color: rgba(70,50,20,0.4); }
.nav-search button {
  background: none; border: none;
  cursor: pointer;
  color: rgba(70,50,20,0.5);
  font-size: 14px;
  transition: color 0.2s;
}
.nav-search button:hover { color: var(--green-main); }

/* Nav links - white, elegant */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
  list-style: none;
}
.nav-links li a {
  color: rgba(255,255,255,0.92);
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  font-size: 14.5px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 24px;
  transition: all 0.25s var(--ease);
  display: block;
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
  letter-spacing: 0.025em;
  position: relative;
}
.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 50%; right: 50%;
  height: 1.5px;
  background: var(--gold);
  transition: all 0.3s var(--ease);
  border-radius: 1px;
}
.nav-links li a:hover::after,
.nav-links li a.active::after { left: 18%; right: 18%; }
.nav-links li a:hover {
  background: rgba(255,255,255,0.10);
  color: var(--gold-light);
}
.nav-links li a.active { color: var(--gold-light); }

.nav-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Sign in — refined green pill */
.btn-signin {
  background: linear-gradient(135deg, var(--green-main), var(--green-deep));
  color: #fff !important;
  border: 1px solid rgba(201,168,76,0.35) !important;
  border-radius: 30px;
  padding: 7px 22px !important;
  font-family: 'Playfair Display', serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  text-decoration: none !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  letter-spacing: 0.02em;
}
.btn-signin:hover {
  background: linear-gradient(135deg, var(--green-light), var(--green-main)) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
}

/* Language button */
.btn-language {
  background: linear-gradient(135deg, var(--green-main), var(--green-deep));
  color: #fff;
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 30px;
  padding: 7px 15px;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  display: flex; align-items: center; gap: 7px;
  position: relative;
  font-family: 'Amiri', serif;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.btn-language:hover {
  background: linear-gradient(135deg, var(--green-light), var(--green-main));
  transform: translateY(-1px);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 10px); right: 0;
  background: linear-gradient(160deg, #1a5030, #0e2e18);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-deep);
  min-width: 130px;
  display: none;
  z-index: 2000;
  border: 1px solid rgba(201,168,76,0.3);
}
.lang-dropdown.open { display: block; animation: dropIn 0.22s var(--ease-spring); }
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.lang-dropdown a {
  display: block; padding: 12px 22px;
  color: var(--cream);
  text-decoration: none;
  font-family: 'Amiri', serif;
  font-size: 16px; font-weight: 600;
  transition: all 0.2s;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.lang-dropdown a:last-child { border-bottom: none; }
.lang-dropdown a:hover {
  background: rgba(201,168,76,0.18);
  color: var(--gold-light);
  padding-left: 28px;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 60px; left: -240px;
  width: 210px;
  z-index: 900;
  background: linear-gradient(160deg, rgba(70,42,16,0.97), rgba(45,25,8,0.97));
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 0 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 6px 0 32px rgba(0,0,0,0.6);
  transition: left 0.34s var(--ease);
  border: 1px solid rgba(201,168,76,0.2);
  border-left: none;
}
.sidebar.open { left: 0; }

/* Gold line top decoration */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  border-radius: 1px;
}
.sidebar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 10%; right: 10%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--gold-dark), transparent);
  border-radius: 1px;
}

.sidebar ul { list-style: none; }
.sidebar ul li a {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 22px;
  color: rgba(245,234,208,0.88);
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  font-size: 15px; font-weight: 600;
  transition: all 0.25s var(--ease);
  letter-spacing: 0.015em;
  border-left: 3px solid transparent;
}
.sidebar ul li a:hover {
  background: rgba(201,168,76,0.12);
  color: var(--gold-light);
  border-left-color: var(--gold);
  padding-left: 28px;
}
.sidebar ul li a.active {
  background: rgba(201,168,76,0.15);
  color: var(--gold-light);
  border-left-color: var(--gold);
}
.sidebar ul li a i { font-size: 15px; opacity: 0.75; }

/* Story submenu inside sidebar */
.story-selector-dropdown {
  background: rgba(0,0,0,0.25);
  margin: 2px 14px 6px;
  border-radius: 8px;
  overflow: hidden;
  display: none;
  border: 1px solid rgba(255,255,255,0.07);
}
.story-selector-dropdown.open,
.story-selector-dropdown[style*="block"] { display: block; }
.story-selector-dropdown a {
  display: block; padding: 10px 16px;
  color: var(--cream-dark);
  text-decoration: none;
  font-family: 'Amiri', serif; font-size: 14px;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.story-selector-dropdown a:last-child { border-bottom: none; }
.story-selector-dropdown a:hover {
  background: rgba(201,168,76,0.15);
  color: var(--gold-light);
}

/* ===== CONTENT WRAPPER ===== */
.content-wrap {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  padding-top: 60px;
}

/* ===== PAGE ANIMATIONS ===== */
.page-fade { animation: pageEnter 0.55s var(--ease) forwards; }
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== GLASS CARD — universal frosted card ===== */
.glass-card {
  background: rgba(245,234,208,0.10);
  border: 1px solid rgba(201,168,76,0.20);
  border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ===== PARCHMENT CARD — warm paper surface ===== */
.parchment-card {
  background: linear-gradient(160deg, #faf4e0 0%, #f2e6c2 40%, #ead8a8 100%);
  border: 1.5px solid rgba(150,100,30,0.35);
  border-radius: var(--radius);
  box-shadow: var(--shadow-deep), var(--shadow-gold);
  position: relative;
  overflow: hidden;
}
/* Subtle vignette inner shadow */
.parchment-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 60px rgba(120,80,20,0.12);
  pointer-events: none; z-index: 1;
}
.parchment-card > * { position: relative; z-index: 2; }

/* Islamic ornamental frame inside parchment */
.ornament-frame {
  position: absolute; inset: 10px;
  border: 1px solid rgba(150,100,30,0.22);
  border-radius: calc(var(--radius) - 4px);
  pointer-events: none;
  z-index: 1;
}
.ornament-frame::before {
  content: '';
  position: absolute; inset: 5px;
  border: 1px solid rgba(150,100,30,0.12);
  border-radius: calc(var(--radius) - 8px);
}

/* ===== SECTION CENTERING ===== */
.section-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 60px);
  padding: 30px 20px;
}

/* ===== PAGE TITLE BLOCK ===== */
.page-title-block {
  text-align: center;
  margin-bottom: 36px;
  position: relative;
}
.page-title-en {
  font-family: 'Cinzel Decorative', cursive;
  font-size: clamp(18px, 3.5vw, 30px);
  color: var(--gold-light);
  text-shadow: 0 2px 16px rgba(0,0,0,0.7), 0 0 40px rgba(201,168,76,0.3);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.page-title-ar {
  font-family: 'Noto Sans Arabic', serif;
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 500;
  color: rgba(240,220,180,0.75);
  direction: rtl;
  margin-top: 6px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
  letter-spacing: 0.01em;
}
.page-title-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
}
.title-ornament {
  flex: 1;
  max-width: 100px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(201,168,76,0.6));
}
.title-ornament.right {
  background: linear-gradient(to left, transparent, rgba(201,168,76,0.6));
}
.title-ornament-diamond {
  width: 8px; height: 8px;
  background: var(--gold);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* ===== GOLD DIVIDER ===== */
.divider-gold {
  display: flex; align-items: center; gap: 12px;
  margin: 22px auto;
  max-width: 280px;
}
.divider-gold::before,
.divider-gold::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, rgba(150,100,30,0.5));
}
.divider-gold::after {
  background: linear-gradient(to left, transparent, rgba(150,100,30,0.5));
}
.divider-gold-diamond {
  width: 10px; height: 10px;
  background: var(--gold-dark);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* ===== HOME — OPEN BOOK ===== */
.book-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 60px);
  padding: 20px;
  gap: 28px;
  position: relative;
}

.callout {
  position: absolute;
  background: linear-gradient(150deg, rgba(55,32,10,0.95), rgba(35,20,6,0.95));
  color: var(--cream);
  border-radius: 14px;
  padding: 14px 20px;
  font-family: 'Amiri', serif;
  font-size: 15px; font-weight: 600;
  line-height: 1.55;
  max-width: 240px;
  text-align: center;
  box-shadow: var(--shadow-deep);
  z-index: 20;
  border: 1px solid rgba(201,168,76,0.25);
}
.callout::after { content: ''; position: absolute; border: 9px solid transparent; }
.callout.bottom-arrow::after { top:100%;left:50%;transform:translateX(-50%);border-top-color:rgba(35,20,6,0.95); }
.callout.top-arrow::after    { bottom:100%;left:50%;transform:translateX(-50%);border-bottom-color:rgba(35,20,6,0.95); }
.callout.left-arrow::after   { top:50%;right:100%;transform:translateY(-50%);border-right-color:rgba(35,20,6,0.95); }

/* Open book */
.open-book {
  position: relative;
  width: min(700px, 90vw);
  aspect-ratio: 1.65/1;
  filter: drop-shadow(0 28px 70px rgba(0,0,0,0.70));
  transition: transform 0.35s var(--ease-spring);
}
.open-book:hover { transform: scale(1.015) translateY(-4px); }

.book-page {
  position: absolute; top: 0; bottom: 0; width: 50%;
}
.book-page.left {
  left: 0;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(145deg, #f8f0d8 0%, #ecd88a 50%, #d8bc68 100%);
  border: 2px solid rgba(140,95,25,0.5);
  border-right: none;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
}
.book-page.right {
  right: 0;
  border-radius: 0 10px 10px 0;
  background: linear-gradient(145deg, #d8bc60 0%, #ecd890 50%, #f8f2dc 100%);
  border: 2px solid rgba(140,95,25,0.5);
  border-left: none;
  display: flex; align-items: center; justify-content: center;
}
/* Subtle inner shadow for page curl feeling */
.book-page.left::after {
  content: '';
  position: absolute; top: 0; right: 0; bottom: 0; width: 20px;
  background: linear-gradient(to right, transparent, rgba(100,70,20,0.12));
  pointer-events: none;
}
.book-page.right::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0; width: 20px;
  background: linear-gradient(to left, transparent, rgba(100,70,20,0.12));
  pointer-events: none; z-index: 1;
}
.book-spine {
  position: absolute; left: 50%; top: 1.5%;
  transform: translateX(-50%);
  width: 6px; height: 97%;
  background: linear-gradient(to bottom, #6a4018, #c09040 30%, #e8c060 50%, #c09040 70%, #6a4018);
  z-index: 5; border-radius: 3px;
  box-shadow: 0 0 12px rgba(0,0,0,0.6);
}
.book-corner {
  position: absolute;
  width: 30px; height: 30px;
  border: 1.5px solid rgba(140,95,25,0.55);
}
.book-corner.tl { top:10px;  left:10px;  border-right:none; border-bottom:none; }
.book-corner.tr { top:10px;  right:10px; border-left:none;  border-bottom:none; }
.book-corner.bl { bottom:10px; left:10px;  border-right:none; border-top:none; }
.book-corner.br { bottom:10px; right:10px; border-left:none;  border-top:none; }

.book-title-ar {
  font-family: 'Noto Sans Arabic', serif;
  font-size: clamp(17px, 3vw, 26px);
  font-weight: 700; color: var(--brown);
  text-align: center; direction: rtl;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(255,255,255,0.5);
}
.book-title-en {
  font-family: 'Cinzel Decorative', cursive;
  font-size: clamp(11px, 1.85vw, 17px);
  color: var(--brown-mid);
  text-align: center;
  letter-spacing: 0.05em;
}
.book-divider {
  width: 55%; height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-dark), transparent);
  margin: 2px auto;
}
.book-logo {
  width: 58%; max-width: 210px;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.4));
  position: relative; z-index: 2;
}

/* Book CTA */
.book-cta { text-align: center; }

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 34px;
  background: linear-gradient(135deg, var(--green-main), var(--green-deep));
  color: #fff;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 40px;
  font-family: 'Playfair Display', serif;
  font-size: 15.5px; font-weight: 600;
  cursor: pointer;
  transition: all 0.28s var(--ease);
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.1);
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--green-light), var(--green-main));
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5), 0 0 20px rgba(201,168,76,0.15);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary + .btn-primary { margin-top: 12px; }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 24px;
  background: rgba(255,255,255,0.08);
  color: var(--gold-light);
  border: 1.5px solid rgba(201,168,76,0.45);
  border-radius: 40px;
  font-family: 'Playfair Display', serif;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  text-decoration: none;
  backdrop-filter: blur(4px);
}
.btn-outline:hover {
  background: rgba(201,168,76,0.18);
  border-color: var(--gold);
  color: var(--gold-bright);
  transform: translateY(-1px);
}

.btn-submit {
  display: block; width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--green-main), var(--green-deep));
  color: #fff;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 40px;
  font-family: 'Playfair Display', serif;
  font-size: 17px; font-weight: 700;
  cursor: pointer;
  transition: all 0.28s var(--ease);
  margin-top: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
  letter-spacing: 0.02em;
}
.btn-submit:hover {
  background: linear-gradient(135deg, var(--green-light), var(--green-main));
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: linear-gradient(160deg, #faf4e0, #f0e4bc);
  border-radius: var(--radius);
  padding: 44px 40px;
  max-width: 480px; width: 100%;
  text-align: center;
  box-shadow: var(--shadow-deep), var(--shadow-gold);
  position: relative;
  transform: translateY(28px) scale(0.97);
  transition: transform 0.38s var(--ease-spring);
  border: 1.5px solid rgba(150,100,30,0.3);
  overflow: hidden;
}
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }
/* Ornamental double border inside modal */
.modal-box::before {
  content: '';
  position: absolute; inset: 8px;
  border: 1px solid rgba(150,100,30,0.18);
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
}
.modal-box h2 {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 18px; color: var(--brown);
  margin-bottom: 8px;
}
.modal-box p {
  font-family: 'Playfair Display', serif;
  font-size: 15px; color: var(--brown-light);
  margin-bottom: 28px; line-height: 1.65;
}

/* ===== PROVERBS — Scroll ===== */
.scroll-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 60px);
  padding: 30px 20px 60px;
}
.parchment-scroll {
  position: relative;
  background: linear-gradient(to bottom, #fdf7e8, #f4e8c4, #ead8a4);
  border-radius: 6px;
  padding: 52px 52px;
  margin: 28px auto 0;
  max-width: 640px; width: 100%;
  box-shadow: 0 18px 60px rgba(0,0,0,0.55), var(--shadow-gold);
  border: 1px solid rgba(150,100,30,0.3);
}
/* Scroll ends */
.parchment-scroll::before,
.parchment-scroll::after {
  content: '';
  position: absolute; left: -14px; right: -14px;
  height: 48px;
  background: linear-gradient(to bottom, #d8a840, #b88828, #d8a840);
  border-radius: 50% / 24px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  z-index: 2;
}
.parchment-scroll::before { top: -22px; }
.parchment-scroll::after  { bottom: -22px; }

/* ===== RIDDLES — Tall Scroll ===== */
.parchment-scroll-v {
  position: relative;
  background: linear-gradient(to bottom, #fdf8ec, #f4ecd0, #eadaaa);
  border-radius: 4px;
  padding: 68px 50px 88px;
  margin: 0 auto;
  max-width: 500px; min-height: 420px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.55), var(--shadow-gold);
}
.scroll-roll-top, .scroll-roll-bottom {
  position: absolute; left: -8%; right: -8%;
  height: 56px;
  background: linear-gradient(to bottom, #c89030, #e8b850, #c89030);
  border-radius: 50% / 28px;
  z-index: 2;
}
.scroll-roll-top    { top: -24px; box-shadow: 0 6px 20px rgba(0,0,0,0.5); }
.scroll-roll-bottom { bottom: -24px; box-shadow: 0 -6px 20px rgba(0,0,0,0.5); }

/* ===== CONTENT ITEMS ===== */
.content-item {
  padding: 16px 0;
  border-bottom: 1px solid rgba(140,95,25,0.2);
  font-family: 'Amiri', serif; font-size: 17px;
  color: var(--brown); line-height: 1.65;
  transition: background 0.2s;
}
.content-item:hover { background: rgba(201,168,76,0.06); border-radius: 6px; padding-left: 8px; }
.content-item:last-child { border-bottom: none; }
.content-item .item-ar {
  font-weight: 700; direction: rtl;
  margin-bottom: 4px; font-size: 18px;
  color: var(--brown);
}
.content-item .item-en {
  font-style: italic;
  color: var(--brown-light); font-size: 15px;
}
.item-num {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--green-main), var(--green-deep));
  color: #fff;
  border-radius: 50%;
  width: 28px; height: 28px;
  font-size: 12px;
  font-family: 'Cinzel Decorative', cursive; font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ===== STORY PAGE ===== */
.story-book-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 60px);
  padding: 26px 20px 60px;
}
.story-book {
  width: min(840px, 96vw);
  background: linear-gradient(140deg, #f8f0d6 0%, #ecd888 50%, #e8d8a4 100%);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.60), var(--shadow-gold);
  overflow: hidden;
  border: 2px solid rgba(140,95,25,0.45);
  display: flex; min-height: 540px;
  position: relative;
}
/* Page numbering marks */
.story-book::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 3px;
  background: linear-gradient(to bottom, rgba(120,80,20,0.3), rgba(180,130,40,0.5), rgba(120,80,20,0.3));
  z-index: 5;
}
.story-half { flex: 1; padding: 32px 28px; position: relative; overflow-y: auto; }
.story-half.left { border-right: 1px solid rgba(140,95,25,0.2); }
.story-half h3 {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 12px; color: var(--brown);
  margin-bottom: 16px; text-align: center;
  letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0.7;
}
.story-half h3.ar {
  font-family: 'Noto Sans Arabic', serif;
  font-size: 15px; direction: rtl; letter-spacing: 0;
}
.story-text {
  font-family: 'Amiri', serif; font-size: 16.5px;
  line-height: 1.9; color: var(--brown);
}
.story-text.ar { direction: rtl; text-align: right; }
.moral-lesson {
  margin-top: 18px; padding: 13px 16px;
  background: rgba(26,92,53,0.1);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--green-main);
  font-family: 'Amiri', serif; font-size: 14.5px;
  color: var(--green-dark); font-style: italic; line-height: 1.65;
}
.moral-lesson.ar { border-left: none; border-right: 3px solid var(--green-main); text-align: right; direction: rtl; }

/* ===== VIDEO / ANIMATED ===== */
.video-container {
  background: var(--green-dark);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-deep);
  max-width: 640px; margin: 0 auto;
  border: 1.5px solid rgba(201,168,76,0.25);
}
.video-placeholder {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(145deg, #061810, #0e3020, #1a5030);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
}
.video-logo { width: 130px; filter: drop-shadow(0 6px 18px rgba(0,0,0,0.6)); }
.video-title-en {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 15px; color: var(--gold);
  letter-spacing: 0.04em;
}
.video-controls {
  background: rgba(4,12,8,0.92);
  padding: 10px 18px;
  display: flex; align-items: center; gap: 12px;
  border-top: 1px solid rgba(201,168,76,0.15);
}
.video-controls button {
  background: none; border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer; font-size: 16px; padding: 4px;
  transition: color 0.2s;
}
.video-controls button:hover { color: var(--gold); }
.progress-bar { flex: 1; height: 4px; background: rgba(255,255,255,0.15); border-radius: 2px; }
.progress-fill { width: 25%; height: 100%; background: #e53935; border-radius: 2px; }

/* ===== SUBMIT FORM ===== */
.submit-section {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 60px);
  padding: 26px 20px 60px;
}
.submit-card {
  background: rgba(250,244,224,0.90);
  border-radius: var(--radius);
  padding: 40px 44px;
  max-width: 720px; width: 100%;
  box-shadow: var(--shadow-deep), var(--shadow-gold);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(150,100,30,0.3);
  position: relative; overflow: hidden;
}
.submit-card::before {
  content: '';
  position: absolute; inset: 8px;
  border: 1px solid rgba(150,100,30,0.15);
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
}
.submit-card .intro-text {
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-size: 17px; color: var(--brown);
  margin-bottom: 28px; line-height: 1.75;
  position: relative;
}
.intro-text .highlight-green { color: var(--green-main); font-weight: 700; }
.intro-text .highlight-proverb { color: #a04800; font-weight: 700; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group.full { grid-column: 1/-1; }
.form-group label {
  font-family: 'Playfair Display', serif;
  font-size: 14.5px; font-weight: 600; color: var(--brown);
  position: relative;
}
.form-group label .optional {
  font-weight: 400; font-style: italic;
  color: var(--brown-light); font-size: 12.5px; margin-left: 4px;
}
.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(255,255,255,0.78);
  border: 1.5px solid rgba(140,95,25,0.22);
  border-radius: 30px;
  padding: 12px 20px;
  color: var(--text-dark);
  font-family: 'Amiri', serif; font-size: 15px;
  outline: none;
  width: 100%;
  transition: all 0.25s var(--ease);
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.06);
}
.form-group textarea {
  border-radius: var(--radius-sm);
  resize: vertical; min-height: 110px;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(80,50,15,0.38); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  background: rgba(255,255,255,0.95);
  border-color: var(--green-main);
  box-shadow: 0 0 0 3px rgba(26,92,53,0.13), inset 0 1px 4px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 7L11 1' stroke='%231a6640' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 42px;
  cursor: pointer;
}
.form-group select option { background: #fff; color: var(--text-dark); }

.consent-group {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 20px 0;
  font-family: 'Playfair Display', serif;
  font-size: 14px; color: var(--brown); line-height: 1.55;
}
.consent-group input[type="checkbox"] {
  width: 18px; height: 18px;
  flex-shrink: 0; margin-top: 2px;
  accent-color: var(--green-main);
}

/* ===== ABOUT PAGE ===== */
.about-card {
  background: rgba(250,244,224,0.93);
  border-radius: var(--radius); padding: 52px;
  max-width: 720px; margin: 0 auto;
  box-shadow: var(--shadow-deep), var(--shadow-gold);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(150,100,30,0.3);
  position: relative; overflow: hidden;
}
.about-card::before {
  content: '';
  position: absolute; inset: 8px;
  border: 1px solid rgba(150,100,30,0.15);
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
}
.about-card h1 {
  font-family: 'Cinzel Decorative', cursive;
  font-size: clamp(18px,3vw,26px); color: var(--brown);
  text-align: center; margin-bottom: 6px;
  letter-spacing: 0.03em;
}
.about-card h1.ar {
  font-family: 'Noto Sans Arabic', serif;
  font-size: clamp(18px,3vw,24px); direction: rtl;
}
.about-card p {
  font-family: 'Amiri', serif; font-size: 17px;
  line-height: 1.9; color: var(--brown); margin-bottom: 14px;
}
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px,1fr));
  gap: 16px; margin-top: 6px;
}
.feature-item {
  background: rgba(26,92,53,0.08);
  border: 1px solid rgba(26,92,53,0.15);
  border-radius: 12px; padding: 18px;
  text-align: center;
  transition: all 0.25s var(--ease);
}
.feature-item:hover {
  background: rgba(26,92,53,0.14);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.feature-icon { font-size: 28px; margin-bottom: 8px; }
.feature-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700; color: var(--brown); font-size: 15px;
}
.feature-desc {
  font-family: 'Amiri', serif;
  font-size: 13px; color: var(--brown-light);
}

/* ===== CONTACT PAGE ===== */
.contact-card {
  background: rgba(250,244,224,0.93);
  border-radius: var(--radius); padding: 36px;
  box-shadow: var(--shadow-deep), var(--shadow-gold);
  border: 1.5px solid rgba(150,100,30,0.3);
  position: relative; overflow: hidden;
}
.contact-card::before {
  content: ''; position: absolute; inset: 8px;
  border: 1px solid rgba(150,100,30,0.15);
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
}
.contact-card h2 {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 20px; color: var(--brown); margin-bottom: 8px;
}
.contact-info-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(140,95,25,0.18);
  font-family: 'Amiri', serif; font-size: 16px; color: var(--brown);
  text-align: left;
  transition: padding-left 0.2s;
}
.contact-info-item:hover { padding-left: 6px; }
.contact-info-item .icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--green-main), var(--green-deep));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

/* ===== FOLKTALES GRID ===== */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px; max-width: 840px; margin: 0 auto;
}
.story-card {
  background: rgba(250,244,224,0.88);
  border-radius: var(--radius); padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.30s var(--ease-spring);
  border: 1.5px solid rgba(201,168,76,0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative; overflow: hidden;
}
.story-card::before {
  content: ''; position: absolute; inset: 8px;
  border: 1px solid rgba(150,100,30,0.12);
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
  transition: opacity 0.3s;
  opacity: 0;
}
.story-card:hover {
  transform: translateY(-7px) scale(1.02);
  box-shadow: 0 24px 60px rgba(0,0,0,0.60), var(--shadow-gold);
  border-color: var(--gold);
}
.story-card:hover::before { opacity: 1; }
.story-num {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 11px; color: var(--gold-dark);
  margin-bottom: 8px; letter-spacing: 0.08em; text-transform: uppercase;
}
.story-card h3 {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 15.5px; color: var(--brown); margin-bottom: 6px;
}
.story-card .story-ar {
  font-family: 'Noto Sans Arabic', serif;
  font-size: 15px; color: var(--brown-light);
  direction: rtl; margin-bottom: 16px;
}
.btn-read {
  background: linear-gradient(135deg, var(--green-main), var(--green-deep));
  color: #fff; border: none;
  border-radius: 22px; padding: 9px 26px;
  font-family: 'Playfair Display', serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.25s var(--ease);
  box-shadow: 0 3px 12px rgba(0,0,0,0.3);
}
.btn-read:hover {
  background: linear-gradient(135deg, var(--green-light), var(--green-main));
  transform: translateY(-1px);
}

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: linear-gradient(135deg, var(--green-main), var(--green-deep));
  color: #fff;
  padding: 14px 30px;
  border-radius: 40px;
  font-family: 'Amiri', serif; font-size: 16px;
  box-shadow: var(--shadow-deep);
  z-index: 9999;
  transition: transform 0.42s var(--ease-spring);
  border: 1px solid rgba(201,168,76,0.3);
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== GOLD SHIMMER ANIMATION ===== */
@keyframes goldShimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.shimmer-gold {
  background: linear-gradient(90deg, var(--gold-dark) 0%, var(--gold-bright) 40%, var(--gold) 50%, var(--gold-bright) 60%, var(--gold-dark) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: goldShimmer 3.5s linear infinite;
}

/* ===== ORNAMENT ===== */
.ornament { color: var(--gold); font-size: 18px; margin: 0 8px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.15); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--gold-dark), var(--gold));
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-light); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .story-book { flex-direction: column; }
  .story-book::before { display: none; }
  .story-half.left { border-right: none; border-bottom: 1px solid rgba(140,95,25,0.2); }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .submit-card { padding: 24px 20px; }
  .about-card  { padding: 28px 22px; }
  .parchment-scroll { padding: 38px 28px; }
  .contact-card { padding: 24px 20px; }
}
@media (max-width: 480px) {
  .navbar { padding: 9px 12px; gap: 8px; }
  .nav-search input { width: 80px; }
  .open-book { width: 98vw; }
  .book-title-ar { font-size: 15px; }
  .book-title-en { font-size: 10px; }
}

/* ===== AD BANNER ===== */
.ad-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1100;
  background: linear-gradient(90deg, var(--green-deep), var(--green-main), var(--green-deep));
  border-top: 1px solid rgba(201,168,76,0.35);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
}
.ad-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 11px 20px;
  flex-wrap: wrap;
  font-family: 'Amiri', serif;
  font-size: 15px;
  color: rgba(255,255,255,0.92);
}
.ad-banner-cta {
  background: var(--gold);
  color: var(--brown) !important;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 18px;
  border-radius: 20px;
  text-decoration: none;
  transition: all .22s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.ad-banner-cta:hover { background: var(--gold-bright); transform: translateY(-1px); }
.ad-banner-close {
  background: none; border: none;
  color: rgba(255,255,255,0.5);
  font-size: 15px; cursor: pointer;
  padding: 2px 6px;
  transition: color .2s;
  margin-left: 4px;
}
.ad-banner-close:hover { color: #fff; }

/* Body padding when ad banner shows */
body.is-free .content-wrap { padding-bottom: 56px; }

/* ===== PREMIUM BADGE ===== */
.badge-premium {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #b8860b, #ffd700, #b8860b);
  color: #2a1a00;
  font-family: 'Cinzel Decorative', cursive;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: .04em;
  box-shadow: 0 2px 10px rgba(201,168,76,0.4);
  white-space: nowrap;
}
.badge-premium.badge-sm { font-size: 10px; padding: 3px 10px; }

/* ===== UPGRADE BUTTON ===== */
.btn-upgrade {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #8a6820, #c9a84c, #8a6820);
  color: #fff !important;
  border: none;
  border-radius: 20px;
  padding: 6px 16px;
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all .25s var(--ease);
  box-shadow: 0 2px 10px rgba(201,168,76,0.35);
  white-space: nowrap;
}
.btn-upgrade:hover {
  background: linear-gradient(135deg, #c9a84c, #f5d87e, #c9a84c);
  color: #2a1a00 !important;
  transform: translateY(-1px);
}

/* ===== USER MENU ===== */
.nav-user-menu { position: relative; }
.btn-user {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 30px;
  padding: 5px 12px 5px 5px;
  cursor: pointer;
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  transition: all .22s;
}
.btn-user:hover { background: rgba(255,255,255,0.2); }
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(201,168,76,0.4);
}
.user-initial {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-main), var(--green-deep));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  border: 1px solid rgba(201,168,76,0.4);
  color: var(--gold-light);
  flex-shrink: 0;
}
.user-name-nav {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255,255,255,0.9);
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: linear-gradient(160deg, #faf4e0, #f0e4bc);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-deep);
  border: 1.5px solid rgba(150,100,30,0.3);
  display: none;
  z-index: 2100;
  animation: dropIn .22s var(--ease-spring);
}
.user-dropdown.open { display: block; }
.user-dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(140,95,25,0.2);
  font-family: 'Amiri', serif;
  font-size: 14px;
  color: var(--brown);
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-family: 'Amiri', serif;
  font-size: 15px;
  color: var(--brown);
  text-decoration: none;
  transition: all .2s;
  border-bottom: 1px solid rgba(140,95,25,0.1);
}
.user-dropdown-item:last-child { border-bottom: none; }
.user-dropdown-item:hover { background: rgba(26,92,53,0.08); padding-left: 22px; }
.user-dropdown-item.upgrade-item { color: var(--gold-dark); font-weight: 700; }
.user-dropdown-item.upgrade-item:hover { background: rgba(201,168,76,0.1); }

/* ===== SIDEBAR USER INFO ===== */
.sidebar-user {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(201,168,76,0.15);
  margin-bottom: 8px;
}
.sidebar-user-name {
  font-family: 'Playfair Display', serif;
  font-size: 14px; font-weight: 600;
  color: rgba(245,234,208,0.9);
  margin-bottom: 4px;
}
.sidebar-premium-link {
  color: var(--gold-light) !important;
  border-left-color: var(--gold) !important;
}
.sidebar-premium-link:hover { background: rgba(201,168,76,0.14) !important; }

/* ===== INLINE AD (inside content) ===== */
.ad-inline {
  background: rgba(8,20,12,0.45);
  border: 1px dashed rgba(201,168,76,0.25);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  text-align: center;
  font-family: 'Amiri', serif;
  font-size: 13px;
  color: rgba(245,234,208,0.5);
  margin: 18px 0;
  backdrop-filter: blur(6px);
}
.ad-inline .ad-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,0.25);
  margin-bottom: 4px;
}
.is-premium .ad-inline,
.is-premium .ad-banner { display: none !important; }

/* ===== LANGUAGE TOGGLE ON STORY PAGE ===== */
.lang-tabs {
  display: flex;
  background: rgba(0,0,0,0.25);
  border-radius: 30px;
  padding: 3px;
  gap: 2px;
  border: 1px solid rgba(201,168,76,0.2);
}
.lang-tab {
  padding: 7px 20px;
  border-radius: 26px;
  font-family: 'Playfair Display', serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s var(--ease);
  color: rgba(255,255,255,0.6);
  border: none;
  background: transparent;
}
.lang-tab.active {
  background: linear-gradient(135deg, var(--green-main), var(--green-deep));
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.lang-tab:hover:not(.active) { color: rgba(255,255,255,0.9); }

/* ===== STORY IMAGES GALLERY ===== */
.story-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.story-img-item {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid rgba(150,100,30,0.3);
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  transition: transform .25s var(--ease);
}
.story-img-item:hover { transform: scale(1.04); }
.story-img-item img { width: 100%; height: 100%; object-fit: cover; }
.story-img-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(26,92,53,0.3), rgba(8,28,16,0.5));
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}

/* ===== PREMIUM PAGE ===== */
.premium-hero {
  text-align: center;
  padding: 10px 0 30px;
}
.premium-crown {
  font-size: 64px;
  margin-bottom: 10px;
  animation: crownFloat 3s ease-in-out infinite;
  display: block;
}
@keyframes crownFloat {
  0%,100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-10px) rotate(3deg); }
}
.premium-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin: 28px 0;
}
.premium-card {
  background: rgba(250,244,224,0.90);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  border: 1.5px solid rgba(150,100,30,0.25);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  transition: all .28s var(--ease-spring);
  position: relative;
  overflow: hidden;
}
.premium-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-deep), var(--shadow-gold); }
.premium-card.featured {
  border-color: var(--gold);
  background: linear-gradient(160deg, #faf4e0, #f4e8c0);
  box-shadow: var(--shadow-deep), var(--shadow-gold);
}
.premium-card.featured::before {
  content: '⭐ Popular';
  position: absolute; top: 14px; right: -28px;
  background: var(--gold);
  color: var(--brown);
  font-size: 11px; font-weight: 700;
  padding: 4px 40px;
  transform: rotate(45deg);
  font-family: 'Cinzel Decorative', cursive;
  letter-spacing: .04em;
}
.premium-price {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 32px;
  color: var(--brown);
  margin: 12px 0 4px;
}
.premium-price sup { font-size: 16px; vertical-align: super; }
.premium-price span { font-size: 16px; }
.premium-plan-name {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 14px;
  color: var(--gold-dark);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.premium-features {
  list-style: none;
  text-align: left;
  margin-bottom: 22px;
}
.premium-features li {
  font-family: 'Amiri', serif;
  font-size: 15px;
  color: var(--brown);
  padding: 5px 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.premium-features li i { color: var(--green-main); font-size: 12px; flex-shrink: 0; }

/* ===== SEARCH RESULTS ===== */
.search-result-item {
  background: rgba(250,244,224,0.88);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin-bottom: 14px;
  border: 1px solid rgba(150,100,30,0.2);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
  transition: all .25s var(--ease);
}
.search-result-item:hover {
  transform: translateX(4px);
  border-color: var(--gold);
  box-shadow: var(--shadow);
}
.search-result-type {
  display: inline-block;
  font-size: 11px;
  font-family: 'Cinzel Decorative', cursive;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}
.type-story   { background: rgba(26,92,53,0.15);  color: var(--green-main); }
.type-proverb { background: rgba(201,168,76,0.15); color: var(--gold-dark); }
.type-riddle  { background: rgba(120,80,20,0.12);  color: var(--brown-mid); }
.search-result-title {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 15px; color: var(--brown);
  margin-bottom: 5px;
}
.search-result-excerpt {
  font-family: 'Amiri', serif;
  font-size: 15px; color: var(--brown-light);
  line-height: 1.6;
}
.search-highlight { background: rgba(201,168,76,0.3); border-radius: 3px; padding: 0 2px; font-weight: 700; color: var(--brown); }

/* ===== GLOBAL INPUT READABILITY OVERRIDES ===== */
/* Ensures ALL inputs on parchment/card backgrounds are always readable */
.parchment-card .form-group input,
.parchment-card .form-group select,
.parchment-card .form-group textarea,
.submit-card .form-group input,
.submit-card .form-group select,
.submit-card .form-group textarea,
.about-card .form-group input,
.about-card .form-group textarea {
  background: rgba(255,255,255,0.80) !important;
  color: var(--text-dark) !important;
  border-color: rgba(140,95,25,0.22) !important;
}
.parchment-card .form-group input::placeholder,
.parchment-card .form-group textarea::placeholder,
.submit-card .form-group input::placeholder,
.submit-card .form-group textarea::placeholder {
  color: rgba(80,50,15,0.38) !important;
}
.parchment-card .form-group input:focus,
.parchment-card .form-group textarea:focus,
.submit-card .form-group input:focus,
.submit-card .form-group textarea:focus {
  background: rgba(255,255,255,0.96) !important;
  border-color: var(--green-main) !important;
  box-shadow: 0 0 0 3px rgba(26,92,53,0.13) !important;
}

/* Select on parchment - show dark arrow on light bg */
.submit-card .form-group select,
.parchment-card .form-group select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 7L11 1' stroke='%231a6640' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 18px center !important;
  background-color: rgba(255,255,255,0.80) !important;
}
[dir="rtl"] .submit-card .form-group select,
[dir="rtl"] .parchment-card .form-group select {
  background-position: left 18px center !important;
  padding-right: 18px !important;
  padding-left: 42px !important;
}
.submit-card .form-group select option,
.parchment-card .form-group select option {
  background: #fff !important;
  color: var(--text-dark) !important;
}

/* ===== RTL FIXES ===== */
[dir="rtl"] .navbar { flex-direction: row-reverse; }
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] .nav-right { flex-direction: row-reverse; }
[dir="rtl"] .sidebar { left: auto; right: -240px; border-radius: var(--radius) 0 0 var(--radius); border-right: none; border-left: 1px solid rgba(201,168,76,0.2); }
[dir="rtl"] .sidebar.open { right: 0; }
[dir="rtl"] .sidebar ul li a { border-left: none; border-right: 3px solid transparent; }
[dir="rtl"] .sidebar ul li a:hover,
[dir="rtl"] .sidebar ul li a.active { border-right-color: var(--gold); padding-right: 28px; padding-left: 22px; }
[dir="rtl"] .sidebar::before,
[dir="rtl"] .sidebar::after { left: 10%; right: 10%; }
[dir="rtl"] .story-selector-dropdown { margin: 2px 14px 6px; }
[dir="rtl"] #sidebarOverlay { left: auto; }
[dir="rtl"] .search-result-item:hover { transform: translateX(-4px); }
[dir="rtl"] .contact-info-item:hover { padding-right: 6px; padding-left: 0; }
[dir="rtl"] .moral-lesson { border-left: none; border-right: 3px solid var(--green-main); }
[dir="rtl"] .form-group label .optional { margin-left: 0; margin-right: 4px; }
[dir="rtl"] .page-title-ar { text-align: center; }
[dir="rtl"] .book-title-ar { direction: rtl; }

/* ===== NAVBAR — ensure always visible on live host ===== */
.navbar {
  min-height: 58px;
}
/* Ensure nav stays above ad banner */
.navbar { z-index: 1050; }
.ad-banner { z-index: 1040; }

/* When ad banner is showing, push content down */
body.is-free .content-wrap {
  padding-bottom: 60px;
}

/* ===== SUBMIT PAGE — consent checkbox area on parchment ===== */
.submit-card .consent-group {
  background: rgba(26,92,53,0.06);
  border: 1px solid rgba(26,92,53,0.14);
  border-radius: 10px;
  padding: 14px 16px;
}
.submit-card .consent-group label {
  color: var(--brown) !important;
  font-size: 14px;
}

/* ===== STORY BOOK — fix on live ===== */
.story-book {
  min-height: 480px;
}
.story-half {
  max-height: 75vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(140,95,25,0.3) transparent;
}
.story-half::-webkit-scrollbar { width: 4px; }
.story-half::-webkit-scrollbar-thumb { background: rgba(140,95,25,0.3); border-radius: 2px; }

/* ===== PROVERBS / RIDDLES scroll — prevent overflow on mobile ===== */
.parchment-scroll,
.parchment-scroll-v {
  overflow: visible;
  margin-bottom: 32px;
}

/* ===== QUICK TILES — ensure grid on all sizes ===== */
@media (max-width: 480px) {
  .quick-tile { min-width: 72px; padding: 12px 14px; font-size: 12px; }
  .quick-tile-icon { font-size: 18px; }
  .form-grid { grid-template-columns: 1fr !important; }
  .form-group.full { grid-column: 1 !important; }
  .premium-cards { grid-template-columns: 1fr !important; }
  .contact-layout { grid-template-columns: 1fr !important; }
  .story-book { flex-direction: column; }
  .story-book::before { display: none; }
  .story-half.left { border-right: none; border-bottom: 1px solid rgba(140,95,25,0.2); max-height: none; }
  .story-half { max-height: none; }
}

@media (max-width: 640px) {
  .contact-layout { grid-template-columns: 1fr !important; }
  .nav-search input { width: 80px; }
  .user-name-nav { display: none; }
  .page-title-en { font-size: clamp(14px, 4vw, 22px) !important; }
}

/* ===== FOLKTALES — story cards on dark background ===== */
.story-card {
  /* already has backdrop-filter but enforce bg */
  background: rgba(250,244,224,0.90) !important;
}
.story-card:hover {
  background: rgba(252,246,228,0.97) !important;
}

/* ===== ANIMATED PAGE — sidebar layout on narrow screens ===== */
@media (max-width: 700px) {
  .animated-layout { flex-direction: column !important; }
  .animated-sidebar { width: 100% !important; }
}

/* ===== PAGE TITLE — gold text visibility on all backgrounds ===== */
.page-title-en {
  text-shadow:
    0 2px 20px rgba(0,0,0,0.8),
    0 0 50px rgba(201,168,76,0.25);
}
.page-title-ar {
  text-shadow: 0 1px 10px rgba(0,0,0,0.6);
}

/* ===== PREMIUM PAGE crown float improvement ===== */
.premium-crown {
  filter: drop-shadow(0 4px 16px rgba(201,168,76,0.5));
}

/* ===== FOOTER links hover ===== */
footer a:hover { color: rgba(201,168,76,0.9) !important; }

/* ===== SEARCH — result items on dark bg ===== */
.search-result-item {
  display: block;
  text-decoration: none;
}
.search-result-item:hover .search-result-title {
  color: var(--green-dark);
}

/* ===== AD BANNER — better mobile ===== */
@media (max-width: 540px) {
  .ad-banner-inner { padding: 9px 14px; gap: 8px; font-size: 13px; }
  .ad-banner-cta { font-size: 12px; padding: 5px 12px; }
}

/* ===== LANG TABS — story page ===== */
.lang-tabs {
  flex-shrink: 0;
}
@media (max-width: 540px) {
  .lang-tab { padding: 6px 12px; font-size: 12px; }
}

/* ===== BOOK CONTAINER — ensure centered vertically ===== */
.book-container {
  min-height: calc(100vh - 58px);
}

/* ===== NAV SEARCH — visible on all backgrounds ===== */
.nav-search {
  min-width: 0;
}
