/*
 * App styles – one file for every page.
 * Change the colours in :root to rebrand the app.
 */
:root {
  --brand: #4a2f8f;          /* top bar, active tab, links */
  --brand-light: #7c5cd6;
  --bg: #f6f4fb;             /* page background */
  --card: #ffffff;           /* lists and entry text */
  --text: #1f1a2e;
  --muted: #6b6480;
  --line: #e3def0;
  --highlight: #ffe58a;      /* search matches */
  --font-arabic: "Geeza Pro", "Noto Naskh Arabic", "Traditional Arabic", "Arial", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-arabic);
  font-size: 18px;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}

/* Top bar with the two tabs */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
}
.tabs {
  display: flex;
  max-width: 420px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 3px;
}
.tabs a {
  flex: 1;
  text-align: center;
  padding: 6px 0;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}
.tabs a.active { background: #fff; color: var(--brand); }

.content {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 12px calc(env(safe-area-inset-bottom) + 24px);
}

.page-title { font-size: 24px; margin: 8px 4px 12px; color: var(--brand); }

/* Lists: Fehrist, chapters, search results */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.list li + li { border-top: 1px solid var(--line); }
.list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
}
.list a::after { content: "‹"; margin-inline-start: auto; color: var(--muted); font-size: 22px; }
.list a:active { background: var(--bg); }
.letters .letter {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg);
  color: var(--brand);
  font-size: 22px;
  font-weight: bold;
}

/* Entry page */
.entry {
  background: var(--card);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 12px 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.entry h1 { font-size: 24px; margin: 0 0 8px; color: var(--brand); }
.entry p { margin: 0 0 10px; }

.pager { display: flex; gap: 8px; }
.pager a {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--brand);
  text-decoration: none;
  font-size: 15px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Search form and results */
.search-form { background: var(--card); border-radius: 14px; padding: 16px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06); }
.search-row { display: flex; gap: 8px; }
.search-row input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
button, .button {
  font: inherit;
  font-weight: bold;
  padding: 8px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
}
.modes { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 16px; color: var(--muted); }
.hint { color: var(--muted); font-size: 15px; margin: 10px 4px 0; }
.summary { margin: 14px 4px 8px; color: var(--muted); font-size: 16px; }
.results .result { display: block; }
.results .head { display: block; font-weight: bold; color: var(--brand); }
.results .extract { display: block; color: var(--text); font-size: 16px; }
mark { background: var(--highlight); color: inherit; border-radius: 3px; }
