/* Duas: /dua/ (categories) and /dua/{slug}/ (a category's duas). views/duah*.php, assets/js/duah.js. */

/* ── Hero ─────────────────────────────────────────────────────────────── */
.duah-hero { position: relative; overflow: hidden; color: #fff; padding: 38px 0 34px;
  background: radial-gradient(120% 140% at 85% -10%, #14b8a6 0%, transparent 45%),
              linear-gradient(135deg, #0d9488 0%, #0f766e 48%, #064e3b 100%); }
.duah-hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .09;
  background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 1.5px); background-size: 22px 22px; }
.duah-hero-glow { position: absolute; width: 420px; height: 420px; right: -120px; top: -180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(250, 204, 21, .22), transparent 65%); animation: duahGlow 9s ease-in-out infinite alternate; }
@keyframes duahGlow { from { transform: translate(0, 0) scale(1); } to { transform: translate(-40px, 30px) scale(1.12); } }
.duah-hero-ar { font-family: 'Scheherazade New', 'Amiri', serif; font-size: 34px; line-height: 1.5; color: #fde68a;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .18); margin-bottom: 2px; animation: duahFade .8s ease both; }
.duah-hero-title { font-size: 30px; font-weight: 800; letter-spacing: -.4px; margin: 0 0 6px; animation: duahUp .6s .05s cubic-bezier(.2, .8, .2, 1) both; }
.duah-hero-sub { max-width: 640px; margin: 0 0 14px; font-size: 15.5px; opacity: .9; line-height: 1.6; animation: duahUp .6s .1s cubic-bezier(.2, .8, .2, 1) both; }
.duah-hero-stats { display: flex; flex-wrap: wrap; gap: 8px; animation: duahUp .6s .15s cubic-bezier(.2, .8, .2, 1) both; }
.duah-hero-stats span { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(6px); }
.duah-search { position: relative; max-width: 560px; margin-top: 18px; animation: duahUp .6s .2s cubic-bezier(.2, .8, .2, 1) both; }
.duah-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #0f766e; pointer-events: none; }
[dir="rtl"] .duah-search svg { left: auto; right: 16px; }
.duah-search input { width: 100%; height: 50px; border: 0; border-radius: 16px; padding: 0 18px 0 46px; font-size: 15.5px; color: #0f172a;
  background: #fff; box-shadow: 0 10px 30px -10px rgba(2, 44, 34, .55); outline: 0; transition: box-shadow .25s, transform .25s; }
[dir="rtl"] .duah-search input { padding: 0 46px 0 18px; }
.duah-search input:focus { box-shadow: 0 0 0 4px rgba(253, 230, 138, .55), 0 14px 34px -12px rgba(2, 44, 34, .6); transform: translateY(-1px); }

.duah-hero-cat { padding: 30px 0 28px; }
.duah-hero-cat-inner { display: flex; align-items: center; gap: 18px; }
.duah-hero-pic { flex: none; width: 76px; height: 76px; display: grid; place-items: center; border-radius: 22px; background: rgba(255, 255, 255, .95);
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, .35); animation: duahPop .6s cubic-bezier(.2, .9, .3, 1.3) both; }
.duah-hero-pic img { width: 52px; height: 52px; object-fit: contain; }
.duah-hero-kicker { display: inline-block; color: #fde68a; font-size: 13px; font-weight: 700; text-decoration: none; letter-spacing: .3px; margin-bottom: 2px; }
.duah-hero-kicker:hover { color: #fff; }
.duah-hero-cat .duah-hero-title { font-size: 26px; }

/* ── Categories ───────────────────────────────────────────────────────── */
.duah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.duah-cat { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 16px 16px 14px; border-radius: 18px;
  background: #fff; border: 1px solid #e2e8f0; color: #0f172a; text-decoration: none; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, border-color .25s; }
.duah-cat:hover { transform: translateY(-3px); border-color: #5eead4; box-shadow: 0 14px 30px -14px rgba(13, 148, 136, .45); color: #0f172a; }
.duah-cat:active { transform: translateY(-1px) scale(.99); }
.duah-cat-num { position: absolute; top: 8px; right: 12px; font-size: 11px; font-weight: 800; color: #cbd5e1; }
[dir="rtl"] .duah-cat-num { right: auto; left: 12px; }
.duah-cat-pic { flex: none; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px;
  background: linear-gradient(145deg, #f0fdfa, #ccfbf1); transition: transform .35s cubic-bezier(.2, .9, .3, 1.3); }
.duah-cat:hover .duah-cat-pic { transform: rotate(-6deg) scale(1.06); }
.duah-cat-pic img { width: 40px; height: 40px; object-fit: contain; }
.duah-cat-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.duah-cat-title { font-weight: 800; font-size: 15.5px; line-height: 1.35; }
.duah-cat-count { font-size: 12.5px; color: #64748b; margin-top: 3px; font-weight: 600; }
.duah-cat-arrow { flex: none; color: #94a3b8; transition: transform .25s, color .25s; }
.duah-cat:hover .duah-cat-arrow { transform: translateX(3px); color: #0d9488; }
[dir="rtl"] .duah-cat-arrow { transform: scaleX(-1); }
[dir="rtl"] .duah-cat:hover .duah-cat-arrow { transform: scaleX(-1) translateX(3px); }
.duah-cat.duah-hide { display: none; }

/* ── Search results ───────────────────────────────────────────────────── */
.duah-results { margin-bottom: 22px; }
.duah-results-head { font-size: 13px; font-weight: 700; color: #64748b; margin: 0 0 10px; }
.duah-results-list { display: grid; gap: 10px; }
.duah-hit { display: block; padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid #e2e8f0; text-decoration: none; color: #0f172a;
  transition: border-color .2s, box-shadow .2s, transform .2s; animation: duahUp .35s cubic-bezier(.2, .8, .2, 1) both; }
.duah-hit:hover { border-color: #5eead4; box-shadow: 0 10px 24px -14px rgba(13, 148, 136, .5); transform: translateY(-1px); color: #0f172a; }
.duah-hit-title { font-weight: 800; font-size: 15px; }
.duah-hit-mean { font-size: 13.5px; color: #475569; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.duah-hit-cat { display: inline-block; margin-top: 7px; font-size: 11.5px; font-weight: 700; color: #0f766e; background: #f0fdfa; border-radius: 999px; padding: 2px 9px; }
.duah-hit mark { background: #fef3c7; color: inherit; border-radius: 3px; padding: 0 1px; }
.duah-results-none { padding: 26px; text-align: center; color: #64748b; background: #f8fafc; border-radius: 16px; border: 1px dashed #cbd5e1; }

/* ── A category's duas ────────────────────────────────────────────────── */
.duah-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: start; }
.duah-list { display: grid; gap: 18px; min-width: 0; }
.duah-card { position: relative; padding: 20px 22px 16px; border-radius: 22px; background: #fff; border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04); scroll-margin-top: 90px; transition: border-color .3s, box-shadow .3s; }
.duah-card:target, .duah-card.flash { animation: duahFlash 1.6s ease; }
@keyframes duahFlash { 0%, 40% { box-shadow: 0 0 0 4px rgba(250, 204, 21, .55); } 100% { box-shadow: 0 1px 2px rgba(15, 23, 42, .04); } }
.duah-card.playing { border-color: #14b8a6; box-shadow: 0 0 0 3px rgba(20, 184, 166, .16), 0 18px 34px -18px rgba(13, 148, 136, .55); }
.duah-card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.duah-num { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; font-weight: 800; font-size: 14px;
  color: #92400e; background: linear-gradient(145deg, #fef3c7, #fde68a); box-shadow: inset 0 0 0 1px rgba(217, 119, 6, .25); transform: rotate(-4deg); }
.duah-card-title { font-size: 17px; font-weight: 800; line-height: 1.4; margin: 5px 0 0; }
.duah-card-title a { color: #0f172a; text-decoration: none; }
.duah-card-title a:hover { color: #0f766e; }
.duah-ar { font-family: 'Scheherazade New', 'Amiri', serif; font-size: 28px; line-height: 2.05; color: #0f172a; text-align: center;
  padding: 16px 18px; margin: 4px 0 14px; border-radius: 16px; background: linear-gradient(180deg, #fbf7ec, #fffdf7);
  border: 1px solid #f3e8c8; word-spacing: 2px; }
.duah-block { margin-bottom: 12px; }
.duah-label { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: #94a3b8; margin-bottom: 3px; }
.duah-tr { margin: 0; font-size: 15.5px; line-height: 1.75; color: #0f766e; font-weight: 600; }
.duah-mean { margin: 0; font-size: 15.5px; line-height: 1.8; color: #334155; }
.duah-source { display: inline-flex; align-items: flex-start; gap: 7px; margin: 2px 0 10px; padding: 6px 11px; border-radius: 10px;
  background: #f8fafc; color: #64748b; font-size: 13px; line-height: 1.55; }
.duah-source svg { flex: none; margin-top: 3px; color: #0d9488; }
.duah-benefit { margin: 4px 0 12px; border-radius: 14px; background: #fffbeb; border: 1px solid #fde68a; overflow: hidden; }
.duah-benefit summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 800;
  font-size: 14px; color: #92400e; user-select: none; }
.duah-benefit summary::-webkit-details-marker { display: none; }
.duah-benefit summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .3s; }
[dir="rtl"] .duah-benefit summary::after { margin-left: 0; margin-right: auto; }
.duah-benefit[open] summary::after { transform: rotate(225deg); }
.duah-benefit summary svg { color: #d97706; }
.duah-benefit-body { padding: 0 16px 14px; font-size: 14.5px; line-height: 1.8; color: #44403c; }
.duah-benefit[open] .duah-benefit-body { animation: duahUnfold .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes duahUnfold { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.duah-benefit-body p { margin: 0 0 8px; }
.duah-ref { font-size: 13px; color: #78716c; }
.duah-ref span { font-weight: 700; }

.duah-actions { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px dashed #e2e8f0; }
.duah-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 999px; border: 0; font-size: 13.5px; font-weight: 700;
  cursor: pointer; transition: background .2s, color .2s, transform .15s, box-shadow .2s; }
.duah-btn:active { transform: scale(.95); }
.duah-play { color: #fff; background: linear-gradient(135deg, #14b8a6, #0f766e); box-shadow: 0 8px 18px -10px rgba(13, 148, 136, .8); }
.duah-play:hover { box-shadow: 0 10px 22px -10px rgba(13, 148, 136, .95); }
.duah-play .i-pause { display: none; }
.duah-card.playing .duah-play .i-play { display: none; }
.duah-card.playing .duah-play .i-pause { display: inline; }
.duah-card.playing .duah-play { animation: duahPulse 1.6s ease-out infinite; }
@keyframes duahPulse { 0% { box-shadow: 0 0 0 0 rgba(20, 184, 166, .5); } 100% { box-shadow: 0 0 0 12px rgba(20, 184, 166, 0); } }
.duah-card.loading .duah-play { opacity: .75; }
.duah-ghost { color: #475569; background: #f1f5f9; }
.duah-ghost:hover { color: #0f766e; background: #ccfbf1; }
.duah-progress { position: absolute; left: 0; right: 0; bottom: -10px; height: 3px; border-radius: 3px; background: transparent; overflow: hidden; }
.duah-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #14b8a6, #facc15); transition: width .25s linear; }
[dir="rtl"] .duah-progress span { margin-left: auto; }

.duah-intro { padding: 20px 22px; border-radius: 22px; color: #134e4a; scroll-margin-top: 90px;
  background: linear-gradient(160deg, #f0fdfa, #ecfeff 60%, #fff); border: 1px solid #99f6e4; }
.duah-intro-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: #0d9488; }
.duah-intro-title { font-size: 19px; font-weight: 800; margin: 6px 0 4px; color: #0f172a; }
.duah-intro-ar { font-family: 'Scheherazade New', 'Amiri', serif; font-size: 24px; line-height: 1.9; color: #0f766e; }
.duah-intro-text { margin: 6px 0 10px; font-size: 15px; line-height: 1.8; color: #334155; }
.duah-intro .duah-benefit { background: #fff; border-color: #ccfbf1; }
.duah-intro .duah-benefit summary { color: #0f766e; }
.duah-intro .duah-benefit summary svg { color: #14b8a6; }

.duah-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.duah-pager-link { display: flex; flex-direction: column; padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid #e2e8f0; text-decoration: none;
  color: #0f172a; transition: border-color .2s, transform .2s; }
.duah-pager-link:hover { border-color: #5eead4; transform: translateY(-2px); color: #0f172a; }
.duah-pager-link small { color: #94a3b8; font-weight: 700; font-size: 12px; }
.duah-pager-link span { font-weight: 800; font-size: 14.5px; }
.duah-pager-link.next { text-align: end; grid-column: 2; }

.duah-side { position: sticky; top: 84px; }
.duah-side-box { padding: 14px; border-radius: 20px; background: #fff; border: 1px solid #e2e8f0; }
.duah-side-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: #94a3b8; padding: 2px 6px 8px; }
.duah-side-list { display: grid; gap: 2px; max-height: calc(100vh - 170px); overflow-y: auto; scrollbar-width: thin; }
.duah-side-list a { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 11px; color: #334155; text-decoration: none; font-size: 13.5px; font-weight: 600;
  transition: background .2s, color .2s; }
.duah-side-list a:hover { background: #f0fdfa; color: #0f766e; }
.duah-side-list a.on { background: linear-gradient(135deg, #14b8a6, #0f766e); color: #fff; }
.duah-side-list img { flex: none; width: 24px; height: 24px; object-fit: contain; }
.duah-side-list span { flex: 1; min-width: 0; line-height: 1.35; }
.duah-side-list em { font-style: normal; font-size: 11.5px; font-weight: 800; opacity: .6; }

.duah-toast { position: fixed; left: 50%; bottom: 28px; z-index: 1080; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: 999px; background: #0f172a; color: #fff; font-weight: 700; font-size: 14px; transition: opacity .25s, transform .25s; }
.duah-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Cards rise into place as they scroll in (duah.js adds .duah-anim; without it they just show). */
.duah-anim .duah-rise { opacity: 0; transform: translateY(16px); }
.duah-anim .duah-rise.in { opacity: 1; transform: none; transition: opacity .55s cubic-bezier(.2, .8, .2, 1), transform .55s cubic-bezier(.2, .8, .2, 1);
  transition-delay: calc(var(--d, 0) * 1ms); }
@keyframes duahUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes duahFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes duahPop { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }

@media (max-width: 991.98px) {
  .duah-layout { grid-template-columns: 1fr; }
  .duah-side { position: static; }
  .duah-side-list { max-height: none; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 575.98px) {
  .duah-hero { padding: 28px 0 26px; }
  .duah-hero-ar { font-size: 28px; }
  .duah-hero-title { font-size: 24px; }
  .duah-hero-cat .duah-hero-title { font-size: 21px; }
  .duah-hero-pic { width: 62px; height: 62px; border-radius: 18px; }
  .duah-hero-pic img { width: 42px; height: 42px; }
  .duah-grid { grid-template-columns: 1fr; gap: 10px; }
  .duah-card, .duah-intro { padding: 16px 16px 14px; border-radius: 18px; }
  .duah-ar { font-size: 25px; padding: 12px 12px; }
  .duah-card-title { font-size: 16px; }
  .duah-pager { grid-template-columns: 1fr; }
  .duah-pager-link.next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .duah-hero *, .duah-cat, .duah-card, .duah-hit, .duah-play { animation: none !important; transition: none !important; }
  .duah-anim .duah-rise { opacity: 1; transform: none; }
}
