/* Quran by Barmagly — web reader  © 2026 Barmagly */

:root {
  --emerald-deep: #0D2C27;
  --emerald: #008B5B;
  --emerald-soft: #007444;
  --gold: #D4AF37;
  --gold-soft: #E8C870;

  --bg: #F3F1EC;
  --bg-card: #FFFFFF;
  --text: #1B1B1F;
  --text-dim: #555;
  --text-muted: #888;
  --border: #E5E2DB;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(13,44,39,.06);
}

html.dark {
  --bg: #0E1513;
  --bg-card: #141B19;
  --text: #E7E5DF;
  --text-dim: #B0B0B0;
  --text-muted: #7D7D7D;
  --border: #1F2624;
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Tajawal", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app { display: flex; flex-direction: column; min-height: 100vh; }

/* ------- Top bar ------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--emerald-deep), var(--emerald));
  color: #fff;
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(212,175,55,0.18);
  color: var(--gold); font-weight: 800; font-size: 22px;
  border: 1.5px solid rgba(212,175,55,0.4);
}
.brand-mark.small { width: 28px; height: 28px; font-size: 16px; }
.brand-name { font-size: 18px; letter-spacing: 0.3px; }
.topnav { margin-right: auto; display: flex; gap: 18px; }
.topnav a {
  color: rgba(255,255,255,.85); text-decoration: none; font-size: 15px;
  padding: 6px 10px; border-radius: 6px; transition: background .2s;
}
.topnav a:hover, .topnav a.active { background: rgba(255,255,255,.12); color: var(--gold); }
.btn-ghost {
  background: rgba(255,255,255,.1); color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 50%; font-size: 20px;
  cursor: pointer; transition: background .2s;
}
.btn-ghost:hover { background: rgba(255,255,255,.2); }

/* ------- Main view ------- */
#view { flex: 1; padding: 24px 20px; max-width: 1100px; width: 100%; margin: 0 auto; }

/* ------- Home / hero ------- */
.hero {
  text-align: center; padding: 60px 20px 40px;
  background: linear-gradient(135deg, var(--emerald-deep), var(--emerald));
  border-radius: 24px; color: #fff;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}
.hero h1 { font-size: 32px; margin-bottom: 12px; color: var(--gold-soft); }
.hero p { font-size: 17px; opacity: .9; max-width: 600px; margin: 0 auto 24px; }
.hero .btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .btn {
  display: inline-block; padding: 12px 28px; border-radius: 999px;
  background: var(--gold); color: var(--emerald-deep);
  font-weight: 700; font-size: 15px; text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.hero .btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(212,175,55,.3); }
.hero .btn-outline { background: transparent; color: var(--gold); border: 1.5px solid var(--gold); }

/* ------- Surah list grid ------- */
.section-title {
  font-size: 22px; font-weight: 700; margin: 0 0 16px;
  display: flex; align-items: baseline; gap: 12px;
}
.section-title .count { font-size: 14px; color: var(--text-muted); font-weight: 400; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.search-box input {
  flex: 1; background: transparent; border: 0; outline: 0;
  font: inherit; color: var(--text);
}
.search-box .icon { color: var(--text-muted); font-size: 18px; }

.surah-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.surah-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; cursor: pointer;
  text-decoration: none; color: var(--text);
  transition: border-color .15s, transform .1s;
}
.surah-card:hover { border-color: var(--emerald); transform: translateY(-1px); }
.surah-num {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0,139,91,.08); color: var(--emerald);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
  border: 1px solid rgba(0,139,91,.2);
}
.surah-info { flex: 1; min-width: 0; }
.surah-name { font-weight: 700; font-size: 16px; color: var(--text); }
.surah-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.surah-ar {
  font-family: "Amiri Quran", "Scheherazade New", "Traditional Arabic", serif;
  font-size: 22px; color: var(--emerald); font-weight: 500;
  flex-shrink: 0;
}

/* ------- Reader ------- */
.reader-head {
  background: linear-gradient(135deg, var(--emerald-deep), var(--emerald));
  color: #fff; border-radius: 16px; padding: 24px 20px;
  margin-bottom: 24px; text-align: center;
  box-shadow: var(--shadow);
}
.reader-head .sname-ar {
  font-family: "Amiri Quran", "Scheherazade New", "Traditional Arabic", serif;
  font-size: 42px; color: var(--gold); line-height: 1.2;
}
.reader-head .sname-en { font-size: 14px; opacity: .8; letter-spacing: 1px; }
.reader-head .sinfo { font-size: 13px; margin-top: 8px; opacity: .75; }

.reader-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.reader-toolbar .nav-btn {
  background: rgba(0,139,91,0.08); color: var(--emerald);
  border: 1px solid rgba(0,139,91,0.2); padding: 8px 14px;
  border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600;
  text-decoration: none;
}
.reader-toolbar .nav-btn:hover { background: rgba(0,139,91,0.14); }
.reader-toolbar .spacer { flex: 1; }

/* Basmala */
.basmala {
  text-align: center;
  font-family: "Amiri Quran", "Scheherazade New", "Traditional Arabic", serif;
  font-size: 34px; color: var(--emerald); padding: 20px 0 30px;
  border-bottom: 1px solid var(--border); margin-bottom: 24px;
}

/* Verses */
.verse-list { display: flex; flex-direction: column; gap: 16px; }
.verse {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 24px;
  box-shadow: var(--shadow);
}
.verse-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.verse-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--emerald); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.verse-arabic {
  font-family: "Amiri Quran", "Scheherazade New", "Traditional Arabic", serif;
  font-size: 28px; line-height: 2.1; color: var(--text);
  text-align: right; direction: rtl;
  padding: 8px 0;
}
.verse-translation {
  font-size: 15px; line-height: 1.8; color: var(--text-dim);
  padding-top: 14px; margin-top: 14px;
  border-top: 1px dashed var(--border);
  direction: ltr; text-align: left;
}
.verse-translation-ar { direction: rtl; text-align: right; }
.verse-translation strong { color: var(--emerald); font-weight: 600; }

/* Loading / messages */
.loading { text-align: center; padding: 80px 20px; color: var(--text-muted); font-size: 15px; }
.loading::before {
  content: ""; display: inline-block; width: 32px; height: 32px;
  border: 3px solid var(--border); border-top-color: var(--emerald);
  border-radius: 50%; margin-bottom: 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* About page */
.about-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; box-shadow: var(--shadow);
}
.about-card h1 { font-size: 26px; margin-bottom: 16px; color: var(--emerald); }
.about-card p { margin-bottom: 14px; color: var(--text-dim); line-height: 1.9; }
.about-card .app-link {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--emerald); color: #fff;
  padding: 12px 24px; border-radius: 999px;
  text-decoration: none; font-weight: 600;
  margin-top: 16px;
}

/* Footer */
.footer {
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 24px 20px; text-align: center;
  color: var(--text-muted); font-size: 13px;
}
.footer .foot-brand { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--text-dim); font-weight: 600; }
.footer .foot-links a { color: var(--emerald); text-decoration: none; margin: 0 4px; }
.footer .foot-copy { margin-top: 10px; }

/* Responsive */
@media (max-width: 700px) {
  .topbar { padding: 10px 12px; gap: 10px; }
  .brand-name { display: none; }
  .topnav { gap: 4px; }
  .topnav a { padding: 5px 8px; font-size: 14px; }
  .hero { padding: 40px 16px; border-radius: 18px; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 15px; }
  .reader-head .sname-ar { font-size: 32px; }
  .verse { padding: 16px; }
  .verse-arabic { font-size: 23px; line-height: 1.95; }
  #view { padding: 18px 14px; }
  .surah-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .surah-card { padding: 10px; gap: 8px; }
}
