/*
 * IslamieBooks Shared Design System v1
 * A single CSS foundation shared by all product frontends.
 * Islamic-appropriate green palette + elegant typography + RTL-safe.
 */

:root {
  /* Brand palette (Islamic green inspired) */
  --green-900: #064e3b;
  --green-800: #065f46;
  --green-700: #047857;
  --green-600: #059669;
  --green-500: #10b981;
  --green-100: #d1fae5;
  --green-50:  #ecfdf5;

  --gold-500: #d4a136;
  --gold-600: #b8860b;

  --bg:        #ffffff;
  --bg-soft:   #f8faf9;
  --surface:   #ffffff;
  --border:    #e5e7eb;
  --text:      #1f2937;
  --text-soft: #6b7280;
  --text-mute: #9ca3af;

  --danger:    #dc2626;
  --info:      #2563eb;

  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 4px 20px rgba(4, 120, 87, 0.08);
  --shadow-lg: 0 12px 40px rgba(4, 120, 87, 0.14);

  --font:    "Noto Sans Tamil", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-ar: "Scheherazade New", "Traditional Arabic", "Amiri", serif;

  --header-h: 64px;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5 { line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.section { padding: 3.5rem 0; }
.section--soft { background: var(--bg-soft); }

/* ---------- RTL / Arabic ---------- */
.arabic, [lang="ar"] { font-family: var(--font-ar); direction: rtl; text-align: right; }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(6,78,59,.97);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header .container { display: flex; align-items: center; gap: 1.5rem; height: 100%; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: #fff; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  display: grid; place-items: center; font-size: 18px;
}
.nav { display: flex; gap: .25rem; flex: 1; }
.nav a {
  color: rgba(255,255,255,.85); padding: .5rem .8rem; border-radius: var(--radius-sm);
  font-size: .95rem; transition: .15s;
}
.nav a:hover { background: rgba(255,255,255,.12); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(255,255,255,.16); color: #fff; }
.header-actions { display: flex; gap: .6rem; align-items: center; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.1rem; border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: .15s; font-family: var(--font);
}
.btn--primary { background: var(--green-600); color: #fff; }
.btn--primary:hover { background: var(--green-700); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--green-700); border-color: var(--green-600); }
.btn--ghost:hover { background: var(--green-50); text-decoration: none; }
.btn--light { background: #fff; color: var(--green-800); }
.btn--light:hover { background: var(--green-50); text-decoration: none; }
.btn--block { width: 100%; justify-content: center; }

/* ---------- FORMS ---------- */
.input, .select, textarea {
  width: 100%; padding: .65rem .9rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--font); font-size: .95rem;
  background: #fff; color: var(--text);
}
.input:focus, .select:focus, textarea:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
label.field { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .9rem; }
label.field small { display: block; font-weight: 400; color: var(--text-soft); }

/* ---------- CARDS / GRID ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px){ .grid--3,.grid--4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px){ .grid--3,.grid--4,.grid--2 { grid-template-columns: 1fr; } }

/* ---------- BADGES ---------- */
.badge {
  display: inline-block; padding: .2rem .6rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600;
}
.badge--green { background: var(--green-100); color: var(--green-800); }
.badge--gold { background: #fbf3d9; color: var(--gold-600); }
.badge--gray { background: #f3f4f6; color: var(--text-soft); }

/* ---------- UTILS ---------- */
.text-center { text-align: center; }
.mt-0{margin-top:0}.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-2{margin-bottom:1rem}
.muted { color: var(--text-soft); }
.small { font-size: .85rem; }
.flex { display: flex; gap: 1rem; align-items: center; }
.flex--between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--green-900), var(--green-700));
  color: #fff; padding: 4.5rem 0; text-align: center;
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.hero p { color: rgba(255,255,255,.9); font-size: 1.1rem; max-width: 640px; margin: 0 auto .5em; }
.hero .arabic { font-size: 1.6rem; color: var(--gold-500); }

/* Footer */
.site-footer { background: var(--green-900); color: rgba(255,255,255,.8); padding: 2.5rem 0; margin-top: 3rem; }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer .grid { align-items: start; }

/* ---------- QURAN READER ---------- */
.aya-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem 1.4rem; margin-bottom: .6rem; box-shadow: var(--shadow);
}
.aya-card__ar { font-family: var(--font-ar); font-size: 1.6rem; line-height: 2.2; margin-bottom: .3rem; }
.aya-card__ta { font-size: 1.02rem; color: var(--text); }
.aya-number {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--green-100); color: var(--green-800); font-weight: 700; font-size: .85rem;
}

/* Translation switcher */
.pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill {
  padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; font-size: .85rem; cursor: pointer; color: var(--text); font-family: var(--font);
}
.pill.active { background: var(--green-600); color: #fff; border-color: var(--green-600); }

/* Skeleton */
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton {
  position: relative; overflow: hidden; background: #eef0ef; border-radius: var(--radius-sm);
}
.skeleton::after {
  content:""; position:absolute; inset:0; transform:translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  animation: shimmer 1.2s infinite;
}

/* Toast */
.toast {
  position: fixed; right: 20px; bottom: 20px; background: var(--green-900); color: #fff;
  padding: .8rem 1.2rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  transform: translateY(20px); opacity: 0; transition: .3s; z-index: 100;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Spinner */
.spinner {
  width: 28px; height: 28px; border: 3px solid var(--green-100);
  border-top-color: var(--green-600); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px){
  .nav { gap: .1rem; }
  .nav a { padding: .4rem .5rem; font-size: .85rem; }
  .hero { padding: 3rem 0; }
}
