/* ===== موقع طمأنينة — التصميم ===== */
:root {
  --bg: #f6f3ec;
  --card: #ffffff;
  --ink: #1d2b27;
  --muted: #6b7a75;
  --brand: #0c6b58;
  --brand-deep: #084d3f;
  --brand-soft: #e3f1ec;
  --gold: #c9a227;
  --gold-soft: #f7efda;
  --line: #e7e2d6;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(12, 60, 50, .08);
  --danger: #b4432f;
}
[data-theme="dark"] {
  --bg: #0f1a17;
  --card: #16241f;
  --ink: #ecf3ef;
  --muted: #93a8a0;
  --brand: #2ea78d;
  --brand-deep: #2ea78d;
  --brand-soft: #14352c;
  --gold: #d8b13c;
  --gold-soft: #2a2a16;
  --line: #243830;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Tajawal", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.8;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%230c6b58' stroke-opacity='.06'%3E%3Crect x='35' y='35' width='50' height='50'/%3E%3Crect x='35' y='35' width='50' height='50' transform='rotate(45 60 60)'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none; z-index: 0;
}
[data-theme="dark"] body::before, [data-theme="dark"]::before { opacity: .4; }
img { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
.container { width: min(1080px, 92%); margin-inline: auto; position: relative; z-index: 1; }

/* ===== الترويسة ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; color: var(--ink); }
.logo svg { width: 38px; height: 38px; }
.main-nav { display: flex; gap: 4px; margin-inline-start: auto; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  padding: 7px 13px; border-radius: 999px; color: var(--ink);
  font-size: .95rem; font-weight: 600; white-space: nowrap; flex-shrink: 0;
}
.main-nav a:hover { background: var(--brand-soft); }
.main-nav a.active { background: var(--brand); color: #fff; }
.icon-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem;
}

/* ===== الواجهة ===== */
.hero { text-align: center; padding: 46px 0 26px; }
.hero .basmala { color: var(--gold); font-size: 1.05rem; font-weight: 600; }
.hero h1 {
  font-size: clamp(2.6rem, 8vw, 4.2rem); font-weight: 900; color: var(--brand-deep);
  margin: 6px 0 2px; letter-spacing: -1px;
}
.hero .ayah { color: var(--muted); font-size: 1.15rem; }
.hero .dates { margin-top: 10px; font-size: .92rem; color: var(--muted); display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.hero .dates span { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px 14px; }

/* ===== العناوين والأقسام ===== */
.section { margin: 34px 0; }
.section-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.45rem; font-weight: 800; margin-bottom: 16px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-title .ornament { color: var(--gold); font-size: 1.2rem; }

/* ===== عداد التسبيح ===== */
.tasbih-card {
  background: linear-gradient(150deg, var(--brand-deep), var(--brand));
  border-radius: calc(var(--radius) + 8px); color: #fff;
  padding: 26px 20px 30px; text-align: center; box-shadow: var(--shadow);
}
.dhikr-pills { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
.dhikr-pills button {
  border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff;
  border-radius: 999px; padding: 6px 14px; cursor: pointer; font-family: inherit; font-size: .9rem;
}
.dhikr-pills button.active { background: #fff; color: var(--brand-deep); font-weight: 700; }
.counter-ring { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.counter-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.counter-ring .track { stroke: rgba(255,255,255,.2); }
.counter-ring .fill { stroke: var(--gold); transition: stroke-dashoffset .15s ease; stroke-linecap: round; }
.counter-btn {
  position: absolute; inset: 16px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.1); color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-family: inherit; transition: transform .07s ease; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; user-select: none;
}
.counter-btn:active { transform: scale(.96); background: rgba(255,255,255,.18); }
.counter-btn .count { font-size: 3.2rem; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.counter-btn .label { font-size: .95rem; opacity: .9; max-width: 150px; }
.tasbih-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.chip {
  border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff;
  border-radius: 999px; padding: 6px 16px; cursor: pointer; font-family: inherit; font-size: .88rem;
}
.chip:hover { background: rgba(255,255,255,.14); }
.tasbih-total { margin-top: 14px; font-size: .9rem; opacity: .85; }
.done-badge { display: none; margin-top: 10px; color: var(--gold); font-weight: 700; }
.done-badge.show { display: block; animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ===== بطاقات الأذكار ===== */
.dhikr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.dhikr-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .2s, transform .07s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.dhikr-card:active { transform: scale(.985); }
.dhikr-card.complete { border-color: var(--brand); background: var(--brand-soft); }
.dhikr-card .dhikr-text { font-size: 1.06rem; line-height: 2; }
.dhikr-card .dhikr-note { color: var(--gold); font-size: .85rem; margin-top: 6px; }
.dhikr-card .meter { height: 7px; background: var(--line); border-radius: 99px; margin-top: 12px; overflow: hidden; }
.dhikr-card .meter i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .2s; }
.dhikr-card .tally { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: .88rem; color: var(--muted); }
.dhikr-card .tally b { color: var(--brand); font-variant-numeric: tabular-nums; }
.dhikr-card .reset-mini { border: none; background: none; color: var(--muted); cursor: pointer; font-size: .8rem; font-family: inherit; }
.dhikr-card .reset-mini:hover { color: var(--danger); }
.tap-hint { text-align: center; color: var(--muted); font-size: .85rem; margin-top: -6px; margin-bottom: 14px; }
.progress-summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.progress-summary .bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress-summary .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--gold)); width: 0; transition: width .3s; }

/* ===== تحدي الثلاثين يومًا ===== */
.challenge30 { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: 22px; box-shadow: var(--shadow); }
.challenge30 .stats { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; color: var(--muted); font-size: .95rem; }
.challenge30 .stats b { color: var(--brand); }
.days-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
@media (min-width: 640px) { .days-grid { grid-template-columns: repeat(10, 1fr); } }
.day-cell {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  display: flex; align-items: center; justify-content: center; font-weight: 700; cursor: pointer;
  font-family: inherit; color: var(--ink); font-size: 1rem; transition: all .15s;
}
.day-cell:hover { border-color: var(--brand); }
.day-cell.done { background: var(--brand); color: #fff; border-color: var(--brand); }
.day-cell.today { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ===== تحدي اليوم ===== */
.daily-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.daily-card {
  border-radius: var(--radius); padding: 20px; color: #fff; position: relative; overflow: hidden;
  min-height: 130px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow);
}
.daily-card:nth-child(1) { background: linear-gradient(140deg, #0c6b58, #084d3f); }
.daily-card:nth-child(2) { background: linear-gradient(140deg, #b98f1f, #8a6a10); }
.daily-card:nth-child(3) { background: linear-gradient(140deg, #26557a, #173a56); }
.daily-card .task { font-size: 1.08rem; font-weight: 700; line-height: 1.9; }
.daily-card button {
  align-self: flex-start; border: none; background: rgba(255,255,255,.92); color: #12332b;
  border-radius: 999px; padding: 6px 18px; font-weight: 700; cursor: pointer; font-family: inherit; font-size: .88rem;
}
.daily-card.done button { background: var(--gold); color: #3d2f04; }
.daily-card .check { position: absolute; top: 14px; inset-inline-end: 16px; font-size: 1.4rem; opacity: 0; transition: opacity .2s; }
.daily-card.done .check { opacity: 1; }

/* ===== الاختبار ===== */
.quiz-teaser { background: var(--gold-soft); border: 1px solid var(--gold); border-radius: calc(var(--radius) + 4px); padding: 24px; text-align: center; }
.quiz-teaser h3 { font-size: 1.3rem; margin-bottom: 6px; }
.quiz-box { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: 26px; box-shadow: var(--shadow); max-width: 720px; margin: 0 auto; }
.quiz-box .q-num { color: var(--muted); font-size: .88rem; }
.quiz-box .q-text { font-size: 1.25rem; font-weight: 700; margin: 8px 0 18px; line-height: 1.9; }
.quiz-opt {
  display: block; width: 100%; text-align: start; border: 1px solid var(--line); background: var(--bg);
  border-radius: 14px; padding: 12px 16px; margin-bottom: 10px; cursor: pointer;
  font-family: inherit; font-size: 1.02rem; color: var(--ink); transition: all .15s;
}
.quiz-opt:hover { border-color: var(--brand); }
.quiz-opt.correct { background: var(--brand-soft); border-color: var(--brand); font-weight: 700; }
.quiz-opt.wrong { background: #f9e7e3; border-color: var(--danger); }
[data-theme="dark"] .quiz-opt.wrong { background: #3a1c16; }
.quiz-score { text-align: center; }
.quiz-score .big { font-size: 3.4rem; font-weight: 900; color: var(--brand); }

/* ===== أزرار المشاركة ===== */
.share-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 10px 22px;
  font-weight: 700; color: #fff; font-size: .98rem; border: none; cursor: pointer; font-family: inherit;
}
.share-btn.wa { background: #1faa55; }
.share-btn.x { background: #14171a; }
.share-btn.tg { background: #2087c5; }

/* ===== المساحات الإعلانية ===== */
.ad-slot {
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  margin: 26px auto; min-height: 90px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .85rem; background: color-mix(in srgb, var(--card) 60%, transparent);
  width: min(728px, 100%); overflow: hidden;
}
.ad-slot[data-filled="true"] { border: none; min-height: 0; background: none; }

/* ===== التذييل ===== */
.site-footer { border-top: 1px solid var(--line); margin-top: 50px; padding: 30px 0 40px; text-align: center; color: var(--muted); font-size: .92rem; }
.site-footer .links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }

/* ===== أزرار عامة ===== */
.btn {
  display: inline-block; background: var(--brand); color: #fff; border: none; border-radius: 999px;
  padding: 11px 30px; font-weight: 700; font-size: 1rem; cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--brand-deep); }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }

/* ===== لوحة التحكم ===== */
.admin-login { max-width: 420px; margin: 60px auto; background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: 30px; box-shadow: var(--shadow); text-align: center; }
.admin-login input { width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; font-family: inherit; font-size: 1rem; margin: 12px 0; background: var(--bg); color: var(--ink); }
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-tabs button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 8px 18px; cursor: pointer; font-family: inherit; font-weight: 600; }
.admin-tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.admin-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.admin-panel h3 { margin-bottom: 12px; }
.admin-panel label { display: block; font-size: .92rem; font-weight: 600; margin: 12px 0 4px; }
.admin-panel input[type="text"], .admin-panel input[type="number"], .admin-panel textarea, .admin-panel select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: .95rem; background: var(--bg); color: var(--ink);
}
.admin-panel textarea { min-height: 110px; resize: vertical; direction: rtl; }
.admin-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.admin-row input { flex: 1; }
.mini-btn { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-family: inherit; font-size: .85rem; }
.mini-btn.danger { color: var(--danger); border-color: var(--danger); }
.notice { background: var(--gold-soft); border: 1px solid var(--gold); border-radius: 12px; padding: 12px 16px; font-size: .9rem; margin-bottom: 16px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat-card { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; }
.stat-card b { display: block; font-size: 1.6rem; color: var(--brand); }

/* ===== صفحات نصية ===== */
.prose { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: 30px; box-shadow: var(--shadow); max-width: 820px; margin: 30px auto; }
.prose h1 { font-size: 1.8rem; margin-bottom: 14px; color: var(--brand-deep); }
.prose h2 { font-size: 1.25rem; margin: 20px 0 8px; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-inline-start: 22px; }

@media (max-width: 640px) {
  .main-nav { order: 3; flex-basis: 100%; margin-inline-start: 0; }
  .main-nav a { padding: 6px 10px; font-size: .86rem; }
  .header-inner { flex-wrap: wrap; }
  .hero { padding: 30px 0 18px; }
  .counter-ring { width: 190px; height: 190px; }
  .days-grid { gap: 6px; }
}

/* جداول الإحصائيات في لوحة التحكم */
.stats-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.stats-table th, .stats-table td { border: 1px solid var(--line); padding: 7px 12px; text-align: start; }
.stats-table th { background: var(--bg); font-weight: 700; }
