:root {
    --quran-navy: #002633;
    --quran-dark: #001923;
    --quran-gold: #e6a530;
    --quran-gold-light: #f5c46b;
    --quran-gold-hover: #f5b742;
    --quran-cyan: #32b2d0;
    --quran-bg: #002e3e;
    --quran-card-bg: rgba(2, 38, 54, 0.95);
    --quran-border: rgba(230, 165, 48, 0.22);
    --quran-text-muted: rgba(255, 255, 255, 0.68);
    --quran-font-size: 27px;
}

body {
    background-color: var(--quran-dark) !important;
    color: #fff;
    font-family: 'Tajawal', 'Cairo', sans-serif !important;
}

/* Disable sticky header on Quran page for maximum reading space */
header, .main-header, #main-header, .glass-header, #glass-header, #header-nav-row, .sticky-top, .navbar-sticky, .header-sticky, .vs-header, .header-area {
    position: relative !important;
    top: auto !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Ensure native select styling and compatibility with theme nice-select */
.quran-select-group .nice-select,
.quran-toolbar .nice-select,
#select-surah-dropdown + .nice-select,
#select-ayah-jump + .nice-select,
#select-reciter + .nice-select,
#select-language + .nice-select {
    display: none !important;
}

.quran-select {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: #00222f url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e6a530' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat left 0.65rem center/12px 12px !important;
    color: #ffffff !important;
    border: 1px solid rgba(230, 165, 48, 0.4) !important;
    border-radius: 12px !important;
    padding: 6px 26px 6px 12px !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    outline: none !important;
    transition: all 0.25s ease;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    height: 38px !important;
    line-height: normal !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#select-tafseer {
    font-size: 12px !important;
    padding: 4px 26px 4px 10px !important;
    height: 36px !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 170px !important;
}

.quran-select:focus, .quran-select:hover {
    border-color: var(--quran-gold) !important;
    background-color: #002a3a !important;
    box-shadow: 0 0 10px rgba(230, 165, 48, 0.2) !important;
}

.quran-select option,
.quran-select optgroup {
    background: #001923 !important;
    color: #ffffff !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    font-family: 'Cairo', sans-serif !important;
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 20, 30, 0.4); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: rgba(230, 165, 48, 0.35); border-radius: 10px; transition: 0.3s; }
::-webkit-scrollbar-thumb:hover { background: var(--quran-gold); }
* { scrollbar-width: thin; scrollbar-color: rgba(230, 165, 48, 0.35) rgba(0, 20, 30, 0.4); }

/* Top Primary Category Switcher (Quran vs Hadith Hub) */
.main-category-bar {
    background: linear-gradient(180deg, #00131d 0%, #00212e 100%);
    border-bottom: 2px solid rgba(230, 165, 48, 0.3);
    padding: 12px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.cat-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(230, 165, 48, 0.25);
    color: rgba(255, 255, 255, 0.85);
    padding: 10px 28px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cat-tab-btn:hover, .cat-tab-btn.active {
    background: linear-gradient(135deg, var(--quran-gold), #b87b14);
    color: var(--quran-dark);
    border-color: var(--quran-gold);
    box-shadow: 0 4px 20px rgba(230, 165, 48, 0.4);
    transform: translateY(-2px);
}

/* Islamic Arabesque Decorated Hero Section */
.quran-hero {
    background: radial-gradient(circle at 50% 30%, rgba(230, 165, 48, 0.22) 0%, rgba(0, 20, 29, 0.96) 80%),
                linear-gradient(180deg, #001722 0%, #002534 100%);
    padding: 35px 20px 25px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(230, 165, 48, 0.3);
    box-shadow: inset 0 -15px 30px rgba(0,0,0,0.6);
    transition: all 0.4s ease;
}

.quran-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(rgba(230, 165, 48, 0.18) 1.5px, transparent 1.5px),
        linear-gradient(45deg, rgba(230, 165, 48, 0.04) 25%, transparent 25%, transparent 75%, rgba(230, 165, 48, 0.04) 75%),
        linear-gradient(-45deg, rgba(230, 165, 48, 0.04) 25%, transparent 25%, transparent 75%, rgba(230, 165, 48, 0.04) 75%);
    background-size: 32px 32px, 64px 64px, 64px 64px;
    opacity: 0.4;
    pointer-events: none;
}

.islamic-frame {
    display: inline-block;
    position: relative;
    padding: 8px 30px;
    border: 2px double rgba(230, 165, 48, 0.5);
    border-radius: 18px;
    background: rgba(0, 20, 30, 0.6);
    backdrop-filter: blur(8px);
    margin-bottom: 10px;
}

.islamic-frame::before, .islamic-frame::after {
    content: '۞';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--quran-gold);
    font-size: 18px;
}
.islamic-frame::before { right: 8px; }
.islamic-frame::after { left: 8px; }

.quran-hero-title {
    font-family: 'Amiri', 'Tajawal', serif;
    font-weight: 700;
    font-size: 38px;
    margin: 10px 0 8px;
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF3D6 40%, #F5C46B 75%, #E6A530 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 25px rgba(230, 165, 48, 0.3);
    letter-spacing: 0.5px;
}

.quran-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(230, 165, 48, 0.12);
    border: 1px solid rgba(230, 165, 48, 0.4);
    color: var(--quran-gold-light);
    padding: 5px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
}

/* Single Streamlined Top Quran Toolbar */
.quran-toolbar {
    position: sticky;
    top: 10px;
    z-index: 1000;
    background: linear-gradient(145deg, rgba(2, 42, 60, 0.97), rgba(1, 30, 44, 0.99));
    border: 1px solid rgba(230, 165, 48, 0.35);
    border-radius: 20px;
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.segmented-switch {
    background: rgba(0, 18, 26, 0.75);
    padding: 4px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: inline-flex;
    gap: 4px;
}

.quran-nav-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.quran-nav-tab.active, .quran-nav-tab:hover {
    background: linear-gradient(135deg, var(--quran-gold), #b87b14);
    color: var(--quran-dark);
    box-shadow: 0 4px 15px rgba(230, 165, 48, 0.3);
}

.quran-select-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quran-select-group label {
    font-size: 11px;
    color: var(--quran-gold-light);
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Font Size Control Buttons */
.font-size-controls {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 3px 8px;
}

.font-btn {
    background: rgba(230, 165, 48, 0.12);
    border: 1px solid rgba(230, 165, 48, 0.3);
    color: var(--quran-gold-light);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.font-btn:hover {
    background: var(--quran-gold);
    color: var(--quran-dark);
}

/* Reader Main Container */
.reader-area {
    background: var(--quran-card-bg);
    border: 1px solid var(--quran-border);
    border-radius: 22px;
    padding: 26px;
    min-height: 600px;
    max-height: 820px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.bismillah-header {
    font-family: 'Amiri', serif;
    font-size: 30px;
    color: var(--quran-gold);
    text-align: center;
    margin: 15px 0 35px;
    text-shadow: 0 4px 18px rgba(230, 165, 48, 0.3);
}

.ayah-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 4px solid transparent;
    border-radius: 18px;
    padding: 20px 22px;
    margin-bottom: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.ayah-box:hover {
    background: rgba(230, 165, 48, 0.12) !important;
    border-color: rgba(230, 165, 48, 0.5) !important;
    border-right: 4px solid var(--quran-gold) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(230, 165, 48, 0.15) !important;
    transform: translateY(-2px);
}

.ayah-box.active-playing {
    background: rgba(230, 165, 48, 0.15) !important;
    border-color: var(--quran-gold) !important;
    border-right: 5px solid var(--quran-gold) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(230, 165, 48, 0.25) !important;
}

.ayah-text {
    font-family: 'Amiri', serif;
    font-size: var(--quran-font-size);
    line-height: 2.4;
    color: #fff;
    text-align: right;
    margin-bottom: 12px;
    direction: rtl;
    transition: font-size 0.2s ease;
}

.ayah-number-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(230, 165, 48, 0.18);
    color: var(--quran-gold);
    font-size: 13px;
    font-weight: 800;
    border: 1px solid var(--quran-gold);
    margin-right: 10px;
    font-family: 'Cairo', sans-serif;
}

.ayah-translation {
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.8;
    direction: ltr;
    text-align: left;
    padding: 12px 16px;
    margin-top: 14px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    border-left: 3px solid var(--quran-gold);
    font-family: 'Inter', system-ui, sans-serif;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Per-Ayah Clean Action Toolbar */
.ayah-toolbar {
    background: rgba(0, 15, 23, 0.5);
    padding: 6px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 12px;
}

.ayah-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.ayah-action-btn:hover, .ayah-action-btn.active {
    background: var(--quran-gold);
    color: var(--quran-dark);
    border-color: var(--quran-gold);
    transform: translateY(-2px);
}

/* Mushaf Continuous View with Clean Rounded Multiline Highlights */
.mushaf-container {
    background: rgba(0, 15, 23, 0.45);
    border: 1px solid rgba(230, 165, 48, 0.25);
    border-radius: 20px;
    padding: 35px 28px;
    text-align: center;
    direction: rtl;
    font-family: 'Amiri', serif;
    font-size: var(--quran-font-size);
    line-height: 2.8;
    color: #f8f9fa;
}

.mushaf-word {
    display: inline;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    padding: 3px 6px;
    border-radius: 8px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.mushaf-word:hover {
    background: rgba(230, 165, 48, 0.22) !important;
    color: #ffffff !important;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(230, 165, 48, 0.2);
}

.mushaf-word.mushaf-playing {
    background: rgba(230, 165, 48, 0.16) !important;
    color: #ffffff !important;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(230, 165, 48, 0.25);
    border: 1px solid rgba(230, 165, 48, 0.35);
}

.mushaf-word.mushaf-playing:hover {
    background: rgba(230, 165, 48, 0.3) !important;
    border-color: var(--quran-gold) !important;
}

.mushaf-ayah-end {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(230, 165, 48, 0.15);
    border: 1px solid rgba(230, 165, 48, 0.4);
    color: var(--quran-gold-light);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
    margin: 0 6px;
    vertical-align: middle;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mushaf-ayah-end.mushaf-playing {
    background: linear-gradient(135deg, var(--quran-gold), #b87b14) !important;
    color: var(--quran-dark) !important;
    box-shadow: 0 0 12px rgba(230, 165, 48, 0.5);
    transform: scale(1.15);
}

/* Mushaf Page Container (المصحف المصور التجويدي الملون) */
.quran-page-wrapper {
    background: #fcfbf7;
    border: 3px double rgba(230, 165, 48, 0.4);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7);
    display: inline-block;
    max-width: 780px;
    width: 100%;
}

.quran-page-wrapper img {
    border-radius: 10px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Ayah Action Buttons */
.ayah-pill-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    margin: 2px 0;
}

.ayah-pill-btn i {
    font-size: 13px;
    margin: 0 !important;
}

.ayah-pill-btn:hover {
    background: rgba(230, 165, 48, 0.2);
    border-color: var(--quran-gold);
    color: #fff;
    transform: translateY(-1px);
}

.ayah-pill-btn.ai-btn {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.ayah-pill-btn.ai-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: #60a5fa;
    color: #fff;
}

.ayah-pill-btn.practice-btn {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.ayah-pill-btn.practice-btn:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: #34d399;
    color: #fff;
}

/* Stacking Context Fix: When any Modal is open, lower toolbar and headers z-index */
body.modal-open .quran-toolbar,
body.modal-open header,
body.modal-open .main-header,
body.modal-open .vs-header,
body.modal-open #main-header,
body.modal-open .glass-header,
body.modal-open .sticky-top {
    z-index: 1 !important;
}

body.modal-open main {
    z-index: auto !important;
}

/* Modals Dark Design System with High Z-Index & Top Positioning */
.modal {
    z-index: 105500 !important;
}

.modal:not(.show) {
    display: none !important;
}

.modal.show {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 0.5rem 1rem 2rem 1rem !important;
    overflow-y: auto !important;
}

.modal-backdrop {
    z-index: 105450 !important;
}

/* When modal is open, lower floating audio player to avoid blocking modal footer and controls */
body.modal-open .quran-floating-player {
    opacity: 0.15 !important;
    pointer-events: none !important;
    transform: translateX(-50%) translateY(40px) !important;
    transition: all 0.3s ease !important;
    z-index: 1000 !important;
}

.style-quran-modal {
    background: linear-gradient(145deg, #0e1e31, #08121d) !important;
    border: 1.5px solid rgba(229, 160, 53, 0.45) !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.95), 0 0 40px rgba(0, 0, 0, 0.8) !important;
    max-height: calc(100vh - 2rem) !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.style-quran-modal .modal-header {
    cursor: move;
    user-select: none;
}

.style-quran-modal .modal-body {
    overflow-y: auto !important;
    max-height: calc(100vh - 9rem) !important;
    scrollbar-width: thin;
    scrollbar-color: var(--quran-gold) rgba(255, 255, 255, 0.05);
}

.style-quran-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

.style-quran-modal .modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.style-quran-modal .modal-body::-webkit-scrollbar-thumb {
    background: var(--quran-gold);
    border-radius: 10px;
}

.modal-dialog-centered {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    min-height: auto !important;
}

.modal-dialog {
    margin: 0.5rem auto !important;
    z-index: 105550 !important;
    max-width: 860px;
    width: 95%;
}

.compare-ayah-banner {
    background: #050d18;
    border: 1px solid #162438;
    border-radius: 14px;
    padding: 12px 18px;
}

.compare-arabic-text {
    font-family: 'Amiri', serif;
    font-size: 22px;
    color: var(--quran-gold-light);
    line-height: 1.9;
    direction: rtl;
}

.translation-card {
    background: #0d1e30;
    border: 1px solid #1a2f47;
    border-radius: 14px;
    padding: 16px;
    height: 100%;
    transition: 0.25s;
}

.translation-card:hover {
    border-color: var(--quran-gold);
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

.trans-title {
    font-weight: 800;
    font-size: 13.5px;
    color: #60a5fa;
}

.trans-author {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.trans-text {
    font-size: 13.5px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
    font-family: sans-serif;
}

/* AI Ustadh Chat System */
.ai-chip-btn {
    background: #0e2035;
    border: 1px solid #1c3350;
    color: var(--quran-gold-light);
    border-radius: 8px;
    padding: 5px 13px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.ai-chip-btn:hover {
    background: var(--quran-gold);
    color: var(--quran-dark);
    border-color: var(--quran-gold);
}

.ai-chat-log {
    background: #050d18;
    border: 1px solid #162438;
    border-radius: 14px;
    padding: 14px;
    max-height: 200px;
    min-height: 140px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-msg-bubble {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.8;
    max-width: 88%;
}

.ai-msg-bubble.system-msg {
    background: #0c1a2c;
    border: 1px dashed rgba(230, 165, 48, 0.3);
    color: var(--quran-gold-light);
    align-self: center;
    text-align: center;
    font-size: 12.5px;
}

.ai-msg-bubble.user-msg {
    background: #1d3b5e;
    color: #fff;
    align-self: flex-start;
    border-bottom-right-radius: 2px;
    direction: rtl;
}

.ai-msg-bubble.assistant-msg {
    background: #0f2742;
    border: 1px solid #1c3e66;
    color: #fff;
    align-self: flex-end;
    border-bottom-left-radius: 2px;
    direction: rtl;
}

.ai-input-group {
    border-radius: 14px;
    overflow: hidden;
    background: #050d18;
    border: 1px solid #162438;
}

.ai-chat-input {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-size: 13px !important;
    padding: 12px 16px !important;
    outline: none !important;
    direction: rtl;
}

/* Voice Practice AI System */
.mic-record-btn {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--quran-gold), #b87b14);
    color: var(--quran-dark);
    border: 4px solid rgba(230, 165, 48, 0.3);
    font-size: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 0 30px rgba(230, 165, 48, 0.4);
}

.mic-record-btn.recording {
    background: #ef4444 !important;
    color: #fff !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    animation: pulseMic 1.2s infinite;
}

@keyframes pulseMic {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.08); box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.practice-results-card {
    background: #081626;
    border: 1px solid #182e47;
    border-radius: 16px;
    padding: 16px;
    margin-top: 15px;
}

.score-circle {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid #10b981;
    color: #34d399;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    margin: 0 auto 6px;
}

/* Side Tafseer Panel */
.side-info-panel {
    background: var(--quran-card-bg);
    border: 1px solid var(--quran-border);
    border-radius: 22px;
    padding: 22px;
    min-height: 600px;
    max-height: 820px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.tafseer-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 4px solid var(--quran-gold);
}

/* Zero Reflow Tajweed Spans (Prevents Any Shaking/Flickering) */
.tajweed-span {
    display: inline;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    box-sizing: border-box;
}

.tajweed-span.active-tajweed-hover,
.tajweed-span:hover {
    background-color: rgba(38, 141, 129, 0.3) !important;
    border-radius: 4px !important;
    text-shadow: 0 0 6px currentColor;
}

/* Interactive Floating Tajweed Popover Card */
.tajweed-popover-card {
    position: fixed;
    z-index: 999999;
    background: #0d1627;
    border: 1px solid #23334d;
    border-radius: 12px;
    padding: 12px 16px;
    width: 290px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.85);
    display: none;
    pointer-events: none;
    animation: popoverFadeIn 0.15s ease;
}

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

.popover-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.popover-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.popover-title-en {
    font-weight: 700;
    font-size: 13.5px;
}

.popover-title-ar {
    font-size: 12.5px;
    color: #a0aec0;
    margin-left: auto;
    direction: rtl;
}

.popover-desc-en {
    font-size: 12px;
    line-height: 1.5;
    color: #cbd5e0;
    direction: ltr;
    text-align: left;
    margin-bottom: 6px;
    font-family: sans-serif;
}

.popover-desc-ar {
    font-size: 12px;
    line-height: 1.6;
    color: var(--quran-gold-light);
    direction: rtl;
    text-align: right;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    padding-top: 6px;
}

/* Bottom Floating Audio Player */
body {
    padding-bottom: 95px !important;
}

.quran-floating-player {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    top: auto;
    width: min(1060px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    min-height: 54px;
    height: auto;
    background: linear-gradient(145deg, rgba(2, 42, 60, 0.98), rgba(1, 30, 44, 0.99));
    border: 1px solid rgba(230, 165, 48, 0.45);
    border-radius: 20px;
    padding: 6px 16px !important;
    margin: 0;
    z-index: 99999;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(230, 165, 48, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    box-sizing: border-box;
}

.player-drag-handle {
    cursor: move !important;
    cursor: grab !important;
    padding: 6px 8px;
    color: var(--quran-gold);
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s ease, transform 0.2s ease;
    user-select: none;
    touch-action: none;
}

.player-drag-handle:hover,
.player-drag-handle:active {
    opacity: 1;
    transform: scale(1.15);
    color: var(--quran-gold-light);
    cursor: grabbing !important;
}

.player-btn.minimize-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(230, 165, 48, 0.35) !important;
    color: var(--quran-gold-light) !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    font-size: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.player-btn.minimize-btn:hover {
    background: var(--quran-gold) !important;
    color: var(--quran-dark) !important;
    border-color: var(--quran-gold) !important;
}

/* Compact / Minimized Mode (Single Floating Horizontal Capsule) */
.quran-floating-player.is-compact {
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    width: auto !important;
    max-width: 320px !important;
    min-width: 220px !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    padding: 6px 18px !important;
    border-radius: 50px !important;
    gap: 8px !important;
    justify-content: space-between !important;
    align-items: center !important;
    overflow: hidden !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 20px rgba(230, 165, 48, 0.3) !important;
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
    top: auto !important;
}

.quran-floating-player.is-compact .player-full-control,
.quran-floating-player.is-compact .player-progress-box,
.quran-floating-player.is-compact #audio-speed-select,
.quran-floating-player.is-compact .radio-live-badge,
.quran-floating-player.is-compact .quran-mini-btn,
.quran-floating-player.is-compact #player-stop-btn,
.quran-floating-player.is-compact #player-subtitle {
    display: none !important;
}

.quran-floating-player.is-compact .player-title-box {
    max-width: 160px !important;
    min-width: 90px !important;
    flex: 0 1 160px !important;
    overflow: hidden !important;
}

.quran-floating-player.is-compact #player-title {
    font-size: 12px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    display: block !important;
}

/* Medium Screens (Laptops & Tablets: 768px to 1199px) */
@media (max-width: 1199.98px) {
    .quran-floating-player:not(.is-compact) {
        width: min(980px, calc(100vw - 16px)) !important;
        padding: 6px 12px !important;
        gap: 6px !important;
    }
    
    .quran-floating-player:not(.is-compact) .player-title-box {
        max-width: 140px !important;
    }

    .quran-floating-player:not(.is-compact) .player-progress-box {
        max-width: 220px !important;
    }

    .quran-floating-player:not(.is-compact) #repeat-mode-text,
    .quran-floating-player:not(.is-compact) #radio-btn-text,
    .quran-floating-player:not(.is-compact) .quran-mini-btn span {
        display: none !important;
    }

    .quran-floating-player:not(.is-compact) .quran-mini-btn,
    .quran-floating-player:not(.is-compact) .radio-live-badge {
        padding: 0 !important;
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* Mobile Screens (< 767.98px) */
@media (max-width: 767.98px) {
    .quran-floating-player {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        border-radius: 20px !important;
        padding: 8px 10px !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        gap: 4px !important;
        bottom: 10px !important;
    }

    .quran-floating-player.is-compact {
        position: fixed !important;
        bottom: 12px !important;
        left: 50% !important;
        right: auto !important;
        top: auto !important;
        transform: translateX(-50%) !important;
        width: auto !important;
        max-width: 280px !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        padding: 6px 12px !important;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        border-radius: 50px !important;
    }

    .quran-floating-player.is-compact .player-title-box {
        max-width: 120px !important;
    }

    .quran-floating-player:not(.is-compact) .player-progress-box {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        order: 99 !important;
        margin-top: 2px !important;
        padding: 0 2px !important;
    }

    .quran-floating-player .player-title-box {
        max-width: 120px !important;
    }
}

.player-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--quran-gold), #b87b14);
    color: var(--quran-dark);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(230, 165, 48, 0.35);
    flex-shrink: 0;
}

.player-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(230, 165, 48, 0.5);
}

.player-btn.stop-btn {
    background: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    color: #ff5c6a !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25) !important;
}

.player-btn.stop-btn:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.6) !important;
}

/* Hadith Section Enhanced Styling */
.hadith-tab-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    padding: 7px 16px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 800;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}
.hadith-tab-btn:hover {
    color: var(--quran-gold-light);
    border-color: var(--quran-gold);
    background: rgba(230, 165, 48, 0.1);
}
.hadith-tab-btn.active {
    background: linear-gradient(135deg, #e6a530 0%, #b87b14 100%);
    color: #001f2b;
    border-color: #e6a530;
    box-shadow: 0 4px 14px rgba(230, 165, 48, 0.35);
}

.hadith-group-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    border-radius: 8px;
    padding: 4px 14px;
    font-size: 11.5px;
    font-weight: 700;
    transition: all 0.3s ease;
}
.hadith-group-btn:hover {
    background: rgba(230, 165, 48, 0.15);
    color: #fff;
    border-color: var(--quran-gold);
}
.hadith-group-btn.active {
    background: rgba(230, 165, 48, 0.25);
    color: var(--quran-gold-light);
    border-color: var(--quran-gold);
    font-weight: 900;
}

/* Hadith Text Box Custom Scrollbar */
.hadith-text-scrollbox {
    max-height: 180px;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: var(--quran-gold) rgba(0, 0, 0, 0.3);
    padding-left: 8px;
}
.hadith-text-scrollbox::-webkit-scrollbar {
    width: 6px;
}
.hadith-text-scrollbox::-webkit-scrollbar-thumb {
    background: var(--quran-gold);
    border-radius: 10px;
}
.hadith-text-scrollbox::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.quran-mini-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    height: 30px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1;
    flex-shrink: 0;
}

.quran-mini-select {
    background: #00222f !important;
    border: 1px solid rgba(230, 165, 48, 0.35) !important;
    color: #fff !important;
    border-radius: 20px !important;
    padding: 2px 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    cursor: pointer;
    outline: none;
    height: 30px !important;
    width: auto !important;
    max-width: 65px !important;
    display: inline-block !important;
    box-sizing: border-box;
    line-height: 1;
    flex-shrink: 0;
    text-align: center;
}

/* Hadith Section Cards */
.hadith-card,
.hadith-studio-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 5px solid var(--quran-gold);
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 16px;
    transition: 0.3s;
    position: relative;
}

.topic-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s;
}
.topic-chip.active, .topic-chip:hover {
    background: var(--quran-gold);
    color: var(--quran-dark);
    border-color: var(--quran-gold);
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Responsive Media Queries
   ========================================================================== */

@media (max-width: 991.98px) {
    .quran-toolbar {
        padding: 12px 14px !important;
        margin-bottom: 15px !important;
    }
    
    .reader-area, .side-info-panel {
        min-height: auto !important;
        max-height: 75vh !important;
        padding: 16px !important;
    }

    .mushaf-container {
        padding: 20px 14px !important;
    }

    .quran-hero-title {
        font-size: 28px !important;
    }
}

@media (max-width: 767.98px) {
    body {
        padding-bottom: 90px !important;
    }

    .quran-hero {
        padding: 20px 12px 16px !important;
    }

    .quran-hero-title {
        font-size: 24px !important;
    }

    .cat-tab-btn {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }

    .quran-toolbar {
        border-radius: 16px !important;
        padding: 10px 12px !important;
    }

    .quran-select {
        font-size: 12px !important;
        padding: 4px 24px 4px 8px !important;
        height: 36px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #select-tafseer {
        min-width: 100% !important;
        width: 100% !important;
    }

    .ayah-box {
        padding: 14px 12px !important;
        border-radius: 14px !important;
    }

    .ayah-text {
        font-size: calc(var(--quran-font-size) * 0.88) !important;
        line-height: 2.1 !important;
    }

    .mushaf-container {
        font-size: calc(var(--quran-font-size) * 0.86) !important;
        line-height: 2.3 !important;
        padding: 16px 10px !important;
        border-radius: 14px !important;
    }

    .ayah-pill-btn {
        font-size: 11px !important;
        padding: 4px 10px !important;
        gap: 5px !important;
    }

    /* Fixed Floating Audio Player at Bottom of Mobile Screen */
    .quran-floating-player {
        position: fixed !important;
        bottom: 10px !important;
        left: 8px !important;
        right: 8px !important;
        transform: none !important;
        width: auto !important;
        max-width: 100% !important;
        margin: 0 !important;
        z-index: 99999 !important;
        border-radius: 22px !important;
        padding: 8px 12px !important;
        background: linear-gradient(145deg, rgba(2, 42, 60, 0.98), rgba(1, 30, 44, 0.99)) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(230, 165, 48, 0.25) !important;
    }

    .quran-floating-player.is-compact {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: auto !important;
        max-width: 280px !important;
        padding: 6px 14px !important;
    }

    /* Mobile Modals */
    .modal-dialog {
        margin: auto !important;
        max-width: 95% !important;
    }

    .style-quran-modal {
        max-height: 92vh !important;
        border-radius: 16px !important;
    }

    .compare-arabic-text {
        font-size: 19px !important;
    }

    .ai-chat-log {
        max-height: 180px !important;
    }

    .quran-page-wrapper {
        padding: 8px !important;
        border-radius: 12px !important;
    }
}

@media (max-width: 480px) {
    .ayah-toolbar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .ayah-toolbar > div {
        width: 100% !important;
        justify-content: flex-start !important;
    }

    .ayah-pill-btn {
        font-size: 10.5px !important;
        padding: 4px 8px !important;
    }
}

/* Floating Page Navigation Buttons for Fullscreen Viewer */
.page-nav-floating-btn {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 1050 !important;
    width: 52px !important;
    height: 52px !important;
    border-radius: 50% !important;
    background: rgba(0, 30, 45, 0.85) !important;
    border: 2px solid var(--quran-gold) !important;
    color: var(--quran-gold-light) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 22px !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 5px 25px rgba(0,0,0,0.6) !important;
}

.page-nav-floating-btn:hover {
    background: var(--quran-gold) !important;
    color: #001923 !important;
    transform: translateY(-50%) scale(1.15) !important;
}

.right-nav-btn { right: 30px !important; }
.left-nav-btn { left: 30px !important; }

@media (max-width: 768px) {
    .right-nav-btn { right: 10px !important; width: 40px !important; height: 40px !important; font-size: 16px !important; }
    .left-nav-btn { left: 10px !important; width: 40px !important; height: 40px !important; font-size: 16px !important; }
}

/* Repeat Buttons Styling */
.btn-stop-repeat {
    transition: all 0.25s ease !important;
}

.btn-stop-repeat.active-stop {
    background: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    color: #ff6b6b !important;
    opacity: 1 !important;
    cursor: pointer !important;
}

.btn-stop-repeat.active-stop:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4) !important;
}

.btn-stop-repeat.disabled-stop {
    opacity: 0.45 !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    cursor: default !important;
}

/* Quran Toast Notification System */
.quran-toast-container {
    position: fixed;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    pointer-events: none;
}

.quran-toast {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 24, 36, 0.96);
    border: 1.5px solid var(--quran-gold, #e6a530);
    color: #ffffff;
    padding: 11px 24px;
    border-radius: 14px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(230, 165, 48, 0.35);
    font-size: 14px;
    font-weight: 800;
    font-family: 'Tajawal', 'Cairo', sans-serif;
    backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl;
}

.quran-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.quran-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Copy Action Button Styles */
.ayah-copy-btn {
    border-radius: 8px;
    padding: 4px 11px;
    font-size: 11.5px;
    font-weight: 700;
    transition: all 0.2s ease;
    border: 1px solid rgba(230, 165, 48, 0.3);
    color: var(--quran-gold-light);
    background: rgba(230, 165, 48, 0.08);
}

.ayah-copy-btn:hover {
    background: var(--quran-gold);
    color: #001923;
    border-color: var(--quran-gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 165, 48, 0.3);
}

.tafseer-copy-btn-main {
    background: linear-gradient(135deg, #e6a530 0%, #b87b14 100%);
    color: #001f2b;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 14px;
    box-shadow: 0 4px 14px rgba(230, 165, 48, 0.3);
    transition: all 0.25s ease;
}

.tafseer-copy-btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(230, 165, 48, 0.45);
    color: #000;
}





/* ==========================================================================
   GHARIB AL-QURAN & THEMATIC SEARCH STYLES
   ========================================================================== */

.quran-word-item {
    display: inline-block;
    padding: 2px 5px;
    margin: 0 1px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.quran-word-item:hover {
    background: rgba(230, 165, 48, 0.28);
    color: var(--quran-gold-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(230, 165, 48, 0.25);
}

.word-modal-header {
    background: linear-gradient(135deg, #002633 0%, #003a4d 100%);
    border-bottom: 2px solid var(--quran-gold);
    color: #fff;
    padding: 18px 24px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.word-badge-title {
    font-family: 'Amiri', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--quran-gold-light);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.meaning-card-box {
    background: rgba(0, 46, 62, 0.7);
    border: 1px solid var(--quran-border);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 14px;
}

.meaning-source-tag {
    font-size: 11px;
    font-weight: 800;
    background: rgba(230, 165, 48, 0.15);
    color: var(--quran-gold-light);
    border: 1px solid var(--quran-border);
    padding: 4px 10px;
    border-radius: 6px;
}

.topic-category-header {
    font-size: 14px;
    font-weight: 800;
    color: var(--quran-gold-light);
    margin-bottom: 10px;
    border-bottom: 1px solid var(--quran-border);
    padding-bottom: 5px;
}

.topic-pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 34, 47, 0.85);
    border: 1px solid rgba(230, 165, 48, 0.3);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
}

.topic-pill-tag:hover, .topic-pill-tag.active {
    background: linear-gradient(135deg, var(--quran-gold) 0%, #b8801b 100%);
    color: #001923;
    border-color: var(--quran-gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 165, 48, 0.3);
}

.topic-result-card {
    background: var(--quran-card-bg);
    border: 1px solid var(--quran-border);
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.topic-result-card:hover {
    border-color: var(--quran-gold);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}


/* Fix Modal Header & Overflows */
.word-modal-header {
    background: linear-gradient(135deg, #001f2b 0%, #003244 100%) !important;
    border-bottom: 2px solid var(--quran-gold) !important;
    color: #fff !important;
    padding: 22px 28px !important;
    border-top-left-radius: 22px !important;
    border-top-right-radius: 22px !important;
    position: relative !important;
    overflow: hidden !important;
}

.word-badge-title {
    font-family: 'Tajawal', 'Amiri', serif !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    margin-top: 6px !important;
}

.topic-tag-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    white-space: normal !important;
    word-break: break-word !important;
    text-align: right !important;
    line-height: 1.4 !important;
    max-width: 100% !important;
}

.topic-pill-tag {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: rgba(0, 34, 47, 0.9) !important;
    border: 1px solid rgba(230, 165, 48, 0.35) !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 8px 16px !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    user-select: none !important;
    white-space: nowrap !important;
}

.topic-pill-tag:hover, .topic-pill-tag.active {
    background: linear-gradient(135deg, var(--quran-gold) 0%, #b8801b 100%) !important;
    color: #001923 !important;
    border-color: var(--quran-gold) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(230, 165, 48, 0.35) !important;
}

.topic-result-card {
    background: rgba(0, 25, 35, 0.95) !important;
    border: 1px solid var(--quran-border) !important;
    border-radius: 20px !important;
    padding: 24px !important;
    margin-bottom: 18px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
}

/* Active Hadith Card & Button Playing State */
.hadith-card.hadith-active-playing,
.hadith-studio-card.hadith-active-playing,
.hadith-audio-box.hadith-active-playing {
    border-color: #e6a530 !important;
    box-shadow: 0 0 25px rgba(230, 165, 48, 0.55), inset 0 0 15px rgba(230, 165, 48, 0.15) !important;
    background: linear-gradient(145deg, rgba(230, 165, 48, 0.15), rgba(0, 30, 45, 0.95)) !important;
    transform: translateY(-2px) !important;
    position: relative !important;
}

.hadith-card.hadith-active-playing::before,
.hadith-studio-card.hadith-active-playing::before,
.hadith-audio-box.hadith-active-playing::before {
    content: '🔊 جاري التشغيل الآن';
    position: absolute;
    top: -12px;
    right: 15px;
    left: auto;
    background: linear-gradient(135deg, #e6a530, #b87b14);
    color: #00121a;
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    animation: pulseHadithBadge 1.8s infinite;
    z-index: 10;
}

@keyframes pulseHadithBadge {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(230, 165, 48, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(230, 165, 48, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(230, 165, 48, 0); }
}

.btn-hadith-playing {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.45) !important;
}

/* Hadith Card & Audio Studio Badge Overlap & Floating Fix */
#hadith-main-section .badge,
#hadith-results-container .badge,
.hadith-card .badge,
.hadith-studio-card .badge,
.hadith-card-badge {
    margin-left: 0 !important;
    margin-right: 0 !important;
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle !important;
    white-space: normal !important;
    max-width: 100% !important;
    transform: none !important;
    float: none !important;
}

.hadith-card .d-flex.align-items-center {
    gap: 8px !important;
}

/* Professional Player Quick Rewind & Forward Seek Buttons */
.player-btn.seek-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0 !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    transition: all 0.2s ease !important;
}
.player-btn.seek-btn:hover {
    background: rgba(230, 165, 48, 0.25) !important;
    border-color: #e6a530 !important;
    color: #f6c867 !important;
    transform: translateY(-2px) !important;
}
.player-btn.seek-btn:active {
    transform: scale(0.92) !important;
}

/* Audio Progress Range Slider Custom Styling (Arabic RTL Orientation) */
.player-progress-box,
.player-progress-box *,
.audio-slider-wrapper,
#audio-progress {
    direction: rtl !important;
}

#audio-progress {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    height: 6px !important;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 10px !important;
    outline: none !important;
    cursor: pointer !important;
}

#audio-progress::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background: #e6a530 !important;
    cursor: pointer !important;
    box-shadow: 0 0 12px rgba(230, 165, 48, 0.9) !important;
    border: 2px solid #ffffff !important;
    transition: transform 0.15s ease !important;
}

#audio-progress::-webkit-slider-thumb:hover,
#audio-progress::-webkit-slider-thumb:active {
    transform: scale(1.35) !important;
    background: #f6c867 !important;
}

#audio-progress::-moz-range-thumb {
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background: #e6a530 !important;
    cursor: pointer !important;
    box-shadow: 0 0 12px rgba(230, 165, 48, 0.9) !important;
    border: 2px solid #ffffff !important;
    transition: transform 0.15s ease !important;
}

#audio-progress::-moz-range-thumb:hover,
#audio-progress::-moz-range-thumb:active {
    transform: scale(1.35) !important;
    background: #f6c867 !important;
}

/* Live Radio Badge Active Pulse Style */
.radio-live-badge.live-active {
    background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.7) !important;
    animation: pulseRadioBadge 1.8s infinite !important;
}

@keyframes pulseRadioBadge {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

