/* ============================================
   DEENIWEB.COM - Complete Stylesheet
   Islamic warm color palette - No white, no black
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --bg-body: #E4D5C0;
    --bg-body-alt: #D9C8AE;
    --bg-card: #F3EAE0;
    --bg-card-alt: #F8F0E5;
    --bg-card-hover: #FDF8F2;
    --bg-input: #F0E6D8;
    --bg-navbar: #1B5E3B;
    --bg-navbar-hover: #237A4D;
    --bg-navbar-sticky: #1B5E3B;
    --bg-dropdown: #237A4D;
    --bg-footer: #1B4332;
    --bg-modal: rgba(26, 46, 35, 0.7);
    --bg-badge: #C8873E;
    --bg-sticky-card: #FDF8F2;
    --bg-toast: #2D6A4F;
    --text-primary: #2C1810;
    --text-secondary: #5A3E2B;
    --text-muted: #8B7355;
    --text-on-dark: #F3EAE0;
    --text-on-dark-muted: #C4B8A8;
    --text-arabic: #1B4332;
    --text-link: #1B7A4E;
    --text-link-hover: #145233;
    --accent-green: #2D8B5F;
    --accent-green-light: #3DAF78;
    --accent-green-dark: #1B6B42;
    --accent-gold: #C8873E;
    --accent-gold-light: #DAA04D;
    --accent-gold-dark: #A06B2E;
    --accent-coral: #C9543E;
    --accent-coral-light: #E07A5F;
    --accent-teal: #1A8A8A;
    --accent-indigo: #5C6BC0;
    --border-color: #C9A882;
    --border-light: #DDD0BB;
    --border-dark: #A08968;
    --shadow-sm: 0 1px 3px rgba(44, 24, 16, 0.08);
    --shadow-md: 0 3px 10px rgba(44, 24, 16, 0.1);
    --shadow-lg: 0 8px 30px rgba(44, 24, 16, 0.12);
    --shadow-xl: 0 15px 50px rgba(44, 24, 16, 0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50px;
    --font-arabic: 'Amiri', 'Traditional Arabic', serif;
    --font-urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
    --font-ui: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    --navbar-height: 48px;
    --sticky-card-height: auto;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text-link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text-link-hover); }

img { max-width: 100%; height: auto; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body-alt); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-dark); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-weight: 700; color: var(--text-primary); line-height: 1.3; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

.arabic-text {
    font-family: var(--font-arabic);
    direction: rtl;
    text-align: right;
    line-height: 2.2;
    color: var(--text-arabic);
    font-weight: 700;
}

.urdu-text {
    font-family: var(--font-urdu);
    direction: rtl;
    text-align: right;
    line-height: 2.4;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.translation-text {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.8;
    color: var(--text-primary);
}

.tafsir-text {
    font-size: 0.98rem;
    line-height: 1.9;
    color: var(--text-secondary);
    font-style: italic;
}

/* ---------- Navbar ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--bg-navbar);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-on-dark);
    font-weight: 800;
    font-size: 1.15rem;
    text-decoration: none;
    flex-shrink: 0;
}

.navbar-brand svg { flex-shrink: 0; }

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin-left: auto;
}

.navbar-nav a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    color: var(--text-on-dark);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    background: var(--bg-navbar-hover);
    color: var(--text-on-dark);
}

.navbar-nav a svg { width: 16px; height: 16px; flex-shrink: 0; }

.nav-search-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.12);
    border-radius: var(--radius-full);
    padding: 0 12px;
    margin: 0 12px;
    height: 32px;
    flex: 0 1 280px;
}

.nav-search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-on-dark);
    font-size: 0.82rem;
    width: 100%;
    font-family: var(--font-ui);
}

.nav-search-box input::placeholder { color: var(--text-on-dark-muted); }

.nav-search-box svg { width: 14px; height: 14px; color: var(--text-on-dark-muted); flex-shrink: 0; margin-right: 6px; }

/* Hamburger */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-on-dark);
    margin: 5px 0;
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-navbar);
    z-index: 999;
    padding: 20px 24px;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
}

.mobile-menu.open { display: block; }

.mobile-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-on-dark);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: background var(--transition);
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.mobile-menu a:hover { background: var(--bg-navbar-hover); }
.mobile-menu a svg { width: 20px; height: 20px; }

.mobile-search-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.12);
    border-radius: var(--radius-full);
    padding: 0 16px;
    height: 42px;
    margin-bottom: 16px;
}

.mobile-search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-on-dark);
    font-size: 0.95rem;
    width: 100%;
    font-family: var(--font-ui);
}

.mobile-search-box input::placeholder { color: var(--text-on-dark-muted); }
.mobile-search-box svg { width: 18px; height: 18px; color: var(--text-on-dark-muted); margin-right: 8px; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Main Content ---------- */
.main-content {
    margin-top: var(--navbar-height);
    padding: 16px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - var(--navbar-height));
}

.main-content.wide { max-width: 1100px; }

/* ---------- Sticky Ayah/Hadith Card ---------- */
.sticky-card {
    position: sticky;
    top: var(--navbar-height);
    z-index: 100;
    background: var(--bg-sticky-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 12px 16px;
    margin-bottom: 16px;
    transition: box-shadow var(--transition);
}

.sticky-card-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sticky-card-nav .sc-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-right: auto;
}

.sticky-card-nav .sc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-green);
    color: var(--text-on-dark);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.sticky-card-nav .sc-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-green { background: var(--accent-green); color: var(--text-on-dark); }
.btn-green:hover { background: var(--accent-green-dark); color: var(--text-on-dark); }

.btn-gold { background: var(--accent-gold); color: var(--text-on-dark); }
.btn-gold:hover { background: var(--accent-gold-dark); color: var(--text-on-dark); }

.btn-coral { background: var(--accent-coral); color: var(--text-on-dark); }
.btn-coral:hover { background: #A8432F; color: var(--text-on-dark); }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-outline:hover { background: var(--bg-card); border-color: var(--border-dark); color: var(--text-primary); }

.btn-sm { padding: 4px 10px; font-size: 0.75rem; }
.btn-lg { padding: 10px 24px; font-size: 0.95rem; }

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-nav {
    background: var(--accent-green);
    color: var(--text-on-dark);
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-nav:hover { background: var(--accent-green-dark); }
.btn-nav:disabled { background: var(--border-light); color: var(--text-muted); cursor: not-allowed; }

/* ---------- Toggle Switch ---------- */
.toggle-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
}

.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    transition: background var(--transition);
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--text-on-dark);
    border-radius: 50%;
    transition: transform var(--transition);
}

.toggle-wrap.active .toggle-switch { background: var(--accent-green); }
.toggle-wrap.active .toggle-switch::after { transform: translateX(16px); }

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-body { padding: 16px; }

.card-clickable { cursor: pointer; }
.card-clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ---------- Ayah Card ---------- */
.ayah-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.ayah-card:hover { box-shadow: var(--shadow-md); }

.ayah-number-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gold);
    color: var(--text-on-dark);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.ayah-arabic {
    font-family: var(--font-arabic);
    font-size: 1.65rem;
    line-height: 2.4;
    direction: rtl;
    text-align: right;
    color: var(--text-arabic);
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.ayah-translation {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.85;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.ayah-tafsir {
    background: var(--bg-card-alt);
    border-left: 3px solid var(--accent-teal);
    padding: 12px 16px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-top: 10px;
}

.ayah-tafsir-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-teal);
    margin-bottom: 4px;
}

.ayah-tafsir-text {
    font-size: 0.92rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.ayah-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.ayah-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-ui);
}

.ayah-toggle-btn:hover { background: var(--bg-card-hover); border-color: var(--border-color); color: var(--text-primary); }
.ayah-toggle-btn.active { background: var(--accent-green); color: var(--text-on-dark); border-color: var(--accent-green); }
.ayah-toggle-btn svg { width: 12px; height: 12px; }

/* ---------- Hadith Card ---------- */
.hadith-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.hadith-number-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-coral);
    color: var(--text-on-dark);
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.hadith-arabic {
    font-family: var(--font-arabic);
    font-size: 1.4rem;
    line-height: 2.3;
    direction: rtl;
    text-align: right;
    color: var(--text-arabic);
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.hadith-grade {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--accent-gold);
    color: var(--text-on-dark);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.hadith-reference {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.hadith-text {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.85;
    color: var(--text-primary);
}

/* ---------- Surah Grid ---------- */
.surah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.surah-grid-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: var(--text-primary);
}

.surah-grid-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-green);
}

.surah-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--accent-green);
    color: var(--text-on-dark);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 800;
    flex-shrink: 0;
}

.surah-info { flex: 1; min-width: 0; }
.surah-info .name-en { font-size: 0.82rem; font-weight: 700; display: block; line-height: 1.2; }
.surah-info .name-ar { font-family: var(--font-arabic); font-size: 1rem; color: var(--text-arabic); display: block; }
.surah-info .meta { font-size: 0.68rem; color: var(--text-muted); font-weight: 500; }

/* ---------- Hadith Books Grid ---------- */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.book-grid-item {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: var(--text-primary);
}

.book-grid-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-gold);
}

.book-grid-item .book-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-gold);
    color: var(--text-on-dark);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.book-grid-item .book-title { font-size: 0.9rem; font-weight: 700; display: block; margin-bottom: 4px; }
.book-grid-item .book-meta { font-size: 0.75rem; color: var(--text-muted); }

/* ---------- Search Results ---------- */
.search-result-item {
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    display: block;
    color: var(--text-primary);
}

.search-result-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-green);
}

.search-result-type {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.search-result-type.quran { background: var(--accent-green); color: var(--text-on-dark); }
.search-result-type.hadith { background: var(--accent-coral); color: var(--text-on-dark); }
.search-result-type.book { background: var(--accent-gold); color: var(--text-on-dark); }

.search-result-ref { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.search-result-text { font-size: 0.92rem; line-height: 1.7; color: var(--text-secondary); }
.search-result-text.arabic-result { font-family: var(--font-arabic); direction: rtl; text-align: right; font-size: 1.1rem; }

.search-highlight {
    background: var(--accent-gold-light);
    color: var(--text-primary);
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 700;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--bg-footer);
    color: var(--text-on-dark-muted);
    padding: 30px 20px;
    margin-top: 40px;
    text-align: center;
}

.site-footer a { color: var(--accent-gold-light); }
.site-footer a:hover { color: var(--text-on-dark); }

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.footer-links a {
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

.footer-copy { font-size: 0.75rem; opacity: 0.7; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: border-color var(--transition);
    outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--accent-green); }
.form-textarea { min-height: 100px; resize: vertical; }
.form-select { cursor: pointer; appearance: auto; }

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-body-alt);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.tab-btn {
    padding: 7px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { background: var(--bg-card); color: var(--accent-green); box-shadow: var(--shadow-sm); }

/* ---------- Badge ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-green { background: var(--accent-green); color: var(--text-on-dark); }
.badge-gold { background: var(--accent-gold); color: var(--text-on-dark); }
.badge-coral { background: var(--accent-coral); color: var(--text-on-dark); }
.badge-teal { background: var(--accent-teal); color: var(--text-on-dark); }

/* ---------- Toast Notification ---------- */
.toast-container {
    position: fixed;
    top: calc(var(--navbar-height) + 10px);
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-toast);
    color: var(--text-on-dark);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 340px;
}

.toast.error { background: var(--accent-coral); }
.toast.success { background: var(--accent-green); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- Visitor Counter ---------- */
.visitor-counter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

.visitor-counter svg { width: 13px; height: 13px; }

/* ---------- Report Button ---------- */
.report-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: var(--accent-coral);
    color: var(--text-on-dark);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    transition: all var(--transition);
}

.report-btn:hover { transform: scale(1.1); box-shadow: var(--shadow-xl); }
.report-btn svg { width: 20px; height: 20px; }

/* ---------- Modal ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-modal);
    z-index: 1500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 24px;
    width: 100%;
    max-width: 460px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-close {
    width: 30px;
    height: 30px;
    background: var(--bg-input);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition);
}

.modal-close:hover { background: var(--accent-coral); color: var(--text-on-dark); }

/* ---------- Hero Section ---------- */
.hero-section {
    text-align: center;
    padding: 30px 16px 20px;
}

.hero-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.hero-search {
    max-width: 500px;
    margin: 20px auto 0;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 4px 6px 4px 18px;
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition);
}

.hero-search:focus-within { border-color: var(--accent-green); }

.hero-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: var(--font-ui);
}

.hero-search input::placeholder { color: var(--text-muted); }

.hero-search button {
    width: 40px;
    height: 40px;
    background: var(--accent-green);
    color: var(--text-on-dark);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    flex-shrink: 0;
}

.hero-search button:hover { background: var(--accent-green-dark); }
.hero-search button svg { width: 18px; height: 18px; }

/* ---------- Stats Row ---------- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
}

.stat-card .stat-num {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent-green);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ---------- Section Headers ---------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title svg { width: 20px; height: 20px; color: var(--accent-green); }

.section-link {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-green);
    text-decoration: none;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
}

.pagination a { background: var(--bg-card); border: 1px solid var(--border-light); color: var(--text-secondary); }
.pagination a:hover { border-color: var(--accent-green); color: var(--accent-green); }
.pagination .active { background: var(--accent-green); color: var(--text-on-dark); border-color: var(--accent-green); }
.pagination .disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Loading ---------- */
.loader {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-green);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; font-weight: 500; }

/* ---------- PayPal Donate Section ---------- */
.donate-section {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    margin: 30px 0;
}

.donate-section h2 { margin-bottom: 8px; }
.donate-section p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 20px; }

.donate-amounts {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.donate-amount-btn {
    padding: 8px 20px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.donate-amount-btn:hover, .donate-amount-btn.selected {
    border-color: var(--accent-gold);
    background: var(--accent-gold);
    color: var(--text-on-dark);
}

/* ---------- Admin Styles ---------- */
.admin-login-box {
    max-width: 380px;
    margin: 80px auto 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.admin-sidebar {
    width: 220px;
    background: var(--bg-footer);
    min-height: calc(100vh - var(--navbar-height));
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    padding: 16px 0;
    overflow-y: auto;
    z-index: 100;
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-on-dark-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: rgba(255,255,255,0.06);
    color: var(--text-on-dark);
    border-left-color: var(--accent-gold);
}

.admin-sidebar a svg { width: 18px; height: 18px; flex-shrink: 0; }

.admin-main {
    margin-left: 220px;
    padding: 20px;
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
}

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.admin-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.admin-stat .num { font-size: 1.8rem; font-weight: 900; }
.admin-stat .label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }

/* JSON Editor */
.json-editor-area {
    width: 100%;
    min-height: 400px;
    padding: 14px;
    background: #2C2416;
    color: #E8D5B7;
    border: 2px solid var(--border-dark);
    border-radius: var(--radius-md);
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

.json-editor-area:focus { border-color: var(--accent-green); }

.json-status {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 8px;
}

.json-status.valid { background: #D4EDDA; color: #155724; }
.json-status.invalid { background: #F8D7DA; color: #721C24; }

/* Reports table */
.reports-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.reports-table th {
    background: var(--bg-body-alt);
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.reports-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.reports-table tr:hover td { background: var(--bg-card-alt); }

/* ---------- Utility Classes ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.font-bold { font-weight: 700; }
.font-arabic { font-family: var(--font-arabic); }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 12px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.overflow-auto { overflow-x: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    :root {
        --navbar-height: 48px;
    }

    .navbar-nav { display: none; }
    .nav-search-box { display: none; }
    .hamburger { display: block; }

    .main-content { padding: 10px; }

    .hero-title { font-size: 1.5rem; }
    .hero-search { margin: 16px 10px 0; }

    .surah-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
    }

    .surah-grid-item { padding: 10px; gap: 8px; }
    .surah-num { width: 28px; height: 28px; font-size: 0.7rem; }
    .surah-info .name-en { font-size: 0.75rem; }
    .surah-info .name-ar { font-size: 0.85rem; }

    .book-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

    .ayah-arabic { font-size: 1.35rem; line-height: 2.2; }
    .ayah-card { padding: 14px; }
    .hadith-arabic { font-size: 1.2rem; line-height: 2.1; }
    .hadith-card { padding: 14px; }

    .sticky-card { padding: 10px 12px; border-radius: var(--radius-md); }

    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }

    .site-footer { display: none; }

    .report-btn { bottom: 14px; right: 14px; width: 40px; height: 40px; }

    /* Admin mobile */
    .admin-sidebar { display: none; }
    .admin-main { margin-left: 0; padding: 12px; }
    .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }

    .tabs { font-size: 0.78rem; }
    .tab-btn { padding: 6px 10px; font-size: 0.78rem; }

    h1 { font-size: 1.35rem; }
    h2 { font-size: 1.15rem; }
}

@media (max-width: 380px) {
    .surah-grid { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); }
    .book-grid { grid-template-columns: 1fr; }
    .donate-amounts { gap: 6px; }
    .donate-amount-btn { padding: 6px 14px; font-size: 0.82rem; }
}

/* ---------- Print ---------- */
@media print {
    .navbar, .sticky-card, .report-btn, .site-footer, .ayah-actions, .mobile-menu { display: none !important; }
    .main-content { margin-top: 0; }
    .ayah-card, .hadith-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}