/* ==========================================================================
   Kur'an Knowledge Graph - Clean Responsive Dark Glassmorphism Theme
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-main: #070914;
    --bg-secondary: #0c1020;
    --bg-card: rgba(16, 23, 42, 0.65);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --bg-glass: rgba(15, 23, 42, 0.8);
    
    /* Borders & Glows */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-gold: rgba(212, 175, 55, 0.25);
    --border-gold-glow: rgba(245, 158, 11, 0.4);
    
    /* Brand Accents */
    --accent-gold: #f59e0b;
    --accent-gold-light: #fbbf24;
    --accent-gold-dark: #b45309;
    --accent-gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d4af37 100%);
    
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-purple: #8b5cf6;
    
    /* Typography */
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-arabic: 'Amiri', 'Traditional Arabic', serif;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-gold: #fbbf24;
}

/* Reset & Global Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background Ambient Glow */
.app-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: 
        radial-gradient(circle at 15% 20%, rgba(245, 158, 11, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(6, 182, 212, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 50%),
        linear-gradient(180deg, #070914 0%, #0d1222 100%);
    z-index: -1;
    pointer-events: none;
}

/* Dark Overlay for Mobile Sidebar Drawer */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* App Container Layout */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 330px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    z-index: 160;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.close-sidebar-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 0;
}

.logo-wrapper {
    position: relative;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(212, 175, 55, 0.05) 100%);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}

.logo-icon {
    font-size: 1.4rem;
}

.logo-glow {
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: var(--accent-gold-gradient);
    opacity: 0.15;
    filter: blur(6px);
    z-index: -1;
}

.brand-text h1 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.73rem;
    color: var(--text-muted);
}

.version-tag {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    border: 1px solid var(--border-gold);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
}

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px 10px;
    margin-bottom: 16px;
    transition: all 0.25s ease;
    gap: 6px;
}

.search-box:focus-within {
    border-color: var(--accent-gold);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

.search-icon {
    font-size: 0.9rem;
    opacity: 0.6;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: var(--font-main);
    min-width: 0;
}

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

.search-submit-btn {
    background: var(--accent-gold);
    color: #000;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.search-submit-btn:hover {
    transform: scale(1.05);
}

/* Sidebar Navigation & Surah Sorting Toggle */
.nav-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 2px;
}

.section-header h2 {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-gold);
    letter-spacing: 1.2px;
}

.surah-sort-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 2px;
}

.sort-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-btn.active {
    background: var(--accent-gold);
    color: #000000;
}

.surah-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.surah-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.surah-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(245, 158, 11, 0.2);
    transform: translateX(3px);
}

.surah-item.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(15, 23, 42, 0.8) 100%);
    border-color: var(--accent-gold);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
}

.surah-item .surah-num {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-gold);
    min-width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.surah-item .surah-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.surah-item .surah-name-tr {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}

.surah-item .surah-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.surah-item .surah-name-ar {
    font-family: var(--font-arabic);
    font-size: 1.15rem;
    color: var(--accent-gold-light);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 24px;
    overflow: hidden;
}

/* Top Header Bar with Language Dropdown on Top Right */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-toggle {
    display: none;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.header-brand-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo-icon {
    font-size: 1.25rem;
}

.header-title-text {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Custom Glassmorphism Language Dropdown (Top-Right) */
.lang-dropdown-custom {
    position: relative;
    margin-left: auto;
    z-index: 200;
}

.lang-dropdown-trigger {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    color: var(--text-main);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.lang-dropdown-trigger:hover {
    border-color: var(--accent-gold);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.2);
}

.flag-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.flag-badge.tr { background: linear-gradient(135deg, #e11d48 0%, #be123c 100%); }
.flag-badge.en { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }
.flag-badge.ar { background: linear-gradient(135deg, #059669 0%, #047857 100%); }

.dropdown-arrow {
    font-size: 0.7rem;
    color: var(--accent-gold);
    transition: transform 0.2s ease;
}

.lang-dropdown-custom.open .dropdown-arrow {
    transform: rotate(180deg);
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    min-width: 135px;
    z-index: 300;
    padding: 4px 0;
}

.lang-dropdown-custom.open .lang-dropdown-menu {
    display: flex;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.lang-option:hover, .lang-option.active {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.18) 0%, transparent 100%);
    color: var(--accent-gold-light);
}

/* View Tabs Bar */
.view-tabs {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 16px;
    width: fit-content;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--accent-gold-gradient);
    color: #000000;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
}

/* Reader Tab Header Card */
.surah-header-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
    border: 1px solid var(--border-gold);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    flex-wrap: wrap;
    gap: 10px;
}

.header-main-info h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-gold-light);
    margin-bottom: 6px;
}

.surah-meta-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-pill {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.72rem;
    padding: 2px 9px;
    border-radius: 20px;
    color: var(--text-muted);
}

.basmala-banner {
    font-family: var(--font-arabic);
    font-size: 1.6rem;
    color: var(--accent-gold);
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

/* Ayah Cards Container */
.ayahs-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 6px;
}

.ayah-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.ayah-card:hover {
    border-color: rgba(245, 158, 11, 0.3);
    transform: translateY(-1px);
}

.ayah-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ayah-badge {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    border: 1px solid var(--border-gold);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 8px;
}

.ayah-action-btns {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.action-btn-surah {
    cursor: pointer;
    background: rgba(245, 158, 11, 0.18);
    color: var(--accent-gold);
    border: 1px solid var(--border-gold);
    font-weight: 600;
    transition: all 0.2s ease;
}

.action-btn-surah:hover {
    background: rgba(245, 158, 11, 0.35);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.action-btn-graph {
    cursor: pointer;
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
    font-weight: 600;
    transition: all 0.2s ease;
}

.action-btn-graph:hover {
    background: rgba(16, 185, 129, 0.35);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* TURKISH TEXT IS LARGE & PROMINENT */
.ayah-tr-text {
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.7;
    color: #f8fafc;
    border-left: 3.5px solid var(--accent-gold);
    padding-left: 14px;
}

/* ARABIC TEXT IS BALANCED & MEDIUM SIZE */
.ayah-ar-text {
    font-family: var(--font-arabic);
    font-size: 1.3rem;
    line-height: 1.8;
    text-align: right;
    direction: rtl;
    color: var(--accent-gold-light);
    word-spacing: 3px;
    opacity: 0.9;
}

/* Graph Controls Toolbar */
.graph-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 14px;
    gap: 14px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.control-group label {
    font-weight: 500;
    color: var(--text-muted);
}

.control-group select, .ctrl-num-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 0.85rem;
    outline: none;
    font-family: var(--font-main);
}

.ctrl-num-input {
    width: 65px;
    text-align: center;
}

.graph-legend {
    display: flex;
    gap: 8px;
}

.legend-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
}

.legend-pill.surah { color: #d4af37; border: 1px solid rgba(212, 175, 55, 0.3); }
.legend-pill.ayah { color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.legend-pill.word { color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.3); }
.legend-pill.lemma { color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.4); }

.primary-btn {
    background: var(--accent-gold-gradient);
    color: #000000;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.85rem;
    font-family: var(--font-main);
    cursor: pointer;
    transition: transform 0.15s ease;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.25);
}

.primary-btn:hover {
    transform: translateY(-1px) scale(1.02);
}

/* Graph Canvas Wrapper & Right Side Node Details Drawer */
.graph-canvas-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    overflow: hidden;
    border-radius: 16px;
}

.network-container {
    flex: 1;
    min-height: 550px;
    background: #050711;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.network-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent-gold);
    font-size: 0.95rem;
    font-weight: 600;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-gold);
    padding: 12px 22px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
}

/* Right Side Drawer for Node Details */
.node-detail-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 350px;
    background: rgba(12, 16, 32, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--border-gold);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.node-detail-drawer.open {
    display: flex !important;
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    flex-shrink: 0;
}

.drawer-title-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-title-box h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

.drawer-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.drawer-badge.surah { background: rgba(212, 175, 55, 0.2); color: #d4af37; border: 1px solid rgba(212, 175, 55, 0.4); }
.drawer-badge.ayah { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }
.drawer-badge.word { background: rgba(6, 182, 212, 0.2); color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.4); }

.close-drawer-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 6px;
    transition: color 0.15s ease;
}

.close-drawer-btn:hover {
    color: var(--accent-gold);
}

.drawer-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.drawer-placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 40px;
    line-height: 1.6;
}

.detail-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.field-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: #ffffff;
}

.field-value.arabic {
    font-family: var(--font-arabic);
    font-size: 1.5rem;
    color: var(--accent-gold);
}

.field-value.turkish {
    color: var(--accent-gold-light);
    line-height: 1.5;
}

.drawer-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    flex-shrink: 0;
}

.expand-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
}

/* ==========================================================================
   Responsive Media Queries (Mobile & Tablet Optimization)
   ========================================================================== */

@media (max-width: 768px) {
    .main-content {
        padding: 14px;
    }

    /* Show hamburger menu toggle button on mobile */
    .mobile-menu-toggle {
        display: flex;
    }

    .header-logo-icon {
        display: none;
    }

    .header-title-text {
        font-size: 0.95rem;
    }

    /* Convert sidebar into slide-out drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 290px;
        z-index: 200;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.7);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .close-sidebar-btn {
        display: block;
    }

    .view-tabs {
        width: 100%;
        justify-content: space-between;
    }

    .tab-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .surah-header-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
    }

    .basmala-banner {
        font-size: 1.4rem;
        width: 100%;
        text-align: center;
        margin-top: 8px;
    }

    .ayah-card {
        padding: 14px 16px;
    }

    .ayah-tr-text {
        font-size: 1.05rem;
    }

    .ayah-ar-text {
        font-size: 1.2rem;
    }

    .network-container {
        min-height: 420px;
    }

    .sidebar-overlay.active {
        z-index: 150;
    }

    /* Node Detail Popup Modal for Mobile View */
    .node-detail-drawer {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.92);
        width: 90vw;
        max-width: 400px;
        max-height: 82vh;
        max-height: 82dvh;
        z-index: 210;
        background: rgba(12, 16, 32, 0.97);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border: 1px solid var(--border-gold);
        border-radius: 20px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(245, 158, 11, 0.15);
        display: none;
        flex-direction: column;
        overflow: hidden;
        opacity: 0;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .node-detail-drawer.open {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translate(-50%, -50%) scale(1) !important;
    }

    .drawer-header {
        padding: 14px 18px;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .drawer-body {
        padding: 16px;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    .drawer-footer {
        padding: 14px 18px;
        background: rgba(12, 16, 32, 0.98);
        border-top: 1px solid var(--border-gold);
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
        position: sticky;
        bottom: 0;
        z-index: 10;
        flex-shrink: 0;
    }

    .expand-btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.92rem;
        font-weight: 700;
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
    }
}
