/* ==========================================================================
   IslamicApps.in — main stylesheet
   ========================================================================== */

:root {
    --bg: #f7f5ef;
    --surface: #ffffff;
    --surface-2: #f1eee5;
    --text: #10201b;
    --text-2: #2c3d37;
    --muted: #5d6d66;
    --border: #e6e1d5;
    --header-bg: rgba(247, 245, 239, .86);

    --primary: #0b6b4f;
    --primary-600: #085a42;
    --primary-700: #064634;
    --primary-50: #e4f2ec;

    --gold: #c9a14a;
    --gold-600: #a07a26;
    --gold-light: #f0d48c;
    --gold-50: #f8f0dc;

    --hero-1: #03241a;
    --hero-2: #0a4a37;
    --hero-3: #0f6149;

    --radius: 20px;
    --radius-sm: 12px;
    --radius-lg: 30px;
    --shadow-sm: 0 1px 2px rgba(16, 32, 27, .06), 0 1px 3px rgba(16, 32, 27, .08);
    --shadow: 0 14px 34px -14px rgba(8, 60, 44, .28);
    --shadow-lg: 0 30px 60px -20px rgba(4, 40, 29, .45);

    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-ar: 'Amiri', 'Traditional Arabic', serif;
    --header-h: 74px;

    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23e2c16f' stroke-opacity='.16' stroke-width='1'%3E%3Crect x='18' y='18' width='44' height='44'/%3E%3Cpath d='M40 9L71 40 40 71 9 40z'/%3E%3Ccircle cx='40' cy='40' r='9'/%3E%3Cpath d='M0 0L9 9M80 0L71 9M0 80L9 71M80 80L71 71'/%3E%3C/g%3E%3C/svg%3E");
    --pattern-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%230b6b4f' stroke-opacity='.07' stroke-width='1'%3E%3Crect x='18' y='18' width='44' height='44'/%3E%3Cpath d='M40 9L71 40 40 71 9 40z'/%3E%3Ccircle cx='40' cy='40' r='9'/%3E%3C/g%3E%3C/svg%3E");
}

[data-theme="dark"] {
    --bg: #0a1310;
    --surface: #101c18;
    --surface-2: #15241f;
    --text: #e7efea;
    --text-2: #c6d3cd;
    --muted: #93a79e;
    --border: #213530;
    --header-bg: rgba(10, 19, 16, .84);
    --primary: #2fb585;
    --primary-600: #25a075;
    --primary-700: #1b7f5c;
    --primary-50: rgba(47, 181, 133, .13);
    --gold-600: #e0bd66;
    --gold-50: rgba(224, 189, 102, .12);
    --shadow: 0 14px 34px -14px rgba(0, 0, 0, .6);
    --pattern-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23e2c16f' stroke-opacity='.05' stroke-width='1'%3E%3Crect x='18' y='18' width='44' height='44'/%3E%3Cpath d='M40 9L71 40 40 71 9 40z'/%3E%3Ccircle cx='40' cy='40' r='9'/%3E%3C/g%3E%3C/svg%3E");
    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color .3s, color .3s;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .2s; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.02em; font-weight: 800; color: var(--text); }
p { margin: 0 0 1em; }
button { font-family: inherit; }
.container { width: 100%; max-width: 1220px; margin: 0 auto; padding: 0 20px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 1000; }
.skip-link:focus { top: 8px; }
[lang="ar"] { font-family: var(--font-ar); direction: rtl; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .55em;
    padding: .8em 1.4em; border-radius: 999px; border: 2px solid transparent;
    font-weight: 700; font-size: .95rem; line-height: 1.2; cursor: pointer; white-space: nowrap;
    transition: transform .2s, box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 22px -10px rgba(11, 107, 79, .7); }
.btn-primary:hover { background: var(--primary-600); color: #fff; }
.btn-gold { background: linear-gradient(135deg, #f0d48c, #c9a14a); color: #221807; box-shadow: 0 12px 26px -12px rgba(201, 161, 74, .9); }
.btn-gold:hover { color: #221807; box-shadow: 0 16px 30px -12px rgba(201, 161, 74, 1); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost-light { color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.btn-play { background: #0f1f1a; color: #fff; }
.btn-play:hover { background: var(--primary); color: #fff; }
[data-theme="dark"] .btn-play { background: var(--primary-700); }
[data-theme="dark"] .btn-play:hover { background: var(--primary); }
.btn-sm { padding: .55em 1.05em; font-size: .85rem; }
.btn-lg { padding: 1em 1.7em; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ---------- Top bar & Header ---------- */
.topbar { background: linear-gradient(90deg, #a07a26, #c9a14a, #a07a26); color: #1d1405; text-align: center; font-size: .86rem; font-weight: 600; padding: .5em 1em; }
.site-header { position: sticky; top: 0; z-index: 100; transition: box-shadow .3s; }
.site-header::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: var(--header-bg); border-bottom: 1px solid transparent;
    -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
    transition: border-color .3s;
}
.site-header.scrolled { box-shadow: 0 8px 30px -18px rgba(0, 0, 0, .35); }
.site-header.scrolled::before { border-bottom-color: var(--border); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.28rem; letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand-mark { width: 42px; height: 42px; flex-shrink: 0; filter: drop-shadow(0 6px 10px rgba(5, 56, 42, .35)); }
.brand-text b { color: var(--primary); font-weight: 800; }
.brand-text small { color: var(--gold-600); font-size: .72em; font-weight: 700; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav > a { padding: .55em 1em; border-radius: 999px; color: var(--text-2); font-weight: 600; font-size: .95rem; }
.main-nav > a:hover { background: var(--primary-50); color: var(--primary); }
.main-nav > a.active { background: var(--primary); color: #fff; }
.nav-mobile-extra { display: none; }
.nav-actions { display: flex; align-items: center; gap: 8px; position: relative; z-index: 101; }
.icon-btn {
    width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1rem;
    transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.menu-toggle { display: none; }
.nav-overlay { position: fixed; inset: 0; background: rgba(2, 20, 14, .5); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 90; }

.search-drawer { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.search-drawer.open { max-height: 110px; }
.search-drawer-form { display: flex; align-items: center; gap: 10px; padding-top: 4px; padding-bottom: 16px; }
.search-drawer-form i { color: var(--muted); }
.search-drawer-form input {
    flex: 1; min-width: 0; border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
    border-radius: 999px; padding: .75em 1.2em; font: inherit; outline: none;
}
.search-drawer-form input:focus { border-color: var(--primary); }

@media (max-width: 1100px) {
    .menu-toggle { display: inline-grid; }
    .hide-sm { display: none !important; }
    .main-nav {
        position: fixed; top: 0; right: 0; bottom: 0; width: min(330px, 86vw);
        flex-direction: column; align-items: stretch; gap: 6px;
        padding: calc(var(--header-h) + 16px) 20px 28px;
        background: var(--surface); box-shadow: var(--shadow-lg);
        transform: translateX(105%); transition: transform .35s cubic-bezier(.2, .8, .2, 1);
        z-index: 95; overflow-y: auto;
    }
    .main-nav > a { padding: .9em 1.1em; font-size: 1.05rem; border-radius: 14px; }
    .nav-mobile-extra { display: flex; flex-direction: column; gap: 4px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border); }
    .nav-mobile-extra a:not(.btn) { color: var(--muted); padding: .5em 1.1em; font-size: .92rem; }
    .nav-mobile-extra .btn { margin-top: 10px; }
    body.nav-open { overflow: hidden; }
    body.nav-open .main-nav { transform: none; }
    body.nav-open .nav-overlay { opacity: 1; pointer-events: auto; }
}
@media (max-width: 400px) {
    .brand-text small { display: none; }
    .brand { font-size: 1.12rem; }
    .nav-actions { gap: 6px; }
    .icon-btn { width: 38px; height: 38px; }
}

/* ---------- Hero ---------- */
.hero {
    position: relative; overflow: hidden; color: #fff;
    padding: 64px 0 120px;
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(240, 212, 140, .22), transparent 60%),
        radial-gradient(700px 400px at -10% 110%, rgba(47, 181, 133, .18), transparent 60%),
        linear-gradient(160deg, var(--hero-1), var(--hero-2) 55%, var(--hero-3));
}
.hero::before {
    content: ""; position: absolute; inset: 0; background-image: var(--pattern);
    -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 95%); mask-image: linear-gradient(to bottom, #000 20%, transparent 95%);
}
.hero::after {
    content: ""; position: absolute; left: -5%; right: -5%; bottom: -1px; height: 80px;
    background: var(--bg); border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.12fr .88fr; gap: 48px; align-items: center; }
.bismillah { display: inline-block; font-family: var(--font-ar); font-size: clamp(1.5rem, 3vw, 2.1rem); color: var(--gold-light); margin-bottom: 14px; text-shadow: 0 0 30px rgba(240, 212, 140, .35); }
.eyebrow {
    display: inline-flex; align-items: center; gap: .55em; padding: .45em 1em; border-radius: 999px;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
    font-size: .84rem; font-weight: 600; color: #f4e6bf;
}
.eyebrow i { color: var(--gold-light); }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 5.2vw, 3.7rem); margin: 20px 0 16px; letter-spacing: -.03em; }
.hero h1 .accent { background: linear-gradient(90deg, #f7e0a0, #c9a14a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: clamp(1rem, 1.6vw, 1.15rem); color: rgba(255, 255, 255, .82); max-width: 560px; }
.hero-search {
    display: flex; align-items: center; background: #fff; border-radius: 999px; padding: 6px;
    max-width: 560px; margin: 28px 0 22px; box-shadow: 0 24px 44px -18px rgba(0, 0, 0, .55);
}
.hero-search > i { color: #7d8b85; padding: 0 4px 0 16px; }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #10201b; font: inherit; font-size: 1rem; padding: .75em .6em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 600px; margin-top: 40px; }
.hero-stat {
    text-align: center; padding: 14px 10px; border-radius: 18px;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hero-stat b { display: block; font-size: 1.45rem; color: var(--gold-light); line-height: 1.2; }
.hero-stat span { font-size: .78rem; color: rgba(255, 255, 255, .72); }

.hero-visual { position: relative; display: flex; justify-content: center; padding: 10px 30px; }
.arch {
    width: min(370px, 100%); aspect-ratio: 3 / 4; padding: 9px;
    border-radius: 200px 200px 34px 34px;
    background: linear-gradient(165deg, #f7e0a0, rgba(201, 161, 74, .35) 60%, rgba(201, 161, 74, .15));
    box-shadow: var(--shadow-lg), 0 0 80px -20px rgba(240, 212, 140, .35);
}
.arch-inner {
    position: relative; height: 100%; overflow: hidden;
    border-radius: 192px 192px 26px 26px;
    background: radial-gradient(circle at 50% 0%, #135a44, #062a1f 70%);
    display: flex; flex-direction: column; align-items: center; padding: 50px 22px 22px;
}
.arch-inner::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern); opacity: .9; }
.arch-moon { position: relative; font-size: 2.1rem; color: var(--gold-light); filter: drop-shadow(0 0 18px rgba(240, 212, 140, .7)); }
.arch-title { position: relative; font-size: 1.5rem; color: var(--gold-light); margin: 6px 0 18px; }
.arch-grid { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 10px; width: 100%; }
.arch-app { display: flex; flex-direction: column; align-items: center; gap: 7px; color: #fff; font-size: .72rem; font-weight: 600; text-align: center; line-height: 1.2; }
.arch-app .app-icon { width: 60px; height: 60px; border-radius: 17px; box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .6); }
.arch-app span:last-child { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.float-card {
    position: absolute; display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px;
    background: var(--surface); color: var(--text); border-radius: 18px; box-shadow: var(--shadow-lg);
    animation: float 6s ease-in-out infinite;
}
.float-card > i { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--gold-50); color: var(--gold-600); font-size: 1.05rem; }
.float-card b { display: block; font-size: .95rem; line-height: 1.2; }
.float-card small { color: var(--muted); font-size: .76rem; }
.fc-1 { left: -6px; top: 24%; }
.fc-2 { right: -6px; bottom: 14%; animation-delay: -3s; }
@keyframes float { 50% { transform: translateY(-12px); } }

@media (max-width: 980px) {
    .hero { padding: 48px 0 110px; }
    .hero-grid { grid-template-columns: 1fr; gap: 36px; text-align: center; }
    .hero-sub, .hero-search, .hero-stats { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
}
@media (max-width: 560px) {
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .hero-search { padding: 5px; }
    .hero-search > i { display: none; }
    .hero-search input { padding-left: 1em; }
    .hero-actions .btn { flex: 1 1 100%; }
    .hero-visual { padding: 0; }
    .arch { width: min(300px, 88%); }
    .arch-inner { padding-top: 40px; }
    .arch-app .app-icon { width: 50px; height: 50px; border-radius: 14px; }
    .float-card { padding: 8px 12px 8px 8px; }
    .float-card > i { width: 34px; height: 34px; }
    .float-card small { display: none; }
    .fc-1 { left: 0; top: 12%; }
    .fc-2 { right: 0; bottom: 8%; }
}

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-sm { padding: 48px 0; }
.section-alt { background: var(--surface-2); }
.pattern-soft { background-image: var(--pattern-dark); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 38px; }
.section-head.center { flex-direction: column; align-items: center; text-align: center; }
.section-head.center .section-desc { margin: 0 auto; }
.kicker { display: inline-flex; align-items: center; gap: .6em; color: var(--gold-600); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 10px; }
.kicker::before, .section-head.center .kicker::after { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }
.section-title { font-size: clamp(1.7rem, 3.4vw, 2.55rem); margin-bottom: .35em; }
.section-desc { color: var(--muted); max-width: 620px; margin: 0; }
@media (max-width: 600px) {
    .section { padding: 60px 0; }
    .section-sm { padding: 36px 0; }
    .section-head { margin-bottom: 28px; }
}

/* ---------- Language chips ---------- */
.lang-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.lang-chip {
    display: inline-flex; align-items: center; gap: 12px; padding: 8px 20px 8px 8px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--text);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.lang-chip:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow); color: var(--text); }
.lang-glyph {
    width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-700)); color: var(--gold-light);
    font-size: 1.15rem; font-weight: 700;
}
.lang-names { display: flex; flex-direction: column; line-height: 1.25; }
.lang-names b { font-size: .98rem; }
.lang-names small { color: var(--muted); font-size: .76rem; }
@media (max-width: 560px) {
    .lang-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .lang-chip { padding-right: 10px; border-radius: 18px; }
    .lang-glyph { width: 38px; height: 38px; font-size: 1rem; }
}

/* ---------- Feature cards (every app includes these) ---------- */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.feat-card {
    position: relative; overflow: hidden; display: flex; gap: 16px; align-items: flex-start; padding: 22px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
    transition: transform .25s, box-shadow .25s, border-color .25s;
}
.feat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.feat-icon {
    width: 50px; height: 50px; flex-shrink: 0; border-radius: 15px; display: grid; place-items: center;
    font-size: 1.2rem; color: var(--gold-light);
    background: linear-gradient(135deg, var(--primary), var(--primary-700));
    box-shadow: 0 12px 22px -12px rgba(11, 107, 79, .8);
}
.feat-card h3 { font-size: 1.02rem; margin: 2px 0 4px; }
.feat-card p { color: var(--muted); font-size: .88rem; margin: 0; }
.card .feat-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.card .feat-card { padding: 16px; background: var(--surface-2); border-color: transparent; }
.card .feat-icon { width: 42px; height: 42px; font-size: 1rem; border-radius: 12px; }
@media (max-width: 560px) {
    .feat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .feat-card { flex-direction: column; gap: 10px; padding: 16px 14px; }
    .feat-card p { font-size: .8rem; }
    .feat-icon { width: 42px; height: 42px; font-size: 1rem; }
    .card .feat-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- App cards ---------- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 22px; }
.app-card {
    position: relative; display: flex; flex-direction: column; padding: 20px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    transition: transform .25s, box-shadow .25s, border-color .25s;
}
.app-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.app-card-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.app-card-top { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.app-card-meta { min-width: 0; }
.app-icon {
    width: 68px; height: 68px; border-radius: 18px; object-fit: cover; flex-shrink: 0;
    background: var(--surface-2); box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .35);
}
.icon-fallback { display: grid; place-items: center; color: #f7e0a0; font-weight: 800; font-size: 1.7rem; line-height: 1; }
.ifb-0 { background: linear-gradient(135deg, #0f7a5a, #03241a); }
.ifb-1 { background: linear-gradient(135deg, #1d4e89, #0b213d); }
.ifb-2 { background: linear-gradient(135deg, #8a5a14, #3b2405); }
.ifb-3 { background: linear-gradient(135deg, #6b2d6b, #2a0f2a); }
.ifb-4 { background: linear-gradient(135deg, #0e6d73, #04292c); }
.ifb-5 { background: linear-gradient(135deg, #7a2e2e, #2e0f0f); }
.app-title { font-size: 1.03rem; line-height: 1.3; margin: 0 0 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-dev { font-size: .8rem; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge { display: inline-flex; align-items: center; gap: .35em; font-size: .7rem; font-weight: 700; padding: .3em .7em; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge-lang { background: var(--primary-50); color: var(--primary); }
.badge-gold { background: var(--gold-50); color: var(--gold-600); }
.app-desc { flex: 1; font-size: .9rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 14px; }
.app-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .84rem; color: var(--muted); padding-top: 12px; margin-bottom: 14px; border-top: 1px dashed var(--border); }
.app-stats i { margin-right: 3px; }
.app-stats .rating { color: var(--text); font-weight: 700; }
.rating i, .stars i { color: #f5a524; }
.app-card .btn { position: relative; z-index: 2; }
@media (max-width: 600px) {
    .app-grid { grid-template-columns: 1fr; gap: 14px; }
    .app-card { padding: 16px; }
    .app-icon { width: 60px; height: 60px; border-radius: 16px; }
}

/* ---------- Tabs ---------- */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.tab-btn { border: 0; background: transparent; color: var(--muted); padding: .6em 1.15em; border-radius: 999px; font-weight: 700; font-size: .9rem; cursor: pointer; transition: background .2s, color .2s; }
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { background: var(--primary); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .45s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Ayah / CTA ---------- */
.ayah, .cta-band {
    position: relative; overflow: hidden; color: #fff; border-radius: var(--radius-lg);
    background: radial-gradient(600px 300px at 90% 0%, rgba(240, 212, 140, .2), transparent 60%), linear-gradient(135deg, var(--hero-1), var(--hero-3));
    box-shadow: var(--shadow-lg);
}
.ayah::before, .cta-band::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern); }
.ayah { padding: clamp(40px, 6vw, 64px) clamp(20px, 5vw, 48px); text-align: center; }
.ayah > * { position: relative; }
.ayah .arabic { font-family: var(--font-ar); font-size: clamp(1.6rem, 4.2vw, 2.7rem); line-height: 1.9; color: var(--gold-light); }
.ayah p { font-size: clamp(1rem, 1.8vw, 1.18rem); color: rgba(255, 255, 255, .86); max-width: 720px; margin: 12px auto 8px; font-style: italic; }
.ayah cite { font-style: normal; font-weight: 700; font-size: .9rem; color: var(--gold-light); }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; padding: clamp(32px, 5vw, 56px); }
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.cta-band p { color: rgba(255, 255, 255, .8); margin: 0; max-width: 560px; }
@media (max-width: 700px) { .cta-band { flex-direction: column; text-align: center; } }

.gp-badge {
    display: inline-flex; align-items: center; gap: 12px; padding: 11px 24px 11px 18px;
    background: #000; color: #fff; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .25);
    box-shadow: 0 14px 28px -12px rgba(0, 0, 0, .6); transition: transform .2s;
}
.gp-badge:hover { transform: translateY(-2px); color: #fff; }
.gp-badge i { font-size: 1.9rem; background: linear-gradient(135deg, #00d7fe, #00f076 40%, #ffd500 70%, #ff3a44); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gp-badge small { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; opacity: .85; line-height: 1.2; }
.gp-badge b { display: block; font-size: 1.25rem; line-height: 1.15; }

/* ---------- Features & FAQ ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature { padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: transform .25s, box-shadow .25s; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature > i { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.3rem; background: var(--gold-50); color: var(--gold-600); margin-bottom: 18px; }
.feature h3 { font-size: 1.12rem; }
.feature p { color: var(--muted); font-size: .94rem; margin: 0; }

.faq { max-width: 840px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 0 22px; transition: box-shadow .2s; }
.faq details[open] { box-shadow: var(--shadow); border-color: transparent; }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-size: 1.3rem; font-weight: 600; transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 18px; margin: 0; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
    position: relative; overflow: hidden; text-align: center; color: #fff; padding: 58px 0 86px;
    background: radial-gradient(800px 400px at 80% -20%, rgba(240, 212, 140, .2), transparent 60%), linear-gradient(160deg, var(--hero-1), var(--hero-2) 60%, var(--hero-3));
}
.page-hero::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern); }
.page-hero::after { content: ""; position: absolute; left: -5%; right: -5%; bottom: -1px; height: 44px; background: var(--bg); border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.page-hero > .container { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; font-size: clamp(1.9rem, 4.4vw, 3rem); margin-bottom: 10px; }
.page-hero p { color: rgba(255, 255, 255, .8); max-width: 660px; margin: 0 auto; }
.breadcrumb { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: .85rem; color: rgba(255, 255, 255, .65); margin-bottom: 14px; }
.breadcrumb a { color: var(--gold-light); }
.breadcrumb i { font-size: .65rem; align-self: center; }

/* ---------- Apps listing ---------- */
.apps-layout { display: grid; grid-template-columns: 270px 1fr; gap: 32px; align-items: start; }
.filter-panel { position: sticky; top: calc(var(--header-h) + 20px); padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto; }
.filter-panel h4 { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 20px 0 8px; }
.filter-panel h4:first-child { margin-top: 0; }
.filter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.filter-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: .5em .75em; border-radius: 10px; color: var(--text-2); font-size: .92rem; }
.filter-list a:hover { background: var(--surface-2); color: var(--primary); }
.filter-list a.active { background: var(--primary-50); color: var(--primary); font-weight: 700; }
.filter-list a i { width: 18px; text-align: center; color: var(--muted); margin-right: 6px; }
.filter-list a.active i { color: var(--primary); }
.filter-list .count { font-size: .74rem; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: .1em .6em; border-radius: 999px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.toolbar-form { display: flex; flex-wrap: wrap; gap: 10px; flex: 1; }
.search-inline { position: relative; flex: 1; min-width: 200px; max-width: 440px; }
.search-inline i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-inline input { padding-left: 42px; border-radius: 999px; }
.result-info { color: var(--muted); font-size: .92rem; margin: 0; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: .4em .5em .4em 1em; border-radius: 999px; background: var(--primary-50); color: var(--primary); font-size: .85rem; font-weight: 700; }
.chip a { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-size: .7rem; }
.filter-toggle { display: none; }
@media (max-width: 920px) {
    .apps-layout { grid-template-columns: 1fr; }
    .filter-panel { position: static; display: none; max-height: none; }
    .filter-panel.open { display: block; animation: fadeUp .3s ease; }
    .filter-toggle { display: inline-flex; }
}

.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 44px; }
.pagination a, .pagination span { min-width: 44px; height: 44px; padding: 0 12px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .dots { border: 0; background: transparent; }

.empty { text-align: center; padding: 60px 20px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty > i { font-size: 2.6rem; color: var(--gold); margin-bottom: 14px; }
.empty p { color: var(--muted); }

/* ---------- App details ---------- */
.app-hero { position: relative; padding: 40px 0 36px; background: var(--surface); border-bottom: 1px solid var(--border); background-image: var(--pattern-dark); }
.app-hero .breadcrumb { justify-content: flex-start; color: var(--muted); }
.app-hero .breadcrumb a { color: var(--primary); }
.app-head { display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; }
.app-head .app-icon { width: 132px; height: 132px; border-radius: 32px; font-size: 3rem; box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .55); }
.app-head h1 { font-size: clamp(1.6rem, 3.6vw, 2.5rem); margin-bottom: 6px; }
.app-head .dev { color: var(--primary); font-weight: 700; margin-bottom: 10px; display: inline-block; }
.app-head .badges { margin-top: 0; }
.app-head .badge { font-size: .78rem; padding: .35em .85em; }
.head-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.head-cta small { color: var(--muted); font-size: .78rem; }
.app-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-top: 30px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fact { padding: 16px 12px; text-align: center; border-right: 1px solid var(--border); }
.fact:last-child { border-right: 0; }
.fact b { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 1.15rem; }
.fact span { font-size: .78rem; color: var(--muted); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 30px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(20px, 3vw, 30px); }
.card + .card { margin-top: 24px; }
.card h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 10px; }
.card h2 i { color: var(--gold-600); font-size: 1.1rem; }
.shots { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; scrollbar-width: thin; }
.shots img { height: 400px; width: auto; flex-shrink: 0; border-radius: 18px; border: 1px solid var(--border); scroll-snap-align: start; cursor: zoom-in; background: var(--surface-2); }
.description { color: var(--text-2); }
.check-list { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 8px; }
.check-list li { position: relative; padding-left: 30px; }
.check-list li::before { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .65rem; background: var(--primary-50); color: var(--primary); }
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.info-list li:last-child { border-bottom: 0; }
.info-list span { color: var(--muted); }
.info-list b { text-align: right; word-break: break-word; }
.share { display: flex; flex-wrap: wrap; gap: 8px; }
.share a, .share button { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; border: 0; color: #fff; cursor: pointer; font-size: 1.05rem; transition: transform .2s; }
.share a:hover, .share button:hover { transform: translateY(-3px); color: #fff; }
.s-wa { background: #25d366; } .s-fb { background: #1877f2; } .s-x { background: #111; } .s-tg { background: #229ed9; } .s-copy { background: var(--primary); }
.sticky-side { position: sticky; top: calc(var(--header-h) + 20px); }
.mobile-dl { display: none; }
@media (max-width: 980px) {
    .detail-layout { grid-template-columns: minmax(0, 1fr); }
    .sticky-side { position: static; }
    .app-head { grid-template-columns: auto 1fr; }
    .head-cta { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 600px) {
    .app-hero .breadcrumb { justify-content: center; }
    .app-head { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 16px; }
    .app-head .badges { justify-content: center; }
    .app-head .app-icon { width: 108px; height: 108px; border-radius: 28px; }
    .head-cta { justify-content: center; }
    .app-facts { grid-template-columns: repeat(2, 1fr); }
    .fact:nth-child(2n) { border-right: 0; }
    .fact { border-bottom: 1px solid var(--border); }
    .shots img { height: 320px; }
    .mobile-dl {
        display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 120;
        padding: 10px; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border);
        border-radius: 18px; box-shadow: var(--shadow-lg);
    }
    .mobile-dl .app-icon { width: 44px; height: 44px; border-radius: 12px; font-size: 1.2rem; }
    .mobile-dl b { flex: 1; font-size: .9rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    body.has-mobile-dl { padding-bottom: 80px; }
    body.has-mobile-dl .to-top { bottom: 92px; }
}

/* ---------- Prose / legal ---------- */
.legal-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 20px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.toc h4 { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: .9rem; }
.toc a { color: var(--text-2); }
.toc a:hover { color: var(--primary); }
.prose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(22px, 4.5vw, 50px); }
.prose h2 { font-size: 1.32rem; margin: 1.9em 0 .6em; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h2:first-of-type { margin-top: .6em; }
.prose h3 { font-size: 1.08rem; margin-top: 1.4em; }
.prose p, .prose li { color: var(--text-2); }
.prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: .45em; }
.updated { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; color: var(--gold-600); background: var(--gold-50); padding: .45em 1em; border-radius: 999px; }
.note { padding: 16px 20px; border-radius: 14px; background: var(--primary-50); color: var(--text-2); border-left: 4px solid var(--primary); margin: 1.2em 0; }
@media (max-width: 920px) { .legal-layout { grid-template-columns: 1fr; } .toc { position: static; } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.about-visual { position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 380px; display: grid; place-items: center; text-align: center; padding: 40px; color: #fff; background: linear-gradient(160deg, var(--hero-1), var(--hero-3)); box-shadow: var(--shadow-lg); }
.about-visual::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern); }
.about-visual > * { position: relative; }
.about-visual .arabic { font-family: var(--font-ar); font-size: clamp(1.6rem, 3.6vw, 2.4rem); color: var(--gold-light); line-height: 1.9; }
.about-visual p { color: rgba(255, 255, 255, .85); font-style: italic; margin: 10px 0 6px; }
.about-visual cite { color: var(--gold-light); font-style: normal; font-weight: 700; font-size: .88rem; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 16px; text-align: center; }
.stat-box b { display: block; font-size: 2rem; color: var(--primary); line-height: 1.2; }
.stat-box span { color: var(--muted); font-size: .9rem; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } .stats-row { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Forms & contact ---------- */
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 28px; align-items: start; }
.contact-info { display: grid; gap: 14px; }
.contact-item { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.contact-item > i { width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--primary-700)); color: var(--gold-light); font-size: 1.1rem; }
.contact-item h3 { font-size: 1rem; margin-bottom: 2px; }
.contact-item p, .contact-item a { margin: 0; color: var(--muted); font-size: .93rem; word-break: break-word; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: .88rem; }
.input, .field input, .field select, .field textarea {
    width: 100%; padding: .8em 1em; border: 1.5px solid var(--border); border-radius: 12px;
    background: var(--bg); color: var(--text); font: inherit; outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.field textarea { min-height: 150px; resize: vertical; }
select.input { cursor: pointer; padding-right: 2.2em; }
.hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 14px 18px; border-radius: 14px; margin-bottom: 20px; font-weight: 600; font-size: .95rem; }
.alert i { margin-top: 3px; }
.alert-success { background: #e5f5ed; color: #0b6b4f; border: 1px solid #bfe5d1; }
.alert-error { background: #fdecec; color: #b42318; border: 1px solid #f6c8c4; }
[data-theme="dark"] .alert-success { background: rgba(47, 181, 133, .12); color: #7fdcb6; border-color: rgba(47, 181, 133, .3); }
[data-theme="dark"] .alert-error { background: rgba(244, 67, 54, .12); color: #ff9c92; border-color: rgba(244, 67, 54, .3); }
@media (max-width: 860px) { .contact-grid, .form-grid { grid-template-columns: 1fr; } }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 90px 0; }
.notfound .big { font-size: clamp(5rem, 16vw, 9rem); font-weight: 800; line-height: 1; background: linear-gradient(135deg, var(--primary), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Footer ---------- */
.site-footer { position: relative; overflow: hidden; margin-top: 40px; padding-top: 72px; background: #03201a; color: rgba(255, 255, 255, .7); font-size: .94rem; }
.site-footer::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern); opacity: .55; }
.footer-grid { position: relative; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.3fr; gap: 36px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 18px; }
.site-footer a { color: rgba(255, 255, 255, .72); }
.site-footer a:hover { color: var(--gold-light); }
.site-footer .brand, .site-footer .brand:hover { color: #fff; margin-bottom: 16px; }
.site-footer .brand-text b { color: #5fd3a6; }
.site-footer .brand-text small { color: var(--gold-light); }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.contact-lines li { display: flex; gap: 10px; align-items: baseline; word-break: break-word; }
.contact-lines i { color: var(--gold-light); width: 16px; }
.footer-contact .btn { margin-top: 18px; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.socials a { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: #fff; transition: background .2s, color .2s, transform .2s; }
.socials a:hover { background: var(--gold-light); color: #1d1405; transform: translateY(-3px); }
.footer-bottom { position: relative; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 56px; padding-top: 22px; padding-bottom: 22px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .86rem; }
@media (max-width: 1020px) { .footer-grid { grid-template-columns: 1fr 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }
@media (max-width: 640px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
    .footer-contact { grid-column: 1 / -1; }
    .footer-bottom { justify-content: center; text-align: center; }
}

/* ---------- Widgets ---------- */
.cookie {
    position: fixed; left: 16px; bottom: 16px; z-index: 200; max-width: 460px;
    display: none; align-items: center; gap: 14px; padding: 14px 16px;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg);
}
.cookie.show { display: flex; animation: fadeUp .4s ease; }
.cookie > i { font-size: 1.5rem; color: var(--gold); }
.cookie p { margin: 0; font-size: .86rem; color: var(--muted); }
@media (max-width: 520px) { .cookie { right: 12px; left: 12px; bottom: 12px; flex-wrap: wrap; } .cookie .btn { width: 100%; } }
.to-top {
    position: fixed; right: 18px; bottom: 18px; z-index: 150; width: 48px; height: 48px; border-radius: 50%; border: 0;
    display: grid; place-items: center; cursor: pointer; background: var(--primary); color: #fff; box-shadow: var(--shadow);
    opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .3s, transform .3s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 400; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
    background: #0f1f1a; color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: .92rem; transition: opacity .3s, transform .3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.lightbox { position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(0, 0, 0, .9); cursor: zoom-out; }
.lightbox.open { display: flex; animation: fadeUp .25s ease; }
.lightbox img { max-height: 90vh; max-width: 100%; width: auto; border-radius: 18px; }
.lightbox .close { position: absolute; top: 16px; right: 16px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 1.2rem; cursor: pointer; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Website language: top-bar switcher ---------- */
.lang-switch { position: relative; }
.lang-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer;
    transition: border-color .2s, color .2s;
}
.lang-btn:hover, .lang-switch.open .lang-btn { border-color: var(--primary); color: var(--primary); }
.lang-btn .fa-globe { color: var(--primary); }
.lang-btn .caret { font-size: .65rem; opacity: .6; transition: transform .2s; }
.lang-switch.open .caret { transform: rotate(180deg); }
.lang-menu {
    position: absolute; top: calc(100% + 10px); inset-inline-end: 0; width: 240px; max-height: min(70vh, 460px); overflow-y: auto;
    padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s, transform .2s, visibility .2s; z-index: 130;
}
.lang-switch.open .lang-menu { opacity: 1; visibility: visible; transform: none; }
.lang-menu a { display: flex; align-items: center; gap: 10px; padding: .6em .8em; border-radius: 10px; color: var(--text); }
.lang-menu a:hover { background: var(--primary-50); color: var(--primary); }
.lang-menu a.active { background: var(--primary-50); color: var(--primary); }
.lang-menu b { font-weight: 700; }
.lang-menu small { color: var(--muted); font-size: .78rem; }
.lang-menu .fa-check { margin-inline-start: auto; }
@media (max-width: 1180px) { .nav-actions .btn.hide-sm { display: none; } }
@media (max-width: 560px) {
    .lang-btn { padding: 0 11px; gap: 6px; height: 38px; }
    .lang-btn .caret { display: none; }
    .lang-btn span { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 400px) { .lang-btn span { display: none; } }

/* ---------- First-visit language picker ---------- */
body.modal-open { overflow: hidden; }
.lang-modal {
    position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 16px;
    background: rgba(2, 20, 14, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.lang-modal-box {
    width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 30px 26px 26px;
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.lang-modal-head { text-align: center; margin-bottom: 20px; }
.lang-modal-head .brand-mark { width: 54px; height: 54px; margin-bottom: 10px; }
.lang-modal-head h2 { font-size: 1.5rem; margin: 0 0 6px; }
.lang-modal-head p { color: var(--muted); margin: 0; font-size: .95rem; }
.lang-modal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.lang-modal-grid a {
    display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px;
    border: 1.5px solid var(--border); background: var(--bg); color: var(--text); transition: border-color .2s, transform .2s, background .2s;
}
.lang-modal-grid a:hover { border-color: var(--primary); background: var(--primary-50); transform: translateY(-2px); color: var(--text); }
.lang-modal-grid b { font-size: 1.12rem; }
.lang-modal-grid small { color: var(--muted); font-size: .8rem; }
@media (max-width: 480px) { .lang-modal-grid { grid-template-columns: 1fr 1fr; } .lang-modal-box { padding: 24px 16px 18px; } }

/* ---------- Right-to-left languages (Urdu, Arabic) ---------- */
[lang="ur"] body { font-family: 'Plus Jakarta Sans', 'Noto Nastaliq Urdu', system-ui, sans-serif; line-height: 2; }
[lang="ur"] h1, [lang="ur"] h2, [lang="ur"] h3 { line-height: 1.9; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
[dir="rtl"] .breadcrumb .fa-chevron-right { transform: scaleX(-1); }
[dir="rtl"] .search-inline i { left: auto; right: 16px; }
[dir="rtl"] .search-inline input { padding-left: 1em; padding-right: 42px; }
[dir="rtl"] .fact { border-right: 0; border-left: 1px solid var(--border); }
[dir="rtl"] .fact:last-child { border-left: 0; }
[dir="rtl"] .check-list li { padding-left: 0; padding-right: 30px; }
[dir="rtl"] .check-list li::before { left: auto; right: 0; }
[dir="rtl"] .info-list b { text-align: left; }
[dir="rtl"] .filter-list a i { margin-right: 0; margin-left: 6px; }
[dir="rtl"] .app-stats i { margin-right: 0; margin-left: 3px; }
[dir="rtl"] .note { border-left: 0; border-right: 4px solid var(--primary); }
[dir="rtl"] .toc ol, [dir="rtl"] .prose ul { padding-left: 0; padding-right: 1.2em; }
@media (max-width: 1100px) {
    [dir="rtl"] .main-nav { right: auto; left: 0; transform: translateX(-105%); }
    [dir="rtl"] body.nav-open .main-nav { transform: none; }
}

/* ---------- Donate ---------- */
.donate-btn span { white-space: nowrap; }
@media (max-width: 1180px) { .donate-btn span { display: none; } .donate-btn { width: 42px; height: 42px; padding: 0; justify-content: center; border-radius: 50%; } }
@media (max-width: 400px) { .donate-btn { width: 38px; height: 38px; } }
.donate-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .donate-grid { grid-template-columns: minmax(0, 1fr); } }
.donate-card h2, .donate-side h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.donate-card h2 i, .donate-side h2 i { color: var(--gold-600); }
.amount-input { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.amount-input span { padding: 0 14px; font-weight: 800; color: var(--muted); }
.amount-input input { border: 0 !important; box-shadow: none !important; background: transparent !important; font-size: 1.6rem; font-weight: 800; padding: .55em 0; padding-inline-start: 0; }
.amount-input span { font-size: 1.4rem; }
.amount-field { margin-top: 6px; }
.amount-field small { color: var(--muted); font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.amount-input:focus-within { border-color: var(--primary); }
.check-line { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; font-weight: 600; cursor: pointer; }
.check-line input { width: 18px; height: 18px; accent-color: var(--primary); }
.donate-secure { margin: 12px 0 0; font-size: .85rem; color: var(--muted); text-align: center; }
.donate-secure i { color: var(--primary); }
#donateBtn:disabled { opacity: .7; cursor: wait; }
.donate-done { text-align: center; padding: 24px 8px; display: grid; gap: 10px; justify-items: center; }
.donate-done > i { font-size: 3.4rem; color: var(--primary); }
.donate-done h2 { justify-content: center; margin: 0; }
.donate-done p { font-size: 1.05rem; margin: 0; }
.donate-done code { word-break: break-all; }
.donate-side { display: grid; gap: 20px; }
.donate-hadith { padding: 26px 24px; }
.donate-hadith p { font-size: 1.05rem; }
.supporters { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.supporters li { display: flex; align-items: center; gap: 12px; }
.sup-avatar { width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-weight: 800; }
.sup-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-name small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.supporters b { color: var(--primary); }
.donate-card > form > .field { margin-bottom: 16px; }
.donate-card > form > .field > span { font-weight: 700; font-size: .88rem; }
.donate-card .form-grid { margin-bottom: 8px; }
.donate-card .field textarea { min-height: 90px; }

[hidden] { display: none !important; }
@media (max-width: 480px) { #searchToggle, .search-drawer { display: none; } }
.spotlight-note { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--gold-50); color: var(--text-2); font-size: .9rem; font-weight: 600; text-align: start; }
.spotlight-note i { color: var(--gold-600); margin-top: 3px; }

/* ---------- Donor spotlight ticker (last 24 hours) ---------- */
.donor-ticker { display: flex; align-items: center; overflow: hidden; background: #062e22; color: #f3e6c4; font-size: .86rem; height: 38px; }
.donor-ticker:hover { color: #fff; }
.ticker-label { flex-shrink: 0; display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 14px; background: linear-gradient(90deg, #a07a26, #c9a14a); color: #1d1405; font-weight: 800; z-index: 1; }
.ticker-track { display: flex; overflow: hidden; flex: 1; min-width: 0; mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.ticker-items { display: flex; flex-shrink: 0; gap: 34px; padding-inline-end: 34px; animation: ticker 40s linear infinite; white-space: nowrap; }
.donor-ticker:hover .ticker-items { animation-play-state: paused; }
.ticker-item b { color: #fff; }
.ticker-item em { font-style: normal; color: var(--gold-light); font-weight: 700; }
.ticker-item q { opacity: .9; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }
[dir="rtl"] .ticker-items { animation-name: ticker-rtl; }
@keyframes ticker-rtl { from { transform: translateX(0); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .ticker-items { animation: none; } .ticker-track { overflow-x: auto; } }
@media (max-width: 560px) { .ticker-label span, .ticker-label { font-size: .8rem; padding: 0 10px; } }
.amount-input select { align-self: stretch; border: 0; border-inline-start: 1.5px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 800; padding: 0 14px; cursor: pointer; outline: none; }
.amount-input input { min-width: 0; flex: 1 1 auto; width: auto !important; }
.amount-input select { flex: 0 0 auto; width: auto; }
.amount-field small { display: block; }
.cur-hint { margin-top: 4px; }
.cur-hint i { color: var(--primary); }
.app-field { margin-bottom: 16px; }
.app-field > span { font-weight: 700; font-size: .88rem; }
.app-field select { width: 100%; padding: .8em 1em; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; }

/* ---------- "More languages coming" support banner ---------- */
.support-banner { background: linear-gradient(90deg, #0a4a37, #0f6149); color: #f3efe2; border-bottom: 1px solid rgba(232, 198, 110, .25); }
.support-inner { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.support-inner > i { color: var(--gold-light); font-size: 1.2rem; flex-shrink: 0; }
.support-inner p { margin: 0; flex: 1; font-size: .9rem; font-weight: 600; line-height: 1.5; }
.support-inner .btn { flex-shrink: 0; }
.support-close { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; }
.support-close:hover { background: rgba(255, 255, 255, .2); }
@media (max-width: 600px) {
    .support-inner { flex-wrap: wrap; gap: 8px 10px; }
    .support-inner > i { display: none; }
    .support-inner p { flex-basis: calc(100% - 44px); font-size: .84rem; }
    .support-inner .btn { order: 3; }
}

/* ---------- Search tags ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tag-cloud.start { justify-content: flex-start; gap: 8px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; padding: .5em 1em; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: .88rem; font-weight: 600; transition: border-color .2s, color .2s, background .2s; }
.tag-chip i { color: var(--gold-600); font-size: .75em; }
.tag-chip:hover, .tag-chip.active { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.card .tag-chip { font-size: .8rem; padding: .4em .8em; }
.app-grid.few { grid-template-columns: repeat(auto-fit, minmax(280px, 380px)); justify-content: center; }
.lang-chip.soon { opacity: .75; }
.lang-chip.soon small { color: var(--gold-600); }
@media (max-width: 560px) { .hero-visual { display: none; } .hero { padding-bottom: 56px; } }
@media (max-width: 560px) { .feature { padding: 20px; } .feature > i { width: 44px; height: 44px; font-size: 1.1rem; margin-bottom: 12px; } .feature-grid { gap: 14px; } }
.feat-grid > *, .detail-layout > * { min-width: 0; }
@media (max-width: 560px) { .card .feat-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .feat-card h3 { overflow-wrap: anywhere; } }
@media (max-width: 560px) { .btn { white-space: normal; text-align: center; } .card > .btn-lg, .description + .btn-lg { width: 100%; justify-content: center; } }

/* Very small phones (320px): keep all header buttons on screen */
@media (max-width: 360px) {
    #themeToggle { display: none; }
    .nav-actions { gap: 5px; }
    .brand-mark { width: 36px; height: 36px; }
    .brand { gap: 8px; font-size: 1.05rem; }
}
.donate-grid > * { min-width: 0; }

/* ---------- Coming soon apps ---------- */
.soon-icon { position: relative; display: inline-block; flex-shrink: 0; border-radius: 18px; overflow: hidden; }
.soon-icon .app-icon { filter: blur(3px) saturate(.7); transform: scale(1.08); display: block; }
.soon-ribbon { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 2px; background: rgba(6, 46, 34, .85); color: var(--gold-light); font-size: .58rem; font-weight: 800; text-align: center; line-height: 1.2; letter-spacing: .02em; }
.app-card.soon { border-style: dashed; }
.app-card.soon .app-title { color: var(--text-2); }
.badge.badge-soon { background: var(--gold-50); color: var(--gold-600); }
.app-card.soon .btn { position: relative; z-index: 2; }
.arch-app.is-soon span:last-child { opacity: .75; }
.arch-app .soon-icon { border-radius: 17px; }
.arch-app .soon-ribbon { font-size: .5rem; }
