/* ═══════════════════════════════════════════════
   DESIGN SYSTEM - أحمد الغريب - إندوباك
   Premium Quran Reader
   ═══════════════════════════════════════════════ */

/* Font Face - DigitalKhatt / Saleem Nastaleeq */
@font-face {
    font-family: 'DigitalKhattV2';
    src: url('fonts/DigitalKhattV2.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ─── CSS Variables ─── */
:root {
    /* Primary Palette - Deep Navy + Gold */
    --bg-primary: #0A1628;
    --bg-secondary: #0F1F35;
    --bg-card: #132440;
    --bg-card-hover: #1A2F52;
    --bg-surface: rgba(19, 36, 64, 0.85);

    /* Gold Accent */
    --gold-primary: #C9A44C;
    --gold-light: #E6C96E;
    --gold-dark: #9C7A2E;
    --gold-glow: rgba(201, 164, 76, 0.15);

    /* Teal Accent */
    --teal-primary: #1A7A6D;
    --teal-light: #2BA89A;
    --teal-glow: rgba(26, 122, 109, 0.15);

    /* Text */
    --text-primary: #E8E6E3;
    --text-secondary: #9EAFC2;
    --text-muted: #5E7490;
    --text-accent: var(--gold-light);

    /* Borders */
    --border-subtle: rgba(201, 164, 76, 0.12);
    --border-medium: rgba(201, 164, 76, 0.25);

    /* Layout */
    --header-height: 72px;
    --max-width: 1100px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Shadows */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
    --shadow-elevated: 0 12px 48px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-glow-gold: 0 0 20px rgba(201, 164, 76, 0.2);

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Background Pattern ─── */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 20%, rgba(201, 164, 76, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(26, 122, 109, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(201, 164, 76, 0.02) 0%, transparent 70%);
}

/* ─── Quran Text Font ─── */
.quran-text {
    font-family: 'DigitalKhattV2', 'Amiri', serif;
    font-size: 1.7rem;
    line-height: 2.8;
    color: var(--text-primary);
    text-rendering: optimizeLegibility;
    -webkit-font-feature-settings: "liga", "calt", "kern";
    font-feature-settings: "liga", "calt", "kern";
}

/* ═══════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: rgba(10, 22, 40, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    gap: 16px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.header-logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--border-medium);
    box-shadow: var(--shadow-glow-gold);
    transition: transform var(--transition-fast);
}

.header-logo:hover {
    transform: scale(1.08);
}

.header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.header-subtitle {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.header-nav {
    display: flex;
    gap: 6px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-btn:hover {
    background: var(--gold-glow);
    color: var(--gold-light);
    border-color: var(--border-subtle);
}

.nav-btn.active {
    background: linear-gradient(135deg, rgba(201, 164, 76, 0.15), rgba(201, 164, 76, 0.06));
    color: var(--gold-light);
    border-color: var(--border-medium);
}

/* ═══════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════ */
main {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - var(--header-height));
}

.section-visible {
    display: block;
    animation: fadeIn 0.4s ease;
}

.section-hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════ */
.hero {
    text-align: center;
    padding: 60px 24px 48px;
    position: relative;
}

.hero-glow {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 164, 76, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-logo {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-xl);
    border: 3px solid var(--border-medium);
    box-shadow: var(--shadow-elevated), var(--shadow-glow-gold);
    margin-bottom: 28px;
    position: relative;
    animation: floatLogo 6s ease-in-out infinite;
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.hero-title {
    font-size: 2.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-primary), var(--gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.hero-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.9;
    max-width: 520px;
    margin: 0 auto 32px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-lg);
    font-family: 'Cairo', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-medium);
    box-shadow: 0 4px 20px rgba(201, 164, 76, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(201, 164, 76, 0.45);
    background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
}

.cta-button:active {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════
   FEATURES GRID
   ═══════════════════════════════════════════════ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 60px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    transition: all var(--transition-medium);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-primary), var(--teal-primary));
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-medium);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    font-size: 2.2rem;
    margin-bottom: 14px;
}

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════
   SURAH SELECTOR
   ═══════════════════════════════════════════════ */
.surah-selector {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 28px 20px;
}

.selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.selector-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold-light);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    min-width: 240px;
    transition: border-color var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(201, 164, 76, 0.1);
}

.search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Surah Grid */
.surah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.surah-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.surah-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--gold-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card), var(--shadow-glow-gold);
}

.surah-card:active {
    transform: translateY(0);
}

.surah-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: var(--bg-primary);
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.surah-name-ar {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    font-family: 'Amiri', serif;
}

.surah-info-text {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════
   QURAN READER
   ═══════════════════════════════════════════════ */
.quran-reader {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Reader Toolbar */
.reader-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: var(--bg-card-hover);
    color: var(--gold-light);
    border-color: var(--gold-primary);
}

.reader-surah-info {
    text-align: center;
    flex: 1;
    min-width: 0;
}

.surah-name-display {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold-light);
    font-family: 'Amiri', serif;
}

.surah-ayah-count {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Bismillah */
.bismillah-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px 16px;
    margin: 16px 0;
}

.bismillah-ornament {
    color: var(--gold-primary);
    font-size: 1.5rem;
    opacity: 0.6;
}

.bismillah-text {
    font-size: 1.9rem;
    color: var(--gold-light);
    text-align: center;
}

/* Verses */
.verses-container {
    padding: 8px 0 24px;
}

.verse-item {
    padding: 18px 20px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.verse-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-card);
}

.verse-item:active {
    transform: scale(0.995);
}

.verse-item.copied {
    border-color: var(--teal-primary);
    background: rgba(26, 122, 109, 0.08);
}

.verse-text {
    font-family: 'DigitalKhattV2', 'Amiri', serif;
    font-size: 1.65rem;
    line-height: 2.6;
    color: var(--text-primary);
    text-align: justify;
    text-rendering: optimizeLegibility;
    word-spacing: 4px;
}

.verse-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

.verse-ref {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.verse-copy-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.verse-item:hover .verse-copy-hint {
    opacity: 1;
}

/* Surah Navigation */
.surah-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 0 40px;
    border-top: 1px solid var(--border-subtle);
}

.surah-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.surah-nav-btn:hover {
    background: var(--bg-card-hover);
    color: var(--gold-light);
    border-color: var(--gold-primary);
}

.surah-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════
   TOAST NOTIFICATION
   ═══════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 12px 28px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--teal-primary), #147A6A);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-medium);
    z-index: 200;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.site-footer {
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    margin-top: 40px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 48px 24px 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 36px;
}

.footer-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 16px;
    position: relative;
}

.footer-heading::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--gold-primary), transparent);
    margin-top: 8px;
}

.footer-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 6px 0;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
}

.footer-links a:hover {
    color: var(--gold-light);
    transform: translateX(-4px);
}

.footer-links a svg {
    flex-shrink: 0;
    color: var(--teal-primary);
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: var(--bg-card-hover);
    border-color: var(--gold-primary);
    color: var(--gold-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
}

.footer-bottom {
    border-top: 1px solid var(--border-subtle);
    padding: 20px 24px;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }

    .header-title {
        font-size: 0.95rem;
    }

    .header-subtitle {
        display: none;
    }

    .nav-btn span {
        display: none;
    }

    .nav-btn {
        padding: 8px 12px;
    }

    .hero-title {
        font-size: 1.9rem;
    }

    .hero-desc {
        font-size: 0.9rem;
    }

    .hero-logo {
        width: 100px;
        height: 100px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .surah-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .verse-text {
        font-size: 1.45rem;
        line-height: 2.4;
    }

    .selector-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: unset;
    }

    .toolbar-btn span {
        display: none;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .header-logo {
        width: 38px;
        height: 38px;
    }

    .header-title {
        font-size: 0.85rem;
    }

    .hero {
        padding: 40px 16px 36px;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-logo {
        width: 86px;
        height: 86px;
    }

    .cta-button {
        padding: 12px 28px;
        font-size: 0.95rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        padding: 0 16px 40px;
    }

    .feature-card {
        padding: 22px 18px;
    }

    .surah-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
    }

    .surah-card {
        padding: 12px 8px;
    }

    .surah-name-ar {
        font-size: 0.95rem;
    }

    .verse-item {
        padding: 14px 14px;
        margin-bottom: 6px;
    }

    .verse-text {
        font-size: 1.3rem;
        line-height: 2.2;
    }

    .bismillah-text {
        font-size: 1.5rem;
    }

    .surah-nav-btn {
        padding: 10px 16px;
        font-size: 0.82rem;
    }

    .reader-toolbar {
        padding: 10px 0;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 36px 20px 24px;
    }
}

/* ─── Scrollbar Styling ─── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 164, 76, 0.3);
}

/* ─── Selection ─── */
::selection {
    background: rgba(201, 164, 76, 0.25);
    color: var(--text-primary);
}

/* ─── Focus Styles ─── */
*:focus-visible {
    outline: 2px solid var(--gold-primary);
    outline-offset: 2px;
}

/* Loading skeleton for surah grid */
.surah-card.skeleton {
    background: var(--bg-card);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* ???????????????????????????????????????????????
   MUSHAF PAGE VIEW & SEARCH EXTENSIONS
   ??????????????????????????????????????????????? */

/* Tabs */
.mushaf-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    padding: 0 20px;
}

.tab-btn {
    padding: 10px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    background: var(--bg-card-hover);
    color: var(--gold-light);
}

.tab-btn.active {
    background: var(--gold-primary);
    color: var(--bg-primary);
    border-color: var(--gold-primary);
}

/* Page Frame */
.mushaf-page-container {
    background: #FDFBF7; /* Paper-like background for Mushaf */
    border-radius: var(--radius-md);
    padding: 32px 24px;
    margin: 16px 0 32px;
    border: 8px solid var(--bg-card);
    outline: 2px solid var(--gold-dark);
    outline-offset: -10px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.05), var(--shadow-card);
    min-height: 65vh;
}

.mushaf-page {
    text-align: justify;
    text-align-last: center;
    direction: rtl;
    line-height: 2.8;
}

/* Inline Verses */
.verse-inline {
    font-family: 'DigitalKhattV2', 'Amiri', serif;
    font-size: 1.8rem;
    color: #111; /* Dark text on light paper */
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    padding: 0 2px;
    display: inline;
}

.verse-inline:hover {
    background: rgba(201, 164, 76, 0.2);
    border-radius: 4px;
}

.verse-inline.copied {
    background: var(--teal-light);
    color: white;
}

/* Page Number Display */
.page-number-display {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-primary);
}

/* Search UI */
.search-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 20px;
}

.section-title {
    font-size: 1.8rem;
    color: var(--gold-light);
    text-align: center;
    margin-bottom: 24px;
}

.search-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.search-tab {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.search-tab:hover {
    border-color: var(--gold-light);
    color: var(--text-primary);
}

.search-tab.active {
    background: rgba(201, 164, 76, 0.15);
    border-color: var(--gold-primary);
    color: var(--gold-light);
}

.search-panel {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    margin-bottom: 32px;
}

.search-box.large {
    padding: 8px 16px;
}

.search-box.large input {
    font-size: 1.1rem;
    padding: 8px;
}

.search-action-btn {
    padding: 10px 24px;
    background: var(--gold-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-action-btn:hover {
    background: var(--gold-light);
}

.search-results-stats {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-align: right;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-result-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-result-item:hover {
    border-color: var(--gold-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.result-text {
    font-family: 'DigitalKhattV2', 'Amiri', serif;
    font-size: 1.6rem;
    line-height: 2.2;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.result-highlight {
    color: var(--gold-light);
    background: rgba(201, 164, 76, 0.15);
    padding: 0 4px;
    border-radius: 4px;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-medium);
    padding-top: 12px;
}

.bismillah-inline {
    display: block;
    text-align: center;
    font-family: 'DigitalKhattV2', 'Amiri', serif;
    font-size: 1.8rem;
    color: var(--gold-dark);
    margin: 16px 0;
}

/* Bismillah special inline wrap */
.surah-title-inline {
    display: block;
    text-align: center;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 30"><rect x="0" y="0" width="100" height="30" fill="%23C9A44C" opacity="0.1" rx="15" ry="15" /></svg>') center/contain no-repeat;
    padding: 12px;
    margin: 24px auto;
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: #111;
    width: 60%;
}

@media (max-width: 480px) {
    .mushaf-page-container {
        padding: 16px 12px;
        border-width: 4px;
    }
    .verse-inline {
        font-size: 1.45rem;
    }
    .tab-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    .search-tab {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}
