@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Tajawal:wght@400;500;700;800;900&display=swap');

@font-face {
    font-family: 'QCF4_Hafs_01_W';
    src: url('./fonts/QCF4_Hafs_01_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_02_W';
    src: url('./fonts/QCF4_Hafs_02_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_03_W';
    src: url('./fonts/QCF4_Hafs_03_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_04_W';
    src: url('./fonts/QCF4_Hafs_04_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_05_W';
    src: url('./fonts/QCF4_Hafs_05_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_06_W';
    src: url('./fonts/QCF4_Hafs_06_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_07_W';
    src: url('./fonts/QCF4_Hafs_07_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_08_W';
    src: url('./fonts/QCF4_Hafs_08_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_09_W';
    src: url('./fonts/QCF4_Hafs_09_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_10_W';
    src: url('./fonts/QCF4_Hafs_10_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_11_W';
    src: url('./fonts/QCF4_Hafs_11_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_12_W';
    src: url('./fonts/QCF4_Hafs_12_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_13_W';
    src: url('./fonts/QCF4_Hafs_13_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_14_W';
    src: url('./fonts/QCF4_Hafs_14_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_15_W';
    src: url('./fonts/QCF4_Hafs_15_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_16_W';
    src: url('./fonts/QCF4_Hafs_16_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_17_W';
    src: url('./fonts/QCF4_Hafs_17_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_18_W';
    src: url('./fonts/QCF4_Hafs_18_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_19_W';
    src: url('./fonts/QCF4_Hafs_19_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_20_W';
    src: url('./fonts/QCF4_Hafs_20_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_21_W';
    src: url('./fonts/QCF4_Hafs_21_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_22_W';
    src: url('./fonts/QCF4_Hafs_22_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_23_W';
    src: url('./fonts/QCF4_Hafs_23_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_24_W';
    src: url('./fonts/QCF4_Hafs_24_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_25_W';
    src: url('./fonts/QCF4_Hafs_25_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_26_W';
    src: url('./fonts/QCF4_Hafs_26_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_27_W';
    src: url('./fonts/QCF4_Hafs_27_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_28_W';
    src: url('./fonts/QCF4_Hafs_28_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_29_W';
    src: url('./fonts/QCF4_Hafs_29_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_30_W';
    src: url('./fonts/QCF4_Hafs_30_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_31_W';
    src: url('./fonts/QCF4_Hafs_31_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_32_W';
    src: url('./fonts/QCF4_Hafs_32_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_33_W';
    src: url('./fonts/QCF4_Hafs_33_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_34_W';
    src: url('./fonts/QCF4_Hafs_34_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_35_W';
    src: url('./fonts/QCF4_Hafs_35_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_36_W';
    src: url('./fonts/QCF4_Hafs_36_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_37_W';
    src: url('./fonts/QCF4_Hafs_37_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_38_W';
    src: url('./fonts/QCF4_Hafs_38_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_39_W';
    src: url('./fonts/QCF4_Hafs_39_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_40_W';
    src: url('./fonts/QCF4_Hafs_40_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_41_W';
    src: url('./fonts/QCF4_Hafs_41_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_42_W';
    src: url('./fonts/QCF4_Hafs_42_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_43_W';
    src: url('./fonts/QCF4_Hafs_43_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_44_W';
    src: url('./fonts/QCF4_Hafs_44_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_45_W';
    src: url('./fonts/QCF4_Hafs_45_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_46_W';
    src: url('./fonts/QCF4_Hafs_46_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_Hafs_47_W';
    src: url('./fonts/QCF4_Hafs_47_W.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'QCF4_BSML';
    src: url('./fonts/QCF4_QBSML.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

/* ═══════════════════════════════════════════════════════════
   COLOR SYSTEM — Clear Hierarchy
   Title = pure black  |  Subtitle = dark brown  |  Body = warm gray
   ═══════════════════════════════════════════════════════════ */
:root {
    /* Page background */
    --page-bg: #F5F0E6;
    --page-bg-alt: #EDE7DA;

    /* Card surfaces */
    --surface: #FFFFFF;
    --surface-warm: #FAF7F1;
    --surface-hover: #F7F3EC;

    /* Title — pure black, maximum contrast */
    --color-title: #111111;

    /* Subtitle — dark warm brown, clearly different from title */
    --color-subtitle: #5C4A2F;

    /* Body text — comfortable reading gray-brown */
    --color-body: #3D3428;

    /* Muted / caption — lighter, secondary */
    --color-muted: #8C7E6A;
    --color-caption: #A89880;

    /* Accent — deep gold */
    --accent: #8B6914;
    --accent-medium: #A37E1E;
    --accent-light: #D4AF50;
    --accent-subtle: rgba(139, 105, 20, 0.08);

    /* Borders */
    --border-light: #E8E0D0;
    --border-medium: #D5CCBB;
    --border-accent: rgba(139, 105, 20, 0.15);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(60, 40, 10, 0.05);
    --shadow-md: 0 4px 16px rgba(60, 40, 10, 0.07);
    --shadow-lg: 0 8px 30px rgba(60, 40, 10, 0.09);

    /* Radii */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ═══════════════════════════════════════════════════════════
   GLOBAL
   ═══════════════════════════════════════════════════════════ */
body {
    font-family: 'Tajawal', sans-serif;
    background: var(--page-bg);
    color: var(--color-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* Kill particles */
#particlesCanvas {
    display: none !important;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 880px;
    margin: 0 auto;
    padding: 2rem 1.2rem;
    flex: 1;
    width: 100%;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--page-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-caption);
}

::selection {
    background: rgba(212, 175, 80, 0.3);
    color: var(--color-title);
}

/* ═══════════════════════════════════════════════════════════
   SPLASH
   ═══════════════════════════════════════════════════════════ */
.splash-screen {
    position: fixed;
    inset: 0;
    background: var(--page-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid var(--accent-light);
    box-shadow: 0 0 30px rgba(139, 105, 20, 0.15);
    animation: splashIn 1.2s var(--ease) forwards;
}

@keyframes splashIn {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }

    60% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.splash-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   HERO SECTION — Completely New Layout
   ═══════════════════════════════════════════════════════════ */
.hero-section {
    margin-bottom: 2rem;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* ── Identity Bar (top) — logo + name ── */
.hero-identity-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1.2rem 2rem;
    background: var(--surface-warm);
    border-bottom: 1px solid var(--border-light);
}

.hero-logo-img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--accent-light);
    object-fit: cover;
    flex-shrink: 0;
}

.hero-identity-text {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hero-identity-name {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-title);
    line-height: 1.3;
}

.hero-identity-label {
    font-family: 'Tajawal', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-muted);
    line-height: 1.3;
}

/* ── Theme Toggle Button ── */
.theme-toggle {
    margin-right: auto;
    background: var(--surface-warm);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--accent);
    font-size: 1rem;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--accent-subtle);
    border-color: var(--border-accent);
    transform: scale(1.08);
}

/* ── Social Accounts Link Button ── */
.social-link-btn {
    background: var(--surface-warm);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--accent);
    font-size: 0.92rem;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.social-link-btn:hover {
    background: var(--accent-subtle);
    border-color: var(--border-accent);
    transform: scale(1.08);
    color: var(--accent-medium);
}

/* ── Main Content Area ── */
.hero-container {
    padding: 2.5rem 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.2rem;
}

.hero-text-content {
    width: 100%;
    text-align: center;
}

/* TITLE — Big, bold, IBM Plex, pure black */
.hero-title {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--color-title);
    line-height: 1.3;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

/* SUBTITLE — smaller, lighter weight, warm brown */
.hero-subtitle {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--color-subtitle);
    line-height: 1.5;
    margin-bottom: 0;
}

/* Divider — clean thin line + dot */
.hero-divider {
    width: 60px;
    height: 0;
    margin: 0.8rem auto;
    position: relative;
    border: none;
    background: transparent;
}

.hero-divider::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--border-medium), var(--accent-light), var(--border-medium), transparent);
    border-radius: 2px;
}

/* LEAD / DESCRIPTION — Tajawal, body color, lighter weight */
.hero-lead {
    font-family: 'Tajawal', sans-serif;
    color: var(--color-body);
    font-size: 0.95rem;
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.95;
}

.hero-lead-highlight {
    color: var(--accent);
    font-weight: 700;
}

/* ── Meta Badges Row ── */
.hero-meta-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.edition-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-warm);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 0.35rem 1rem;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-muted);
}

.edition-badge i {
    color: var(--accent-medium);
    font-size: 0.7rem;
}

.edition-badge strong {
    color: var(--accent);
    font-weight: 700;
}

/* ── Dua Box ── */
.hero-doa {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--accent-subtle);
    border: 1px solid var(--border-accent);
    border-right: 3px solid var(--accent-light);
    padding: 0.75rem 1.4rem;
    border-radius: var(--r-sm);
    font-family: 'Tajawal', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-muted);
    max-width: 100%;
}

.hero-doa i {
    color: var(--accent-medium);
    font-size: 1rem;
    flex-shrink: 0;
}

.hero-doa strong {
    color: var(--color-title);
    font-weight: 700;
}

/* ── Telegram Links Bar (bottom) ── */
.tg-links {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--border-light);
}

.tg-links-label {
    display: none;
}

.tg-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.7rem 0.5rem;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--color-subtitle);
    border: none;
    border-radius: 0;
    background: transparent;
    transition: background 0.25s ease, color 0.25s ease;
}

.tg-link+.tg-link {
    border-right: 1px solid var(--border-light);
}

.tg-link i {
    font-size: 0.85rem;
}

.tg-link:hover {
    background: var(--surface-warm);
    color: var(--accent);
}

.tg-link--download {
    color: var(--accent);
}

.tg-link--download:hover {
    background: var(--accent-subtle);
}

/* ═══════════════════════════════════════════════════════════
   VISITOR COUNTER
   ═══════════════════════════════════════════════════════════ */
.visitor-counter-wrap {
    text-align: center;
    margin-bottom: 1.5rem;
}

.visitor-counter {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 30px;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-muted);
    box-shadow: var(--shadow-sm);
}

.visitor-counter .vc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-light);
    box-shadow: 0 0 6px rgba(212, 175, 80, 0.4);
    animation: vcPulse 2s infinite;
}

.visitor-counter .vc-num {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
}

@keyframes vcPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

/* ═══════════════════════════════════════════════════════════
   CONTROLS
   ═══════════════════════════════════════════════════════════ */
.controls {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: 1.8rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 12px;
    z-index: 100;
}

.controls-row {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 260px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    color: var(--color-title);
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.3px;
}

.form-group label i {
    color: var(--accent-medium);
    margin-left: 4px;
}

select,
input[type="text"] {
    width: 100%;
    padding: 0.9rem 1.1rem;
    background: var(--surface);
    border: 1.5px solid var(--border-medium);
    border-radius: var(--r-md);
    color: var(--color-title);
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238B6914' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.8rem center;
    padding-left: 2.5rem;
}

select:focus,
input[type="text"]:focus {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(212, 175, 80, 0.12);
}

input[type="text"]::placeholder {
    color: var(--color-caption);
    font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════
   VOICE SEARCH
   ═══════════════════════════════════════════════════════════ */
.voice-search-row {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border-light);
}

.voice-search-group {
    display: flex;
    flex-direction: column;
}

.voice-search-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    color: var(--color-title);
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.3px;
}

.voice-search-group label i {
    color: var(--accent-medium);
    margin-left: 4px;
}

.voice-search-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Voice Button */
.voice-btn {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--border-medium);
    background: var(--surface-warm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    outline: none;
}

.voice-btn:hover {
    background: var(--accent-subtle);
    border-color: var(--border-accent);
    transform: scale(1.06);
    box-shadow: 0 0 0 4px rgba(139, 105, 20, 0.08);
}

.voice-btn-icon {
    font-size: 1.3rem;
    color: var(--accent);
    z-index: 2;
    transition: color 0.3s ease, transform 0.3s ease;
}

/* Pulsing rings (hidden by default) */
.voice-btn-rings {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.voice-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--accent-light);
    opacity: 0;
    width: 100%;
    height: 100%;
}

/* Active listening state */
.voice-btn.listening {
    background: var(--accent-subtle);
    border-color: var(--accent-light);
    box-shadow: 0 0 0 6px rgba(212, 175, 80, 0.12);
    animation: voiceBtnPulse 1.5s ease-in-out infinite;
}

.voice-btn.listening .voice-btn-icon {
    color: #ef4444;
    transform: scale(1.15);
}

.voice-btn.listening .voice-btn-rings {
    display: flex;
}

.voice-btn.listening .voice-ring:nth-child(1) {
    animation: voiceRingPulse 2s ease-out infinite 0s;
}

.voice-btn.listening .voice-ring:nth-child(2) {
    animation: voiceRingPulse 2s ease-out infinite 0.5s;
}

.voice-btn.listening .voice-ring:nth-child(3) {
    animation: voiceRingPulse 2s ease-out infinite 1s;
}

@keyframes voiceRingPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

@keyframes voiceBtnPulse {

    0%,
    100% {
        box-shadow: 0 0 0 6px rgba(212, 175, 80, 0.12);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(212, 175, 80, 0.06);
    }
}

/* Status and transcript */
.voice-status {
    font-family: 'Tajawal', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-muted);
    line-height: 1.5;
    flex: 1;
    min-width: 0;
}

.voice-status.active {
    color: #ef4444;
    font-weight: 600;
}

.voice-status.success {
    color: #16a34a;
    font-weight: 600;
}

.voice-status.error {
    color: #ef4444;
}

.voice-transcript {
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.8rem 1.1rem;
    background: var(--accent-subtle);
    border: 1px solid var(--border-accent);
    border-radius: var(--r-md);
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    direction: rtl;
    text-align: right;
    line-height: 1.7;
    animation: voiceTranscriptIn 0.35s var(--ease);
}

@keyframes voiceTranscriptIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Unsupported browser warning */
.voice-unsupported {
    font-family: 'Tajawal', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-caption);
    text-align: center;
    padding: 0.6rem;
}

/* ═══════════════════════════════════════════════════════════
   RESULTS
   ═══════════════════════════════════════════════════════════ */
#searchResults {
    display: none;
    margin-bottom: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

#searchTitle {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-title);
    margin-bottom: 1.2rem;
}

#searchTitle i {
    color: var(--accent);
}

#results,
#searchResults {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

/* ═══════════════════════════════════════════════════════════
   MUSHAF CARD
   ═══════════════════════════════════════════════════════════ */
.mushaf-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--r-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.mushaf-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.mushaf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    user-select: none;
    -webkit-user-select: none;
}

.page-badge {
    background: var(--accent-subtle);
    color: var(--accent);
    padding: 0.5rem 1.1rem;
    border-radius: var(--r-md);
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    border: 1px solid var(--border-accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.font-badge {
    background: var(--surface-warm);
    color: var(--color-muted);
    padding: 0.5rem 1.1rem;
    border-radius: var(--r-md);
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ═══ QCF Text — UNTOUCHED logic ═══ */
.qcf-text-area {
    font-family: 'QCF4_Hafs_01_W', Arial, sans-serif;
    font-size: 2.2rem;
    line-height: 2.2;
    color: var(--color-title);
    text-align: center;
    direction: rtl;
    unicode-bidi: bidi-override;
    white-space: pre-wrap;
    word-spacing: 0;
    letter-spacing: 0;
    word-break: normal;
    overflow-wrap: break-word;
    overflow-x: hidden;
    margin: 0 auto 2rem auto;
    max-width: 100%;
    padding: 2rem 1.5rem;
    background: var(--surface-warm);
    border-radius: var(--r-md);
    border: 1px solid var(--border-light);
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

.qcf-text-area span {
    display: inline;
    cursor: text;
    padding: 0 1px;
}

.qcf-text-area ::selection {
    background: rgba(212, 175, 80, 0.3);
    color: var(--color-title);
}

.qcf-text-area span::selection {
    background: rgba(212, 175, 80, 0.3);
    color: var(--color-title);
}

.highlighted-word {
    color: var(--color-title);
    background: rgba(212, 175, 80, 0.2);
    padding: 0 6px;
    border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════
   FULL-SCREEN PAGE VIEWER OVERLAY
   ═══════════════════════════════════════════════════════════ */
.page-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--page-bg);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease), visibility 0.4s;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* Only the QCF text area is selectable */
.page-viewer-overlay .pv-qcf-text {
    user-select: text;
    -webkit-user-select: text;
}

.page-viewer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── Toolbar ── */
.pv-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 0.6rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.pv-toolbar-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.pv-toolbar-controls {
    gap: 0.6rem;
}

/* Close Button */
.pv-close-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--border-medium);
    background: var(--surface-warm);
    color: var(--color-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.pv-close-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #ef4444;
    transform: rotate(90deg);
}

/* Title */
.pv-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-subtle);
    padding: 0.4rem 1rem;
    border-radius: var(--r-md);
    border: 1px solid var(--border-accent);
    white-space: nowrap;
}

/* Font Info */
.pv-font-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-muted);
    background: var(--surface-warm);
    padding: 0.35rem 0.8rem;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-light);
    margin-right: auto;
    white-space: nowrap;
}

/* ── Navigation Group ── */
.pv-nav-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--surface-warm);
    border-radius: var(--r-lg);
    border: 1px solid var(--border-light);
    padding: 0.2rem;
}

.pv-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--accent);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.pv-nav-btn:hover {
    background: var(--accent-subtle);
    transform: scale(1.1);
}

.pv-nav-btn:active {
    transform: scale(0.95);
}

.pv-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pv-nav-btn:disabled:hover {
    background: transparent;
    transform: none;
}

.pv-page-select-wrap {
    position: relative;
}

.pv-page-select {
    padding: 0.35rem 2rem 0.35rem 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--r-sm);
    color: var(--color-title);
    font-family: 'Tajawal', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    outline: none;
    min-width: 100px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238B6914' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.5rem center;
}

.pv-page-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(212, 175, 80, 0.15);
}

/* ── Search Group ── */
.pv-search-group {
    flex: 1;
    min-width: 0;
}

.pv-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1.5px solid var(--border-medium);
    border-radius: var(--r-md);
    padding: 0.4rem 0.8rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.pv-search-input-wrap:focus-within {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(212, 175, 80, 0.12);
}

.pv-search-input-wrap i {
    color: var(--accent);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.pv-search-input {
    border: none !important;
    background: transparent !important;
    padding: 0.3rem 0 !important;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-title);
    outline: none;
    width: 100%;
    box-shadow: none !important;
}

/* ── Action Buttons ── */
.pv-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.45rem 1rem;
    border-radius: var(--r-md);
    border: none;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.pv-copy-btn {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(139, 105, 20, 0.2);
}

.pv-copy-btn:hover {
    background: var(--accent-medium);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(139, 105, 20, 0.3);
}

.pv-copy-btn:active {
    transform: scale(0.97);
}

.pv-copy-btn.copied {
    background: #16a34a;
    color: #fff;
}

/* ── Search Results Dropdown ── */
.pv-search-results {
    max-height: 50vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-light);
    margin-top: 0.3rem;
}

.pv-search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0.8rem;
    border-radius: var(--r-md);
    background: var(--surface-warm);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.88rem;
    color: var(--color-body);
}

.pv-search-result-item:hover {
    background: var(--accent-subtle);
    border-color: var(--border-accent);
    color: var(--accent);
    transform: translateX(-3px);
}

.pv-search-result-item .pv-sr-badge {
    background: var(--accent-subtle);
    color: var(--accent);
    padding: 0.2rem 0.6rem;
    border-radius: var(--r-sm);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid var(--border-accent);
}

.pv-search-result-item .pv-sr-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: rtl;
}

/* ── Content Area ── */
.pv-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    scroll-behavior: smooth;
}

.pv-page-card {
    width: 100%;
    max-width: 900px;
    background: var(--surface-warm);
    border-radius: var(--r-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    animation: pvCardIn 0.5s var(--ease);
}

@keyframes pvCardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pv-qcf-text {
    margin-bottom: 0 !important;
    background: var(--surface-warm) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: var(--r-md) !important;
    padding: 2rem 1.5rem !important;
}

/* ── Bottom Navigation Bar ── */
.pv-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.2rem;
    background: var(--surface);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    gap: 0.5rem;
}

.pv-bottom-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.55rem 1.2rem;
    border-radius: var(--r-lg);
    border: 1.5px solid var(--border-medium);
    background: var(--surface-warm);
    color: var(--accent);
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

.pv-bottom-btn:hover {
    background: var(--accent-subtle);
    border-color: var(--border-accent);
    transform: scale(1.03);
}

.pv-bottom-btn:active {
    transform: scale(0.97);
}

.pv-bottom-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pv-bottom-page-num {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-title);
    text-align: center;
    min-width: 80px;
}

/* ═══════════════════════════════════════════════════════════
   PAGE VIEWER — RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .pv-toolbar {
        padding: 0.5rem 0.6rem;
        gap: 0.4rem;
    }

    .pv-toolbar-row {
        gap: 0.4rem;
    }

    .pv-title {
        font-size: 0.82rem;
        padding: 0.3rem 0.7rem;
    }

    .pv-font-info {
        font-size: 0.72rem;
        padding: 0.25rem 0.5rem;
    }

    .pv-close-btn {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .pv-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .pv-page-select {
        font-size: 0.8rem;
        min-width: 80px;
        padding: 0.3rem 1.5rem 0.3rem 0.5rem;
    }

    .pv-search-input-wrap {
        padding: 0.3rem 0.6rem;
    }

    .pv-search-input {
        font-size: 0.82rem !important;
    }

    .pv-action-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.78rem;
    }

    .pv-copy-btn span {
        display: none;
    }

    .pv-content {
        padding: 0.8rem 0.4rem;
    }

    .pv-page-card {
        padding: 1rem 0.5rem;
        border-radius: var(--r-md);
    }

    .pv-qcf-text {
        font-size: 1rem !important;
        line-height: 2.3 !important;
        padding: 0.5rem 0.2rem !important;
    }

    .pv-bottom-nav {
        padding: 0.4rem 0.6rem;
    }

    .pv-bottom-btn {
        padding: 0.45rem 0.8rem;
        font-size: 0.78rem;
    }

    .pv-bottom-page-num {
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .pv-toolbar-controls {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .pv-toolbar-controls::-webkit-scrollbar {
        display: none;
    }

    .pv-font-info {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
        white-space: normal;
        text-align: center;
    }

    .pv-qcf-text {
        font-size: 0.9rem !important;
        line-height: 2.3 !important;
    }

    .pv-bottom-btn span {
        display: none;
    }

    .pv-bottom-btn {
        padding: 0.45rem 0.7rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   PAGE VIEWER — DARK MODE
   ═══════════════════════════════════════════════════════════ */
[data-theme="dark"] .page-viewer-overlay {
    background: var(--page-bg);
}

[data-theme="dark"] .pv-toolbar {
    background: var(--surface);
    border-bottom-color: var(--border-light);
}

[data-theme="dark"] .pv-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-medium);
    color: var(--color-muted);
}

[data-theme="dark"] .pv-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

[data-theme="dark"] .pv-nav-group {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-light);
}

[data-theme="dark"] .pv-page-select {
    background-color: var(--surface);
    border-color: var(--border-medium);
    color: var(--color-title);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23D4AF50' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="dark"] .pv-search-input-wrap {
    background: var(--surface);
    border-color: var(--border-medium);
}

[data-theme="dark"] .pv-search-input {
    color: #F0F0F0 !important;
}

[data-theme="dark"] .pv-copy-btn {
    background: var(--accent);
    color: #0C1117;
}

[data-theme="dark"] .pv-copy-btn:hover {
    background: var(--accent-light);
}

[data-theme="dark"] .pv-page-card {
    background: var(--surface);
    border-color: var(--border-light);
}

[data-theme="dark"] .pv-qcf-text {
    color: #FFFFFF !important;
}

[data-theme="dark"] .pv-bottom-nav {
    background: var(--surface);
    border-top-color: var(--border-light);
}

[data-theme="dark"] .pv-bottom-btn {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-medium);
}

[data-theme="dark"] .pv-bottom-btn:hover {
    background: rgba(212, 175, 80, 0.1);
    border-color: rgba(212, 175, 80, 0.25);
}

[data-theme="dark"] .pv-search-result-item {
    background: var(--surface-warm);
    border-color: var(--border-light);
    color: var(--color-body);
}

[data-theme="dark"] .pv-search-result-item:hover {
    background: rgba(212, 175, 80, 0.08);
    border-color: rgba(212, 175, 80, 0.2);
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.primary-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--r-md);
    padding: 1rem 2rem;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(139, 105, 20, 0.2);
}

.primary-btn:hover {
    background: var(--accent-medium);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 105, 20, 0.25);
}

.primary-btn:active {
    transform: scale(0.98);
}

.primary-btn.copied {
    background: #16a34a;
    color: #fff;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.pulse-glow {
    animation: none;
}

/* ═══════════════════════════════════════════════════════════
   LOADING
   ═══════════════════════════════════════════════════════════ */
#loading {
    text-align: center;
    padding: 3rem;
    display: none;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    color: var(--accent);
    font-size: 1.4rem;
    font-weight: 700;
    animation: flash 1.5s infinite;
}

@keyframes flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* ═══════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--surface);
    border: 1px solid var(--border-medium);
    color: var(--accent);
    padding: 0.7rem 1.8rem;
    border-radius: 30px;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transition: transform 0.5s var(--ease);
    z-index: 10001;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
.footer {
    border-top: 1px solid var(--border-light);
    padding: 3rem 1.5rem 2rem;
    margin-top: auto;
    background: var(--surface-warm);
}

.footer-content {
    max-width: 880px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2.5rem;
}

.social-section h3 {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    color: var(--color-title);
    margin-bottom: 1.2rem;
    font-size: 1.15rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.social-section h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 30px;
    height: 2px;
    background: var(--accent-light);
    border-radius: 2px;
}

.social-section ul {
    list-style: none;
    padding: 0;
}

.social-section ul li {
    margin-bottom: 0.8rem;
}

.social-section a {
    font-family: 'Tajawal', sans-serif;
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-section a::before {
    content: '←';
    color: var(--accent);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.social-section a:hover {
    color: var(--accent);
}

.social-section a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.footer-simple-content {
    max-width: 880px;
    margin: 2.5rem auto 0;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    text-align: center;
}

.footer-simple-content p {
    font-family: 'Tajawal', sans-serif;
    color: var(--color-caption);
    font-size: 0.85rem;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .qcf-text-area {
        font-size: 2rem;
        padding: 2rem 1.2rem;
        line-height: 2.2;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .mushaf-card {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem 0.6rem;
    }

    .hero-section {
        margin-bottom: 1.2rem;
    }

    .hero-identity-bar {
        padding: 1rem 1.2rem;
        gap: 10px;
    }

    .hero-logo-img {
        width: 42px;
        height: 42px;
    }

    .hero-identity-name {
        font-size: 0.95rem;
    }

    .hero-identity-label {
        font-size: 0.75rem;
    }

    .hero-container {
        padding: 1.8rem 1.2rem 1.5rem;
        gap: 1rem;
    }

    .hero-title {
        font-size: 1.7rem;
        margin-bottom: 0.3rem;
    }

    .hero-subtitle {
        font-size: 0.88rem;
    }

    .hero-lead {
        font-size: 0.85rem;
    }

    .hero-doa {
        font-size: 0.82rem;
        padding: 0.6rem 0.8rem;
        flex-direction: column;
        text-align: center;
    }

    .hero-meta-row {
        gap: 0.4rem;
    }

    .edition-badge {
        font-size: 0.72rem;
        padding: 0.3rem 0.8rem;
    }

    .tg-links {
        flex-direction: column;
    }

    .tg-link+.tg-link {
        border-right: none;
        border-top: 1px solid var(--border-light);
    }

    .tg-link {
        padding: 0.6rem;
        font-size: 0.78rem;
    }

    .controls {
        padding: 1.2rem;
        border-radius: var(--r-md);
        margin-bottom: 1.5rem;
    }

    .form-group {
        min-width: 100%;
    }

    .form-group label {
        font-size: 0.82rem;
        margin-bottom: 0.4rem;
    }

    select,
    input[type="text"] {
        font-size: 0.95rem;
        padding: 0.8rem 0.9rem;
    }

    .voice-search-row {
        margin-top: 1rem;
        padding-top: 1rem;
    }

    .voice-btn {
        width: 50px;
        height: 50px;
    }

    .voice-btn-icon {
        font-size: 1.15rem;
    }

    .voice-status {
        font-size: 0.82rem;
    }

    .voice-search-group label {
        font-size: 0.82rem;
        margin-bottom: 0.4rem;
    }

    .qcf-text-area {
        font-size: 1.7rem;
        line-height: 2.2;
        padding: 1.5rem 0.8rem;
        margin: 0 auto 2rem auto;
        border-radius: 8px;
    }

    .mushaf-card {
        padding: 1.2rem 0.8rem;
        border-radius: var(--r-md);
    }

    .mushaf-header {
        flex-direction: column;
        gap: 8px;
        align-items: center;
        padding-bottom: 0.8rem;
        margin-bottom: 1.2rem;
    }

    .page-badge,
    .font-badge {
        font-size: 0.82rem;
        width: 100%;
        padding: 0.5rem;
        justify-content: center;
    }

    .primary-btn {
        font-size: 0.95rem;
        padding: 0.85rem 0.6rem;
    }

    .footer-content {
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .voice-btn {
        width: 46px;
        height: 46px;
    }

    .voice-btn-icon {
        font-size: 1.05rem;
    }

    .voice-status {
        font-size: 0.78rem;
    }

    .voice-transcript {
        font-size: 0.88rem;
        padding: 0.6rem 0.8rem;
    }

    .hero-title {
        font-size: 1.45rem;
    }

    .hero-subtitle {
        font-size: 0.82rem;
    }

    .hero-container {
        padding: 1.5rem 0.8rem 1.2rem;
    }

    .hero-doa {
        font-size: 0.78rem;
        padding: 0.5rem 0.6rem;
    }

    .edition-badge {
        font-size: 0.68rem;
        padding: 0.25rem 0.6rem;
    }

    .visitor-counter {
        width: 100%;
        justify-content: center;
        padding: 0.5rem 0.8rem;
        gap: 7px;
        font-size: 0.8rem;
    }

    .visitor-counter .vc-num {
        font-size: 1rem;
    }

    .qcf-text-area {
        font-size: 1rem;
        line-height: 2.3;
        padding: 0.8rem 0.2rem;
        margin: 0 auto 1.5rem auto;
        direction: rtl;
        unicode-bidi: bidi-override;
    }

    .mushaf-card {
        padding: 0.7rem 0.4rem;
    }

    .page-badge,
    .font-badge {
        font-size: 0.7rem;
        padding: 0.3rem;
    }

    .primary-btn {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS (kept simple)
   ═══════════════════════════════════════════════════════════ */
.fade-up-target {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.fade-up-visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-anim {
    opacity: 0;
    transform: translateY(16px);
    animation: heroIn 0.7s var(--ease) forwards;
}

.hero-anim:nth-child(1) {
    animation-delay: 0.08s;
}

.hero-anim:nth-child(2) {
    animation-delay: 0.16s;
}

.hero-anim:nth-child(3) {
    animation-delay: 0.24s;
}

.hero-container .hero-text-content .hero-anim:nth-child(1) {
    animation-delay: 0.18s;
}

.hero-container .hero-text-content .hero-anim:nth-child(2) {
    animation-delay: 0.28s;
}

.hero-container .hero-text-content .hero-anim:nth-child(3) {
    animation-delay: 0.38s;
}

.hero-container .hero-text-content .hero-anim:nth-child(4) {
    animation-delay: 0.48s;
}

.hero-container .hero-text-content .hero-anim:nth-child(5) {
    animation-delay: 0.58s;
}

.hero-container>.hero-doa.hero-anim {
    animation-delay: 0.6s;
}

.hero-section>.tg-links.hero-anim {
    animation-delay: 0.7s;
}

@keyframes heroIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.revealed {
    opacity: 1 !important;
    transform: translate(0, 0) scale(1) !important;
}

/* ═══════════════════════════════════════════════════════════
   DARK MODE — Full Theme Override
   Triggered by data-theme="dark" on <html>
   ═══════════════════════════════════════════════════════════ */
[data-theme="dark"] {
    --page-bg: #0C1117;
    --page-bg-alt: #111820;

    --surface: #161D27;
    --surface-warm: #1A2231;
    --surface-hover: #1E2738;

    --color-title: #F0F0F0;
    --color-subtitle: #C2B8A2;
    --color-body: #B8AEA0;
    --color-muted: #7A7060;
    --color-caption: #5C5448;

    --accent: #D4AF50;
    --accent-medium: #C9A240;
    --accent-light: #E0C06A;
    --accent-subtle: rgba(212, 175, 80, 0.1);

    --border-light: rgba(255, 255, 255, 0.07);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(212, 175, 80, 0.2);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
}

/* Splash in dark mode */
[data-theme="dark"] .splash-screen {
    background: #0C1117;
}

/* Scrollbar dark */
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #0C1117;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Selection dark */
[data-theme="dark"] ::selection {
    background: rgba(212, 175, 80, 0.35);
    color: #fff;
}

/* Toggle button in dark mode */
[data-theme="dark"] .theme-toggle {
    background: rgba(212, 175, 80, 0.1);
    border-color: rgba(212, 175, 80, 0.2);
    color: var(--accent-light);
}

[data-theme="dark"] .theme-toggle:hover {
    background: rgba(212, 175, 80, 0.18);
}

/* QCF verse text: white on dark */
[data-theme="dark"] .qcf-text-area {
    color: #FFFFFF;
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .qcf-text-area ::selection {
    background: rgba(212, 175, 80, 0.35);
    color: #fff;
}

[data-theme="dark"] .qcf-text-area span::selection {
    background: rgba(212, 175, 80, 0.35);
    color: #fff;
}

/* Highlighted word in dark */
[data-theme="dark"] .highlighted-word {
    color: #fff;
    background: rgba(212, 175, 80, 0.25);
}

/* Inputs dark */
[data-theme="dark"] select,
[data-theme="dark"] input[type="text"] {
    background: var(--surface);
    border-color: var(--border-medium);
    color: #F0F0F0;
}

[data-theme="dark"] input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] select:focus,
[data-theme="dark"] input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 80, 0.15);
}

/* Select dropdown arrow */
[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23D4AF50' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Button dark */
[data-theme="dark"] .primary-btn {
    background: var(--accent);
    color: #0C1117;
}

[data-theme="dark"] .primary-btn:hover {
    background: var(--accent-light);
}

[data-theme="dark"] .primary-btn.copied {
    background: #22c55e;
    color: #fff;
}

/* Toast dark */
[data-theme="dark"] .toast {
    background: var(--surface);
    border-color: var(--border-medium);
    color: var(--accent);
}

/* Footer dark */
[data-theme="dark"] .footer {
    background: var(--surface-warm);
    border-top-color: var(--border-light);
}

/* Visitor counter dark */
[data-theme="dark"] .visitor-counter .vc-dot {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(212, 175, 80, 0.4);
}

/* Loading dark */
[data-theme="dark"] #loading {
    color: var(--accent);
}

/* Voice search dark */
[data-theme="dark"] .voice-btn {
    background: rgba(212, 175, 80, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .voice-btn:hover {
    background: rgba(212, 175, 80, 0.15);
    border-color: rgba(212, 175, 80, 0.25);
}

[data-theme="dark"] .voice-btn.listening {
    background: rgba(212, 175, 80, 0.12);
    border-color: var(--accent-light);
}

[data-theme="dark"] .voice-transcript {
    background: rgba(212, 175, 80, 0.08);
    border-color: rgba(212, 175, 80, 0.2);
    color: var(--accent-light);
}

[data-theme="dark"] .voice-search-row {
    border-top-color: rgba(255, 255, 255, 0.07);
}

/* Smooth transition for theme switch */
html {
    transition: background-color 0.3s ease;
}

body,
.hero-section,
.hero-identity-bar,
.hero-container,
.controls,
.mushaf-card,
.qcf-text-area,
.footer,
.toast,
.visitor-counter,
.edition-badge,
.hero-doa,
.tg-link,
.theme-toggle,
.voice-btn,
.voice-search-row,
.voice-transcript {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}