/* ============================================================
   Islamic Scholar Platform – Global Dark Theme
   Design System: Glassmorphism + Gold Accent
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Inter:wght@300;400;500;600;700&family=Amiri:ital,wght@0,400;0,700;1,400&display=swap');

/* ---- CSS Variables ---- */
:root {
  --gold:          #D4AF37;
  --gold-light:    #F0D060;
  --gold-dark:     #9A7D1C;
  --bg-deep:       #04060C;
  --bg-dark:       #080D18;
  --bg-mid:        #0D1526;
  --glass-bg:      rgba(13, 21, 38, 0.65);
  --glass-border:  rgba(212, 175, 55, 0.18);
  --glass-hover:   rgba(212, 175, 55, 0.08);
  --text-primary:  #F0EAD6;
  --text-secondary:#9BA5B4;
  --text-muted:    #5A6475;
  --radius:        16px;
  --radius-sm:     8px;
  --shadow-gold:   0 0 40px rgba(212,175,55,0.12);
  --shadow-deep:   0 24px 64px rgba(0,0,0,0.6);
  --transition:    0.35s cubic-bezier(0.4,0,0.2,1);
  --font-display:  'Cinzel', serif;
  --font-main:     'Inter', sans-serif;
  --font-arabic:   'Amiri', serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-mid); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }

/* ---- Typography ---- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: var(--text-primary);
}
.arabic { font-family: var(--font-arabic); direction: rtl; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-secondary) !important; }

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Starfield / Background ---- */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 20% 20%, rgba(212,175,55,0.04) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(30,60,120,0.08) 0%, transparent 60%),
              var(--bg-deep);
}
.site-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(212,175,55,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 70%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 20%, rgba(212,175,55,0.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 35% 85%, rgba(255,255,255,0.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 45%, rgba(212,175,55,0.25) 0%, transparent 100%);
  animation: twinkle 8s ease-in-out infinite alternate;
}
@keyframes twinkle {
  0%   { opacity: 0.5; }
  100% { opacity: 1; }
}

/* ---- Glassmorphism Cards ---- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.glass:hover {
  border-color: rgba(212,175,55,0.35);
  box-shadow: var(--shadow-deep), var(--shadow-gold), inset 0 1px 0 rgba(255,255,255,0.07);
}

/* ---- Navbar ---- */
.navbar-scholar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  background: rgba(4, 6, 12, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--transition);
}
.navbar-scholar .logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.navbar-scholar .logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.nav-link-scholar {
  color: var(--text-secondary) !important;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color var(--transition);
  position: relative;
  padding: 4px 0 !important;
  margin: 0 14px;
}
.nav-link-scholar::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 100%;
  height: 1px;
  background: var(--gold);
  transition: right var(--transition);
}
.nav-link-scholar:hover, .nav-link-scholar.active {
  color: var(--gold) !important;
}
.nav-link-scholar:hover::after, .nav-link-scholar.active::after {
  right: 0;
}

/* ---- Buttons ---- */
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0a0a0a;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  border-radius: 50px;
  padding: 12px 28px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(212,175,55,0.35);
  position: relative;
  overflow: hidden;
}
.btn-gold::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.btn-gold:hover::before { opacity: 1; }
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(212,175,55,0.5);
  color: #0a0a0a;
}
.btn-gold:active { transform: translateY(0); }

.btn-outline-gold {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 50px;
  padding: 11px 28px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-outline-gold:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0a0a0a;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(212,175,55,0.4);
}

.btn-glass {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  backdrop-filter: blur(20px);
}
.btn-glass:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--glass-hover);
}

/* ---- Section Titles ---- */
.section-title {
  text-align: center;
  margin-bottom: 60px;
}
.section-title .eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
  position: relative;
  padding: 0 24px;
}
.section-title .eyebrow::before,
.section-title .eyebrow::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 20px;
  height: 1px;
  background: var(--gold);
}
.section-title .eyebrow::before { right: 0; }
.section-title .eyebrow::after  { left: 0; }
.section-title h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
}
.section-title p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 16px auto 0;
  font-size: 1rem;
}

/* ---- Gold Divider ---- */
.gold-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 16px auto;
}

/* ---- 3D Book Card ---- */
.book-card-wrap {
  perspective: 1000px;
}
.book-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  transform-style: preserve-3d;
  cursor: pointer;
}
.book-card:hover {
  border-color: rgba(212,175,55,0.4);
  box-shadow: var(--shadow-deep), 0 0 60px rgba(212,175,55,0.15);
}
.book-card .book-cover-img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}
.book-cover-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-mid), #0a1428);
  color: var(--gold);
  font-size: 2rem;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.book-cover-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212,175,55,0.05) 0%, transparent 60%);
}
.book-cover-placeholder .book-title-over {
  font-family: var(--font-arabic);
  font-size: 0.95rem;
  color: var(--gold);
  text-align: center;
  padding: 0 16px;
  line-height: 1.4;
}
.book-spine {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 12px;
  background: linear-gradient(180deg, var(--gold-dark), var(--gold), var(--gold-dark));
  opacity: 0;
  transition: opacity var(--transition);
}
.book-card:hover .book-spine { opacity: 1; }

.book-card-body {
  padding: 16px;
}
.book-card-body .book-cat {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.book-card-body h4 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-family: var(--font-main);
}
.book-card-body .book-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.badge-free {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0a0a0a;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 50px;
  text-transform: uppercase;
}
.badge-premium {
  display: inline-block;
  background: rgba(212,175,55,0.12);
  color: var(--gold);
  border: 1px solid rgba(212,175,55,0.3);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 50px;
  text-transform: uppercase;
}

/* ---- Stats Counter ---- */
.stat-card {
  text-align: center;
  padding: 32px 24px;
}
.stat-card .stat-number {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  display: block;
}
.stat-card .stat-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 8px;
}

/* ---- Page Sections ---- */
section { padding: 100px 0; }
.hero-section { padding: 0; min-height: 100vh; }

/* ---- Ornamental Separator ---- */
.ornament {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.ornament::before, .ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border));
}
.ornament::after {
  background: linear-gradient(90deg, var(--glass-border), transparent);
}
.ornament-icon {
  color: var(--gold);
  font-size: 0.9rem;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--glass-border);
  padding: 60px 0 30px;
}
.site-footer .footer-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 12px;
}
.site-footer p { color: var(--text-muted); font-size: 0.88rem; }
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color var(--transition);
  display: block;
  margin-bottom: 8px;
}
.footer-links a:hover { color: var(--gold); }
.social-links { display: flex; gap: 12px; margin-top: 16px; }
.social-links a {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-decoration: none;
  transition: all var(--transition);
}
.social-links a:hover {
  background: var(--gold);
  color: #0a0a0a;
  border-color: var(--gold);
  transform: translateY(-3px);
}

/* ---- Filter / Tag Pills ---- */
.filter-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; justify-content: center; }
.filter-pill {
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  transition: all var(--transition);
}
.filter-pill:hover, .filter-pill.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0a0a0a;
  border-color: transparent;
  font-weight: 700;
}

/* ---- Search Bar ---- */
.search-bar {
  position: relative; max-width: 480px; margin: 0 auto 40px;
}
.search-bar input {
  width: 100%;
  padding: 14px 52px 14px 22px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  backdrop-filter: blur(20px);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.12);
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar .search-icon {
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 1rem;
}

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 20px rgba(212,175,55,0.2); }
  50%      { box-shadow: 0 0 40px rgba(212,175,55,0.4); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.animate-fadeup  { animation: fadeUp 0.8s ease forwards; }
.animate-fadein  { animation: fadeIn 0.6s ease forwards; }
.animate-float   { animation: float 5s ease-in-out infinite; }
.animate-glow    { animation: glowPulse 3s ease-in-out infinite; }
[data-delay="1"] { animation-delay: 0.1s; }
[data-delay="2"] { animation-delay: 0.2s; }
[data-delay="3"] { animation-delay: 0.3s; }
[data-delay="4"] { animation-delay: 0.4s; }
[data-delay="5"] { animation-delay: 0.5s; }

/* Pre-animation state */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Hero specific ---- */
.hero-canvas {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 50px;
  padding: 6px 18px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

/* ---- Scholar Quote Block ---- */
.quote-block {
  border-left: 3px solid var(--gold);
  padding: 16px 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-arabic);
  font-size: 1.2rem;
  color: var(--text-primary);
  font-style: italic;
}
.quote-block cite {
  display: block;
  font-size: 0.8rem;
  color: var(--gold);
  margin-top: 10px;
  font-style: normal;
  font-family: var(--font-main);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ---- Page Hero Banners ---- */
.page-hero {
  padding: 160px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(212,175,55,0.07) 0%, transparent 70%);
}
.page-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  section { padding: 60px 0; }
  .page-hero { padding: 120px 0 60px; }
  .navbar-scholar { padding: 12px 0; }
  .book-card-body h4 { font-size: 0.85rem; }
}
