/* Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');

@font-face {
    font-family: 'UthmanicHafs';
    src: url('/static/fonts/UthmanicHafs1Ver18.woff2') format('woff2');
    font-display: swap;
    font-weight: normal;
    font-style: normal;
}

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

/* Modern theme refresh */
:root {
    --bg: #111111;
    --bg-alt: #141414;
    --card: rgba(255, 255, 255, 0.04);
    --card-strong: rgba(255, 255, 255, 0.08);
    --stroke: rgba(255, 255, 255, 0.12);
    --muted: #9fb3c8;
    --text: #e5e7eb;
    --accent: #4db6ac;
    --accent-2: #fbbf24;
    --accent-3: #34d399;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --glass: blur(16px);
    --nav-bg: rgba(12, 38, 30, 0.97);
    --nav-border: rgba(77, 182, 172, 0.2);
    --nav-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --font-english: 'Open Sans', 'DM Sans', 'Space Grotesk', Helvetica, Arial, sans-serif;
    --font-arabic: 'UthmanicHafs', 'Scheherazade New', 'Amiri Quran', 'Amiri', 'Traditional Arabic', serif;
    --ayah-bg: #1c1c1c;
    --ayah-border: rgba(255, 255, 255, 0.06);
    --ayah-text: #ffffff;
    --ayah-row-bg: #242424;
    --ayah-row-hover: #2c2c2c;
    --ayah-row-text: #f0f0f0;
    --ayah-row-border: rgba(255, 255, 255, 0.06);
    --translation-bg: transparent;
    --translation-border: rgba(255, 255, 255, 0.06);
    --translation-text: #ffffff;
}

:root.light-theme {
    --bg: #f7f8fb;
    --bg-alt: #eef2f7;
    --card: rgba(0, 0, 0, 0.04);
    --card-strong: rgba(0, 0, 0, 0.08);
    --stroke: rgba(0, 0, 0, 0.08);
    --muted: #4b5563;
    --text: #0f172a;
    --accent: #0ea5e9;
    --accent-2: #f59e0b;
    --accent-3: #10b981;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    --nav-bg: rgba(255, 255, 255, 0.9);
    --nav-border: rgba(0, 0, 0, 0.06);
    --nav-shadow: 0 10px 25px rgba(15, 23, 42, 0.1);
    --font-english: 'Open Sans', 'DM Sans', 'Space Grotesk', Helvetica, Arial, sans-serif;
    --font-arabic: 'UthmanicHafs', 'Scheherazade New', 'Amiri Quran', 'Amiri', 'Traditional Arabic', serif;
    --ayah-bg: #f5f5f5;
    --ayah-border: rgba(0, 0, 0, 0.08);
    --ayah-text: #111111;
    --ayah-row-bg: #ffffff;
    --ayah-row-hover: #f9f9f9;
    --ayah-row-text: #111111;
    --ayah-row-border: rgba(0, 0, 0, 0.08);
    --translation-bg: transparent;
    --translation-border: rgba(0, 0, 0, 0.08);
    --translation-text: #374151;
}

body {
    font-family: var(--font-english);
    background-color: #111111;
    background-image: none;
    color: var(--text);
    letter-spacing: 0.01em;
}

:root.light-theme body {
    background-color: #f0f0f0;
}

body, p, h1, h2, h3, h4, h5, h6, a, li, span {
    color: var(--text);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-english);
    letter-spacing: 0.01em;
}

body.light-theme {
    background-color: #f7f8fb;
    background-image: radial-gradient(800px 700px at 20% 10%, rgba(14, 165, 233, 0.08), transparent 60%),
                      radial-gradient(600px 600px at 80% 20%, rgba(16, 185, 129, 0.08), transparent 60%),
                      linear-gradient(135deg, #f9fafb 0%, #eef2f7 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

main {
    padding: 0;
}

.feature {
    text-align: center;
    padding: 1.5rem;
    background: #252535;
    border-radius: 8px;
    border: 1px solid #2a2a3e;
}

.feature h3 {
    color: #4db6ac;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.start-buttons {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    justify-content: center;
}

.quick-links {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #2a2a3e;
}

.quick-links h3 {
    color: #4db6ac;
    margin-bottom: 1rem;
}

.quick-links ul {
    list-style: none;
    background: linear-gradient(145deg, var(--card), var(--card-strong));
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

.quick-links a {
    color: #4db6ac;
    background: var(--card-strong);
    padding: 0.5rem;
    display: block;
    border-radius: 4px;
    transition: background 0.3s;
}

.quick-links a:hover {
    background: #252535;
}

/* About — body paragraphs */
.about-body { font-size: 0.9rem; color: rgba(255,255,255,0.55); line-height: 1.75; margin: 0 0 1.1rem; }

/* Get in Touch — modern icon links */
.git-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.git-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin: 0 0 0.9rem;
}
.git-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.git-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.git-link svg { color: #4db6ac; flex-shrink: 0; }
.git-link:hover { background: rgba(77,182,172,0.08); border-color: rgba(77,182,172,0.3); color: #4db6ac; }

/* Ayah Container */
.ayah-container {
    background: #1e1e2e;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid #2a2a3e;
}

/* Compact Sticky Surah Header */
.surah-header-sticky {
    position: fixed;
    top: 0;
    left: 220px; /* Offset by sidebar width */
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg,
        rgba(77, 182, 172, 0.18) 0%,
        rgba(77, 208, 225, 0.12) 50%,
        rgba(56, 142, 60, 0.12) 100%),
        #0a1a12;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(77, 182, 172, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.surah-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 0.75rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.surah-title-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    min-width: 0;
}

.surah-transliteration-inline {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.surah-translation-inline {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-style: italic;
    opacity: 0.8;
}

.surah-header-centre {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.surah-progress-inline {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Progress in row 1 (hdr-progress): always visible since it's now in row 1 */
.hdr-progress {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
}

.surah-header-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.header-jump-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.header-jump-input {
    width: 40px;
    padding: 0.3rem 0.4rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(77,182,172,0.3);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.8rem;
    text-align: center;
}

.header-jump-input:focus {
    outline: none;
    border-color: #4db6ac;
    background: rgba(77,182,172,0.12);
}

.header-jump-input::placeholder { color: var(--text-muted); opacity: 0.6; }

.surah-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #4db6ac, #26a69a);
    color: #1a1a2e;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.surah-name-arabic {
    font-family: var(--font-arabic);
    font-size: 1.3rem;
    color: #4db6ac;
    font-weight: 600;
    line-height: 1;
}

.surah-meta-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    flex-wrap: wrap;
}

.surah-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.surah-meta-item svg {
    width: 16px;
    height: 16px;
    color: #4db6ac;
    flex-shrink: 0;
}

.surah-progress {
    color: #4db6ac;
    font-weight: 600;
}

.btn-context-compact {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: rgba(77, 182, 172, 0.1);
    border: 1px solid rgba(77, 182, 172, 0.3);
    border-radius: 8px;
    color: #4db6ac;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-context-compact:hover {
    background: rgba(77, 182, 172, 0.2);
    border-color: #4db6ac;
    transform: translateY(-1px);
}

.btn-context-compact svg {
    width: 16px;
    height: 16px;
}

/* Verses per page selector in header */
.verses-per-page {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.verses-per-page-select {
    background: rgba(77, 182, 172, 0.1);
    border: 1px solid rgba(77, 182, 172, 0.3);
    border-radius: 6px;
    color: var(--text);
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.verses-per-page-select:hover {
    background: rgba(77, 182, 172, 0.2);
    border-color: #4db6ac;
}

.verses-per-page-select:focus {
    outline: none;
    border-color: #4db6ac;
    background: rgba(77, 182, 172, 0.15);
}

/* Navigation Jump Section */
.nav-jump-section {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(77, 182, 172, 0.05);
    border: 1px solid rgba(77, 182, 172, 0.2);
    border-radius: 10px;
}

.nav-jump-inputs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.nav-jump-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--stroke);
    border-radius: 8px;
    padding: 0.65rem 0.5rem;
    color: var(--text);
    font-size: 0.95rem;
    text-align: center;
    min-width: 0; /* Allow shrinking */
}

.nav-jump-input:first-child {
    flex: 1.05; /* Surah box - just slightly wider */
}

.nav-jump-input:last-child {
    flex: 0.95; /* Ayah box - just slightly narrower */
}

.nav-jump-input:focus {
    outline: none;
    border-color: #4db6ac;
    background: rgba(77, 182, 172, 0.1);
}

.nav-jump-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.btn-jump-nav {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #4db6ac, #26a69a);
    border: none;
    border-radius: 8px;
    color: #1a1a2e;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-jump-nav:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(77, 182, 172, 0.4);
}

.btn-jump-nav svg {
    width: 14px;
    height: 14px;
}

/* Add padding to content when header is fixed */
.reading-container-with-fixed-header {
    padding-top: 80px; /* Height of fixed header */
}

/* ===== 2-Row Surah Header ===== */
.surah-header-row1 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.25rem;
    height: 48px;
    background: linear-gradient(135deg,
        rgba(77, 182, 172, 0.55) 0%,
        rgba(77, 208, 225, 0.4) 50%,
        rgba(56, 142, 60, 0.45) 100%),
        #0a1a12;
    border-bottom: 1px solid rgba(77, 182, 172, 0.3);
}
.surah-header-row2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 1.25rem;
    overflow: hidden;
}
.hdr-r1-spacer { flex: 1; }
.hdr-hamburger { display: none; } /* visible on mobile only */
.surah-type-badge {
    font-size: 0.68rem;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    background: rgba(77, 182, 172, 0.12);
    border: 1px solid rgba(77, 182, 172, 0.3);
    color: #4db6ac;
    text-transform: capitalize;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Responsive adjustments for sticky header */
@media (max-width: 968px) {
    .surah-header-sticky { left: 0; position: fixed; top: 0; }
}

.surah-header h2 {
    color: #4db6ac;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.surah-info {
    color: #a0a0a0;
    font-size: 1.1rem;
}

.verse-counter {
    color: #707070;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Arabic Text */
.arabic-text, .arabic {
    font-size: 2.6rem;
    line-height: 2.4;
    text-align: center;
    padding: 2rem;
    background: #141828;
    border-radius: 8px;
    margin: 2rem 0;
    color: #ffffff;
    font-family: var(--font-arabic);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.surah-name-arabic {
    font-family: var(--font-arabic);
}

/* Translation */
.translation {
    font-size: 1.3rem;
    line-height: 1.8;
    text-align: center;
    padding: 2rem;
    background: #252535;
    border-radius: 8px;
    color: #d0d0d0;
    margin-bottom: 2rem;
    border: 1px solid #2a2a3e;
}

/* Navigation Buttons */
.navigation {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #4db6ac 0%, #26a69a 100%);
    color: #1a1a2e;
    border: none;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(77, 182, 172, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #26a69a 0%, #1e8e84 100%);
    color: #1a1a2e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(77, 182, 172, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #4db6ac;
    border: 2px solid #4db6ac;
    font-weight: 600;
}

.btn-secondary:hover {
    background: rgba(77, 182, 172, 0.1);
    color: #4db6ac;
    border-color: #26a69a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 182, 172, 0.2);
}

.btn-nav {
    background: linear-gradient(145deg, var(--card), var(--card-strong));
    color: var(--text);
    border: 1px solid var(--stroke);
}

.btn-nav:hover {
    background: var(--card-strong);
    color: var(--accent);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Jump Section */
.jump-section {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.jump-section input {
    padding: 0.5rem;
    border: 2px solid #3a3a4e;
    border-radius: 4px;
    width: 100px;
    font-size: 1rem;
    background: #252535;
    color: #e0e0e0;
}

.jump-section input:focus {
    outline: none;
    border-color: #4db6ac;
}

/* Explanation Section */
.explanation-section,
.ask-section {
    margin-top: 2rem;
    padding: 2rem;
    background: #2a2a40;
    border-radius: 8px;
    border-left: 4px solid #ffa726;
    border: 1px solid #3a3a4e;
}

.explanation-section h3,
.ask-section h3 {
    color: #ffb74d;
    margin-bottom: 1rem;
}

.explanation-text {
    line-height: 1.8;
    color: #d0d0d0;
}

.explanation-text p {
    margin-bottom: 1rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #a0a0a0;
    font-style: italic;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-orb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4db6ac, #26a69a);
    animation: pulse-orb 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(77, 182, 172, 0.5);
}

@keyframes pulse-orb {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 20px rgba(77, 182, 172, 0.5);
    }
    50% {
        transform: scale(1.5);
        opacity: 0.7;
        box-shadow: 0 0 30px rgba(77, 182, 172, 0.8);
    }
}

.error {
    color: #ef5350;
    text-align: center;
    padding: 1rem;
}

/* Ask Section */
#questionInput {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #3a3a4e;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 1rem;
    resize: vertical;
    background: #252535;
    color: #e0e0e0;
}

#questionInput:focus {
    outline: none;
    border-color: #ffa726;
}

/* Footer */
footer {
    background: #16213e;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
}

.footer-dedication {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

footer #ameen-btn {
    padding: 0.45rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    background: linear-gradient(135deg, #4db6ac 0%, #26a69a 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(77, 182, 172, 0.35);
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

footer #ameen-btn:hover {
    background: linear-gradient(135deg, #26a69a 0%, #1e8e84 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(77, 182, 172, 0.45);
}

.footer-links {
    margin-top: 0.4rem;
    font-size: 0.78rem;
    opacity: 0.75;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.footer-links a {
    color: #a0aec0;
    text-decoration: none;
}

.footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .ayah-container {
        padding: 1.5rem;
    }

    .arabic-text {
        font-size: 2rem;
        padding: 1.5rem;
    }

    .translation {
        font-size: 1.1rem;
    }

    .navigation {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .start-buttons {
        flex-direction: column;
    }
}

/* Two-Column Reading Layout */
.reading-container {
    background: #1e1e2e;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid #2a2a3e;
    margin-top: 0;
}

.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #252535;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 1rem;
}

.count-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.count-selector label {
    color: #a0a0a0;
}

.count-selector select {
    padding: 0.5rem;
    background: #1e1e2e;
    color: #e0e0e0;
    border: 2px solid #3a3a4e;
    border-radius: 4px;
    cursor: pointer;
}

.count-selector select:focus {
    outline: none;
    border-color: #4db6ac;
}

.reading-layout {
    margin-top: 2rem;
}

.ayah-row {
    display: grid;
    grid-template-columns: 44px 1fr;
    grid-template-rows: auto auto;
    gap: 0;
    padding: 2rem 1rem 1.25rem;
    margin-bottom: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    transition: background 0.15s ease;
    cursor: pointer;
    box-shadow: none;
}

.ayah-content {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.bismillah-header {
    font-family: var(--font-arabic);
    font-size: 2.2rem;
    line-height: 2.4;
    color: #c9a84c;
    text-align: center;
    padding: 1.5rem 1rem 0.5rem;
    letter-spacing: 0.05em;
}

.ayah-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.ayah-row.selected {
    background: rgba(77, 182, 172, 0.08);
}

.ayah-badge {
    grid-column: 1;
    grid-row: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: start;
    margin-top: 0.25rem;
    background: transparent;
    color: #4db6ac;
    border: 2px solid #4db6ac;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.arabic-column {
    font-size: 5.4rem;
    line-height: 2.0;
    color: var(--ayah-row-text);
    font-family: var(--font-arabic);
    font-weight: normal;
    text-align: right;
    direction: rtl;
    unicode-bidi: embed;
    padding-bottom: 0.75rem;
    word-break: normal;
    overflow-wrap: anywhere;
    white-space: normal;
    width: 100%;
    /* QCF V4 Tajweed fonts render base glyphs in black (hardcoded in COLR table).
       invert(1) flips black→white; hue-rotate(180deg) restores tajweed hue identity
       because hue-rotate undoes the complementary hue shift that invert introduces. */
    filter: invert(1) hue-rotate(180deg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.english-column {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--translation-text);
    font-family: var(--font-english);
    font-weight: 400;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    -webkit-font-smoothing: antialiased;
}

.surah-separator-row {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1rem;
    margin: 2rem 0 1rem 0;
    background: linear-gradient(135deg, #4db6ac 0%, #26a69a 100%);
    border-radius: 8px;
    color: #1a1a2e;
}

.surah-separator-row h3 {
    margin: 0;
    font-size: 1.5rem;
}

/* Full Width Reading Layout */
.reading-container-full {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
}

.reading-area {
    width: 100%;
}

.query-header {
    margin-bottom: 1rem;
}

.query-header h3 {
    color: #4db6ac;
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.query-header p {
    color: #a0a0a0;
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.query-context {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #252535;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 3px solid #4db6ac;
}

.query-context strong {
    color: #4db6ac;
}

.query-context span {
    color: #e0e0e0;
}

.btn-clear {
    background: transparent;
    border: none;
    color: #ef5350;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: transform 0.2s;
}

.btn-clear:hover {
    transform: scale(1.2);
}

.query-input-area {
    margin-bottom: 1rem;
}

#queryInput {
    width: 100%;
    padding: 0.75rem;
    background: #161616;
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 0.75rem;
    min-height: 80px;
}

#queryInput:focus {
    outline: none;
    border-color: #4db6ac;
}

.query-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.query-actions .btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.95rem;
    justify-content: center;
}

.query-response {
    margin-top: 1rem;
    padding: 1rem;
    background: #1a1a2e;
    border-radius: 6px;
    border-left: 3px solid #ffb74d;
    max-height: 400px;
    overflow-y: auto;
}

.response-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.response-header h4 {
    color: #ffb74d;
    margin: 0;
    font-size: 1.1rem;
}

.response-content {
    color: #d0d0d0;
    line-height: 1.7;
    font-size: 0.95rem;
}

.response-content p {
    margin: 0.5rem 0;
}

.response-content .loading {
    text-align: center;
    padding: 1.5rem;
    color: #a0a0a0;
    font-style: italic;
}

.page-navigation {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #2a2a3e;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}


@media (max-width: 768px) {
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .query-content {
        padding: 1rem;
    }

    .query-actions {
        flex-direction: column;
    }

    .query-actions .btn {
        width: 100%;
    }
}

/* Surah Context Section */
.btn-context {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #5c6bc0 0%, #3f51b5 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-context:hover {
    background: linear-gradient(135deg, #3f51b5 0%, #303f9f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(92, 107, 192, 0.4);
}

.surah-context-section {
    position: fixed;
    top: 68px;
    right: 1rem;
    z-index: 1100;
    width: min(400px, calc(100vw - 2rem));
    max-height: 65vh;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #2a2a40 0%, #252535 100%);
    border-radius: 12px;
    border: 1px solid rgba(77, 182, 172, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

.surah-context-section h3 {
    color: #7986cb;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.context-content {
    color: #d0d0d0;
    line-height: 1.8;
    font-size: 1.1rem;
}

.context-content p {
    margin-bottom: 1rem;
}

.context-source {
    margin-top: 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--stroke);
    font-size: 0.85rem;
    opacity: 0.7;
}

.context-content .loading {
    text-align: center;
    padding: 2rem;
    color: #a0a0a0;
    font-style: italic;
}

.context-content .error {
    color: #ef5350;
    text-align: center;
    padding: 1rem;
}

/* Flash Messages */
.flash-messages {
    max-width: 1000px;
    margin: 1rem auto;
    padding: 0 2rem;
}

.flash-message {
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    font-weight: 500;
}

.flash-success {
    background: #4caf50;
    color: white;
}

.flash-error {
    background: #f44336;
    color: white;
}

/* Authentication Pages */
.auth-container {
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: #181818;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-width: 450px;
    width: 100%;
    border: 1px solid rgba(77, 182, 172, 0.25);
}

.auth-card h2 {
    color: #4db6ac;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #b0b0b0;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: #161616;
    color: #e0e0e0;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input[type="checkbox"] {
    width: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.checkbox-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.4rem;
}

.checkbox-row input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
}

.checkbox-row label {
    display: inline !important;
    margin: 0 0 0 0.5rem !important;
    font-weight: normal !important;
    cursor: pointer;
    white-space: nowrap;
}

.form-group input:focus {
    outline: none;
    border-color: #4db6ac;
    box-shadow: 0 0 0 3px rgba(77, 182, 172, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #4db6ac, #00897b);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    opacity: 0.92;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: #b0b0b0;
}

.auth-footer a {
    color: #4db6ac;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: none;
}

/* Library Hero Header (Bookmarks/Highlights/Notes) */
.lib-hero {
    background: linear-gradient(135deg, rgba(77,182,172,0.18), rgba(77,208,225,0.12), rgba(56,142,60,0.12)), #0a1a12;
    padding: 2.5rem 2rem;
    margin-bottom: 0;
}

.lib-hero h1 {
    color: #ffffff;
    margin: 0 0 0.4rem;
    font-size: 1.8rem;
    font-weight: 700;
}

.lib-hero p {
    color: rgba(255,255,255,0.75);
    margin: 0;
    font-size: 1rem;
}

/* Unified page brand header — replaces .lib-hero, .home-hero, .search-hero etc. */
.page-brand-header {
    padding: 1.75rem 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #e5e7eb;
    letter-spacing: -0.01em;
}

/* Search form section (no gradient background) */
.search-section {
    padding: 0.5rem 2rem 2.5rem;
}

/* Library Container (Bookmarks/Highlights) */
.library-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: auto;
}

.library-container h1 {
    color: #4db6ac;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.bookmarks-list, .highlights-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.bookmark-card, .highlight-card {
    background: #1a2420;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(77, 182, 172, 0.15);
    transition: all 0.3s ease;
}

.bookmark-card:hover, .highlight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.bookmark-header, .highlight-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.bookmark-header h3, .highlight-header h3 {
    flex: 1;
    color: #7986cb;
    font-size: 1.2rem;
}

.bookmark-header h3 a, .highlight-header h3 a {
    color: #7986cb;
    text-decoration: none;
}

.bookmark-header h3 a:hover, .highlight-header h3 a:hover {
    color: #5c6bc0;
}

.highlight-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.highlight-color-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: capitalize;
}

.btn-delete {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    opacity: 1;
    transform: scale(1.2);
}

.ayah-preview {
    margin: 1rem 0;
}

.ayah-preview .arabic-text {
    font-size: 1.6rem;
    line-height: 2.2;
    color: #e0e0e0;
    margin-bottom: 0.75rem;
}

.ayah-preview .english-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #b0b0b0;
}

.bookmark-note, .highlight-note {
    background: #1a1a2e;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    color: #d0d0d0;
    border-left: 4px solid #4db6ac;
}

.bookmark-meta, .highlight-meta {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #808080;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #b0b0b0;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.empty-state a {
    color: #4db6ac;
    text-decoration: none;
    font-weight: 600;
}

/* Ayah Actions (Bookmark/Highlight Buttons) */
.ayah-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
    direction: ltr;
    align-items: center;
}

/* Modern theme refresh definitions live at the top; duplicate removed */
.navbar {
    background: linear-gradient(135deg,
        rgba(77, 182, 172, 0.18) 0%,
        rgba(77, 208, 225, 0.12) 50%,
        rgba(56, 142, 60, 0.12) 100%),
        #0a1a12;
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: var(--nav-shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 56px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    flex: 1;
    flex-wrap: nowrap;
}

.nav-links li {
    display: flex;
    align-items: center;
    list-style: none;
}

.logo {
    font-family: 'Aptos', 'Space Grotesk', 'DM Sans', 'Open Sans', sans-serif;
    font-weight: 800;
    letter-spacing: 0.12em;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
    text-transform: uppercase;
}

.logo .logo-icon {
    width: 22px;
    height: 22px;
    margin-right: 8px;
    vertical-align: middle;
}

.nav-home {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: linear-gradient(145deg, var(--card), var(--card-strong));
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: var(--shadow);
    backdrop-filter: var(--glass);
}

.nav-home:hover {
    color: var(--accent);
    background: var(--card-strong);
    transform: translateY(-1px);
}

.nav-links a {
    padding: 0.35rem 0.75rem;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--accent);
    transform: translateY(-1px);
}

.navbar a,
.navbar a:hover {
    text-decoration: none;
}

.nav-links svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.8px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    position: relative;
}

.menu-toggle,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: linear-gradient(145deg, var(--card), var(--card-strong));
    backdrop-filter: var(--glass);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-toggle:hover,
.theme-toggle:hover {
    background: var(--card-strong);
    transform: translateY(-1px);
}

.light-theme .menu-toggle,
.light-theme .theme-toggle,
.light-theme .btn-icon,
.light-theme .nav-home,
.light-theme .btn-nav {
    background: linear-gradient(145deg, #eef2f7, #e2e8f0);
    border-color: #cbd5e1;
    color: #0f172a;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
}

.light-theme .menu-toggle:hover,
.light-theme .theme-toggle:hover,
.light-theme .nav-home:hover,
.light-theme .btn-nav:hover {
    background: #dfe5ef;
}

.menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--nav-bg);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
    z-index: 1200;
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    flex-direction: column;
}

.menu-dropdown.is-open {
    display: flex;
}

.menu-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: var(--text);
    text-decoration: none;
}

.menu-dropdown a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent);
}

.light-theme .menu-dropdown {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.light-theme .menu-dropdown a {
    color: #0f172a;
}

.light-theme .menu-dropdown a:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #0ea5e9;
}

.light-theme .btn-icon {
    background: linear-gradient(145deg, rgba(255,255,255,0.8), rgba(238,242,247,0.8));
    border-color: rgba(0,0,0,0.08);
    color: #0f172a;
    backdrop-filter: blur(16px);
}

.light-theme .btn-icon:hover {
    background: rgba(238,242,247,0.95);
    color: #0ea5e9;
}

/* ===== Comprehensive light-theme overrides ===== */
.light-theme .welcome-container,
.light-theme .ayah-container,
.light-theme .feature,
.light-theme .reading-container,
.light-theme .controls-bar,
.light-theme .explanation-section,
.light-theme .ask-section,
.light-theme .query-response,
.light-theme .interaction-sidebar,
.light-theme .sidebar-sticky,
.light-theme .content-with-sidebar {
    background: rgba(255, 255, 255, 0.82);
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.light-theme .translation {
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    border-color: rgba(0, 0, 0, 0.06);
}

.light-theme .arabic-text {
    background: linear-gradient(120deg, rgba(14, 165, 233, 0.1), rgba(16, 185, 129, 0.08));
    color: #0f172a;
    border-color: rgba(14, 165, 233, 0.25);
}

.light-theme input,
.light-theme textarea,
.light-theme select {
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.12);
}

.light-theme input:focus,
.light-theme textarea:focus,
.light-theme select:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

.light-theme footer {
    background: rgba(255, 255, 255, 0.6);
    color: #4b5563;
    border-color: rgba(0, 0, 0, 0.06);
}

.light-theme .navigation a,
.light-theme .quick-links a {
    color: #0f172a;
}

.light-theme .navigation a:hover,
.light-theme .quick-links a:hover {
    color: #0ea5e9;
}

.light-theme .btn {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(238, 242, 247, 0.9));
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.light-theme .btn:hover {
    background: rgba(238, 242, 247, 0.95);
    color: #0ea5e9;
}

.light-theme .btn-primary,
.light-theme .btn-secondary {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(238, 242, 247, 0.9));
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.08);
}

.light-theme .btn-primary:hover,
.light-theme .btn-secondary:hover {
    background: rgba(238, 242, 247, 0.95);
    color: #0ea5e9;
}

.light-theme .nav-links a {
    color: #0f172a;
}

.light-theme .nav-links a:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #0ea5e9;
}

.light-theme .logo {
    color: #0f172a;
}

.light-theme .surah-header {
    border-color: rgba(0, 0, 0, 0.08);
    color: #0f172a;
}

.light-theme .verse-counter,
.light-theme .explanation-text,
.light-theme .loading,
.light-theme .error {
    color: #0f172a;
}

.light-theme .source-citation.grounded {
    background: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
}

.light-theme .source-citation.ungrounded {
    background: rgba(255, 152, 0, 0.1);
    color: #e65100;
}

.light-theme .auth-prompt {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(16, 185, 129, 0.12));
}

.light-theme .auth-prompt p,
.light-theme .auth-prompt a {
    color: #0f172a;
}

.light-theme .auth-footer {
    color: #4b5563;
}

.light-theme .auth-footer a {
    color: #0ea5e9;
}
/* ===== End light-theme overrides ===== */

.welcome-container,
.ayah-container,
.feature,
.translation,
.arabic-text,
.explanation-section,
.ask-section,
.query-response,
.interaction-sidebar,
.sidebar-sticky {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.welcome-container,
.ayah-container {
    padding: 3rem;
}

.surah-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.arabic-text {
    background: var(--ayah-bg);
    color: var(--ayah-text);
    border: 1px solid var(--ayah-border);
    font-size: 2.6rem;
    font-family: var(--font-arabic);
    line-height: 2.4;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.translation {
    background: var(--translation-bg);
    border: 1px solid var(--translation-border);
    color: var(--translation-text);
    font-size: 1.15rem;
    font-family: var(--font-english);
}

.explanation-section,
.ask-section {
    border-left: 4px solid var(--accent-2);
    background: linear-gradient(145deg, var(--card), var(--card-strong));
    color: var(--text);
    border: 1px solid var(--stroke);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.query-actions .btn:hover {
    background: var(--card-strong);
    color: var(--accent);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
}

.query-actions .btn.btn-primary {
    background: linear-gradient(135deg, #3a9e94, #00796b);
    color: #fff;
    border: none;
    box-shadow: none;
}

.query-actions .btn.btn-primary:hover {
    opacity: 0.9;
}

.query-actions .btn.btn-secondary {
    background: #222222;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.query-actions .btn.btn-secondary:hover {
    background: #2a2a2a;
    border-color: rgba(77, 182, 172, 0.4);
    color: var(--accent);
}
.verse-counter,
.explanation-text,
.loading,
.error,
.navigation,
.quick-links,
.quick-links a,
.ayah-container p,
.reading-container p,
.welcome-container p {
    color: var(--text);
}

.btn {
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 0.85rem 1.35rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    font-family: 'Aptos', 'DM Sans', 'Space Grotesk', 'Open Sans', sans-serif;
    background: linear-gradient(145deg, var(--card), var(--card-strong));
    border: 1px solid var(--stroke);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
    color: var(--text);
    backdrop-filter: var(--glass);
}

.btn-primary {
    background: linear-gradient(135deg, #4db6ac, #00897b);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(77, 182, 172, 0.3);
}

.btn-primary:hover {
    opacity: 0.92;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(145deg, var(--card), var(--card-strong));
    color: var(--text);
    border: 1px solid var(--stroke);
    backdrop-filter: var(--glass);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.btn-secondary:hover {
    background: var(--card-strong);
    color: var(--accent);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.btn-nav {
    background: linear-gradient(145deg, var(--card), var(--card-strong));
    color: var(--text);
    box-shadow: none;
    border: 1px solid var(--stroke);
}

.btn-nav:hover {
    background: var(--card-strong);
    color: var(--accent);
}

input,
textarea,
select {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18);
}

.query-response {
    border-left: 4px solid var(--accent);
    background: rgba(6, 9, 19, 0.9);
}

.interaction-sidebar {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 12, 24, 0.95);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: linear-gradient(145deg, var(--card), var(--card-strong));
    backdrop-filter: var(--glass);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: var(--card-strong);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.btn-bookmark.bookmarked svg {
    stroke: #ef4444;
    fill: rgba(239, 68, 68, 0.15);
}

/* Highlight Colors */
.highlight-yellow {
    background: linear-gradient(135deg, rgba(255, 235, 59, 0.15) 0%, rgba(255, 193, 7, 0.15) 100%) !important;
    border-left: 4px solid #ffeb3b !important;
}

.highlight-green {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(67, 160, 71, 0.15) 100%) !important;
    border-left: 4px solid #4caf50 !important;
}

.highlight-blue {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15) 0%, rgba(30, 136, 229, 0.15) 100%) !important;
    border-left: 4px solid #2196f3 !important;
}

.highlight-pink {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.15) 0%, rgba(216, 27, 96, 0.15) 100%) !important;
    border-left: 4px solid #e91e63 !important;
}

.highlight-color-tag {
    background: #4db6ac;
    color: white;
}

/* Auth Prompt on Index */
.auth-prompt {
    margin-top: 3rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #5c6bc0 0%, #3f51b5 100%);
    border-radius: 8px;
    text-align: center;
}

.auth-prompt p {
    color: white;
    font-size: 1.1rem;
    margin: 0;
}

.auth-prompt a {
    color: #ffeb3b;
    text-decoration: none;
    font-weight: 600;
}

.auth-prompt a:hover {
    text-decoration: none;
}

/* Scrollbar styling for sidebar */
.sidebar-sticky::-webkit-scrollbar {
    width: 8px;
}

.sidebar-sticky::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 4px;
}

.sidebar-sticky::-webkit-scrollbar-thumb {
    background: #4db6ac;
    border-radius: 4px;
}

.sidebar-sticky::-webkit-scrollbar-thumb:hover {
    background: #26a69a;
}

/* Theme-aware surfaces and typography overrides */
.feature,
.ayah-container,
.reading-container,
.controls-bar,
.explanation-section,
.ask-section,
.welcome-container,
.query-response,
.interaction-sidebar,
.sidebar-sticky,
.content-with-sidebar,
.navigation,
.jump-section input,
.quick-links a,
footer,
.loading,
.error {
    background: var(--card);
    color: var(--text);
    border-color: var(--stroke);
    box-shadow: var(--shadow);
}

footer {
    border-top: 1px solid var(--stroke);
}

.jump-section input,
#questionInput,
input,
textarea,
select {
    border: 1px solid var(--stroke);
}

.navigation a,
.quick-links a {
    color: var(--text);
}

/* Mobile improvements */
@media (max-width: 768px) {
    .content-with-sidebar {
        gap: 0;
    }

    .controls-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .count-selector, .jump-section {
        width: 100%;
    }

    .sidebar-sticky {
        padding: 1rem;
        max-height: 250px;
    }

    .query-header h3 {
        font-size: 1rem;
    }

    .query-header p {
        font-size: 0.8rem;
    }

    #queryInput {
        font-size: 0.9rem;
        min-height: 60px;
    }

    .query-actions .btn {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
}

/* Citation and Source Styles */
.source-citation {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
    font-weight: 600;
}

.source-citation.grounded {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #81c784;
}

.source-citation.ungrounded {
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #ffb74d;
}

/* Navbar layout harden — rules consolidated in the hard overrides block below */

/* Navbar hard overrides to enforce horizontal layout */
.nav-inner {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    flex-wrap: nowrap !important;
}

.navbar .logo,
.navbar .nav-home,
.navbar .nav-actions {
    flex-shrink: 0 !important;
}

.nav-links {
    list-style: none !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.9rem !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 1 auto !important;
    flex-wrap: nowrap !important;
}

.nav-links li {
    list-style: none !important;
    display: flex !important;
    align-items: center !important;
}

.nav-links a {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    padding: 0.35rem 0.75rem !important;
    text-decoration: none !important;
}

/* Modal Popup Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.modal-content {
    background: #181818;
    border: 1px solid rgba(77, 182, 172, 0.25);
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #ffffff;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

.modal-body {
    padding: 2rem;
}

.modal-verse-info {
    margin-bottom: 1.5rem;
}

.modal-verse-display {
    background: linear-gradient(145deg, rgba(77, 182, 172, 0.08), rgba(77, 182, 172, 0.03));
    border: 1px solid rgba(77, 182, 172, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
}

.modal-verse-number {
    font-size: 0.9rem;
    color: #4db6ac;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-verse-arabic {
    font-size: 2rem;
    line-height: 2;
    color: var(--text);
    font-family: var(--font-arabic);
    margin-bottom: 1rem;
    text-align: right;
}

.modal-verse-english {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-muted);
    font-family: var(--font-english);
}

.query-input-area {
    margin-bottom: 1.5rem;
}

.query-input-area textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    background: #161616;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 1rem;
}

.query-input-area textarea:focus {
    outline: none;
    border-color: rgba(77, 182, 172, 0.5);
    box-shadow: none;
}

.query-actions {
    display: flex;
    gap: 0.75rem;
}

.query-actions .btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.query-response {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #161616;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.response-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(77, 182, 172, 0.2);
}

.response-header h4 {
    margin: 0;
    color: #4db6ac;
    font-size: 1.1rem;
}

.response-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.response-content {
    color: var(--text);
    line-height: 1.7;
    font-size: 0.95rem;
}

.btn-compact {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-clear {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 1rem;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-verse-arabic {
        font-size: 1.6rem;
    }
    
    .query-actions {
        flex-direction: column;
    }
    
    .query-actions .btn {
        width: 100%;
    }
}

/* ===================================
   Modern Home Page Styles
   =================================== */

/* Hero Section */
.home-hero {
    position: relative;
    margin: -3rem -2rem 3rem -2rem;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.15) 0%, 
        rgba(77, 208, 225, 0.1) 50%, 
        rgba(56, 142, 60, 0.1) 100%);
    border-radius: 0 0 24px 24px;
    overflow: visible;
    z-index: 1;
}

.home-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(77, 182, 172, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(77, 208, 225, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    z-index: 2;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    background: linear-gradient(135deg, #ffffff 0%, #e0f2f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin: 0 0 2.5rem 0;
    font-weight: 400;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-color) 0%, #388e3c 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(77, 182, 172, 0.3);
    position: relative;
    z-index: 10;
    cursor: pointer;
    pointer-events: auto;
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(77, 182, 172, 0.4);
}

.btn-hero-secondary {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.05rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
    cursor: pointer;
    pointer-events: auto;
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(77, 182, 172, 0.3);
    transform: translateY(-2px);
}

/* What's New Section */
.whats-new-section {
    margin: 2rem 0;
    padding: 1.75rem 2rem;
    background: linear-gradient(135deg, rgba(77,182,172,0.12), rgba(56,142,60,0.08)), #0a1a12;
    border: 1px solid rgba(77,182,172,0.2);
    border-radius: 14px;
}

.whats-new-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.whats-new-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    padding: 0.2rem 0.55rem;
    background: #4db6ac;
    color: #0a1408;
    border-radius: 4px;
    flex-shrink: 0;
}

.whats-new-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e5e7eb;
    margin: 0;
}

.whats-new-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.1rem;
}

.wn-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.wn-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.wn-item strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 0.2rem;
}

.wn-item p {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
    margin: 0;
}

/* What's New — header extras */
.wn-release-date {
    margin-left: auto;
    font-size: 0.71rem;
    color: var(--muted);
}

/* What's New — featured block */
.wn-featured {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
    background: rgba(77,182,172,0.06);
    border: 1px solid rgba(77,182,172,0.18);
    border-radius: 10px;
    padding: 1.1rem 1.3rem;
    margin-bottom: 1.1rem;
}
.wn-featured-logo {
    flex-shrink: 0;
    width: 54px; height: 54px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0a1f2d 0%, #0d2a1e 60%, #091a28 100%);
    border: 1px solid rgba(77,182,172,0.18);
    border-radius: 12px;
}
.wn-featured-body { flex: 1; min-width: 0; }
.wn-featured-label {
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: #4db6ac; margin-bottom: 0.2rem;
}
.wn-featured-title {
    font-size: 1.05rem; font-weight: 700; color: #e5e7eb;
    margin: 0 0 0.35rem;
}
.wn-featured-desc {
    font-size: 0.82rem; color: #9fb3c8; line-height: 1.52;
    margin: 0 0 0.75rem;
}
.wn-featured-actions { display: flex; align-items: center; gap: 0.55rem; }
.wn-featured-cta {
    display: inline-flex; align-items: center; gap: 0.38rem;
    padding: 0.32rem 0.9rem;
    background: rgba(77,182,172,0.14);
    border: 1px solid rgba(77,182,172,0.32);
    border-radius: 6px; color: #4db6ac; font-size: 0.8rem; font-weight: 600;
    text-decoration: none; transition: background 0.15s, border-color 0.15s;
}
.wn-featured-cta:hover { background: rgba(77,182,172,0.26); border-color: rgba(77,182,172,0.55); color: #4db6ac; }
.wn-share-btn {
    display: inline-flex; align-items: center; gap: 0.32rem;
    padding: 0.32rem 0.65rem;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.32); font-size: 0.8rem; font-weight: 500;
    cursor: pointer; font-family: inherit;
    transition: color 0.15s;
}
.wn-share-btn:hover { color: rgba(255,255,255,0.7); }

/* What's New — compact bullet list */
.wn-bullets {
    list-style: none;
    margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.3rem 1.5rem;
}
.wn-bullets li {
    font-size: 0.82rem; color: var(--muted); line-height: 1.5;
    padding-left: 1rem; position: relative;
}
.wn-bullets li::before {
    content: '';
    position: absolute; left: 0; top: 0.55em;
    width: 4px; height: 4px; border-radius: 50%;
    background: rgba(77,182,172,0.55);
}

/* Feature card — Immersive Qur'an variant */
.feature-card-immersive { position: relative; }
.feature-card-immersive:hover { border-color: rgba(77,182,172,0.42); }
.feature-icon-immersive {
    background: linear-gradient(135deg, rgba(77,182,172,0.15), rgba(0,137,123,0.1));
    border-color: rgba(77,182,172,0.3);
}
.feature-card-new-badge {
    position: absolute; top: 0.8rem; right: 0.9rem;
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
    color: #4db6ac; background: none; padding: 0;
}

@media (max-width: 600px) {
    .whats-new-section { padding: 1.25rem 1rem; }
    .wn-featured { flex-direction: column; gap: 0.85rem; padding: 1rem; }
    .wn-featured-logo { width: 46px; height: 46px; }
    .wn-bullets { grid-template-columns: 1fr; }
}

/* Legal pages (Privacy & Terms) */
.legal-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 0.5rem 0 3rem;
}
.legal-page h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.3rem;
    color: #e5e7eb;
}
.legal-page .legal-updated {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 2.5rem;
    display: block;
}
.legal-section {
    margin-bottom: 2rem;
}
.legal-section h3 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #4db6ac;
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(77,182,172,0.2);
}
.legal-section p, .legal-section li {
    font-size: 0.88rem;
    color: #9fb3c8;
    line-height: 1.65;
    margin-bottom: 0.6rem;
}
.legal-section ul {
    padding-left: 1.2rem;
    margin: 0.5rem 0;
}
.legal-section ul li { margin-bottom: 0.35rem; }
.legal-section a { color: #4db6ac; text-decoration: none; }
.legal-section a:hover { color: #80cbc4; }

/* About & Release History */
.home-about-section {
    margin: 2.5rem 0;
    padding: 1.75rem 2rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
}
.about-intro {
    color: #9fb3c8;
    font-size: 0.92rem;
    line-height: 1.65;
    margin-bottom: 1.75rem;
    max-width: 72ch;
}
.release-history-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    margin-bottom: 1rem;
}
.release-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.release-item {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0 1.25rem;
    padding: 0.85rem 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    align-items: start;
}
.release-version {
    font-size: 0.78rem;
    font-weight: 700;
    font-family: monospace;
    color: rgba(255,255,255,0.45);
    padding-top: 0.1rem;
    white-space: nowrap;
}
.release-current .release-version { color: #4db6ac; }
.release-date {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    font-family: sans-serif;
    color: rgba(255,255,255,0.25);
    margin-top: 0.2rem;
    letter-spacing: 0;
}
.release-tag {
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    font-family: sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(77,182,172,0.18);
    color: #4db6ac;
    border-radius: 3px;
    padding: 1px 5px;
    margin-top: 0.35rem;
    width: fit-content;
}
.release-item ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.release-item ul li {
    font-size: 0.84rem;
    color: #9fb3c8;
    line-height: 1.45;
    padding-left: 1rem;
    position: relative;
}
.release-item ul li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: rgba(255,255,255,0.25);
}
@media (max-width: 600px) {
    .home-about-section { padding: 1.25rem 1rem; }
    .release-item { grid-template-columns: 1fr; gap: 0.4rem; }
    .release-version { padding-bottom: 0.1rem; }
}

/* Feature Cards Grid */
.home-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-4px);
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.08) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border-color: rgba(77, 182, 172, 0.3);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem auto;
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.2) 0%, 
        rgba(77, 208, 225, 0.15) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.3) 0%, 
        rgba(77, 208, 225, 0.25) 100%);
}

.feature-icon svg {
    stroke: #4db6ac;
}

.feature-icon svg,
.feature-icon span svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.5;
    stroke: #4db6ac;
    fill: none;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Quick Access Section */
.home-quick-access {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    text-align: center;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.quick-link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.04) 0%, 
        rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    position: relative;
    cursor: pointer;
    pointer-events: auto;
}

.quick-link-card:hover {
    transform: translateX(4px);
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.06) 0%, 
        rgba(255, 255, 255, 0.04) 100%);
    border-color: rgba(77, 182, 172, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.quick-link-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.15) 0%, 
        rgba(77, 208, 225, 0.1) 100%);
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-link-card:hover .quick-link-number {
    transform: scale(1.05);
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.25) 0%, 
        rgba(77, 208, 225, 0.2) 100%);
}

.quick-link-content {
    flex: 1;
    min-width: 0;
}

.quick-link-content h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.quick-link-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Authentication Prompt */
.home-auth-prompt {
    margin-top: 3rem;
}

.auth-prompt-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.03) 0%, 
        rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.auth-prompt-card:hover {
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.08) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border-color: rgba(77, 182, 172, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.auth-prompt-card svg,
.auth-prompt-card span svg {
    flex-shrink: 0;
    stroke: #4db6ac;
    fill: none;
    width: 24px;
    height: 24px;
}

.auth-prompt-card p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Feature Modal */
.feature-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.feature-modal-content {
    background: linear-gradient(145deg, 
        rgba(30, 30, 30, 0.95) 0%, 
        rgba(20, 20, 20, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.feature-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.feature-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.feature-modal-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--accent-color) 0%, #4dd0e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-modal-content ol {
    margin: 0 0 2rem 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.feature-modal-content ol li {
    margin-bottom: 1rem;
}

.feature-modal-content ol li strong {
    color: var(--text-primary);
    font-weight: 600;
}

.feature-note {
    background: rgba(77, 182, 172, 0.1);
    border-left: 3px solid var(--accent-color);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.feature-note strong {
    color: var(--accent-color);
}

.feature-modal-action {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-modal-primary {
    flex: 1;
    min-width: 140px;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-color) 0%, #388e3c 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(77, 182, 172, 0.3);
}

.btn-modal-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(77, 182, 172, 0.4);
}

.btn-modal-secondary {
    flex: 1;
    min-width: 140px;
    padding: 0.875rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.btn-modal-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(77, 182, 172, 0.3);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .home-hero {
        margin: -1.5rem -1.5rem 2rem -1.5rem;
        padding: 3rem 1.5rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.05rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-hero-primary,
    .btn-hero-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .home-features {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .quick-links-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

/* ===================================
   Search Page Styles
   =================================== */

/* Search Hero */
.search-hero {
    position: relative;
    margin: -3rem -2rem 3rem -2rem;
    padding: 3.5rem 2rem 4rem 2rem;
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.12) 0%, 
        rgba(77, 208, 225, 0.08) 50%, 
        rgba(56, 142, 60, 0.08) 100%);
    border-radius: 0 0 24px 24px;
}

.search-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(77, 182, 172, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.search-hero-content {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    z-index: 2;
}

.search-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    background: linear-gradient(135deg, #ffffff 0%, #e0f2f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.search-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0 0 2.5rem 0;
    line-height: 1.6;
}

/* Search Input Wrapper */
.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.08) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 0.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-input-wrapper:focus-within {
    border-color: rgba(77, 182, 172, 0.4);
    box-shadow: 0 0 0 4px rgba(77, 182, 172, 0.1);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.07) 100%);
}

.search-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--text-muted);
}

.search-icon svg {
    width: 20px;
    height: 20px;
}

.search-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    padding: 0.75rem 0.5rem;
    font-size: 1.05rem;
    color: var(--text-primary);
    font-family: inherit;
}

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

.btn-search {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--accent-color) 0%, #388e3c 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(77, 182, 172, 0.3);
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(77, 182, 172, 0.4);
}

.btn-search svg {
    width: 18px;
    height: 18px;
}

/* Search Examples */
.search-examples {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.example-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.example-query {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.example-query:hover {
    background: rgba(77, 182, 172, 0.15);
    border-color: rgba(77, 182, 172, 0.3);
    color: var(--accent-color);
    transform: translateY(-1px);
}

/* Search Results Container */
.search-results-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Loading State */
.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.loading-orb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #4dd0e1 100%);
    border-radius: 50%;
    animation: pulse-orb 1.5s ease-in-out infinite;
}

/* Empty/Error States */
.search-empty,
.search-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4rem 2rem;
    text-align: center;
}

.search-empty svg,
.search-error svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-muted);
}

.search-empty h3,
.search-error p {
    margin: 0;
    color: var(--text-secondary);
}

.search-error svg {
    stroke: #f44336;
}

/* Results Section */
.results-section {
    margin-bottom: 3rem;
}

.results-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.results-heading svg {
    width: 22px;
    height: 22px;
    stroke: var(--accent-color);
}

/* Results Grid (for Surah results) */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Results List (for Semantic results) */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Result Card */
.result-card {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.result-card:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.08) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border-color: rgba(77, 182, 172, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* Surah Result */
.surah-result {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    cursor: pointer;
}

.result-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.2) 0%, 
        rgba(77, 208, 225, 0.15) 100%);
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-color);
    transition: all 0.3s ease;
}

.surah-result:hover .result-number {
    transform: scale(1.05);
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.3) 0%, 
        rgba(77, 208, 225, 0.25) 100%);
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.result-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.result-arrow svg {
    width: 20px;
    height: 20px;
}

.surah-result:hover .result-arrow {
    color: var(--accent-color);
    transform: translateX(4px);
}

/* Semantic Result */
.semantic-result {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.result-verse-key {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 0.95rem;
}

.result-source {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.result-snippet {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Priority Result Badge */
.priority-result {
    border-color: rgba(77, 182, 172, 0.4);
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.08) 0%, 
        rgba(255, 255, 255, 0.03) 100%);
}

.result-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--accent-color) 0%, #388e3c 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Verse Result Specific Styles */
.verse-result {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    text-decoration: none;
}

.result-surah-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.result-arabic {
    font-family: 'Amiri Quran', serif;
    font-size: 1.4rem;
    color: #4dd0e1;
    line-height: 2;
    text-align: right;
    direction: rtl;
    padding: 0.75rem;
    background: rgba(77, 208, 225, 0.05);
    border-radius: 8px;
    border-right: 3px solid rgba(77, 208, 225, 0.3);
}

.result-verse-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-style: italic;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid rgba(77, 182, 172, 0.3);
    border-radius: 8px;
    line-height: 1.7;
}

.result-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-top: 0.25rem;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.result-action svg {
    width: 16px;
    height: 16px;
}

.verse-result:hover .result-action {
    opacity: 1;
    transform: translateX(4px);
}

/* Search Mode Toggle */
.search-mode-toggle {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn svg {
    width: 18px;
    height: 18px;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(77, 182, 172, 0.3);
}

.mode-btn.active {
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.2) 0%, 
        rgba(77, 208, 225, 0.15) 100%);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(77, 182, 172, 0.2);
}

/* Mode Description */
.mode-description {
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
}

.mode-desc-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(77, 182, 172, 0.06);
    border-left: 3px solid var(--accent-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mode-desc-content.hidden {
    display: none;
}

.mode-desc-content svg {
    flex-shrink: 0;
    color: var(--accent-color);
    margin-top: 0.15rem;
}

.mode-desc-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.mode-desc-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* AI Answer Section */
.ai-answer-section {
    margin-bottom: 2rem;
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.08) 0%, 
        rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(77, 182, 172, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    animation: slideIn 0.4s ease-out;
}

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

.answer-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.answer-header svg {
    width: 24px;
    height: 24px;
    color: var(--accent-color);
}

.answer-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.synthesized-answer {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.synthesized-answer p {
    margin-bottom: 0.75rem;
}

/* Surah Context Card */
.surah-context-card {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--accent-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.surah-context-card:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.08) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border-color: rgba(77, 182, 172, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.surah-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.surah-number {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.2) 0%, 
        rgba(77, 208, 225, 0.15) 100%);
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent-color);
}

.surah-name {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.surah-name-arabic {
    font-family: 'Amiri Quran', serif;
    font-size: 1.3rem;
    color: #4dd0e1;
}

.surah-name-transliteration {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.context-snippet {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.view-surah-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, 
        var(--accent-color) 0%, 
        rgba(77, 208, 225, 0.8) 100%);
    color: #0a1e2a;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.view-surah-btn svg {
    width: 16px;
    height: 16px;
}

.view-surah-btn:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(77, 182, 172, 0.3);
}

/* Verse Card */
.verse-card {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.verse-card:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, 
        rgba(77, 182, 172, 0.08) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border-color: rgba(77, 182, 172, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.verse-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}

.verse-meta .result-verse-key {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 0.95rem;
}

.verse-meta .result-surah-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.verse-arabic {
    font-family: 'Amiri Quran', serif;
    font-size: 1.4rem;
    color: #4dd0e1;
    line-height: 2;
    text-align: right;
    direction: rtl;
    padding: 0.75rem;
    background: rgba(77, 208, 225, 0.05);
    border-radius: 8px;
    border-right: 3px solid rgba(77, 208, 225, 0.3);
    margin-bottom: 0.75rem;
}

.verse-translation {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-style: italic;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid rgba(77, 182, 172, 0.3);
    border-radius: 8px;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.tafsir-note {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border-left: 2px solid rgba(77, 182, 172, 0.2);
    line-height: 1.6;
}

.tafsir-note::before {
    content: "📖 ";
    margin-right: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .search-hero {
        margin: -1.5rem -1.5rem 2rem -1.5rem;
        padding: 2.5rem 1.5rem 3rem 1.5rem;
    }
    
    .search-title {
        font-size: 2rem;
    }
    
    .search-subtitle {
        font-size: 1rem;
    }
    
    .search-input-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .search-icon {
        display: none;
    }
    
    .btn-search {
        width: 100%;
        justify-content: center;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .search-examples {
        gap: 0.5rem;
    }
    
    .example-label {
        width: 100%;
        text-align: center;
    }
}

/* ===== Highlight Colour Picker Popover ===== */
.highlight-picker-popover {
    position: absolute;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1e1e1e;
    border: 1px solid rgba(77,182,172,0.3);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.hc-swatch {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.hc-swatch:hover { transform: scale(1.2); border-color: rgba(255,255,255,0.7); }
.hc-yellow { background: #ffeb3b; }
.hc-green  { background: #4caf50; }
.hc-blue   { background: #2196f3; }
.hc-pink   { background: #f06292; }
/* Text highlight marks */
.hl-mark { border-radius: 2px; padding: 0 1px; }
.hl-mark.hl-yellow { background: rgba(255, 213, 79, 0.5); }
.hl-mark.hl-green  { background: rgba(165, 214, 167, 0.55); }
.hl-mark.hl-blue   { background: rgba(100, 181, 246, 0.5); }
.hl-mark.hl-pink   { background: rgba(240, 98, 146, 0.45); }
.hl-mode-active { outline: 2px dashed rgba(77,182,172,0.4); outline-offset: 4px; border-radius: 4px; }
.hl-mode-active .ayah-content { cursor: text; user-select: text; }

.hc-remove {
    background: none;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    width: 28px; height: 28px;
    color: #e5e7eb;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}
.hc-remove:hover { background: rgba(255,80,80,0.25); }

/* ===== Share Toast ===== */
.share-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #4db6ac;
    color: #0a0f1f;
    padding: 0.6rem 1.4rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 9999;
    white-space: nowrap;
}
.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Share / Play Popover Menu ===== */
.share-popover-menu {
    position: fixed;
    z-index: 2100;
    background: var(--ayah-row-bg);
    border: 1px solid var(--stroke);
    border-top: 2px solid var(--accent);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 160px;
}
.share-popover-btn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.75rem;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    width: 100%;
    text-align: left;
}
.share-popover-btn:hover { background: rgba(77,182,172,0.12); color: var(--accent); }
.share-popover-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ===== Explain Limit Box ===== */
.explain-limit-box {
    text-align: center;
    padding: 2rem 1.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
}
.explain-limit-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.explain-limit-box h4 { margin: 0 0 0.5rem; color: #e5e7eb; font-size: 1.1rem; }
.explain-limit-box p  { margin: 0 0 1.25rem; color: #9fb3c8; font-size: 0.95rem; }
.explain-limit-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ===== Share button in surah header ===== */
.btn-context-compact {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.btn-context-compact:hover { background: rgba(255,255,255,0.12); }
.btn-context-compact svg  { width: 14px; height: 14px; }

/* ===== Mobile: layout, sidebar, reading ===== */
@media (max-width: 768px) {
    /* Sidebar starts below topbar/row1 so hamburger is never covered */
    .sidebar { top: 56px !important; height: calc(100vh - 56px) !important; }
    .sidebar-overlay { top: 56px !important; }

    /* ── Surah page: hide the generic topbar, use 2-row header instead ── */
    body.page-surah .mobile-topbar { display: none !important; }
    body.page-surah .app-layout  { padding-top: 0 !important; }
    /* Row 1 sits at top: 0 on surah page (no topbar) */
    body.page-surah .surah-header-sticky { top: 0 !important; left: 0 !important; }
    /* Show hamburger inside row 1 on mobile */
    body.page-surah .hdr-hamburger { display: flex !important; }

    /* ── 2-row surah header: mobile sizing ── */
    .surah-header-row1 { height: 52px; padding: 0 0.6rem; gap: 0.35rem; }
    .surah-header-row2 { padding: 0.3rem 0.65rem; gap: 0.45rem; overflow-x: auto; flex-wrap: nowrap; }
    .surah-number { width: 28px; height: 28px; font-size: 0.8rem; border-radius: 6px; }
    .surah-name-arabic { font-size: 0.95rem; }
    .surah-transliteration-inline { font-size: 0.75rem; }
    .surah-type-badge { font-size: 0.62rem; }
    /* per-page select: visible on mobile, compact */
    .verses-per-page-select { padding: 0.2rem 0.25rem; font-size: 0.75rem; min-width: 42px; }
    /* progress moves to row 1 on mobile */
    .hdr-progress { display: inline; font-size: 0.72rem; white-space: nowrap; color: rgba(255,255,255,0.7); }
    .btn-context-compact { padding: 0.3rem 0.4rem; font-size: 0; }
    .btn-context-compact svg { width: 15px; height: 15px; }
    .header-jump-input { width: 30px; font-size: 0.76rem; padding: 0.22rem 0.28rem; }

    /* Context bubble: below row1+row2 */
    .surah-context-section { top: 100px; right: 0.5rem; left: 0.5rem; width: auto; }
    /* Content starts below the 2-row header: row1~52px + row2~38px = ~90px */
    .surah-content-wrapper { padding-top: 95px !important; }

    /* ── Reading layout ── */
    .ayah-row { grid-template-columns: 32px 1fr; padding: 1rem; }
    .arabic-column { font-size: 2rem; }
    .english-column { font-size: 0.9rem; }
    .ayah-actions { gap: 5px; padding-top: 0.4rem; }
    .btn-icon { width: 32px; height: 32px; border-radius: 8px; }
    .btn-icon svg { width: 15px; height: 15px; }

    /* ── Modal ── */
    .modal-content { padding: 1rem; }
    .query-actions { flex-direction: column; }
    .query-actions .btn { width: 100%; justify-content: center; }
    textarea#queryInput { font-size: 1rem; }
    .response-actions { flex-wrap: wrap; gap: 6px; }
    .btn-label-hide-xs { display: none; }
    .surah-meta-group { flex-wrap: wrap; gap: 0.35rem; }
    .surah-meta-item { font-size: 0.72rem; }
}

/* ===== Home/About: logo shown in body on mobile (topbar has no logo) ===== */
.home-logo-mobile { display: none; }
@media (max-width: 768px) {
    .home-logo-mobile {
        display: flex;
        justify-content: center;
        padding: 1.5rem 1rem 2rem;  /* generous bottom gap before hero */
    }
    .home-logo-img { width: 90px; height: auto; border-radius: 10px; }
}

/* ===== Explain: missing tafsir notice ===== */
.explain-missing-box {
    padding: 1.25rem 1.5rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 10px;
    color: #c7d2fe;
    font-size: 0.92rem;
    line-height: 1.65;
}

/* ===== Inline Note Panel ===== */
/* ===== Scribble Annotations ===== */
.scribble-zone {
    grid-column: 2;
    width: 100%;
    margin: 0.5rem 0 0.1rem;
}
/* View mode */
.scribble-view {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
}
.scribble-text {
    flex: 1;
    font-family: 'Caveat', cursive;
    color: #5b8de8;
    font-size: 1.3rem;
    line-height: 1.5;
    border-left: 2px solid rgba(91, 141, 232, 0.35);
    padding: 0.2rem 0.6rem;
    white-space: pre-wrap;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    transition: background 0.15s;
    min-height: 2rem;
}
.scribble-text:hover { background: rgba(91, 141, 232, 0.06); }
/* Edit mode */
.scribble-edit-area {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
}
.scribble-textarea {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1.5px solid rgba(91, 141, 232, 0.4);
    color: #5b8de8;
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    line-height: 1.5;
    padding: 0.2rem 0.5rem;
    resize: none;
    outline: none;
    min-height: 90px;
    box-sizing: border-box;
}
.scribble-textarea::placeholder { color: rgba(91, 141, 232, 0.35); }
.scribble-textarea:focus { border-bottom-color: #5b8de8; }
/* Shared icon group */
.scribble-icon-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex-shrink: 0;
    padding-top: 0.1rem;
    opacity: 0;
    transition: opacity 0.15s;
}
.scribble-view:hover .scribble-icon-group,
.scribble-edit-area .scribble-icon-group { opacity: 1; }
.scribble-icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.28rem;
    border-radius: 4px;
    color: rgba(91, 141, 232, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}
.scribble-icon-btn svg { width: 15px; height: 15px; }
.scribble-link {
    color: #5b8de8;
    font-size: 0.95rem;
    font-family: inherit;
    text-underline-offset: 2px;
    display: inline-block;
    margin-top: 0.15rem;
}
.scribble-link:hover { color: #7ea8f0; }
.scribble-icon-btn:hover { color: #5b8de8; background: rgba(91, 141, 232, 0.1); }
.scribble-delete-btn:hover { color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.scribble-save-btn:hover   { color: #4db6ac; background: rgba(77, 182, 172, 0.1); }
.scribble-cancel-btn:hover { color: #aaa; background: rgba(255,255,255,0.06); }
/* Notes page: display saved notes in handwriting style */
.scribble-display {
    font-family: 'Caveat', cursive;
    color: #5b8de8;
    font-size: 1.3rem;
    line-height: 1.5;
    white-space: pre-wrap;
    border-left: 2px solid rgba(91, 141, 232, 0.35);
    padding-left: 0.75rem;
    margin-top: 0.5rem;
}

.note-panel-popover {
    position: absolute;
    z-index: 1000;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    width: 280px;
}
.note-panel-textarea {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #e5e7eb;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.6rem 0.8rem;
    resize: vertical;
    min-height: 70px;
    outline: none;
    box-sizing: border-box;
}
.note-panel-textarea:focus { border-color: #4db6ac; }
.note-panel-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
}

/* ===== Header Jump Group ===== */
.header-jump-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.header-jump-input {
    width: 52px;
    padding: 0.3rem 0.4rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.82rem;
    text-align: center;
    outline: none;
}
.header-jump-input:focus { border-color: #4db6ac; }
.header-jump-input::-webkit-inner-spin-button { opacity: 0; }
@media (max-width: 500px) {
    .header-jump-input { width: 42px; font-size: 0.75rem; }
}

/* ── Q&A Share Page ─────────────────────────────────────────── */
.qa-share-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}
.qa-share-card {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.qa-share-header {
    margin-bottom: 0.5rem;
}
.qa-share-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.01em;
}
.qa-share-ayah {
    background: var(--card-strong);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.qa-share-surah-label {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 1rem;
}
.qa-surah-translation {
    font-style: italic;
    margin-left: 0.25rem;
}
.qa-share-arabic {
    font-family: var(--font-arabic);
    font-size: 1.7rem;
    line-height: 2.2;
    color: var(--text);
    margin-bottom: 1rem;
    text-align: right;
}
.qa-share-english {
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.65;
}
.qa-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.6rem;
}
.qa-share-question {
    background: rgba(34, 211, 238, 0.06);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}
.qa-share-question p { color: var(--text); font-size: 1rem; }
.qa-share-answer {
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}
.qa-answer-body p {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}
.qa-answer-body p:last-child { margin-bottom: 0; }
.qa-share-footer {
    display: flex;
    gap: 0.75rem;
    flex-wrap: nowrap;
    padding-top: 0.5rem;
    overflow-x: auto;
}
.qa-share-footer .btn-hero-secondary {
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Q&A List Page ───────────────────────────────────────────── */
.qa-list-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}
.qa-list-heading {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.qa-list-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}
.qa-list-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.qa-list-card {
    display: block;
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    text-decoration: none;
    transition: border-color 0.18s, background 0.18s;
}
.qa-list-card:hover {
    border-color: rgba(77,182,172,0.35);
    background: var(--card-strong);
}
.qa-list-card-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.qa-list-surah {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
}
.qa-list-ayah {
    font-size: 0.78rem;
    color: var(--muted);
}
.qa-list-question {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.qa-list-explain {
    font-style: italic;
    font-weight: 400;
    color: var(--muted);
}
.qa-list-preview {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}
.qa-list-empty {
    color: var(--muted);
    font-size: 0.95rem;
    margin-top: 2rem;
}

/* ── Audio Player Bar v2 ─────────────────────────────────────── */
#audioPlayerBar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 900;
    display: flex;
    flex-direction: column;
}

/* Seekable progress strip at top edge of player */
.apb-seek {
    height: 3px;
    background: rgba(255,255,255,0.07);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}
.apb-seek-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4db6ac, #7c6af7, #c084fc);
    pointer-events: none;
}

/* Main body */
.apb-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.25rem;
    height: 80px;
    background: rgba(9, 11, 20, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(77,182,172,0.15);
}

/* Now Playing info — left */
.apb-info {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 0 0 auto;
    min-width: 0;
    max-width: 230px;
}
.apb-quran-icon {
    width: 36px; height: 36px;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(77,182,172,0.18), rgba(124,58,237,0.18));
    border: 1px solid rgba(77,182,172,0.28);
    display: flex; align-items: center; justify-content: center;
    color: #4db6ac;
    flex-shrink: 0;
}
.apb-info-text { min-width: 0; }
.apb-track-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}
.apb-track-sub {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 3px;
    flex-wrap: nowrap;
}
.apb-time {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    white-space: nowrap;
}
.apb-dot { color: rgba(255,255,255,0.25); font-size: 0.7rem; }
.apb-reciter {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    cursor: pointer;
    outline: none;
    max-width: 120px;
    padding: 0;
    font-family: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.apb-reciter option { background: #0d1117; }

/* Spectrum visualizer — center */
.apb-viz {
    flex: 1;
    min-width: 0;
    height: 54px;
    display: flex;
    align-items: center;
}
.apb-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Controls — right */
.apb-controls {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}
.apb-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.55);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.apb-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* Volume knob */
.apb-vol-knob {
    cursor: ns-resize;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
    user-select: none;
}
.apb-vol-knob:hover { opacity: 0.85; }

/* Viz toggle button */
.apb-viz-btn { color: rgba(255,255,255,0.4); }
.apb-viz-btn:hover { color: rgba(153,255,17,0.8) !important; }

/* Close button */
.apb-close-btn:hover { color: #ef4444 !important; background: rgba(239,68,68,0.08) !important; }

/* Highlight currently playing ayah row */
.ayah-row.audio-playing {
    background: rgba(77,182,172,0.06);
    border-left: 3px solid var(--accent);
}

/* Mobile viz drawer */
.apb-drawer {
    position: fixed;
    left: 0; right: 0;
    bottom: 83px;              /* sits directly above the player bar */
    height: 40vh;
    background: rgba(9, 11, 20, 0.98);
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    z-index: 999;
    transform: translateY(calc(100% + 83px));
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.apb-drawer.open { transform: translateY(0); }
.apb-drawer-handle {
    width: 40px; height: 4px;
    background: rgba(255,255,255,0.18);
    border-radius: 2px;
    margin: 10px auto 6px;
    flex-shrink: 0;
    cursor: pointer;
}
.apb-drawer-canvas { width: 100%; flex: 1; min-height: 0; display: block; }
.apb-drawer-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 6px 14px;
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.apb-drawer-pal-btn {
    display: flex; align-items: center; gap: 6px;
    background: transparent; border: none; cursor: pointer;
    color: rgba(255,255,255,0.5); font-size: 0.65rem;
    font-family: monospace; letter-spacing: 0.06em;
    padding: 4px 8px; border-radius: 6px;
}
.apb-drawer-pal-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
.apb-drawer-mode-btns { display: flex; gap: 4px; }
.apb-drawer-mode-btn {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    background: transparent; border: none; cursor: pointer;
    color: rgba(255,255,255,0.35);
    border-radius: 6px; padding: 0;
    transition: color 0.15s, background 0.15s;
}
.apb-drawer-mode-btn:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7); }
.apb-drawer-mode-btn.active { color: #99ff11; }

/* Desktop: hide drawer and mobile controls */
.apb-desktop-only { }
.apb-mobile-viz-btn { display: none; }
@media (min-width: 769px) { .apb-drawer { display: none; } }

/* Bottom padding so player doesn't cover last ayah */
.ayah-list { padding-bottom: 92px; }

/* Responsive — tighter controls + hide desktop-only elements on mobile */
@media (max-width: 768px) {
    .apb-viz { display: none; }
    .apb-viz-btn { display: none; }
    .apb-info { max-width: 170px; }
    .apb-mobile-viz-btn { display: flex; }
    .apb-desktop-only { display: none !important; }
    .apb-controls { gap: 0.1rem; }
    .apb-btn { width: 30px; height: 30px; }
    .apb-vol-knob { width: 28px !important; height: 28px !important; }
}
@media (max-width: 520px) {
    .apb-info { max-width: 130px; }
    .apb-btn { width: 28px; height: 28px; }
}
