/* =========================================================.bottom-reading-nav {

   SURAH AL-WAQIAH — PREMIUM LIGHT DESIGN SYSTEM
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300..900&family=Amiri+Quran&family=Noto+Nastaliq+Urdu&display=swap');

@font-face {
    font-family: 'surahnames';
    src: url('/fonts/sura_names.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    /* === QURAN.COM INSPIRED PALETTE === */
    --primary: #6b553d;
    --primary-light: #8b7256;
    --primary-dark: #4a3a28;
    --primary-glow: rgba(107, 85, 61, 0.12);
    --accent: #c8a96e;
    --accent-light: #dfc48e;
    --word-highlight: #6b553d;

    /* Backgrounds — warm parchment / cream */
    --bg-body: #f8f4ed;
    --bg-card: #fffef9;
    --bg-subtle: #f2ece1;
    --bg-hover: #ede5d8;
    --bg-parchment: #faf6ef;

    /* Text */
    --text-head: #2c1f0f;
    --text-body: #3d2f1e;
    --text-muted: #7a6a57;
    --text-light: #b0a090;

    /* Borders — warm brown tones */
    --border: #e0d5c4;
    --border-light: #ece7db;

    /* Shadows — warm */
    --shadow-xs: 0 1px 2px rgba(60, 40, 10, 0.05);
    --shadow-sm: 0 2px 6px rgba(60, 40, 10, 0.07);
    --shadow-md: 0 4px 16px rgba(60, 40, 10, 0.10);
    --shadow-lg: 0 8px 28px rgba(60, 40, 10, 0.13);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 50px;

    /* Typography */
    --font-main: 'Figtree', sans-serif;
    --font-ar: 'Amiri Quran', serif;
    --font-ur: 'Noto Nastaliq Urdu', serif;
    --font-surah: 'surahnames', 'Amiri Quran', serif;

    /* Font sizes for Quran text */
    --ar-size: 32px;
    --trans-size: 15px;
    --en-size: 15.5px;
    --ur-size: 20px;

    /* Navbar and Bottom Nav */
    --nav-height: 64px;
    --bottom-nav-height: 68px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- dark mode ---- */
[data-theme="dark"] {
    --primary: #c8a96e;
    --primary-light: #dfc48e;
    --primary-dark: #a88a50;
    --primary-glow: rgba(200, 169, 110, 0.18);
    --accent: #dfc48e;
    --word-highlight: #c8a96e;

    --bg-body: #1a1510;
    --bg-card: #221c14;
    --bg-subtle: #2a231a;
    --bg-hover: #342b20;
    --bg-parchment: #1e1912;

    --text-head: #f0e8d8;
    --text-body: #d8ccbc;
    --text-muted: #9a8870;
    --text-light: #6a5a48;

    --border: #3a3025;
    --border-light: #302820;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.30);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.38);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.45);
}

/* ---- sepia mode ---- */
[data-theme="sepia"] {
    --primary: #7a4e2d;
    --primary-light: #9a6a46;
    --primary-dark: #5c3820;
    --primary-glow: rgba(122, 78, 45, 0.12);
    --accent: #c49a5e;
    --word-highlight: #7a4e2d;

    --bg-body: #f0e8d5;
    --bg-card: #faf4e8;
    --bg-subtle: #e8dfc8;
    --bg-hover: #dfd4ba;
    --bg-parchment: #f5eedd;

    --text-head: #3a2e1c;
    --text-body: #4e4030;
    --text-muted: #7a6a50;
    --text-light: #a8977e;

    --border: #d8c8a8;
    --border-light: #e4d8c0;

    --shadow-xs: 0 1px 2px rgba(80, 60, 30, 0.10);
    --shadow-sm: 0 2px 6px rgba(80, 60, 30, 0.12);
    --shadow-md: 0 4px 16px rgba(80, 60, 30, 0.15);
    --shadow-lg: 0 8px 28px rgba(80, 60, 30, 0.18);
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-body);
    line-height: 1.65;
    min-height: 100vh;
    transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
    -webkit-font-smoothing: antialiased;
    padding-top: calc(var(--nav-height) + var(--bottom-nav-height) + 0px);
    padding-bottom: calc(var(--bottom-nav-height) + 0px);
}

/* =========================================================
   NAVBAR
   ========================================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1100;
    background: rgba(250, 246, 239, 0.97);
    height: var(--nav-height);
    transition: transform 0.4s var(--ease), background 0.3s var(--ease);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.navbar.navbar-hidden {
    transform: translateY(-100%);
}

[data-theme="dark"] .navbar {
    background: rgba(26, 21, 16, 0.97);
    border-bottom-color: var(--border);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    gap: 1.5rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-dark);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.01em;
    transition: color 0.2s;
    flex-shrink: 0;
}

.logo img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(107, 85, 61, 0.20);
}

.logo:hover {
    color: var(--primary);
}

/* Nav content wrapper */
.nav-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

/* Nav links row */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

/* Individual nav link */
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-body);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
    white-space: nowrap;
    transition: background 0.18s var(--ease), color 0.18s var(--ease);
    position: relative;
}

.nav-link:hover,
.nav-link:focus-visible {
    background: var(--bg-hover);
    color: var(--primary);
    outline: none;
}

/* Active underline accent */
.nav-link.active-page {
    color: var(--primary);
    background: var(--primary-glow);
}

/* ---- Dropdown ---- */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.dropdown-toggle .chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.25s var(--ease);
    flex-shrink: 0;
    opacity: 0.6;
}

.nav-dropdown.open .chevron {
    transform: rotate(180deg);
    opacity: 1;
}

@media (hover: hover) {
    .nav-dropdown:hover .chevron {
        transform: rotate(180deg);
        opacity: 1;
    }
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 260px;
    max-height: 380px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top left;
    transition:
        opacity 0.22s var(--ease),
        transform 0.22s var(--ease),
        visibility 0.22s;
    z-index: 1000;

    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.dropdown-menu::-webkit-scrollbar {
    width: 4px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

@media (hover: hover) {
    .nav-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }
}

.dropdown-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dropdown-menu-list li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text-body);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    text-transform: capitalize;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.dropdown-menu-list li a:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

/* Small dot icon for dropdown items */
.dropdown-menu-list li a::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary-light);
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.dropdown-menu-list li a:hover::before {
    opacity: 1;
}

/* Nav controls (settings button area) */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

/* ---- Settings dropdown ---- */
.settings-dropdown {
    position: relative;
}

.settings-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 270px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top right;
    transition:
        opacity 0.22s var(--ease),
        transform 0.22s var(--ease),
        visibility 0.22s;
    z-index: 1000;
}

.settings-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

@media (hover: hover) {
    .settings-dropdown:hover .settings-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }
}

.settings-menu-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.25rem;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-body);
}

.setting-item .setting-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: var(--border);
    border-radius: 22px;
    transition: background 0.3s var(--ease);
}

.slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s var(--ease-spring);
}

input:checked+.slider {
    background: var(--primary);
}

input:checked+.slider::before {
    transform: translateX(20px);
}

/* Font size controls */
.font-size-controls {
    display: flex;
    gap: 4px;
}

.font-size-controls button {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-body);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: var(--font-main);
    transition: background 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.font-size-controls button:hover {
    background: var(--bg-hover);
    border-color: var(--primary-light);
    color: var(--primary);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: var(--font-main);
    transition: all 0.15s var(--ease);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn-outline {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-body);
}

.btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-primary:active {
    background: var(--primary-dark);
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text-body);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.mobile-menu-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */
.container {
    max-width: 1060px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

/* =========================================================
   HERO SECTION
   ========================================================= */
.surah-hero {
    text-align: center;
    padding: 0rem 2rem 2.5rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

/* Decorative top gradient line */
.surah-hero::before {
    display: none;
}

/* Soft bg pattern */
.surah-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 10% 0%, rgba(46, 125, 146, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse at 90% 100%, rgba(232, 160, 32, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

/* Surah Hero Header Styling */
.surah-hero-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

@media (max-width: 600px) {
    .surah-hero-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

.surah-header-arabic {
    font-family: var(--font-surah);
    font-size: 4.5rem;
    color: var(--text-head);
    line-height: 1;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.05);
}

.surah-header-meta {
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 600px) {
    .surah-header-meta {
        text-align: center;
        align-items: center;
    }
}

.surah-header-title {
    display: flex;
    align-items: center;
    gap: 0rem;
    margin-bottom: 0rem;
}

.surah-header-title h1 {
    font-family: var(--font-main);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-head);
    letter-spacing: -0.02em;
    margin: 0;
}

.surah-info-btn {
    background: #7a6a53 !important;
    color: white !important;
    border: none;
    border-radius: 50px;
    padding: 2px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: lowercase;
    transition: all 0.2s;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.surah-info-btn:hover {
    background: #8b6d46 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.surah-header-meaning {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

.bismillah-block {
    text-align: center;
    position: relative;
    z-index: 1;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.bismillah-img {
    max-width: 320px;
    width: 90%;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
    transition: transform 0.3s var(--ease);
}

[data-theme="dark"] .bismillah-img {
    filter: invert(1) brightness(1.5) drop-shadow(0 0 8px rgba(255, 255, 255, 0.1));
}

.bismillah {
    font-family: var(--font-ar);
    font-size: 3rem;
    color: var(--text-head);
    font-weight: normal;
    line-height: normal;
    margin: 0;
}

.bismillah-translation {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-top: -0.5rem;
}

/* SEO content card */
.seo-content {
    background: transparent;
    padding: 1rem 0 !important;
    border-radius: 0 !important;
    margin-bottom: 1.5rem !important;
    border: none !important;
    border-top: 1px solid var(--border) !important;
    text-align: left !important;
    position: relative;
    z-index: 1;
}

.seo-content h2 {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--primary) !important;
    margin-bottom: 0.4rem !important;
}

.seo-content p {
    color: var(--text-muted) !important;
    font-size: 0.875rem !important;
    line-height: 1.75 !important;
}

/* Play all button */
.play-all-btn {
    font-size: 0.875rem;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-sm);
    position: relative;
    z-index: 1;
    background: var(--primary);
    color: #fff;
    border: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(107, 85, 61, 0.25);
    transition: all 0.2s var(--ease);
}

.play-all-btn:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 14px rgba(107, 85, 61, 0.30);
    transform: translateY(-1px);
}

/* Play all grouped with select */
.play-all-group {
    display: inline-flex;
    align-items: stretch;
    justify-content: center;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(107, 85, 61, 0.25);
    transition: all 0.2s var(--ease);
    border: 1px solid var(--border);
    background-color: var(--primary);
}

.play-all-group:hover {
    box-shadow: 0 4px 14px rgba(107, 85, 61, 0.30);
    transform: translateY(-1px);
}

.play-all-group .play-all-btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
    margin: 0;
    transform: none;
    /* override hover transform for inner item */
}

.play-all-group .play-reciter-select {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
    background-color: transparent;
    color: white;
    border: none;
    padding: 0 10px 0 5px;
    cursor: pointer;
    outline: none;
    font-weight: 500;
    font-size: 0.85rem;
    font-family: var(--font-main);
    max-width: 250px;
    /* responsive shrink */
    min-width: 140px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.play-all-group .play-reciter-select option {
    background-color: var(--bg-card);
    /* matching the UI theme for options */
    color: var(--text-body);
}

/* Hover fixes for play-all btn inside group */
.play-all-group:hover .play-all-btn {
    background: var(--primary-light);
}

/* =========================================================
   HERO ROW CONTROLS & TOGGLES
   ========================================================= */
.hero-controls-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1rem;
    z-index: 1;
    position: relative;
}

.layout-toggle-container {
    display: inline-flex;
    background: var(--bg-subtle);
    border-radius: 50px;
    padding: 0.35rem;
    align-items: center;
    gap: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

.layout-pill-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.2rem;
    border: none;
    background: transparent;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    color: inherit;
    transition: all 0.2s var(--ease);
    white-space: nowrap;
}

.layout-pill-btn svg {
    opacity: 0.8;
}

.layout-pill-btn.active {
    background: var(--bg-card);
    color: var(--text-head);
    box-shadow: var(--shadow-sm);
}

.layout-pill-reading-group {
    display: flex;
    align-items: center;
    border-radius: 50px;
    transition: all 0.2s var(--ease);
}

.layout-pill-reading-group.active {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    color: var(--text-head);
    padding-right: 0.5rem;
}

.layout-pill-reading-group.active .layout-pill-btn {
    display: none;
    /* Hide 'Reading' when sub-options are shown */
}

.reading-sub-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.layout-sub-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.4rem 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.2s var(--ease);
}

.layout-sub-btn.active,
.layout-sub-btn:hover {
    color: var(--primary);
}

.ar-icon {
    font-family: var(--font-ar);
    font-size: 1.1rem;
    line-height: 1;
    background: var(--text-body);
    color: var(--bg-card);
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
}

.trans-icon {
    font-family: var(--font-main);
    font-size: 0.85rem;
    line-height: 1;
    border: 1.5px solid currentColor;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sub-divider {
    color: var(--border);
    font-weight: 400;
}

/* --- Hero Tab Overrides (Quran Pak Style) --- */
.hero-controls-row {
    width: 100%;
}

.hero-controls-row .layout-toggle-container {
    display: flex;
    width: 100%;
    background: transparent;
    border-radius: 0;
    padding: 0;
    border-bottom: 2px solid var(--border);
    justify-content: center;
    align-items: stretch;
    margin-top: 0.5rem;
}

.hero-controls-row .layout-pill-btn {
    flex: 1;
    display: flex;
    justify-content: center;
    background: transparent;
    border-radius: 0;
    margin-bottom: -2px;
    /* Overlap container border */
    border-bottom: 2px solid transparent;
    padding: 1rem 0.5rem;
}

.hero-controls-row .layout-pill-reading-group {
    flex: 1;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    justify-content: center;
}

.hero-controls-row .layout-pill-reading-group .layout-pill-btn {
    width: 100%;
}

.hero-controls-row .layout-pill-btn.active {
    background: transparent;
    box-shadow: none;
    border-bottom: 2px solid var(--text-head);
    color: var(--text-head);
}

.hero-controls-row .layout-pill-reading-group.active {
    background: transparent;
    box-shadow: none;
    border-bottom: 2px solid var(--text-head);
    margin-bottom: -2px;
}

.hero-controls-row .layout-pill-reading-group.active .layout-pill-btn {
    display: none;
}

.hero-controls-row .reading-sub-options {
    width: 100%;
    justify-content: center;
    padding: 0.5rem;
}

.hero-controls-row .layout-sub-btn {
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
}

/* =========================================================
   AYAH CARDS  — Quran.com style
   ========================================================= */
.ayahs-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ayah-container {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-light);
    border-radius: 0;
    padding: 1.75rem 0.25rem 1.5rem;
    transition: background 0.2s var(--ease);
    position: relative;
    box-shadow: none;
}

.ayah-container:hover {
    background: var(--bg-hover);
    transform: none;
    box-shadow: none;
    border-color: var(--border-light);
}

.ayah-container.playing {
    background: var(--bg-hover);
    border-left: 3px solid var(--primary);
    padding-left: calc(0.25rem - 3px);
}

/* Ayah header */
.ayah-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.ayah-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ayah-header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ayah-header-playables {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    /* properly wrap multiple playback pills */
    gap: 0.35rem;
}

/* Ayah number badge — Quran.com ornate style */
.ayah-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid var(--accent);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
    letter-spacing: -0.01em;
    transition: all 0.2s var(--ease);
    font-family: var(--font-main);
    box-shadow: inset 0 0 0 2px rgba(200, 169, 110, 0.10);
}

.ayah-container:hover .ayah-number {
    background: var(--primary-glow);
    color: var(--primary);
    border-color: var(--primary);
}

/* ---- Toolkit buttons (EN, UR, Play, Bookmark etc) ---- */
.icon-toolkit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    transition: all 0.18s var(--ease);
    text-transform: uppercase;
}

.icon-toolkit-btn.text-icon-btn {
    width: auto;
    padding: 0 0.8rem;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.01em;
    color: var(--text-body);
}

.icon-toolkit-btn.text-icon-btn svg {
    opacity: 0.6;
}

.icon-toolkit-btn.text-icon-btn:hover svg {
    opacity: 1;
}

.icon-toolkit-btn:hover {
    background: var(--bg-subtle);
    color: var(--primary);
    transform: none;
}

.icon-toolkit-btn.active,
.icon-toolkit-btn.bookmarked {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid rgba(107, 85, 61, 0.20);
}

/* ---- Play buttons ---- */
.ayah-controls {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 1;
}

.play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
    /* 15px soft design */
    cursor: pointer;
    transition: all 0.25s var(--ease);
    gap: 0.5rem;
    border: 1px solid transparent;
    background: var(--bg-subtle);
    color: var(--text-muted);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.play-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.play-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.play-btn:active {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.play-btn.active {
    background: var(--primary-dark);
    color: #fff;
    border-color: var(--primary-dark);
}

/* ---- Ayah texts ---- */
.ayah-texts {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 0 0.5rem;
}

.arabic-text {
    font-family: var(--font-ar);
    font-size: var(--ar-size);
    text-align: right;
    line-height: 2.4;
    color: var(--text-head);
    direction: rtl;
    letter-spacing: 0.01em;
}

.quran-word {
    display: inline-block;
    padding: 0 1px;
    transition: color 0.15s ease;
    cursor: pointer;
}

.quran-word:hover {
    color: var(--word-highlight);
}

.quran-word.active {
    color: var(--word-highlight) !important;
}

/* =========================================================
   READING MODE
   ========================================================= */

.ayahs-list.mode-reading {
    display: block;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 1rem 0;
    box-shadow: none !important;
    text-align: justify;
    text-justify: inter-word;
    direction: rtl;
    line-height: 2.2;
}

[data-theme="dark"] .ayahs-list.mode-reading {
    background: transparent;
}

[data-theme="sepia"] .ayahs-list.mode-reading {
    background: transparent;
    border-color: transparent;
}

.ayahs-list.mode-reading .ayah-container {
    display: inline;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.ayahs-list.mode-reading .ayah-container:hover {
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
}

.ayahs-list.mode-reading .ayah-container.playing {
    border-bottom: none;
}

.ayahs-list.mode-reading .arabic-text,
.ayahs-list.mode-reading .english-text,
.ayahs-list.mode-reading .quran-word {
    font-size: 20px;
}

.ayahs-list.mode-reading-arabic {
    display: block;
    background: #FFF9F0;
    border-radius: var(--radius-lg);
    padding: 1rem 2rem 1rem;
    max-width: 1000px;
    width: 100%;
    margin: 1.5rem auto;
    gap: 0;
    line-height: normal;
    direction: rtl;
    text-align: justify;
    text-align-last: right;
    box-shadow: 0 6px 28px rgba(107, 85, 61, 0.12), 0 1px 4px rgba(107, 85, 61, 0.06);
    position: relative;
}

/* Hide everything except the Arabic text in pure Arabic mode */
.ayahs-list.mode-reading-arabic .ayah-header,
.ayahs-list.mode-reading-arabic .ayah-controls,
.ayahs-list.mode-reading-arabic .transliteration-text,
.ayahs-list.mode-reading-arabic .english-text,
.ayahs-list.mode-reading-arabic .urdu-text {
    display: none !important;
}

.ayahs-list.mode-reading-arabic .ayah-texts {
    display: inline;
    gap: 0;
}

/* Page Breaks for Reading Mode */
.reading-page-break {
    display: none;
}

.ayahs-list.mode-reading .reading-page-break {
    display: block;
    width: 100%;
    margin: 2.5rem 0 3rem 0;
    text-align: center;
    position: relative;
    clear: both;
}

.ayahs-list.mode-reading .page-number-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ayahs-list.mode-reading .page-number-wrapper::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1.5rem;
    height: 1px;
    background: var(--border);
    opacity: 0.7;
}

.ayahs-list.mode-reading .reading-page-number {
    display: inline-block;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-main);
}

.ayahs-list.mode-reading-arabic .arabic-text {
    display: inline;
    line-height: inherit;
}

/* For Reading mode with Transliteration/Translation enabled */
/* We revert to block layout so lines flow top-down instead of jumbled inline ltr/rtl */
.ayahs-list.mode-reading-translation {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: var(--bg-body);
    border: none;
    box-shadow: none;
    text-align: left;
    direction: ltr;
}

.ayahs-list.mode-reading-translation .ayah-container {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    text-align: left;
    direction: ltr;
}

.ayahs-list.mode-reading-translation .ayah-header {
    display: flex;
}

.ayahs-list.mode-reading-translation .ayah-controls {
    display: flex;
}

.ayahs-list.mode-reading-translation .ayah-texts {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.ayahs-list.mode-reading-translation .arabic-text {
    display: block;
    text-align: right;
    direction: rtl;
    font-size: var(--ar-size);
}

@media (max-width: 768px) {
    .ayahs-list.mode-reading {
        /* Force full width breaking out of .container padding */
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        padding: 1rem 1rem;
    }

    .ayahs-list.mode-reading-arabic {
        padding: 2rem 1rem 2.5rem;
        max-width: 100%;
        margin: 1rem 0;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .ayahs-list.mode-reading-arabic .arabic-text {
        line-height: 2.5;
        word-spacing: 0.10em;
    }
}

/* ---- Word Hover Tooltip ---- */
.word-tooltip {
    /* Fixed so it doesn't scroll with page — position is set by JS */
    position: fixed;
    /* Centered above the word: translateX(-50%) centers it, translateY(-100%) puts it above */
    transform: translateX(-50%) translateY(-70%);
    margin-top: -22px;
    background: #2c1f0f;
    color: #fff8ef;
    /* Extra bottom padding creates invisible bridge so mouse can reach tooltip */
    padding: 8px 16px 18px 16px;
    border-radius: 10px;
    font-family: var(--font-main);
    opacity: 0;
    /* Smooth fade + slight upward slide */
    transition: opacity 0.18s ease;
    z-index: 10000;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(44, 31, 15, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 80px;
    text-align: center;
}

/* Arabic word shown at top of tooltip */
.word-tooltip .wt-arabic {
    font-family: var(--font-ar);
    font-size: 1.1rem;
    color: #f5d8a8;
    direction: rtl;
    line-height: 1.4;
    font-weight: normal;
}

/* English meaning shown below */
.word-tooltip .wt-meaning {
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff8ef;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

/* Arrow pointing DOWN from tooltip bottom to the word */
.word-tooltip::after {
    content: '';
    position: absolute;
    /* Sits at real bottom edge (above the padding bridge) */
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: #2c1f0f;
    border-bottom: none;
}

.word-tooltip.active {
    opacity: 1;
}


/* ---- Ayah Detail Modal (Premium Popup) ---- */
.quran-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 35, 51, 0.45);
    backdrop-filter: blur(5px);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.quran-modal-overlay.active {
    display: flex;
    opacity: 1 !important;
    z-index: 20000;
}

.quran-modal-card {
    background: #fdfaf3;
    /* Warm cream background */
    width: 100%;
    max-width: 900px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] .quran-modal-card {
    background: #1a2a3a;
    color: #e8f4f8;
}

.modal-top-header {
    padding: 1rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-selectors {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.selector-pill {
    background: #f4ece0;
    border: 1px solid #e8dec8;
    padding: 0.45rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #433020;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: #667891;
    opacity: 0.6;
    transition: 0.2s;
    padding: 5px;
}

.modal-close-btn:hover {
    opacity: 1;
    color: #ef4444;
}

.modal-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 3rem 3rem;
}

/* Verse Header Row */
.modal-verse-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.modal-ref-display {
    font-size: 1.3rem;
    font-weight: 600;
    color: #433020;
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.modal-quick-actions {
    display: flex;
    gap: 1.5rem;
    color: #85725f;
}

.modal-action-btn {
    background: transparent;
    border: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 10px;
    transition: 0.2s;
}

.modal-action-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #433020;
}

/* Interactive meaning bar inside modal */
.modal-word-meaning-bar {
    display: flex;
    align-items: stretch;
    background: #f5eedc;
    border: 1px solid #e8dec8;
    border-radius: 14px;
    margin-bottom: 2rem;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.modal-nav-arrow {
    width: 48px;
    border: none;
    background: transparent;
    color: #85725f;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.modal-nav-arrow:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #433020;
}

.modal-meaning-text {
    flex: 1;
    padding: 1rem 1.25rem;
    border-left: 1px solid #e8dec8;
    border-right: 1px solid #e8dec8;
    position: relative;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.meaning-row {
    font-size: 1rem;
    margin-bottom: 4px;
}

/* Arabic Text Display in Modal */
.modal-quran-text {
    text-align: right;
    direction: rtl;
    font-family: var(--font-ar);
    font-size: 2.4rem;
    line-height: 1.8;
    color: #2d3748;
    margin-bottom: 2.5rem;
}

.modal-quran-text .quran-word {
    padding: 0 4px;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.modal-quran-text .quran-word.highlight {
    color: #9b6c4b !important;
    background: rgba(155, 108, 75, 0.08);
}

/* Modal Footer Tabs */
.modal-bottom-tabs {
    border-top: 1px solid #e8dec8;
    padding: 1.25rem 3rem;
    display: flex;
    gap: 2.5rem;
    color: #85725f;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .ayahs-list.mode-reading {
        padding: 1.5rem 1rem;
    }

    .ayahs-list.mode-reading-arabic .arabic-text {
        font-size: clamp(26px, 6vw, 34px);
    }

    .quran-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .quran-modal-card {
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
        height: 100%;
    }

    .modal-top-header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .modal-selectors {
        flex-wrap: wrap;
        gap: 0.5rem;
        width: calc(100% - 40px);
    }

    .selector-pill {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }

    .modal-scroll-area {
        padding: 1.25rem 1.25rem 2rem;
    }

    .modal-quran-text {
        font-size: 2rem;
        line-height: 1.7;
    }

    .modal-ref-display {
        font-size: 1.1rem;
    }

    .modal-quick-actions {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .modal-bottom-tabs {
        padding: 1rem;
        gap: 1rem;
        font-size: 0.8rem;
        justify-content: space-between;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .modal-meaning-text {
        padding: 0.75rem;
        min-height: 70px;
    }

    .meaning-row {
        font-size: 0.85rem;
    }
}

.modal-bottom-tabs span {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.modal-bottom-tabs span:hover {
    color: #433020;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.arabic-text .end-sym {
    display: inline-block;
    padding: 0 4px;
    font-size: 0.82em;
    color: var(--accent);
    font-family: var(--font-ar);
}

.transliteration-text {
    font-size: var(--trans-size);
    color: var(--primary-light);
    font-style: italic;
    line-height: 1.75;
    font-weight: 400;
    border-left: 2px solid var(--border);
    padding-left: 0.75rem;
    margin-left: 0.25rem;
}

.english-text {
    font-size: var(--en-size);
    color: var(--text-body);
    line-height: 1.85;
    font-weight: 400;
}

.urdu-text {
    font-family: var(--font-ur);
    font-size: var(--ur-size);
    text-align: right;
    line-height: 2.4;
    color: var(--text-body);
    direction: rtl;
    border-right: 2px solid var(--border);
    padding-right: 0.75rem;
    margin-right: 0.25rem;
}

/* =========================================================
   UTILITIES
   ========================================================= */
.hidden {
    display: none !important;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer-seo {
    margin-top: 3.5rem;
    background: var(--bg-subtle);
    border-top: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

/* Gradient accent stripe */
.footer-seo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-dark), var(--accent), var(--primary-light));
}

.footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 4rem 2rem 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

/* About col */

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-dark);
    text-decoration: none;
    margin-bottom: 0.85rem;
}

.footer-logo img {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    object-fit: contain;
}

.footer-about h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-head);
    margin-bottom: 0.75rem;
}

.footer-about p {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.8;
    max-width: 300px;
}

.footer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 0.35rem 0.85rem;
    background: var(--primary-glow);
    border: 1px solid rgba(46, 125, 146, 0.3);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
}

/* Links col */
.footer-links h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-head);
    margin-bottom: 1rem;
}

.seo-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.seo-links li a {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-body);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    text-transform: capitalize;
    transition: all 0.13s var(--ease);
}

.seo-links li a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Footer bottom bar */
.footer-bottom {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--text-light);
    font-size: 0.82rem;
}

.footer-bottom-links {
    display: flex;
    gap: 1.25rem;
}

.footer-bottom-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.15s;
}

.footer-bottom-links a:hover {
    color: var(--primary);
}

/* =========================================================
   SCROLL TO TOP
   ========================================================= */
.scroll-top-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    font-family: var(--font-main);
    transition: all 0.13s var(--ease);
}

.scroll-top-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 1.25rem;
    }

    .footer-inner {
        padding: 3rem 1.25rem 0;
    }

    .footer-bottom {
        padding: 1.5rem 1.25rem;
    }

    .footer-content {
        gap: 2.5rem;
    }
}

/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */
@media (max-width: 768px) {
    :root {
        --nav-height: 60px;
        --ar-size: 26px;
        --ur-size: 18px;
        --en-size: 14px;
        --trans-size: 13px;
    }

    /* Navbar */
    .navbar {
        height: auto;
        min-height: var(--nav-height);
    }

    .nav-container {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .logo {
        flex: 1;
        font-size: 1rem;
        order: 1;
    }

    .nav-controls {
        order: 2;
    }

    .mobile-menu-btn {
        display: flex;
        order: 3;
    }

    .nav-content {
        display: none;
        order: 4;
        width: 100%;
        flex-basis: 100%;
        flex: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        border-top: 1px solid var(--border);
        padding: 0.75rem 0 0.5rem;
        margin-top: 0.5rem;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        overscroll-behavior: contain;
        /* Mobile Scrollbar Defaults */
        scrollbar-width: thin;
        scrollbar-color: var(--primary-light) transparent;
    }

    .nav-content::-webkit-scrollbar {
        width: 5px;
    }

    .nav-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .nav-content::-webkit-scrollbar-thumb {
        background: var(--primary-light);
        border-radius: 4px;
    }

    .nav-content.active {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        width: 100%;
    }

    .nav-link {
        width: 100%;
        padding: 0.6rem 0.75rem;
        border-radius: var(--radius-sm);
        font-size: 0.9rem;
    }

    .nav-dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-left: 2px solid var(--primary-light);
        border-radius: 0;
        margin-left: 1rem;
        padding: 0.25rem 0 0.25rem 0.5rem;
        max-height: none;
        overflow-y: visible;
        background: transparent;
        display: none;
    }

    .dropdown-menu.active {
        display: block;
    }

    .dropdown-menu-list li a {
        font-size: 0.83rem;
        padding: 0.45rem 0.75rem;
    }

    .nav-controls {
        width: 100%;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-light);
        margin-top: 0.25rem;
    }

    .btn-outline {
        width: 100%;
        justify-content: center;
    }

    .settings-menu {
        position: static;
        width: 100%;
        max-width: none;
        transform: none !important;
        box-shadow: none;
        border: none;
        padding: 0.5rem 0.5rem;
        margin-top: 0.5rem;
        background: transparent;
        display: none;
    }

    .settings-menu.active {
        display: flex;
        opacity: 1;
        visibility: visible;
    }

    /* Hero */
    .container {
        padding: 1.25rem 0.9rem;
    }

    .surah-hero {
        padding: 2rem 1.25rem;
        border-radius: var(--radius-lg);
        margin-bottom: 1.5rem;
    }

    .bismillah {
        font-size: 1.8rem;
    }

    .surah-title {
        font-size: 1.5rem;
    }

    .surah-subtitle {
        font-size: 0.82rem;
        gap: 0.4rem;
    }

    .play-all-btn {
        width: 100%;
        justify-content: center;
    }

    /* Ayah cards */
    .ayah-container {
        padding: 1.25rem 1rem;
        border-radius: var(--radius-md);
    }

    .ayah-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .ayah-controls {
        justify-content: flex-start;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
        width: 100%;
    }

    .play-btn {
        width: 100%;
        justify-content: center;
        padding: 0.42rem 0.5rem;
        font-size: 0.73rem;
    }

    .play-btn svg {
        width: 12px;
        height: 12px;
    }

    /* Footer */
    .footer-inner {
        padding: 2.5rem 1rem 0;
    }

    .footer-bottom {
        padding: 1.25rem 1rem;
        flex-direction: column;
        text-align: center;
    }

    .footer-bottom-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-bottom: 2rem;
    }

    .footer-about p {
        max-width: none;
    }

    .seo-links li a {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }
}

@media (max-width: 380px) {
    :root {
        --ar-size: 22px;
        --ur-size: 16px;
    }

    .surah-title {
        font-size: 1.3rem;
    }

    .bismillah {
        font-size: 1.5rem;
    }

    .play-btn {
        font-size: 0.68rem;
        padding: 0.35rem 0.4rem;
    }
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-body);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner-preloader {
    width: 45px;
    height: 45px;
    border: 3.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin-preloader 0.8s linear infinite;
    box-shadow: 0 0 15px var(--primary-glow);
}

@keyframes spin-preloader {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Turbo Progress Bar */
.turbo-progress-bar {
    height: 4px;
    background-color: var(--primary);
    z-index: 9999;
}

/* =========================================================
   AUDIO PLAYER BAR
   ========================================================= */
.tafsir-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 900px;
    height: 85vh;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s var(--ease-spring);
    border: 1px solid var(--border);
}

.audio-player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #181c25;
    color: #fff;
    z-index: 9999;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform: translateY(100%);
    transition: transform 0.3s var(--ease);
    border-top: 1px solid #2d3748;
}

.audio-player-bar:not(.hidden) {
    transform: translateY(0);
}

.player-progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: #a0aec0;
}

#player-progress {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #4a5568;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

#player-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.1s;
}

#player-progress::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.player-controls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding-bottom: 5px;
}

.player-center-controls {
    display: flex;
    align-items: center;
    gap: 25px;
}

.player-btn {
    background: none;
    border: none;
    color: #cbd5e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
}

.player-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

/* Options Menu */
.player-options-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a202c;
    border: 1px solid #2d3748;
    border-radius: 8px;
    padding: 10px 0;
    margin-bottom: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    min-width: 260px;
    z-index: 100;
}

@media (max-width: 768px) {
    .player-options-menu {
        left: 0;
        transform: none;
        /* Align the left edge of the menu with the left edge of the button, so it doesn't bleed */
        margin-left: -10px;
        /* Slight adjustment so it doesn't touch the screen's very edge */
    }
}

.player-options-menu.hidden {
    display: none;
}

.player-opt-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #e2e8f0;
    transition: background 0.2s;
}

.player-opt-item:hover {
    background: #2d3748;
}

/* Word Highlighting */
.quran-word {
    transition: color 0.15s ease;
    cursor: pointer;
    display: inline-block;
    padding: 0 2px;
    border-radius: 4px;
}

.quran-word:hover,
.quran-word.active-word {
    color: #20b2aa !important;
}

/* Dark mode adjustments for words */
[data-theme="dark"] .quran-word:hover,
[data-theme="dark"] .quran-word.active-word {
    color: #3fa8c2 !important;
}

/* =========================================================
   TOOLKITS & HOVER ACTION BAR (QURAN.COM STYLE)
   ========================================================= */
.ayah-header {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.75rem;
}

.ayah-header-actions {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.ayah-container:hover .ayah-header-actions {
    opacity: 1;
}

.icon-toolkit-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border-radius: 6px;
    transition: all 0.18s var(--ease);
    position: relative;
    font-size: 0.82rem;
    font-weight: 600;
    gap: 5px;
}

.icon-toolkit-btn:hover {
    background: var(--bg-subtle);
    color: var(--primary);
}

@media (max-width: 768px) {
    .ayah-header-actions {
        opacity: 1;
    }
}

/* Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-head);
    color: var(--bg-body);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: var(--font-main);
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
    z-index: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    top: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent var(--text-head) transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
    z-index: 500;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* =========================================================
   TAFSIR MODAL & RECITERS OPTIONS
   ========================================================= */
/* ---- Tafsir Modal (Premium Styled) ---- */
.tafsir-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 35, 51, 0.45);
    backdrop-filter: blur(8px);
    z-index: 25000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.tafsir-modal-overlay.active {
    display: flex;
}

.tafsir-modal {
    background: #fdfaf3;
    width: 100%;
    max-width: 800px;
    height: 85vh;
    border-radius: 24px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] .tafsir-modal {
    background: #1a2a3a;
    color: #e8f4f8;
}

/* ---- Premium Tafsir Secondary Bar Refined ---- */
.tafsir-secondary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 2.25rem;
    background: #fdfaf3;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

[data-theme="dark"] .tafsir-secondary-bar {
    background: #1a2a3a;
    border-color: rgba(255, 255, 255, 0.05);
}

.tafsir-controls-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tafsir-lang-container {
    position: relative;
}

.tafsir-lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #eee7d8;
    border: 1px solid #dcd3c1;
    color: #433020;
    padding: 0.4rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    font-family: var(--font-main);
}

[data-theme="dark"] .tafsir-lang-dropdown-btn {
    background: #2a3a4a;
    border-color: #3b4a5a;
    color: #e8f4f8;
}

.tafsir-lang-dropdown-btn:hover {
    background: #e9e2d4;
}

/* Lang Menu Popup */
.tafsir-lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fdfaf3;
    border: 1px solid #e8dec8;
    border-radius: 14px;
    width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 100;
}

[data-theme="dark"] .tafsir-lang-menu {
    background: #1e2e3e;
    border-color: rgba(255, 255, 255, 0.1);
}

.tafsir-lang-menu.active {
    display: block;
}

.lang-menu-label {
    padding: 1.25rem 1.25rem 0.75rem;
    font-size: 1.2rem;
    font-weight: 400;
    color: #85725f;
    border-bottom: 1px solid #e8dec8;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .lang-menu-label {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.lang-menu-list {
    max-height: 250px;
    overflow-y: auto;
    padding: 0 0.5rem 0.5rem;
}

.lang-opt {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: #6d5b4a;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-main);
    transition: 0.2s;
}

[data-theme="dark"] .lang-opt {
    color: #cbd5e0;
}

.lang-opt:hover {
    background: #f5eedc;
}

[data-theme="dark"] .lang-opt:hover {
    background: rgba(255, 255, 255, 0.05);
}

.lang-opt.active {
    background: #f5eedc;
    color: #433020;
    font-weight: 500;
}

[data-theme="dark"] .lang-opt.active {
    background: rgba(255, 255, 255, 0.1);
}

.tafsir-tool-btn {
    background: #eee7d8;
    border: 1px solid #dcd3c1;
    color: #85725f;
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

[data-theme="dark"] .tafsir-tool-btn {
    background: #2a3a4a;
    border-color: #3a4a5a;
    color: #e8f4f8;
}

.tafsir-source-pills {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.tafsir-source-pills::-webkit-scrollbar {
    display: none;
}

.source-pill {
    white-space: nowrap;
    background: #eee7d8;
    border: 1px solid transparent;
    color: #85725f;
    padding: 0.45rem 1.25rem;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
}

[data-theme="dark"] .source-pill {
    background: #2a3a4a;
    color: #cbd5e0;
}

.source-pill.active {
    background: #6b553d;
    color: #fff;
    box-shadow: 0 4px 12px rgba(107, 85, 61, 0.2);
}

.tafsir-modal-header {
    padding: 1.25rem 2.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.tafsir-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #433020;
    font-family: var(--font-main);
}

[data-theme="dark"] .tafsir-modal-header h3 {
    color: #e8f4f8;
}

.tafsir-close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #667891;
    opacity: 0.5;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tafsir-close-btn:hover {
    opacity: 1;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    transform: rotate(90deg);
}

.tafsir-modal-body {
    padding: 2.5rem 3rem;
    overflow-y: auto;
    flex: 1;
    box-sizing: border-box;
    font-family: var(--font-main);
}

.tafsir-info-banner {
    background: #f5eedc;
    border: 1px solid #e8dec8;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    color: #433020;
    margin-bottom: 2rem;
    line-height: 1.5;
}

[data-theme="dark"] .tafsir-info-banner {
    background: #2a3a4a;
    border-color: #3a4a5a;
    color: #e8f4f8;
}

.tafsir-content-area {
    font-size: 1.15rem;
    line-height: 1.9;
    color: #2d3748;
}

[data-theme="dark"] .tafsir-content-area {
    color: #cbd5e0;
}

.tafsir-loading {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #85725f;
    font-style: italic;
    opacity: 0.8;
}

/* Responsiveness for Tafsir */
@media (max-width: 768px) {
    .tafsir-modal {
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .tafsir-modal-header {
        padding: 1rem 1.5rem;
    }

    .tafsir-modal-body {
        padding: 1.75rem 1.5rem;
        font-size: 1.05rem;
    }
}

/* Reciter Select Dropdown */
.reciter-select {
    background: var(--bg-body);
    color: var(--text-body);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    outline: none;
    margin-left: auto;
    cursor: pointer;
}

/* =========================================================
   SEARCH MODAL & BOOKMARK MODAL
   ========================================================= */
/* ---- Search & Bookmark Modals (Premium Styled) ---- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 35, 51, 0.45);
    backdrop-filter: blur(8px);
    z-index: 24000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 20px 20px;
    animation: fadeIn 0.3s ease;
}

.search-overlay.active {
    display: flex;
}

.search-modal {
    background: #fdfaf3;
    width: 100%;
    max-width: 600px;
    border-radius: 20px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .search-modal {
    background: #1a2a3a;
}

.search-overlay.active .search-modal {
    transform: none;
    /* Handled by animation */
}

.search-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    color: var(--text-muted);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: var(--text-head);
    outline: none;
    font-family: var(--font-main);
}

.search-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: color 0.2s;
}

.search-close-btn:hover {
    color: var(--text-head);
}

/* Surah Info Modal specific tweaks */
.surah-info-modal-content {
    max-width: 850px !important;
    height: 85vh;
}

.surah-info-modal-content .search-body {
    padding: 1.5rem 2.25rem;
    max-height: none;
    flex: 1;
    overflow-y: auto;
}

.surah-info-text-content {
    color: var(--text-body);
    line-height: 1.8;
    font-size: 1.05rem;
}

.surah-info-text-content p {
    margin-bottom: 1.25rem;
}

.surah-info-text-content h2,
.surah-info-text-content h3 {
    color: var(--text-head);
    margin-top: 2rem;
    margin-bottom: 1rem;
}



.search-body {
    padding: 1rem 0;
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.search-label {
    padding: 0 1.25rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.search-results {
    display: flex;
    flex-direction: column;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1.25rem;
    color: var(--text-body);
    text-decoration: none;
    transition: background 0.2s;
    cursor: pointer;
}

.search-result-item:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

/* Bookmark Modal Match */
.bookmark-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
    margin: 1rem 1.25rem;
    color: var(--text-body);
    font-weight: 500;
}

.bookmark-menu-item svg {
    color: var(--primary);
}

.bookmark-collections {
    padding: 0 1.25rem 1rem;
}

.bookmark-collections h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--text-head);
}

.new-collection-btn {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-body);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.13s var(--ease);
}

.new-collection-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.bookmark-done-btn {
    width: calc(100% - 2.5rem);
    margin: 0 1.25rem 1.25rem;
    padding: 0.75rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.13s var(--ease);
}

.bookmark-done-btn:hover {
    background: var(--primary-light);
}

/* Custom Theme Selection Button Hovers */
.theme-menu-btn {
    background: transparent !important;
    opacity: 0.7;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.theme-menu-btn:hover {
    background: var(--bg-hover) !important;
    color: var(--primary) !important;
    opacity: 1;
}

.theme-menu-btn.active {
    background: var(--primary-glow) !important;
    color: var(--primary) !important;
    opacity: 1;
    font-weight: 700 !important;
}

/* =========================================================
   READING MODES
   ========================================================= */
.ayahs-list.mode-reading {
    display: block;
    background: var(--bg-parchment);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-sm);
    line-height: 2.3;
    text-align: justify;
    /* Zero out font-size on parent to kill whitespace gaps between inline children */
    font-size: 0;
}

/* Restore font-size on actual text children */
.ayahs-list.mode-reading .arabic-text,
.ayahs-list.mode-reading .english-text,
.ayahs-list.mode-reading .quran-word {
    font-size: 20px;
}

.ayahs-list.mode-reading .ayah-container {
    display: inline;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.ayahs-list.mode-reading .ayah-container:hover {
    background: transparent !important;
    transform: none !important;
}

.ayahs-list.mode-reading .ayah-header {
    display: none !important;
}

.ayahs-list.mode-reading .ayah-texts {
    display: inline;
    margin: 0;
    padding: 0;
    gap: 0;
}

/* ALL non-Arabic elements vanish without leaving space */
.ayahs-list.mode-reading .transliteration-text,
.ayahs-list.mode-reading .english-text,
.ayahs-list.mode-reading .urdu-text,
.ayahs-list.mode-reading .reading-page-break {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* --- ARABIC SUB MODE (Mushaf / Quran Page Style) --- */
.ayahs-list.mode-reading-arabic {
    display: block;
    background: #FFF9F0;
    border: 1px solid #e2d3ba;
    border-radius: var(--radius-lg);
    /* Wide enough to fit 8+ Arabic words per line */
    padding: 3rem 0.5rem 3.5rem;
    max-width: 1000px;
    width: 100%;
    margin: 1.5rem auto;
    gap: 0;
    line-height: normal;
    direction: rtl;
    /* justify stretches words across the full line width */
    text-align: justify;
    text-align-last: right;
    box-shadow: 0 6px 28px rgba(107, 85, 61, 0.12), 0 1px 4px rgba(107, 85, 61, 0.06);
    position: relative;
}

/* Inner border line like a real mushaf frame */
/* .ayahs-list.mode-reading-arabic::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 2px solid #d4b98a;
    border-radius: calc(var(--radius-lg) - 4px);
    pointer-events: none;
    z-index: 0;
} */

/* Page number at bottom */
.ayahs-list.mode-reading-arabic::after {
    content: '534';
    display: block;
    text-align: center;
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 600;
    color: #8b6d46;
    margin-top: 2rem;
    padding-top: 1rem;
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .ayahs-list.mode-reading-arabic {
    background: #1a1610;
    border-color: #3d3425;
}

[data-theme="dark"] .ayahs-list.mode-reading-arabic::before {
    border-color: #4a3c28;
}

[data-theme="dark"] .ayahs-list.mode-reading-arabic::after {
    color: #a08560;
}

/* Hide ALL non-Arabic elements in reading mode */
.ayahs-list.mode-reading-arabic .ayah-header,
.ayahs-list.mode-reading-arabic .ayah-controls,
.ayahs-list.mode-reading-arabic .english-text,
.ayahs-list.mode-reading-arabic .transliteration-text,
.ayahs-list.mode-reading-arabic .urdu-text,
.ayahs-list.mode-reading-arabic .ayah-number {
    display: none !important;
}

/* Flatten ayah containers into inline flow */
.ayahs-list.mode-reading-arabic .ayah-container {
    display: inline;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    border-radius: 0 !important;
}

.ayahs-list.mode-reading-arabic .ayah-container:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Arabic text — matches screenshot exactly */
.ayahs-list.mode-reading-arabic .arabic-text {
    display: inline;
    /* 24px gives ~8-10 words per line in a 1000px container */
    font-size: 24px;
    font-family: var(--font-ar);
    color: #1a1409;
    direction: rtl;
    /* Generous line-height for diacritics (tashkeel) breathing room */
    line-height: 2.6;
    /* Positive word-spacing fills lines naturally */
    word-spacing: 0.12em;
    letter-spacing: 0.01em;
    white-space: normal;
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .ayahs-list.mode-reading-arabic .arabic-text {
    color: #e8dcc8;
}

/* Hide quran-word special styling in reading mode */
.ayahs-list.mode-reading-arabic .quran-word {
    border-radius: 0;
    padding: 0;
    background: transparent !important;
}

.ayahs-list.mode-reading-arabic .quran-word:hover {
    background: rgba(139, 109, 70, 0.1) !important;
    border-radius: 4px;
}

/* Ayah end symbol — ornate Quran marker like screenshot */
.ayahs-list.mode-reading-arabic .end-sym {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Slightly smaller to not disrupt line flow */
    width: 34px;
    height: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='42' fill='none' stroke='%238b6d46' stroke-width='2'/%3E%3Ccircle cx='50' cy='50' r='36' fill='none' stroke='%238b6d46' stroke-width='1'/%3E%3Ccircle cx='50' cy='8' r='5' fill='%238b6d46'/%3E%3Ccircle cx='50' cy='92' r='5' fill='%238b6d46'/%3E%3Ccircle cx='8' cy='50' r='5' fill='%238b6d46'/%3E%3Ccircle cx='92' cy='50' r='5' fill='%238b6d46'/%3E%3Ccircle cx='20' cy='20' r='4' fill='%238b6d46'/%3E%3Ccircle cx='80' cy='20' r='4' fill='%238b6d46'/%3E%3Ccircle cx='20' cy='80' r='4' fill='%238b6d46'/%3E%3Ccircle cx='80' cy='80' r='4' fill='%238b6d46'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    font-size: 12px;
    font-weight: 700;
    color: #8b6d46;
    margin: 0 6px;
    font-family: var(--font-main);
    vertical-align: middle;
    position: relative;
    z-index: 1;
}

/* --- TRANSLATION SUB MODE (Flowing paragraph — exact screenshot match) --- */

.ayahs-list.mode-reading-translation {
    display: block;
    background: var(--bg-parchment);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 3rem;
    max-width: 820px;
    margin: 2rem auto;
    gap: 0;
    line-height: normal;
    direction: ltr;
    text-align: justify;
    position: relative;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .ayahs-list.mode-reading-translation {
    background: #1e1a14;
}

/* Hide Arabic text + all non-English elements */
.ayahs-list.mode-reading-translation .arabic-text,
.ayahs-list.mode-reading-translation .transliteration-text,
.ayahs-list.mode-reading-translation .urdu-text,
.ayahs-list.mode-reading-translation .ayah-header,
.ayahs-list.mode-reading-translation .ayah-controls,
.ayahs-list.mode-reading-translation .ayah-number,
.ayahs-list.mode-reading-translation .end-sym {
    display: none !important;
}

/* Flatten ayah containers into inline flow */
.ayahs-list.mode-reading-translation .ayah-container {
    display: inline;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    border-radius: 0 !important;
}

.ayahs-list.mode-reading-translation .ayah-container:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* English text — flowing paragraph matching screenshot exactly */
.ayahs-list.mode-reading-translation .english-text {
    display: inline !important;
    font-size: 21px;
    font-family: var(--font-main);
    color: #1a1409;
    line-height: 2.1;
    white-space: normal;
}

[data-theme="dark"] .ayahs-list.mode-reading-translation .english-text {
    color: #e0d5c5;
}

/* Bold brown ayah number inline — "1." "2." "3." exactly like screenshot */
.ayahs-list.mode-reading-translation .english-text::before {
    content: attr(data-ayah) ".";
    font-weight: 800;
    font-size: 21px;
    color: #8b6d46;
    margin-right: 4px;
    margin-left: 2px;
}

[data-theme="dark"] .ayahs-list.mode-reading-translation .english-text::before {
    color: #b89a6a;
}

/* =========================================================
   BOTTOM READING NAVBAR
   ========================================================= */
/* Scroll Progress Bar */
.scroll-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--primary);
    z-index: 1001;
    box-shadow: 0 0 10px rgba(139, 109, 70, 0.3);
    transition: width 0.15s ease-out;
}

.bottom-reading-nav {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background: var(--bg-parchment);
    border-top: 1px solid var(--border);
    z-index: 1000;
    box-shadow: 0 -3px 14px rgba(60, 40, 10, 0.08);
    height: var(--bottom-nav-height);
    display: block !important;
    transition: transform 0.4s var(--ease), background 0.3s var(--ease);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.bottom-reading-nav.bottom-nav-shifted {
    transform: translateY(calc(var(--nav-height) * -1));
}

/* If the player is active, adjust bottom reading nav to sit above it */
html.player-active .bottom-reading-nav {
    bottom: 80px;
    /* Adjust height based on player bar height if needed */
}

/* Add an active helper class */
html.player-active body {
    padding-bottom: 160px;
    /* Player + Nav combined */
}

.bottom-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    padding: 0 2rem;
    margin: 0 auto;
    max-width: 1240px;
}

.bottom-nav-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.surah-selector-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-head);
    font-size: 1.15rem;
    font-weight: 700;
    font-family: var(--font-main);
    cursor: pointer;
    transition: color 0.2s var(--ease);
}

.surah-selector-btn:hover {
    color: var(--primary);
}

.settings-gear-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-gear-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: transform 0.3s var(--ease), color 0.2s var(--ease);
    display: flex;
}

.settings-gear-btn:hover {
    color: var(--text-head);
    transform: rotate(45deg);
}

.bottom-nav-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.bottom-nav-right {
    display: flex;
    align-items: center;
}

/* Responsive Pill Design for Toggles - Consolidated and polished */
.layout-toggle-container {
    background: var(--bg-subtle);
    padding: 2px;
    border-radius: 50px;
    display: flex;
    gap: 2px;
    align-items: center;
    border: 1.5px solid var(--border-light);
}

.layout-pill-btn {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background: transparent;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-body);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.25s var(--ease);
}

.layout-pill-btn svg {
    opacity: 0.7;
}

.layout-pill-btn.active {
    background: var(--bg-card);
    color: var(--text-head);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.layout-pill-reading-group {
    display: flex;
    align-items: center;
    border-radius: 50px;
    overflow: hidden;
    transition: all 0.25s var(--ease);
}

.layout-pill-reading-group.active {
    background: var(--bg-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
}

/* When reading mode is active, hide the main "Reading" button text and show sub-options */
.layout-pill-reading-group.active #btn-reading-mode {
    display: none;
}

.reading-sub-options {
    display: flex;
    align-items: center;
    gap: 2px;
    animation: fadeIn 0.3s ease-out;
}

.layout-sub-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.45rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.2s var(--ease);
}

.layout-sub-btn.active {
    color: var(--text-head);
    background: var(--bg-body);
}

.ar-icon {
    font-family: var(--font-ar);
    font-size: 1.05rem;
    line-height: 1;
    border: 1.5px solid currentColor;
    border-radius: 6px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.trans-icon {
    font-family: var(--font-main);
    font-size: 0.85rem;
    line-height: 1;
    background: var(--text-body);
    color: var(--bg-card);
    border-radius: 6px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(5px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sub-divider {
    color: var(--border);
    font-size: 1.2rem;
    opacity: 0.5;
    margin: 0 2px;
    font-weight: 300;
}

@media (max-width: 768px) {
    .hidden-mobile {
        display: none !important;
    }

    .bottom-nav-container {
        padding: 0 0.5rem;
        gap: 0.2rem;
    }

    .bottom-nav-left {
        gap: 0.5rem;
    }

    .surah-selector-btn {
        font-size: 0.95rem;
        gap: 0.3rem;
    }

    .layout-toggle-container {
        transform: none;
        padding: 0.2rem;
    }

    .layout-pill-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
        gap: 0.3rem;
    }

    .layout-pill-btn svg {
        width: 14px;
        height: 14px;
    }

    .layout-sub-btn {
        padding: 0.35rem 0.4rem;
        font-size: 0.8rem;
        gap: 4px;
    }

    .ar-icon {
        width: 20px;
        height: 20px;
        font-size: 0.95rem;
    }

    .sub-divider {
        font-size: 1rem;
        margin: 0 1px;
    }

    /* MOBILE NAVBAR REPAIRS */
    .nav-container {
        padding: 0 1rem;
        gap: 0.2rem;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
    }

    .logo {
        order: 1;
        flex: 1;
        min-width: 0;
        margin-right: auto;
    }

    .nav-controls {
        order: 2;
        margin-left: 0;
        display: flex;
        gap: 0.2rem;
        width: auto !important;
        border: none !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .nav-controls .btn-outline,
    .nav-controls .btn {
        width: auto !important;
        justify-content: center;
    }

    .settings-menu {
        position: absolute !important;
        right: 0;
        top: calc(100% + 5px);
        width: 250px !important;
        background: var(--bg-card) !important;
        border: 1px solid var(--border) !important;
        box-shadow: var(--shadow-lg) !important;
        margin-top: 0 !important;
        padding: 1rem !important;
        z-index: 1000 !important;
    }

    .mobile-menu-btn {
        display: flex;
        order: 3;
        margin-left: 0.2rem;
    }

    .nav-content {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        display: none;
        box-shadow: var(--shadow-md);
        align-items: flex-start;
    }

    .nav-content.active {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.5rem;
    }

    .nav-dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        max-height: none;
        display: none;
        padding: 0 0 0 1rem;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
    }

    .nav-dropdown.open .dropdown-menu {
        display: block;
    }
}

/* Fix gap hover issue for dropdowns */
.dropdown-menu::before,
.settings-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
}

/* Surah Navigation Drawer */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 35, 51, 0.45);
    backdrop-filter: blur(8px);
    z-index: 25000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drawer-overlay.active {
    display: block;
    opacity: 1;
}

.surah-selection-drawer {
    position: absolute;
    top: 0;
    left: 0;
    width: 380px;
    height: 100%;
    background: var(--bg-card);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .surah-selection-drawer {
    border-right: 1px solid var(--border);
}

.drawer-overlay.active .surah-selection-drawer {
    transform: translateX(0);
}

.surah-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.surah-drawer-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #eedebd;
    padding: 6px;
    border-radius: 50px;
}

[data-theme="dark"] .surah-drawer-tabs {
    background: var(--bg-body);
}

.drawer-tab {
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #8c7355;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.2s;
}

[data-theme="dark"] .drawer-tab {
    color: var(--text-muted);
}

.drawer-tab:hover {
    color: var(--text-body);
}

.drawer-tab.active {
    background: #ffffff;
    color: #4a3c2c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .drawer-tab.active {
    background: var(--bg-card);
    color: var(--text-head);
}

.drawer-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: color 0.2s;
}

.drawer-close-btn:hover {
    color: var(--text-head);
    transform: rotate(90deg);
}

.surah-drawer-tip {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.75rem 1.25rem 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.surah-drawer-tip span {
    background: var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-head);
}

.drawer-tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.drawer-tab-content.active {
    display: flex;
}

.drawer-search-box {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.drawer-search-box input {
    width: 100%;
    background: #eedebd;
    border: 1px solid transparent;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    color: #4a3c2c;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
}

.drawer-search-box input::placeholder {
    color: #a48c6b;
}

[data-theme="dark"] .drawer-search-box input {
    background: var(--bg-body);
    color: var(--text-head);
}

.drawer-search-box input:focus {
    border-color: var(--primary);
}

.drawer-surah-list,
.drawer-verse-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.drawer-surah-list::-webkit-scrollbar,
.drawer-verse-list::-webkit-scrollbar {
    width: 6px;
}

.drawer-surah-list::-webkit-scrollbar-thumb,
.drawer-verse-list::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
}

.drawer-surah-list:hover::-webkit-scrollbar-thumb,
.drawer-verse-list:hover::-webkit-scrollbar-thumb {
    background: var(--border);
}

.drawer-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1.25rem;
    color: var(--text-body);
    text-decoration: none;
    transition: background 0.15s;
    cursor: pointer;
    border-radius: 16px;
    margin-bottom: 2px;
    border: none;
    background: transparent;
    font-family: inherit;
    width: 100%;
    text-align: left;
}

.drawer-list-item:hover {
    background: var(--bg-hover);
    color: var(--text-head);
}

.drawer-list-item.active {
    background: #eedebd;
    color: #000;
    font-weight: 600;
}

[data-theme="dark"] .drawer-list-item.active {
    background: var(--bg-subtle);
    color: var(--text-head);
}

.verse-list-item {
    position: relative;
}

.verse-list-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: #deb887;
    border-radius: 4px;
}

.drawer-item-num {
    display: flex;
    align-items: center;
    text-align: left;
    min-width: 24px;
    font-size: 1.05rem;
    font-weight: 600;
    color: inherit;
    flex-shrink: 0;
}

.drawer-item-title {
    font-weight: 500;
    font-size: 1.05rem;
}

@media (max-width: 480px) {
    .surah-selection-drawer {
        width: 100%;
    }
}

/* Generic UI Tooltip */
.ui-tooltip {
    position: fixed;
    background: #000000;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: inherit;
}

.ui-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ui-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #000000 transparent transparent transparent;
}

/* Segmented Loading Spinner (iOS Style) */
.loading-spinner {
    width: 28px;
    height: 28px;
    display: none;
    position: relative;
}

.player-btn.loading svg:not(.loading-spinner) {
    display: none !important;
}

.player-btn.loading .loading-spinner {
    display: block !important;
}

.spinner-segment {
    position: absolute;
    top: 0;
    left: 13px;
    width: 2px;
    height: 7px;
    background: #4a4a4a;
    border-radius: 1px;
    transform-origin: center 14px;
    animation: spinner-fade 1s linear infinite;
}

@keyframes spinner-fade {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0.1;
    }
}

.spinner-segment:nth-child(1) {
    transform: rotate(0deg);
    animation-delay: 0s;
}

.spinner-segment:nth-child(2) {
    transform: rotate(30deg);
    animation-delay: -0.916s;
}

.spinner-segment:nth-child(3) {
    transform: rotate(60deg);
    animation-delay: -0.833s;
}

.spinner-segment:nth-child(4) {
    transform: rotate(90deg);
    animation-delay: -0.75s;
}

.spinner-segment:nth-child(5) {
    transform: rotate(120deg);
    animation-delay: -0.666s;
}

.spinner-segment:nth-child(6) {
    transform: rotate(150deg);
    animation-delay: -0.583s;
}

.spinner-segment:nth-child(7) {
    transform: rotate(180deg);
    animation-delay: -0.5s;
}

.spinner-segment:nth-child(8) {
    transform: rotate(210deg);
    animation-delay: -0.416s;
}

.spinner-segment:nth-child(9) {
    transform: rotate(240deg);
    animation-delay: -0.333s;
}

.spinner-segment:nth-child(10) {
    transform: rotate(270deg);
    animation-delay: -0.25s;
}

.spinner-segment:nth-child(11) {
    transform: rotate(300deg);
    animation-delay: -0.166s;
}

.spinner-segment:nth-child(12) {
    transform: rotate(330deg);
    animation-delay: -0.083s;
}

[data-theme="dark"] .spinner-segment {
    background: #e0d5c5;
}

/* --- Premium Toast Notification --- */
.app-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(44, 31, 15, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.app-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


[data-theme="dark"] .app-toast {
    background: rgba(200, 169, 110, 0.9);
    color: #1a1510;
}

/* =========================================================
   HOME PAGE - QURAN.COM INSPIRED DESIGN
   ========================================================= */

.home-hero {
    padding: 2.5rem 1.5rem 3rem;
    text-align: center;
    background: radial-gradient(circle at center, var(--bg-subtle) 0%, var(--bg-body) 100%);
    border-bottom: 1px solid var(--border-light);
    margin: -2.5rem -1.5rem 2rem;
    position: relative;
}

.home-logo-large {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.home-logo-large img {
    width: 64px;
    height: 64px;
    box-shadow: var(--shadow-md);
    border-radius: 50%;
    padding: 4px;
    background: white;
}

.home-logo-large h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-head);
    margin: 0;
    letter-spacing: -0.5px;
}

.home-search-wrapper {
    max-width: 650px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.home-search-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.6rem 0.6rem 0.6rem 1.8rem;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s var(--ease);
}

.home-search-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    transform: translateY(-2px);
}

.home-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    color: var(--text-body);
    outline: none;
    padding: 0.5rem 0;
}

.home-search-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.home-search-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.home-search-quick {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.home-search-quick a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    background: var(--bg-subtle);
    padding: 6px 16px;
    border-radius: 20px;
    transition: all 0.2s;
}

.home-search-quick a:hover {
    background: var(--primary);
    color: white;
}

/* Feature Sections */
.home-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2rem 0 1.25rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.75rem;
}

.home-section-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-head);
    margin: 0;
}

/* Featured Card */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.featured-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s var(--ease);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.featured-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.featured-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    background: var(--primary-glow);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
}

.featured-content h3 {
    margin: 0 0 0.4rem;
    font-size: 1.35rem;
    color: var(--text-head);
}

.featured-content p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Surah Grid Home */
.home-surah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.surah-card-home {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s var(--ease);
}

.surah-card-home:hover {
    background: var(--bg-body);
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.sc-num {
    background: var(--bg-subtle);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    margin-right: 1.25rem;
    transition: all 0.2s;
}

.surah-card-home:hover .sc-num {
    background: var(--primary);
    color: white;
}

.sc-info {
    flex: 1;
}

.sc-name {
    display: block;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-head);
    margin-bottom: 2px;
}

.sc-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sc-arabic {
    font-family: var(--font-ar);
    font-size: 1.75rem;
    color: var(--text-head);
    margin-left: 1rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .home-hero {
        padding: 1.5rem 1rem 2rem;
        margin: -2.5rem -1rem 1.5rem;
    }

    .home-logo-large h1 {
        font-size: 1.75rem;
    }

    .home-logo-large img {
        width: 48px;
        height: 48px;
    }

    .home-search-btn {
        display: none !important;
    }

    .home-search-container {
        padding: 0.8rem 1.5rem;
    }

    .home-surah-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   Read More Section (Next/Prev Surahs)
   ========================================================= */
.read-more-section {
    max-width: 800px;
    margin: 3rem auto 2rem;
    padding: 2.5rem;
    background: var(--bg-card);
    /* Should be a creamy/off-white color if using a specific theme */
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    font-family: var(--font-main);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.read-more-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.read-more-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-head);
    margin: 0;
}

.read-again-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-body);
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}

.read-again-btn:hover {
    color: var(--text-head);
}

.read-more-cards {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.read-more-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.75rem;
    background: var(--bg-body);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.2s ease;
}

.read-more-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.read-more-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.read-more-surah-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-head);
    margin: 0;
}

.read-more-surah-meaning {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
}

.read-more-badge {
    padding: 0.5rem 1.2rem;
    border-radius: 99px;
    font-size: 0.95rem;
    font-weight: 600;
}

.read-more-badge.next {
    background: var(--text-head);
    color: var(--bg-body);
}

.read-more-card:hover .read-more-badge.next {
    background: #000;
    color: #fff;
    opacity: 0.9;
}

.read-more-badge.prev {
    background: var(--bg-hover);
    color: var(--text-head);
    border: 1px solid var(--border);
}

@media (max-width: 600px) {
    .read-more-section {
        padding: 1.5rem;
        margin: 2rem 1rem;
    }

    .read-more-header h2 {
        font-size: 1.5rem;
    }

    .read-more-card {
        padding: 1.25rem;
        flex-direction: row;
        gap: 1rem;
    }

    .read-more-surah-title {
        font-size: 1.2rem;
    }
}