/* ============================================================
   REKHTA PDF DOWNLOADER — SHARED STYLES
   Includes: themes, layout, components, mobile fixes
   ============================================================ */

/* ========== CSS Variables & Themes ========== */
:root,
[data-theme="dark"] {
    --bg: #0b0f19;
    --surface: #131b2e;
    --surface-rgb: 19, 27, 46;
    --surface-card: #18233c;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --brand: #0284c7;
    --brand-light: #38bdf8;
    --brand-glow: rgba(2, 132, 199, 0.2);
    --accent: #f59e0b;
    --success: #10b981;
    --error: #ef4444;
    --card-bg: rgba(19, 27, 46, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --progress-bg: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(19, 27, 46, 0.9);
    --header-bg: rgba(11, 15, 25, 0.95);
    --badge-bg: rgba(2, 132, 199, 0.15);
    --quote-bg: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-rgb: 255, 255, 255;
    --surface-card: #f1f5f9;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --brand: #0284c7;
    --brand-light: #0ea5e9;
    --brand-glow: rgba(2, 132, 199, 0.12);
    --accent: #d97706;
    --success: #059669;
    --error: #dc2626;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --progress-bg: #e2e8f0;
    --nav-bg: rgba(255, 255, 255, 0.92);
    --header-bg: rgba(248, 250, 252, 0.95);
    --badge-bg: #e0f2fe;
    --quote-bg: #f8fafc;
}

[data-theme="sepia"] {
    --bg: #f5efe1;
    --surface: #ebdcc4;
    --surface-rgb: 235, 220, 196;
    --surface-card: #dfceb4;
    --border: #d4c2a7;
    --border-hover: #c4b093;
    --text: #3c2f21;
    --text-secondary: #5e4c3a;
    --text-muted: #85725d;
    --brand: #8a4b16;
    --brand-light: #b46b2b;
    --brand-glow: rgba(138, 75, 22, 0.15);
    --accent: #b45309;
    --success: #2e7d32;
    --error: #b91c1c;
    --card-bg: #eedfc7;
    --card-border: #d8c7ad;
    --progress-bg: #dacab0;
    --nav-bg: rgba(235, 220, 196, 0.94);
    --header-bg: rgba(245, 239, 225, 0.96);
    --badge-bg: rgba(138, 75, 22, 0.12);
    --quote-bg: rgba(138, 75, 22, 0.05);
}

@font-face {
    font-family: 'Alvi Nastaleeq';
    src: url('../fonts/Alvi-Nastaleeq-Regular.ttf') format('truetype'),
         url('../fonts/Alvi Nastaleeq Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; }

body {
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
    padding-top: 116px;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ========== Sticky Header ========== */
.app-header {
    position: fixed; top: 0; left: 0; width: 100%; height: 60px;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 1.5rem;
    transition: background 0.3s ease;
}

.header-brand {
    display: flex; align-items: center; gap: 0.6rem;
    text-decoration: none; color: var(--text); cursor: pointer;
}

.header-logo-icon {
    width: 34px; height: 34px; border-radius: 8px;
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
    display: flex; align-items: center; justify-content: center;
    color: #ffffff; font-size: 1.1rem;
    box-shadow: 0 2px 8px var(--brand-glow);
}

.header-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.3px; }

.header-badge {
    font-size: 0.7rem; font-weight: 600;
    padding: 0.15rem 0.5rem; border-radius: 20px;
    background: var(--badge-bg); color: var(--brand);
    text-transform: uppercase; letter-spacing: 0.5px;
}

.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.header-btn {
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-secondary); padding: 0.45rem 0.8rem;
    border-radius: 0.5rem; cursor: pointer;
    font-size: 0.85rem; font-weight: 600;
    display: inline-flex; align-items: center; gap: 0.4rem;
    transition: all 0.2s ease;
}

.header-btn:hover {
    background: var(--border); color: var(--text); transform: translateY(-1px);
}

/* ========== Secondary Nav ========== */
.secondary-nav {
    position: fixed; top: 60px; left: 0; width: 100%; height: 48px;
    z-index: 999; background: var(--nav-bg);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: flex-start; align-items: center;
    padding: 0 1rem; gap: 0.5rem;
    overflow-x: auto; white-space: nowrap;
    scrollbar-width: none; -ms-overflow-style: none;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.secondary-nav::-webkit-scrollbar { display: none; }

.secondary-nav.nav-hidden {
    transform: translateY(-100%); opacity: 0; pointer-events: none;
}

.nav-link {
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.88rem; font-weight: 500;
    padding: 0.35rem 0.7rem; border-radius: 6px;
    transition: all 0.2s ease; cursor: pointer;
    display: inline-flex; align-items: center; gap: 0.4rem;
    flex-shrink: 0; white-space: nowrap;
}

.nav-link:hover { color: var(--brand); background: var(--brand-glow); }
.nav-link.active { color: var(--brand); font-weight: 600; background: var(--brand-glow); }

/* ========== Layout ========== */
.app { max-width: 1080px; margin: 0 auto; padding: 1.5rem; }

/* ========== Hero ========== */
.hero {
    text-align: center; padding: 2.2rem 1.5rem 1.8rem;
    margin-bottom: 2rem;
    background: linear-gradient(180deg, var(--surface) 0%, transparent 100%);
    border: 1px solid var(--border); border-radius: 1.25rem;
    position: relative; overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.hero::before {
    content: ''; position: absolute; top: -50px; left: 50%;
    transform: translateX(-50%); width: 300px; height: 100px;
    background: radial-gradient(circle, var(--brand-glow) 0%, transparent 70%);
    z-index: 0; pointer-events: none;
}

.hero-pill {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: var(--badge-bg); color: var(--brand);
    font-size: 0.8rem; font-weight: 600;
    padding: 0.3rem 0.85rem; border-radius: 20px;
    margin-bottom: 1rem; border: 1px solid var(--border);
}

.hero h1 { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 0.6rem; line-height: 1.2; }
.hero p { color: var(--text-secondary); font-size: 1.05rem; max-width: 680px; margin: 0 auto 1.5rem; }

/* ========== Cards ========== */
.downloader-card,
.section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(12px);
}

.section { padding: 1.8rem; border-radius: 1.25rem; }

.card-header-title {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem;
}

.card-header-title h3 {
    font-size: 1.15rem; font-weight: 700;
    display: flex; align-items: center; gap: 0.5rem;
}

.section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.5rem;
}

.section-title { font-size: 1.35rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }

/* ========== Input ========== */
.input-group { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.input-wrapper { position: relative; flex: 1; min-width: 260px; display: flex; align-items: center; }
.input-wrapper i { position: absolute; left: 1rem; color: var(--text-muted); font-size: 1rem; }
[dir="rtl"] .input-wrapper i { left: auto; right: 1rem; }

.url-input {
    width: 100%; background: var(--surface);
    border: 1.5px solid var(--border); border-radius: 0.75rem;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    font-size: 0.95rem; color: var(--text);
    outline: none; transition: all 0.2s ease; font-family: inherit;
}

[dir="rtl"] .url-input { padding: 0.85rem 2.8rem 0.85rem 1rem; }
.url-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }

/* ========== Buttons ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5rem; padding: 0.8rem 1.4rem;
    border: none; border-radius: 0.75rem;
    font-weight: 600; font-size: 0.95rem;
    cursor: pointer; transition: all 0.2s ease;
    background: var(--brand); color: #ffffff;
    font-family: inherit; text-decoration: none; white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 15px var(--brand-glow); filter: brightness(1.05); }

.btn-outline { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--border); color: var(--text); box-shadow: none; }

.btn-accent { background: var(--accent); color: #1a1a1a; }
.btn-accent:hover { background: #d97706; color: #ffffff; }

/* ========== Preview Card ========== */
.preview-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 1rem; padding: 1.25rem; margin-top: 1.25rem;
    display: flex; gap: 1.5rem; align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.preview-card img {
    width: 100px; height: 140px; border-radius: 0.5rem;
    object-fit: cover; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); flex-shrink: 0;
}

.preview-details { flex: 1; }
.preview-details h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.3rem; font-family: 'Alvi Nastaleeq', 'Outfit', sans-serif !important; }
.preview-details .author { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 0.3rem; font-family: 'Alvi Nastaleeq', 'Outfit', sans-serif !important; }
.preview-details .meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.8rem; }

.btn-area { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

.progress-container { width: 100%; margin: 0.6rem 0; }
.progress-bar { height: 8px; background: var(--progress-bg); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-light)); width: 0%; transition: width 0.3s ease; }
.progress-text { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.3rem; font-weight: 500; }

/* ========== Storage Banner ========== */
.storage-banner {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: var(--surface); border-top: 1px solid var(--border);
    color: var(--text); z-index: 9998;
    padding: 0.65rem 1.2rem;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15); font-size: 0.9rem;
}

.storage-banner-content { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }

.banner-close-btn {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.4rem; cursor: pointer; padding: 0 0.4rem; line-height: 1;
}

.banner-close-btn:hover { color: var(--error); }

/* ========== Floating Buttons ========== */
.donate-float, .share-float, .scroll-top-btn {
    position: fixed; right: 1.5rem; z-index: 998;
    width: 46px; height: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: transform 0.2s ease;
    font-size: 1.2rem; color: #ffffff;
}

.donate-float { bottom: 5rem; background: #f59e0b; box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4); }
.share-float { bottom: 8.5rem; background: var(--brand); box-shadow: 0 4px 15px var(--brand-glow); }

.scroll-top-btn {
    bottom: 12rem; background: var(--surface);
    border: 1px solid var(--border); color: var(--text);
    font-size: 1.1rem; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0; transform: translateY(15px); pointer-events: none;
    transition: all 0.3s ease;
}

.scroll-top-btn.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.donate-float:hover, .share-float:hover { transform: scale(1.1); }

/* ========== Direct Scroll ========== */
.direct-scroll-container {
    display: flex; overflow-x: auto; gap: 1.2rem;
    padding: 0.5rem 0 1rem;
    scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}

.direct-scroll-container::-webkit-scrollbar { height: 6px; }
.direct-scroll-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ========== Book Card ========== */
.book-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 0.85rem; padding: 1rem;
    min-width: 190px; max-width: 210px;
    display: flex; flex-direction: column;
    position: relative; transition: all 0.25s ease;
    cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
}

.book-card:hover { transform: translateY(-4px); border-color: var(--brand); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); }

.book-card img {
    width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
    border-radius: 0.5rem; margin-bottom: 0.75rem; background: var(--surface-card);
}

.book-card .title {
    font-weight: 700; font-size: 0.95rem; line-height: 1.3;
    margin-bottom: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: 'Alvi Nastaleeq', 'Outfit', sans-serif !important;
    word-break: break-word; overflow-wrap: anywhere;
}

.book-card .meta {
    font-size: 0.8rem; color: var(--text-secondary);
    margin-bottom: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: 'Alvi Nastaleeq', 'Outfit', sans-serif !important;
}

.book-card .pages { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.6rem; }

.card-actions {
    position: absolute; top: 0.6rem; right: 0.6rem;
    display: flex; gap: 0.3rem; z-index: 2;
}

.card-action-btn {
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(var(--surface-rgb), 0.85);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; color: var(--text-secondary);
    cursor: pointer; transition: all 0.2s ease;
}

.card-action-btn:hover { color: var(--brand); background: var(--surface); transform: scale(1.1); }
.card-action-btn.bookmarked { color: #ef4444; }

/* ========== Library Grid ========== */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.25rem; margin: 1.5rem 0;
}

/* ========== Filters ========== */
.filters-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

.custom-select {
    appearance: none; -webkit-appearance: none;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 0.6rem; padding: 0.6rem 2.2rem 0.6rem 1rem;
    font-size: 0.9rem; color: var(--text); font-family: inherit; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.8rem center; background-size: 10px;
    min-width: 160px;
}

.custom-select:focus { border-color: var(--brand); outline: none; }

/* ========== Pagination ========== */
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 0.6rem; margin-top: 1.5rem; flex-wrap: wrap;
}

.page-input {
    width: 55px; text-align: center;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 0.5rem; padding: 0.4rem; color: var(--text); font-size: 0.9rem;
}

/* ========== Feature Cards ========== */
.grid-features {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem; margin-top: 1.25rem;
}

.feature-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 1rem; padding: 1.4rem; transition: all 0.25s ease;
}

.feature-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05); }

.feature-icon {
    width: 44px; height: 44px; border-radius: 10px;
    background: var(--badge-bg); color: var(--brand);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; margin-bottom: 1rem;
}

.feature-card h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.4rem; }
.feature-card p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; }

/* ========== Steps ========== */
.steps-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem; margin-top: 1.25rem;
}

.step-box {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 1rem; padding: 1.25rem; position: relative;
}

.step-num {
    display: inline-block; width: 28px; height: 28px;
    background: var(--brand); color: #ffffff;
    border-radius: 50%; text-align: center; line-height: 28px;
    font-weight: 700; font-size: 0.85rem; margin-bottom: 0.6rem;
}

.step-box h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.step-box p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.45; }

/* ========== FAQ ========== */
.faq-item {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 0.75rem; margin-bottom: 0.75rem;
    overflow: hidden; transition: border-color 0.2s ease;
}

.faq-header {
    padding: 1rem 1.25rem;
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; font-weight: 600; font-size: 0.95rem; user-select: none;
}

.faq-header i { transition: transform 0.3s ease; color: var(--text-muted); }

.faq-body {
    max-height: 0; overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), padding 0.35s ease;
    padding: 0 1.25rem; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6;
}

.faq-item.open .faq-header { color: var(--brand); }
.faq-item.open .faq-header i { transform: rotate(180deg); color: var(--brand); }
.faq-item.open .faq-body { max-height: 400px; padding: 0 1.25rem 1.25rem; }

/* ========== Blog ========== */
.blog-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.5rem; margin-top: 1.25rem;
}

.blog-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 1rem; overflow: hidden;
    display: flex; flex-direction: column;
    transition: all 0.25s ease; cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.blog-card:hover { transform: translateY(-4px); border-color: var(--brand); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08); }

.blog-card-header { padding: 1.25rem 1.25rem 0.5rem; }

.blog-badge {
    display: inline-block; font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    padding: 0.2rem 0.6rem; border-radius: 20px;
    background: var(--badge-bg); color: var(--brand); margin-bottom: 0.5rem;
}

.blog-card h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.35; margin-bottom: 0.4rem; color: var(--text); }
.blog-card-body { padding: 0 1.25rem 1.25rem; display: flex; flex-direction: column; flex: 1; }
.blog-card-excerpt { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.5; margin-bottom: 1rem; flex: 1; }

.blog-meta-footer {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.78rem; color: var(--text-muted);
    border-top: 1px solid var(--border); padding-top: 0.75rem;
}

.blog-read-link { color: var(--brand); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem; }

/* ========== Article Reader ========== */
.article-reader-container {
    max-width: 820px; margin: 0 auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 1.25rem; padding: 2.2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.article-header { margin-bottom: 1.8rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--border); }
.article-title { font-size: 2rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.4px; margin: 0.6rem 0; word-break: break-word; overflow-wrap: anywhere; }
.article-meta-row { display: flex; align-items: center; gap: 1.2rem; font-size: 0.85rem; color: var(--text-secondary); flex-wrap: wrap; }

.article-body-content { font-size: 1.05rem; line-height: 1.8; color: var(--text); }
.article-body-content p { margin-bottom: 1.4rem; }
.article-body-content h2, .article-body-content h3 { font-size: 1.4rem; font-weight: 700; margin: 2rem 0 0.8rem; color: var(--text); }
.article-body-content ul, .article-body-content ol { padding-left: 1.5rem; margin-bottom: 1.4rem; }
.article-body-content li { margin-bottom: 0.5rem; }

.article-body-content blockquote {
    background: var(--quote-bg); border-left: 4px solid var(--brand);
    padding: 1.2rem 1.5rem; margin: 1.5rem 0;
    border-radius: 0 0.75rem 0.75rem 0; font-style: italic;
}

[dir="rtl"] .article-body-content blockquote {
    border-left: none; border-right: 4px solid var(--brand);
    border-radius: 0.75rem 0 0 0.75rem;
}

.urdu-verse-box {
    background: var(--badge-bg); border: 1px dashed var(--brand);
    border-radius: 0.75rem; padding: 1.2rem; margin: 1.5rem 0;
    text-align: center;
    font-family: 'Alvi Nastaleeq', 'Outfit', sans-serif !important;
    font-size: 1.25rem; line-height: 2.2;
}

.article-action-box {
    background: var(--badge-bg); border: 1px solid var(--brand-glow);
    border-radius: 1rem; padding: 1.4rem; margin: 2.5rem 0 1rem;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
}

/* ========== Views ========== */
.view-section { display: none; animation: fadeIn 0.3s ease; }

/* ========== Authors ========== */
.authors-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem; margin: 1.5rem 0;
}

.author-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 0.75rem; padding: 1.2rem 1rem;
    text-align: center; cursor: pointer;
    transition: all 0.2s ease; font-weight: 600;
    font-family: 'Alvi Nastaleeq', 'Outfit', sans-serif !important;
}

.author-card:hover { transform: translateY(-3px); border-color: var(--brand); color: var(--brand); box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08); }

/* ========== Search ========== */
.search-bar-modern { max-width: 600px; margin: 0 auto 1.5rem; }

.search-dropdown {
    position: absolute; top: 100%; left: 0; width: 100%;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 0 0 0.75rem 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 100; max-height: 350px; overflow-y: auto;
}

.search-filter-chip {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 20px; padding: 0.35rem 0.9rem;
    font-size: 0.82rem; color: var(--text-secondary);
    cursor: pointer; transition: all 0.2s ease;
}

.search-filter-chip.active { background: var(--brand); color: #ffffff; border-color: var(--brand); }

/* ========== Modals ========== */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000; opacity: 0; visibility: hidden;
    transition: all 0.25s ease; padding: 1rem;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 1.25rem; padding: 1.8rem;
    max-width: 520px; width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative; max-height: 90vh; overflow-y: auto;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.large-modal { max-width: 620px; }

@keyframes modalPop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute; top: 1rem; right: 1.2rem;
    background: none; border: none; color: var(--text-muted);
    font-size: 1.5rem; cursor: pointer; line-height: 1; z-index: 10;
}

.modal-close:hover { color: var(--error); }
.modal h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.8rem; }

/* ========== Footer ========== */
.footer {
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 3.5rem 1.5rem 2rem; margin-top: 3.5rem;
}

.footer-content {
    max-width: 1080px; margin: 0 auto;
    display: grid; grid-template-columns: 1.2fr 1fr 1.3fr;
    gap: 2.5rem;
}

.footer-col h4 {
    font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem;
    letter-spacing: -0.2px; color: var(--text);
    display: flex; align-items: center; gap: 0.4rem;
}

.footer-col p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.65; }

.footer-links-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }

.footer-links-list a {
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.9rem; transition: all 0.2s ease;
    display: inline-flex; align-items: center; gap: 0.4rem;
}

.footer-links-list a:hover { color: var(--brand); transform: translateX(3px); }

.contact-form-box {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 1rem; padding: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.contact-form-group { margin-bottom: 0.75rem; }

.contact-form-group label {
    display: block; font-size: 0.8rem; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 0.25rem;
}

.contact-input {
    width: 100%; padding: 0.7rem 0.85rem;
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: 0.6rem; color: var(--text);
    font-family: inherit; font-size: 0.9rem;
    outline: none; transition: all 0.2s ease; display: block;
}

.contact-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }

.contact-submit-btn {
    width: 100%; padding: 0.75rem; font-size: 0.9rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
}

.footer-bottom {
    max-width: 1080px; margin: 2.5rem auto 0;
    padding-top: 1.5rem; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    color: var(--text-muted); font-size: 0.84rem; flex-wrap: wrap; gap: 0.8rem;
}

/* ============================================================
   STATIC PAGE STYLES
   ============================================================ */

.static-page-container {
    max-width: 820px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    padding: 2.2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(12px);
}

.static-page-container h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin-bottom: 0.6rem;
    line-height: 1.25;
}

.static-page-container .page-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.static-page-container h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 2.2rem 0 0.9rem;
    color: var(--text);
}

.static-page-container h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 1.6rem 0 0.6rem;
    color: var(--text);
}

.static-page-container p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1.2rem;
}

.static-page-container ul, .static-page-container ol {
    padding-left: 1.5rem;
    margin-bottom: 1.4rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.static-page-container li { margin-bottom: 0.5rem; }

.static-page-container a { color: var(--brand); text-decoration: underline; }
.static-page-container a:hover { color: var(--brand-light); }

.static-page-container strong { color: var(--text); }

.info-callout {
    background: var(--badge-bg);
    border-left: 4px solid var(--brand);
    border-radius: 0 0.75rem 0.75rem 0;
    padding: 1.2rem 1.4rem;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

[dir="rtl"] .info-callout {
    border-left: none;
    border-right: 4px solid var(--brand);
    border-radius: 0.75rem 0 0 0.75rem;
}

/* ============================================================
   MOBILE RESPONSIVENESS FIXES
   ============================================================ */

html, body { max-width: 100%; overflow-x: hidden; }

@media (max-width: 900px) {
    .footer-content { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
    body { padding-top: 108px; padding-bottom: 130px; }
    .app { padding: 1rem 0.85rem; }

    .app-header { padding: 0 0.85rem !important; }
    .header-title {
        font-size: 1rem !important;
        max-width: 140px;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .header-badge { display: none !important; }
    .header-actions { gap: 0.3rem !important; }
    .header-btn { padding: 0.4rem 0.55rem !important; font-size: 0.78rem !important; }

    .secondary-nav { padding: 0 0.5rem !important; gap: 0.25rem !important; }
    .nav-link { font-size: 0.8rem !important; padding: 0.3rem 0.55rem !important; }

    .hero { padding: 1.5rem 1rem !important; margin-bottom: 1.5rem !important; }
    .hero h1 { font-size: 1.5rem !important; }
    .hero p { font-size: 0.9rem !important; }
    .hero-pill { font-size: 0.72rem !important; }

    .downloader-card { padding: 1rem !important; }
    .input-group { flex-direction: column; align-items: stretch !important; }
    .input-wrapper { min-width: 100% !important; }
    .input-group > .btn { width: 100%; justify-content: center; }

    .section { padding: 1rem !important; border-radius: 1rem !important; }
    .section-title { font-size: 1.15rem !important; }
    .section-header > div { flex-direction: column; align-items: flex-start; }

    #directDownloadSection .section-header { flex-direction: column; align-items: flex-start; }
    #directDownloadSection .section-header > div { flex-direction: row !important; flex-wrap: wrap; }

    .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 0.7rem !important; }
    .direct-scroll-container .book-card { min-width: 150px; max-width: 150px; }
    .book-card { padding: 0.65rem !important; }
    .book-card .title { font-size: 0.82rem !important; }
    .book-card .meta { font-size: 0.72rem !important; }
    .book-card .pages { font-size: 0.7rem !important; }

    .filters-row { width: 100%; flex-direction: column; gap: 0.5rem; }
    .custom-select { width: 100%; }

    .preview-card { flex-direction: column; text-align: center; padding: 0.9rem !important; }
    .preview-card img { width: 80px !important; height: 110px !important; }
    .btn-area { justify-content: center; }

    .storage-banner {
        flex-wrap: wrap; gap: 0.4rem;
        padding: 0.55rem 0.8rem !important;
        font-size: 0.75rem !important;
    }
    .storage-banner-content { flex-direction: column; align-items: flex-start; gap: 0.4rem; width: 100%; }
    .storage-banner .btn {
        width: 100%; padding: 0.45rem !important;
        font-size: 0.78rem !important; justify-content: center;
    }

    .donate-float, .share-float, .scroll-top-btn {
        right: 0.75rem !important;
        width: 40px !important; height: 40px !important;
        font-size: 0.95rem !important;
    }
    .donate-float { bottom: 6.5rem; }
    .share-float { bottom: 9.25rem; }
    .scroll-top-btn { bottom: 12rem; }

    .modal-overlay { padding: 0 !important; align-items: flex-end !important; }
    .modal {
        max-width: 100% !important; width: 100% !important;
        border-radius: 1.25rem 1.25rem 0 0 !important;
        max-height: 92vh !important;
        padding: 1.5rem 1rem 2rem !important;
    }
    .modal.large-modal { max-width: 100% !important; }
    .modal-close {
        top: 0.7rem !important; right: 0.7rem !important;
        width: 36px; height: 36px; border-radius: 50%;
        background: var(--surface-card);
    }

    .article-reader-container { padding: 1.2rem 0.9rem !important; border-radius: 1rem !important; }
    .article-title { font-size: 1.35rem !important; line-height: 1.3 !important; }
    .article-body-content { font-size: 1rem !important; }
    .article-body-content h2 { font-size: 1.2rem !important; }
    .urdu-verse-box { font-size: 1.05rem !important; line-height: 2 !important; padding: 0.9rem !important; }

    .static-page-container { padding: 1.3rem 1rem !important; border-radius: 1rem !important; }
    .static-page-container h1 { font-size: 1.5rem !important; }
    .static-page-container h2 { font-size: 1.2rem !important; }
    .static-page-container p { font-size: 0.95rem !important; }

    .blog-grid { grid-template-columns: 1fr !important; gap: 1rem !important; }

    .footer { padding: 2rem 1rem 6rem !important; margin-top: 2rem !important; }
    .footer-content { display: flex; flex-direction: column; gap: 1.75rem; }
    .footer-col { width: 100%; }
    .contact-form-box { padding: 1rem !important; width: 100%; }
    .footer-bottom {
        flex-direction: column; text-align: center;
        gap: 0.5rem; margin-top: 1.5rem; padding-bottom: 2rem;
    }

    .pagination { gap: 0.4rem !important; }
    .pagination .btn { padding: 0.4rem 0.6rem !important; font-size: 0.78rem !important; }
    .page-input { width: 42px !important; }

    [dir="rtl"] .article-body-content { font-size: 1.1rem; line-height: 2.2; }
}

@media (max-width: 480px) {
    .library-grid { grid-template-columns: 1fr !important; }
    .direct-scroll-container .book-card { min-width: 160px; max-width: 160px; }
    .hero h1 { font-size: 1.3rem !important; }
    .hero p { font-size: 0.85rem !important; }
    .section-title { font-size: 1.05rem !important; }
    .article-title { font-size: 1.2rem !important; }
    .storage-banner { padding: 0.4rem 0.55rem !important; }
    .static-page-container h1 { font-size: 1.35rem !important; }
}

/* Mobile nav scroll indicator */
@media (max-width: 768px) {
    .secondary-nav { position: fixed; }
    .secondary-nav::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, var(--nav-bg));
        pointer-events: none;
    }
}

/* Mobile table scroll inside articles */
@media (max-width: 768px) {
    .article-body-content table {
        display: block; overflow-x: auto; white-space: nowrap;
    }
}