/* ===== HADJITEK MADJITEK — REDESIGNED CSS ===== */
/* Matches platform_design.pdf exactly */

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

/* ===== CSS VARIABLES ===== */
:root {
  --green-dark:   #0e3d22;
  --green-main:   #1a6640;
  --green-light:  #2a8a55;
  --gold:         #c9a84c;
  --gold-light:   #e8c97a;
  --gold-dark:    #9a7a2a;
  --cream:        #f5ead0;
  --cream-dark:   #e8d5a8;
  --brown:        #5c3d1e;
  --brown-light:  #8b6340;
  --brown-sidebar: rgba(78,52,24,0.93);
  --text-dark:    #2a1a0a;
  --text-light:   #f5ead0;
  --white:        #ffffff;
  --shadow:       0 8px 32px rgba(0,0,0,0.45);
  --shadow-deep:  0 16px 60px rgba(0,0,0,0.6);
  --radius:       16px;
  --radius-sm:    10px;
  --transition:   all 0.3s ease;

  /* Navbar frosted */
  --nav-bg:       rgba(255,255,255,0.15);
  --nav-blur:     blur(14px);
  --nav-border:   rgba(255,255,255,0.25);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Amiri', 'Noto Sans Arabic', serif;
  background: #3d2a10;
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== FULL-PAGE BACKGROUND (painted Algerian village) ===== */
/* 
  The design relies on a bg.jpg (the Algerian village painting from the mockup).
  This CSS sets it up perfectly. Upload your background image as /bg.jpg in the root.
  The gradient overlay below matches the warm golden tone of the design exactly.
*/
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(
      180deg,
      rgba(20, 14, 4, 0.28) 0%,
      rgba(180, 130, 50, 0.08) 40%,
      rgba(20, 14, 4, 0.20) 100%
    ),
    url('../bg.jpg') center/cover no-repeat;
}

/* CSS-only fallback — warm golden village palette when bg.jpg is missing */
.page-bg-fallback {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% 50%,  #d4a84a 0%, #a07030 18%, #4a2a08 45%, #1a3d20 70%, #0d2010 100%);
}
.page-bg-fallback::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 60%, rgba(200,160,60,0.35) 0%, transparent 55%),
    radial-gradient(ellipse 40% 60% at 80% 35%, rgba(180,140,55,0.30) 0%, transparent 50%),
    radial-gradient(ellipse 100% 25% at 50% 100%, rgba(8,20,10,0.85) 0%, transparent 55%);
}
.page-bg-fallback::after {
  content: '';
  position: absolute;
  inset: 0;
  /* Subtle noise-like texture */
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 8px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,0.02) 0px, rgba(0,0,0,0.02) 1px, transparent 1px, transparent 8px);
}

/* ===== NAVBAR ===== */
/* Design: fully transparent frosted glass, WHITE text, pill search bar */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 24px;
  background: var(--nav-bg);
  backdrop-filter: var(--nav-blur);
  -webkit-backdrop-filter: var(--nav-blur);
  border-bottom: 1px solid var(--nav-border);
}

/* Hamburger — white, no visible border */
.nav-hamburger {
  background: none;
  border: none;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--white);
  font-size: 20px;
  transition: var(--transition);
  flex-shrink: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.nav-hamburger:hover { opacity: 0.75; }

/* Search pill — white background, dark text */
.nav-search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.90);
  border-radius: 30px;
  padding: 6px 16px;
  gap: 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.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(60,40,10,0.5); }
.nav-search button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  font-size: 15px;
  padding: 0;
  opacity: 0.7;
}
.nav-search button:hover { opacity: 1; }

/* Nav links — centered, WHITE text (matches design mockup) */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
  list-style: none;
}
.nav-links li a {
  color: var(--white);
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 24px;
  transition: var(--transition);
  display: block;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  letter-spacing: 0.02em;
}
.nav-links li a:hover {
  background: rgba(255,255,255,0.2);
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.nav-links li a.active {
  background: rgba(255,255,255,0.18);
}

/* Right side nav buttons */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Sign in — dark green pill */
.btn-signin {
  background: var(--green-main);
  color: #fff !important;
  border: none;
  border-radius: 30px;
  padding: 8px 22px !important;
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.btn-signin:hover { background: var(--green-light) !important; }

/* Language button — dark green pill */
.btn-language {
  background: var(--green-main);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  font-family: 'Amiri', serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.btn-language:hover { background: var(--green-light); }

/* Language dropdown */
.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--green-main);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 120px;
  display: none;
  z-index: 2000;
}
.lang-dropdown.open { display: block; }
.lang-dropdown a {
  display: block;
  padding: 12px 20px;
  color: #fff;
  text-decoration: none;
  font-family: 'Amiri', serif;
  font-size: 16px;
  font-weight: 600;
  transition: var(--transition);
  text-align: center;
}
.lang-dropdown a:hover { background: var(--green-light); }

/* ===== SIDEBAR ===== */
/* Design: warm brown rounded box, white text, visible icons */
.sidebar {
  position: fixed;
  top: 62px;
  left: -230px;
  width: 200px;
  z-index: 900;
  background: var(--brown-sidebar);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  transition: left 0.32s cubic-bezier(.4,0,.2,1);
}
.sidebar.open { left: 0; }

.sidebar ul { list-style: none; }
.sidebar ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  color: var(--white);
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  transition: var(--transition);
  letter-spacing: 0.01em;
}
.sidebar ul li a:hover,
.sidebar ul li a.active {
  background: rgba(255,255,255,0.12);
  padding-left: 28px;
}
.sidebar ul li a i { opacity: 0.75; font-size: 15px; }

/* Story submenu inside sidebar */
.story-selector-dropdown {
  background: rgba(0,0,0,0.25);
  margin: 0 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: none;
}
.story-selector-dropdown.open,
.story-selector-dropdown[style*="block"] { display: block; }
.story-selector-dropdown a {
  display: block;
  padding: 10px 18px;
  color: var(--cream);
  text-decoration: none;
  font-family: 'Amiri', serif;
  font-size: 15px;
  transition: var(--transition);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.story-selector-dropdown a:last-child { border-bottom: none; }
.story-selector-dropdown a:hover { background: rgba(255,255,255,0.12); color: var(--gold-light); }

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

/* ===== PAGE ENTRANCE ANIMATION ===== */
.page-fade {
  animation: pageEnter 0.5s ease forwards;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* Callout / annotation bubbles (as in design) */
.callout {
  position: absolute;
  background: rgba(60,35,12,0.88);
  color: var(--white);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-family: 'Amiri', serif;
  font-size: 15px;
  line-height: 1.6;
  max-width: 240px;
  text-align: center;
  box-shadow: var(--shadow);
  z-index: 20;
  font-weight: 600;
}
.callout::after {
  content: '';
  position: absolute;
  border: 9px solid transparent;
}
.callout.bottom-arrow::after {
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border-top-color: rgba(60,35,12,0.88);
}
.callout.top-arrow::after {
  bottom: 100%; left: 50%;
  transform: translateX(-50%);
  border-bottom-color: rgba(60,35,12,0.88);
}
.callout.left-arrow::after {
  top: 50%; right: 100%;
  transform: translateY(-50%);
  border-right-color: rgba(60,35,12,0.88);
}

/* Open book widget */
.open-book {
  position: relative;
  width: min(680px, 88vw);
  aspect-ratio: 1.65/1;
  filter: drop-shadow(0 24px 60px rgba(0,0,0,0.65));
  transition: transform 0.3s ease;
}
.open-book:hover { transform: scale(1.01); }

.book-page {
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
}
.book-page.left {
  left: 0;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(135deg, #f0dea8 0%, #e4cc88 45%, #d8b860 100%);
  border: 2px solid rgba(140,95,25,0.45);
  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(135deg, #dfc870 0%, #edd888 45%, #f0e0a0 100%);
  border: 2px solid rgba(140,95,25,0.45);
  border-left: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.book-spine {
  position: absolute;
  left: 50%; top: 2%;
  transform: translateX(-50%);
  width: 5px;
  height: 96%;
  background: linear-gradient(to bottom, #7a5020, #c09040, #7a5020);
  z-index: 5;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.book-corner {
  position: absolute;
  width: 28px; height: 28px;
  border: 2px solid rgba(140,95,25,0.55);
}
.book-corner.tl { top: 8px;    left: 8px;   border-right: none; border-bottom: none; }
.book-corner.tr { top: 8px;    right: 8px;  border-left: none;  border-bottom: none; }
.book-corner.bl { bottom: 8px; left: 8px;   border-right: none; border-top: none; }
.book-corner.br { bottom: 8px; right: 8px;  border-left: none;  border-top: none; }

.book-title-ar {
  font-family: 'Noto Sans Arabic', serif;
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 700;
  color: var(--brown);
  text-align: center;
  direction: rtl;
  letter-spacing: 0.01em;
}
.book-title-en {
  font-family: 'Cinzel Decorative', cursive;
  font-size: clamp(11px, 1.9vw, 17px);
  color: var(--brown-light);
  text-align: center;
  letter-spacing: 0.04em;
}
.book-divider {
  width: 55%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-dark), transparent);
  margin: 2px auto;
}
.book-logo {
  width: 60%;
  max-width: 210px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.35));
}

/* ===== CTA BUTTON BELOW BOOK ===== */
.book-cta {
  text-align: center;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 34px;
  background: var(--green-main);
  color: #fff;
  border: none;
  border-radius: 40px;
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}
.btn-primary:hover {
  background: var(--green-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
}
.btn-primary + .btn-primary { margin-top: 12px; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  background: transparent;
  color: var(--green-main);
  border: 2px solid var(--green-main);
  border-radius: 40px;
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-outline:hover { background: var(--green-main); color: #fff; }

/* ===== MODAL (Sign-in) ===== */
/* Design: parchment-toned translucent card, centered on background */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: rgba(245,234,208,0.96);
  border-radius: var(--radius);
  padding: 44px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-deep);
  position: relative;
  transform: translateY(24px);
  transition: transform 0.35s ease;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.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.6;
}

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

/* ===== PROVERBS — Scroll design (page 6 of mockup) ===== */
/* A decorative parchment scroll with curved ornamental top/bottom */
.scroll-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 62px);
  padding: 30px 20px;
}
.parchment-scroll {
  position: relative;
  background: linear-gradient(to bottom, #faf3e0, #f0e4c0, #e8d8a8);
  border-radius: 8px;
  padding: 48px 52px;
  margin: 24px auto 0;
  max-width: 620px;
  width: 100%;
  box-shadow: 0 14px 50px rgba(0,0,0,0.5);
  border: 1px solid rgba(160,110,40,0.35);
}
.parchment-scroll::before,
.parchment-scroll::after {
  content: '';
  position: absolute;
  left: -12px; right: -12px;
  height: 44px;
  background: linear-gradient(to bottom, #d8aa48, #b88828, #d8aa48);
  border-radius: 50% / 22px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  z-index: 2;
}
.parchment-scroll::before { top: -20px; }
.parchment-scroll::after  { bottom: -20px; }

/* ===== RIDDLES — Tall parchment scroll (page 7 of mockup) ===== */
.parchment-scroll-v {
  position: relative;
  background: linear-gradient(to bottom, #faf4e4 0%, #f2e8cc 50%, #e8d8aa 100%);
  border-radius: 4px;
  padding: 64px 50px 80px;
  margin: 0 auto;
  max-width: 480px;
  min-height: 400px;
  box-shadow: 0 14px 50px rgba(0,0,0,0.5);
}
.scroll-roll-top, .scroll-roll-bottom {
  position: absolute;
  left: -6%; right: -6%;
  height: 52px;
  background: linear-gradient(to bottom, #c8902a, #e8b850, #c8902a);
  border-radius: 50% / 26px;
  z-index: 2;
}
.scroll-roll-top    { top: -22px; box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
.scroll-roll-bottom { bottom: -22px; box-shadow: 0 -4px 16px rgba(0,0,0,0.4); }

/* ===== CONTENT ITEMS (Proverbs/Riddles list) ===== */
.content-item {
  padding: 15px 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;
}
.content-item:last-child { border-bottom: none; }
.content-item .item-ar {
  font-weight: 700;
  direction: rtl;
  margin-bottom: 4px;
  font-size: 18px;
}
.content-item .item-en {
  font-style: italic;
  color: var(--brown-light);
  font-size: 15px;
}
.content-item .item-num {
  display: inline-block;
  background: var(--green-main);
  color: #fff;
  border-radius: 50%;
  width: 26px; height: 26px;
  line-height: 26px;
  text-align: center;
  font-size: 13px;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  margin-right: 10px;
  flex-shrink: 0;
}

/* ===== STORY PAGE — Open book layout (page 5 of mockup) ===== */
.story-book-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 62px);
  padding: 28px 20px 60px;
}
.story-book {
  width: min(800px, 94vw);
  background: linear-gradient(135deg, #f4e6be, #e8d090);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
  overflow: hidden;
  border: 2px solid rgba(140,95,25,0.4);
  display: flex;
  min-height: 520px;
}
.story-half { flex: 1; padding: 34px 30px; position: relative; }
.story-half.left { border-right: 2px solid rgba(140,95,25,0.28); }
.story-half h3 {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 13px;
  color: var(--brown);
  margin-bottom: 14px;
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.story-half h3.ar {
  font-family: 'Noto Sans Arabic', serif;
  font-size: 16px;
  direction: rtl;
  letter-spacing: 0;
}
.story-text {
  font-family: 'Amiri', serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--brown);
}
.story-text.ar { direction: rtl; text-align: right; }
.moral-lesson {
  margin-top: 18px;
  padding: 12px 16px;
  background: rgba(26,92,53,0.12);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--green-main);
  font-family: 'Amiri', serif;
  font-size: 14px;
  color: var(--green-dark);
  font-style: italic;
  line-height: 1.6;
}

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

/* ===== SUBMIT FORM (page 9 of mockup) ===== */
/* Design: transparent/translucent over the background, no heavy card */
.submit-section {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 62px);
  padding: 28px 20px 60px;
}
.submit-card {
  background: rgba(245,234,208,0.88);
  border-radius: var(--radius);
  padding: 36px 42px;
  max-width: 700px;
  width: 100%;
  box-shadow: var(--shadow-deep);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.submit-card .intro-text {
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  color: var(--brown);
  margin-bottom: 28px;
  line-height: 1.7;
}
.intro-text .highlight-green { color: var(--green-main); font-weight: 700; }
.intro-text .highlight-proverb { color: #b85c00; font-weight: 700; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1/-1; }
.form-group label {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--brown);
}
.form-group label .optional {
  font-weight: 400;
  font-style: italic;
  color: var(--brown-light);
  font-size: 13px;
  margin-left: 4px;
}
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--green-main);
  border: none;
  border-radius: 30px;
  padding: 12px 20px;
  color: #fff;
  font-family: 'Amiri', serif;
  font-size: 15px;
  outline: none;
  transition: var(--transition);
}
.form-group textarea {
  border-radius: var(--radius-sm);
  resize: vertical;
  min-height: 110px;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(255,255,255,0.5); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  background: var(--green-light);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.35);
}
.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='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 40px;
}
.form-group select option { background: var(--green-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);
  padding: 0;
}
.btn-submit {
  display: block; width: 100%;
  padding: 14px;
  background: var(--green-main);
  color: #fff;
  border: none;
  border-radius: 40px;
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
}
.btn-submit:hover {
  background: var(--green-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}

/* ===== ABOUT PAGE ===== */
.about-card {
  background: rgba(245,234,208,0.92);
  border-radius: var(--radius);
  padding: 50px;
  max-width: 700px;
  margin: 0 auto;
  box-shadow: var(--shadow-deep);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.about-card h1 {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 24px;
  color: var(--brown);
  text-align: center;
  margin-bottom: 6px;
}
.about-card h1.ar {
  font-family: 'Noto Sans Arabic', serif;
  font-size: 22px;
  direction: rtl;
}
.about-card p {
  font-family: 'Amiri', serif;
  font-size: 17px;
  line-height: 1.85;
  color: var(--brown);
  margin-bottom: 14px;
}
.about-card .divider-gold {
  width: 80px; height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin: 18px auto;
}

/* ===== CONTACT PAGE ===== */
.contact-card {
  background: rgba(245,234,208,0.93);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: var(--shadow-deep);
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.contact-card h2 {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 22px;
  color: var(--brown);
  margin-bottom: 20px;
}
.contact-info-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(140,95,25,0.2);
  font-family: 'Amiri', serif;
  font-size: 16px;
  color: var(--brown);
  text-align: left;
}
.contact-info-item .icon {
  width: 42px; height: 42px;
  background: var(--green-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

/* ===== FOLKTALES GRID ===== */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}
.story-card {
  background: rgba(245,234,208,0.90);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(201,168,76,0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.story-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 52px rgba(0,0,0,0.55);
  border-color: var(--gold);
}
.story-card .story-num {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 12px;
  color: var(--gold-dark);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.story-card h3 {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 15px;
  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;
}
.story-card .btn-read {
  background: var(--green-main);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 24px;
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.story-card .btn-read:hover { background: var(--green-light); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--green-main);
  color: #fff;
  padding: 14px 30px;
  border-radius: 40px;
  font-family: 'Amiri', serif;
  font-size: 16px;
  box-shadow: var(--shadow);
  z-index: 9999;
  transition: transform 0.4s cubic-bezier(.4,0,.2,1);
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

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

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .story-book { flex-direction: column; }
  .story-half.left { border-right: none; border-bottom: 2px solid rgba(140,95,25,0.28); }
  .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: 36px 28px; }
}
@media (max-width: 480px) {
  .navbar { padding: 10px 14px; gap: 8px; }
  .nav-search input { width: 90px; }
  .open-book { width: 96vw; }
  .book-title-ar { font-size: 16px; }
  .book-title-en { font-size: 11px; }
}
