/* ============================================
   خط التجويد الملوّن — Premium Design System
   ============================================ */

:root {
    /* Core Palette — Deep Islamic Gold & Midnight */
    --gold-50: #FDF8EF;
    --gold-100: #F9EDCF;
    --gold-200: #F0D89A;
    --gold-300: #E8C46B;
    --gold-400: #D4A843;
    --gold-500: #C8A45A;
    --gold-600: #B08A3E;
    --gold-700: #8E6E2F;
    --gold-800: #6B5223;
    --gold-900: #4A3818;

    --dark-50: #E8E8EC;
    --dark-100: #C5C5CF;
    --dark-200: #9E9EAF;
    --dark-300: #77778F;
    --dark-400: #595977;
    --dark-500: #3B3B5F;
    --dark-600: #353557;
    --dark-700: #2D2D4D;
    --dark-800: #252543;
    --dark-900: #1A1A32;
    --dark-950: #0E0E1F;

    --emerald-400: #34D399;
    --emerald-500: #10B981;
    --ruby-400: #F87171;
    --ruby-500: #EF4444;

    /* Surfaces */
    --bg-primary: #0F0F1A;
    --bg-secondary: #161625;
    --bg-card: #1C1C30;
    --bg-card-hover: #222240;
    --bg-elevated: #252542;

    /* Text */
    --text-primary: #F0ECE3;
    --text-secondary: #A8A4B8;
    --text-muted: #6B6780;
    --text-gold: #E8C46B;
    --text-accent: #C8A45A;

    /* Borders & Dividers */
    --border-subtle: rgba(200, 164, 90, 0.12);
    --border-medium: rgba(200, 164, 90, 0.25);
    --border-strong: rgba(200, 164, 90, 0.4);

    /* Gradients */
    --gradient-gold: linear-gradient(135deg, #C8A45A 0%, #E8D48B 50%, #B8944A 100%);
    --gradient-dark: linear-gradient(180deg, #0F0F1A 0%, #161625 100%);
    --gradient-card: linear-gradient(145deg, rgba(200, 164, 90, 0.08) 0%, rgba(200, 164, 90, 0.02) 100%);
    --gradient-header: linear-gradient(180deg, #0E0E1F 0%, #151528 50%, #1A1A32 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --shadow-gold: 0 4px 20px rgba(200, 164, 90, 0.15);
    --shadow-glow: 0 0 30px rgba(200, 164, 90, 0.1);

    /* Typography */
    --font-ui: 'Cairo', 'Tajawal', 'IBM Plex Sans Arabic', sans-serif;
    --font-display: 'Cairo', 'Tajawal', sans-serif;
    --font-body: 'IBM Plex Sans Arabic', 'Cairo', sans-serif;

    /* Spacing */
    --container-max: 1200px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   Reset & Base
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.7;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

::selection {
    background: rgba(200, 164, 90, 0.3);
    color: var(--gold-100);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--dark-600);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold-600);
}

/* ============================================
   Visitor Badge (Floating)
   ============================================ */

.visitor-badge {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(28, 28, 48, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-medium);
    border-radius: 100px;
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--text-gold);
    box-shadow: var(--shadow-gold), var(--shadow-md);
    animation: badgeFloat 3s ease-in-out infinite;
    transition: all 0.3s var(--ease-smooth);
}

.visitor-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold), var(--shadow-lg);
    border-color: var(--gold-500);
}

.visitor-badge svg {
    color: var(--gold-400);
    flex-shrink: 0;
}

.visitor-badge #visitorCount {
    font-weight: 700;
    font-size: 15px;
    color: var(--gold-300);
    min-width: 20px;
    text-align: center;
}

.visitor-badge .visitor-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

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

/* ============================================
   Header
   ============================================ */

.header {
    position: relative;
    padding: 60px 0 40px;
    background: var(--gradient-header);
    overflow: hidden;
}

.header-bg-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(200, 164, 90, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(200, 164, 90, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(200, 164, 90, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
    opacity: 0.4;
}

.header-content {
    position: relative;
    text-align: center;
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    animation: logoGlow 4s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(200, 164, 90, 0.2)); }
    50% { filter: drop-shadow(0 0 25px rgba(200, 164, 90, 0.4)); }
}

.logo-text h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.logo-subtitle {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 4px;
}

.header-dua {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 28px;
    background: rgba(200, 164, 90, 0.06);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 2;
    backdrop-filter: blur(8px);
}

/* ============================================
   Search Section
   ============================================ */

.search-section {
    padding: 48px 0 32px;
    position: relative;
}

.search-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.search-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--gradient-card);
}

.search-header h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-gold);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-header h2 svg {
    color: var(--gold-400);
}

/* Tabs */
.search-tabs {
    display: flex;
    padding: 0 24px;
    background: rgba(0,0,0,0.15);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.search-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s var(--ease-smooth);
}

.search-tab:hover {
    color: var(--text-gold);
    background: rgba(200, 164, 90, 0.05);
}

.search-tab.active {
    color: var(--gold-400);
    border-bottom-color: var(--gold-400);
}

.search-tab svg {
    flex-shrink: 0;
}

/* Panels */
.search-panel {
    display: none;
    padding: 28px 32px;
    animation: fadeSlideUp 0.35s var(--ease-smooth);
}

.search-panel.active {
    display: block;
}

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

.search-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-field {
    flex: 1;
    min-width: 150px;
}

.search-field.full-width {
    flex: 1 1 100%;
}

.search-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.search-field input,
.search-field select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    transition: all 0.3s var(--ease-smooth);
    outline: none;
}

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

.search-field input:focus,
.search-field select:focus {
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(200, 164, 90, 0.15);
}

.search-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A8A4B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 32px;
}

.search-field select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Search Button */
.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 28px;
    background: var(--gradient-gold);
    border: none;
    border-radius: var(--radius-md);
    color: var(--dark-950);
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    box-shadow: var(--shadow-gold);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(200, 164, 90, 0.3);
}

.search-btn:active {
    transform: translateY(0);
}

.search-btn svg {
    flex-shrink: 0;
}

/* ============================================
   Surah Index
   ============================================ */

.surah-index-section {
    padding: 40px 0 60px;
}

.section-title {
    text-align: center;
    margin-bottom: 32px;
}

.section-title h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-gold);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.section-title h2 svg {
    color: var(--gold-400);
}

.section-title p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

.surah-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    text-decoration: none;
    color: inherit;
}

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

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

.surah-card .surah-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(200, 164, 90, 0.1);
    border: 1px solid var(--border-medium);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold-400);
    flex-shrink: 0;
    /* Rotate for diamond shape */
    transform: rotate(45deg);
}

.surah-card .surah-num span {
    transform: rotate(-45deg);
}

.surah-card .surah-info {
    flex: 1;
    min-width: 0;
}

.surah-card .surah-name-ar {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.surah-card .surah-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   Results Section
   ============================================ */

.results-section {
    padding: 40px 0 60px;
    animation: fadeSlideUp 0.4s var(--ease-smooth);
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.results-header h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-gold);
}

.results-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--gradient-gold);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--dark-950);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-gold);
}

.action-btn.secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
}

.action-btn.secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* Verse Cards */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.verse-card {
    position: relative;
    padding: 24px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all 0.3s var(--ease-smooth);
    animation: verseAppear 0.4s var(--ease-smooth) backwards;
}

.verse-card:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-sm), var(--shadow-glow);
}

.verse-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.verse-ref {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.verse-ref .ref-badge {
    padding: 4px 12px;
    background: rgba(200, 164, 90, 0.1);
    border: 1px solid var(--border-medium);
    border-radius: 100px;
    color: var(--gold-400);
    font-size: 0.8rem;
    font-weight: 700;
}

.verse-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(200, 164, 90, 0.1);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--gold-400);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
}

.verse-copy-btn:hover {
    background: var(--gradient-gold);
    color: var(--dark-950);
    border-color: transparent;
}

.verse-text {
    font-size: 1.8rem;
    line-height: 2.4;
    text-align: center;
    color: var(--text-primary);
    padding: 16px 0;
    word-spacing: 6px;
    font-family: var(--font-display);
}

.verse-mushaf-layout {
    font-size: 2.2rem;
    line-height: 2;
    text-align: justify;
    text-align-last: center;
    color: var(--text-primary);
    padding: 16px 20px;
    word-spacing: normal;
    letter-spacing: 0;
    white-space: pre-wrap;
    /* Font smoothing for pixel-perfect Mushaf rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.verse-mushaf-layout.single-verse {
    text-align: center;
    text-align-last: center;
}

.verse-text-uthmani {
    font-family: var(--font-display);
    font-size: 1.6rem;
    line-height: 2.2;
    text-align: center;
    color: var(--text-primary);
    padding: 12px 0;
}

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

/* Page Navigation */
.page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.page-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
}

.page-nav-btn:hover {
    background: rgba(200, 164, 90, 0.1);
    border-color: var(--gold-500);
    color: var(--gold-400);
}

.page-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-nav-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ============================================
   Loading Overlay
   ============================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(14, 14, 31, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    text-align: center;
}

.spinner-ring {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-medium);
    border-top-color: var(--gold-400);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    font-family: var(--font-ui);
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   Toast
   ============================================ */

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--emerald-500);
    border-radius: 100px;
    color: white;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.3);
    opacity: 0;
    transition: all 0.4s var(--ease-bounce);
    pointer-events: none;
}

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

/* ============================================
   Footer
   ============================================ */

.footer {
    position: relative;
    background: var(--dark-950);
    padding-top: 0;
    margin-top: 40px;
}

.footer-wave {
    color: var(--bg-primary);
    line-height: 0;
    margin-bottom: -1px;
}

.footer-wave svg {
    width: 100%;
    height: 60px;
}

.footer-content {
    padding-top: 48px;
    padding-bottom: 32px;
}

.footer-main {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-brand {
    max-width: 380px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-logo svg {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.footer-logo h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-logo p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

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

.footer-links-group h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-gold);
    margin-bottom: 16px;
}

.footer-links-group h4 svg {
    color: var(--gold-400);
}

.footer-links-group ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links-group a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.3s var(--ease-smooth);
    padding: 6px 0;
}

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

.footer-links-group a svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.footer-links-group a:hover svg {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
}

.footer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-medium), transparent);
    margin-bottom: 20px;
}

.footer-bottom p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.footer-bottom p span {
    color: var(--text-gold);
    font-weight: 700;
}

.footer-copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .visitor-badge {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }

    .header {
        padding: 40px 0 30px;
    }

    .logo-text h1 {
        font-size: 1.8rem;
    }

    .logo-subtitle {
        font-size: 0.9rem;
    }

    .header-dua {
        font-size: 0.85rem;
        padding: 16px 20px;
    }

    .search-section {
        padding: 32px 0 24px;
    }

    .search-header {
        padding: 18px 20px;
    }

    .search-panel {
        padding: 20px;
    }

    .search-row {
        flex-direction: column;
    }

    .search-tab {
        padding: 12px 16px;
        font-size: 0.85rem;
    }

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

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

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

    .verse-text-uthmani {
        font-size: 1.3rem;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .results-actions {
        justify-content: center;
    }

    .footer-main {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-brand {
        max-width: 100%;
    }

    .page-nav {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .logo-text h1 {
        font-size: 1.5rem;
    }

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

    .verse-text {
        font-size: 1.2rem;
        line-height: 2;
    }
}

/* ============================================
   QCF4 Font Dynamic Styles (generated by JS)
   ============================================ */

/* These are injected dynamically via JavaScript when a page is loaded */
