/* المتغيرات الأساسية */
:root {
    --primary-color: #1a5f4a;
    --primary-light: #2d8a6e;
    --primary-dark: #0d4233;
    --gold: #d4af37;
    --gold-light: #f4d35e;
    --bg-color: #f5f1eb;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #5a6c7d;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 15px;
    --transition: all 0.3s ease;
    --mushaf-bg: #fffef5;
    --mushaf-border: #d4af37;
    --page-shadow: rgba(0, 0, 0, 0.2);
}

/* الوضع الداكن */
[data-theme="dark"] {
    --primary-color: #2d8a6e;
    --primary-light: #3da882;
    --primary-dark: #1a5f4a;
    --gold: #f4d35e;
    --gold-light: #d4af37;
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.7);
    --mushaf-bg: #1c2128;
    --mushaf-border: #f4d35e;
    --page-shadow: rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] body {
    background: #0d1117;
}

[data-theme="dark"] .main-header {
    background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .main-nav {
    background: #161b22 !important;
}

[data-theme="dark"] .main-nav a {
    color: #e6edf3;
}

[data-theme="dark"] .section {
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #0d1117;
    color: #e6edf3;
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .btn,
[data-theme="dark"] button {
    background: #21262d;
    color: #e6edf3;
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn.btn-primary {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .surah-card,
[data-theme="dark"] .juz-card,
[data-theme="dark"] .page-card,
[data-theme="dark"] .bookmark-item,
[data-theme="dark"] .hadith-item,
[data-theme="dark"] .wird-item {
    background: #21262d;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .surah-card.memorized {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(76, 175, 80, 0.15) 100%);
    border-color: #4caf50;
}

[data-theme="dark"] .quran-reader {
    background: #0d1117;
}

[data-theme="dark"] .reader-header {
    background: #161b22;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .reader-navigation {
    background: #161b22;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .reader-footer {
    background: #161b22;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .quran-content {
    background: #161b22;
    border-color: #d4af37;
}

[data-theme="dark"] .quran-content::before {
    border-color: rgba(212, 175, 55, 0.3);
}

[data-theme="dark"] .ayah-container {
    background: transparent;
    border-color: rgba(212, 175, 55, 0.2);
}

[data-theme="dark"] .ayah-container:hover {
    background: rgba(212, 175, 55, 0.1);
}

[data-theme="dark"] .bismillah {
    color: var(--gold);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), transparent);
}

[data-theme="dark"] .quran-tabs {
    background: #161b22;
}

[data-theme="dark"] .quran-tab {
    background: #21262d;
    color: #e6edf3;
}

[data-theme="dark"] .quran-tab.active {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .modal-content {
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-header {
    background: #21262d;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .status-btn {
    background: #21262d;
    color: #e6edf3;
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .translation-settings {
    background: #161b22;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .audio-settings {
    background: #161b22;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] #reciter-select {
    background: #0d1117;
    color: #e6edf3;
    border-color: rgba(244, 211, 94, 0.7);
}

[data-theme="dark"] .ayah-action-btn {
    background: #21262d;
    color: #e6edf3;
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .action-btn {
    background: #21262d;
    color: #e6edf3;
}

[data-theme="dark"] .nav-btn {
    background: #21262d;
    color: #e6edf3;
}

/* === إضافات الوضع الداكن الشاملة === */

/* شريط تقدم الحفظ */
[data-theme="dark"] .hifz-progress-container {
    background: #161b22;
    border-color: #d4af37;
}

[data-theme="dark"] .hifz-stat {
    background: #21262d;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

[data-theme="dark"] .hifz-progress-bar {
    background: #30363d;
}

/* بطاقات الأيام */
[data-theme="dark"] .day-card {
    background: #21262d;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .day-card:hover {
    border-color: var(--gold);
}

[data-theme="dark"] .day-card .day-number {
    color: #e6edf3;
}

[data-theme="dark"] .day-card .day-reading {
    color: #8b949e;
}

[data-theme="dark"] .day-card.today {
    background: linear-gradient(135deg, #d4af37 0%, #b8962d 100%);
}

[data-theme="dark"] .day-card.completed {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

[data-theme="dark"] .planner-placeholder {
    background: linear-gradient(135deg, #1b2128 0%, #171d24 100%);
    border-color: rgba(244, 211, 94, 0.35);
}

[data-theme="dark"] .planner-placeholder h3 {
    color: #f4d35e;
}

[data-theme="dark"] .planner-placeholder p,
[data-theme="dark"] .day-status {
    color: #9fb0bf;
}

/* صندوق الورد اليومي */
[data-theme="dark"] .today-reading-box {
    background: linear-gradient(135deg, #2d3a2d 0%, #1e2a1e 100%);
}

[data-theme="dark"] .today-reading-box h3,
[data-theme="dark"] #today-content {
    color: #e6edf3;
}

/* قسم الأذكار */
[data-theme="dark"] .wird-tab {
    background: #21262d;
    border-color: rgba(255, 255, 255, 0.15);
    color: #e6edf3;
}

[data-theme="dark"] .wird-tab:hover,
[data-theme="dark"] .wird-tab.active {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .wird-content {
    background: #161b22;
}

/* قسم السنن */
[data-theme="dark"] .sunnan-box {
    background: #161b22;
}

[data-theme="dark"] .sunna-item {
    background: #21262d;
}

/* قسم المشاعر */
[data-theme="dark"] .feeling-tag {
    background: #21262d;
    color: #e6edf3;
}

[data-theme="dark"] .feeling-tag:hover {
    background: #30363d;
}

[data-theme="dark"] .feelings-search input {
    background: #0d1117;
    color: #e6edf3;
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .feelings-result {
    background: #21262d;
}

/* قسم الأحاديث */
[data-theme="dark"] .dorar-link-box {
    background: #161b22;
    border-color: var(--gold);
}

[data-theme="dark"] .dorar-link-box p {
    color: #e6edf3;
}

[data-theme="dark"] .local-hadith-results {
    background: #161b22;
}

/* آية اليوم */
[data-theme="dark"] .daily-ayah-box {
    background: #161b22;
    border-color: var(--gold);
}

[data-theme="dark"] .ayah-day-selector {
    background: transparent;
}

[data-theme="dark"] .btn-arrow {
    background: #21262d;
    color: #e6edf3;
}

/* أزرار الفلترة */
[data-theme="dark"] .filter-btn {
    background: #21262d;
    color: #e6edf3;
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .filter-btn:hover,
[data-theme="dark"] .filter-btn.active {
    background: var(--primary-color);
    color: white;
}

/* التحكم */
[data-theme="dark"] .control-group select {
    background: #0d1117;
    color: #e6edf3;
    border-color: rgba(255, 255, 255, 0.15);
}

/* الإشارات المرجعية */
[data-theme="dark"] .bookmarks-header h3 {
    color: #e6edf3;
}

[data-theme="dark"] .empty-search,
[data-theme="dark"] .empty-review {
    color: #8b949e;
}

/* تبويب المراجعة */
[data-theme="dark"] .review-header h3 {
    color: #e6edf3;
}

[data-theme="dark"] .review-list {
    background: transparent;
}

[data-theme="dark"] .review-item {
    background: #21262d;
    border-color: rgba(255, 255, 255, 0.1);
}

/* صفحات المصحف */
[data-theme="dark"] .mushaf-container {
    background: #0d1117;
}

[data-theme="dark"] .page {
    background: #161b22;
    border-color: rgba(212, 175, 55, 0.3);
}

[data-theme="dark"] .page-content {
    color: #e6edf3;
}

/* نتائج البحث */
[data-theme="dark"] .search-results {
    background: transparent;
}

[data-theme="dark"] .search-result-item {
    background: #21262d;
    border-color: rgba(255, 255, 255, 0.1);
}

/* نتائج الأحاديث */
[data-theme="dark"] .result {
    background: #21262d;
    color: #e6edf3;
}

[data-theme="dark"] .hadith-results {
    background: transparent;
}

[data-theme="dark"] .btn-secondary {
    background: #21262d;
    color: #e6edf3;
}

[data-theme="dark"] .nav-close-btn,
[data-theme="dark"] .nav-mobile-header {
    color: #e6edf3;
}

[data-theme="dark"] .prayer-status {
    background: rgba(45, 138, 110, 0.14);
    color: #dcefe8;
}

[data-theme="dark"] .prayer-status.loading {
    background: rgba(212, 175, 55, 0.18);
    color: #f4d35e;
}

[data-theme="dark"] .prayer-status.error {
    background: rgba(190, 52, 52, 0.18);
    color: #ffb4b4;
}

[data-theme="dark"] .prayer-summary-card,
[data-theme="dark"] .prayer-time-card,
[data-theme="dark"] .widget-card {
    background: #21262d;
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .prayer-insight-item,
[data-theme="dark"] .date-converter-result,
[data-theme="dark"] .prayer-converter-form input {
    background: #161b22;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e6edf3;
}

[data-theme="dark"] .next-prayer-card {
    background: linear-gradient(135deg, #1b7b61 0%, #245848 100%);
}

[data-theme="dark"] .prayer-time-name,
[data-theme="dark"] .widget-card h3 {
    color: #f4d35e;
}

[data-theme="dark"] .summary-note,
[data-theme="dark"] .prayer-time-meta {
    color: #9fb0bf;
}

[data-theme="dark"] .prayer-insight-item p,
[data-theme="dark"] .date-converter-result span,
[data-theme="dark"] .date-converter-result p {
    color: #9fb0bf;
}

[data-theme="dark"] .prayer-widget-frame {
    background: #0d1117;
    border-color: rgba(255, 255, 255, 0.08);
}

/* آية اليوم */
[data-theme="dark"] .daily-ayah-text {
    background: #21262d;
    color: #e6edf3;
}

[data-theme="dark"] .daily-ayah-tafseer {
    background: #21262d;
    color: #e6edf3;
}

/* صندوق قراءة اليوم */
[data-theme="dark"] .reader-navigation {
    background: #161b22;
    border-color: rgba(255, 255, 255, 0.1);
}

/* عناصر متفرقة */
[data-theme="dark"] .feelings-result-item {
    background: #21262d;
}

[data-theme="dark"] .feelings-ayah {
    background: #161b22;
    color: #e6edf3;
}

[data-theme="dark"] .empty-feelings {
    color: #8b949e;
}

[data-theme="dark"] .progress-bar {
    background: #30363d;
}

/* توقيت السنن */
[data-theme="dark"] .time-period-card {
    background: #21262d;
}

/* قسم المشاعر - نتيجة البحث */
[data-theme="dark"] .ayah-result {
    background: #161b22;
}

[data-theme="dark"] .ayah-text {
    color: #e6edf3;
}

/* قسم الأحاديث */
[data-theme="dark"] .hadith-tab {
    background: #21262d;
    color: #e6edf3;
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .hadith-tab:hover,
[data-theme="dark"] .hadith-tab.active {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .hadith-search input {
    background: #0d1117;
    color: #e6edf3;
    border-color: rgba(255, 255, 255, 0.15);
}

/* يوم الختمة */
[data-theme="dark"] .khatma-day {
    background: #21262d;
}

/* النتائج */
[data-theme="dark"] .search-result-item,
[data-theme="dark"] .result-item {
    background: #21262d;
    color: #e6edf3;
}

/* نص آية اليوم */
[data-theme="dark"] .daily-ayah-text,
[data-theme="dark"] .daily-ayah-tafseer {
    background: #21262d !important;
    color: #e6edf3 !important;
}

/* زر تبديل الوضع */
.theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    cursor: pointer;
    z-index: 2000;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-hover);
}

.header-content {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
}

.theme-icon {
    font-size: 1.5rem;
    transition: var(--transition);
}

[data-theme="dark"] .theme-icon {
    content: '☀️';
}

/* إعادة تعيين الأنماط */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Amiri', sans-serif;
    background: linear-gradient(135deg, #f5f1eb 0%, #e8e4db 100%);
    color: var(--text-primary);
    line-height: 1.8;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* الهيدر */
.main-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

/* ===== قائمة البرجر للجوال ===== */
.burger-menu {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    z-index: 1001;
    transition: var(--transition);
}

.burger-menu span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: var(--transition);
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* الشعار */
.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.site-logo {
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.3));
    animation: moonGlow 3s ease-in-out infinite;
}

@keyframes moonGlow {
    0%, 100% {
        filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.3));
    }
    50% {
        filter: drop-shadow(2px 4px 15px rgba(244, 211, 94, 0.6));
    }
}

.header-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-family: 'Amiri', serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* التنقل */
.main-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.nav-mobile-header {
    display: none;
}

.nav-mobile-header p {
    font-size: 0.85rem;
    opacity: 0.75;
}

.nav-close-btn {
    display: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    transition: var(--transition);
    font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active {
    background: var(--gold);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

/* الحاوية الرئيسية */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* الأقسام */
.section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.section:hover {
    box-shadow: var(--shadow-hover);
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--gold);
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-family: 'Amiri', serif;
}

.section-header p {
    color: var(--text-secondary);
}

/* أزرار التحكم */
.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 95, 74, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #eef4f2 0%, #dde8e4 100%);
    color: var(--primary-dark);
    border: 1px solid rgba(26, 95, 74, 0.12);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 95, 74, 0.16);
}

/* قسم خطة الختم */
.planner-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: var(--primary-color);
}

.control-group select {
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--primary-light);
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.control-group select:focus {
    outline: none;
    border-color: var(--gold);
}

/* خطة الختم */
.plan-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.8rem;
    margin-top: 2rem;
}

.planner-placeholder {
    grid-column: 1 / -1;
    padding: 2.25rem 1.5rem;
    text-align: center;
    border-radius: 24px;
    border: 1px dashed rgba(212, 175, 55, 0.45);
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.9) 0%, rgba(232, 237, 234, 0.9) 100%);
}

.planner-placeholder-icon {
    font-size: 2.8rem;
    margin-bottom: 0.75rem;
}

.planner-placeholder h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.planner-placeholder p {
    color: var(--text-secondary);
}

.day-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.day-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.day-card.today {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    border-color: var(--gold);
}

.day-card.past {
    opacity: 0.78;
}

.day-card.completed {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    color: white;
}

.day-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.day-card.completed .day-number {
    color: white;
}

.day-reading {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

.day-status {
    margin-top: 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.day-card.completed .day-reading {
    color: rgba(255, 255, 255, 0.9);
}

.day-card.completed .day-status {
    color: rgba(255, 255, 255, 0.92);
}

/* صندوق الورد اليومي */
.today-reading-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    border-radius: var(--border-radius);
    text-align: center;
}

.today-reading-box h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

#today-content {
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.today-plan-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.2rem;
}

.today-plan-actions.hidden {
    display: none;
}

.plan-action-btn {
    width: auto;
    min-width: 190px;
}

.today-plan-summary {
    display: grid;
    gap: 0.35rem;
}

.today-plan-status {
    margin-top: 0.4rem;
    font-weight: 700;
}

.today-plan-summary.is-done .today-plan-status {
    color: #0d7a55;
}

/* قسم الأذكار */
.wird-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.wird-tab {
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--primary-color);
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.wird-tab:hover, .wird-tab.active {
    background: var(--primary-color);
    color: white;
}

.wird-content {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.wird-item {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border-right: 4px solid var(--primary-color);
    transition: var(--transition);
}

.wird-item:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow);
}

.wird-text {
    font-size: 1.2rem;
    font-family: 'Amiri', serif;
    line-height: 2;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.wird-count {
    display: inline-block;
    background: var(--gold);
    color: var(--primary-dark);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* قسم سنن الوقت */
.time-display {
    text-align: center;
    margin-bottom: 2rem;
}

.current-time {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Cairo', sans-serif;
}

.current-period {
    font-size: 1.3rem;
    color: var(--gold);
    margin-top: 0.5rem;
}

.sunnan-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
}

/* قسم الصلاة */
.prayer-section {
    position: relative;
    overflow: hidden;
}

.prayer-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(212, 175, 55, 0.16), transparent 38%);
    pointer-events: none;
}

.prayer-controls,
.prayer-summary-grid,
.prayer-times-grid,
.prayer-widgets {
    position: relative;
    z-index: 1;
}

.prayer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    justify-content: center;
    margin-bottom: 1rem;
}

.prayer-control-group {
    min-width: 230px;
}

.prayer-location-btn {
    min-width: 220px;
}

.prayer-status {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: rgba(26, 95, 74, 0.08);
    color: var(--primary-dark);
    font-weight: 600;
}

.prayer-status.loading {
    background: rgba(212, 175, 55, 0.18);
    color: #8a6511;
}

.prayer-status.success {
    background: rgba(45, 138, 110, 0.14);
    color: var(--primary-color);
}

.prayer-status.error {
    background: rgba(190, 52, 52, 0.14);
    color: #a62d2d;
}

.prayer-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.prayer-summary-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1.3rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 241, 235, 0.9) 100%);
    border: 1px solid rgba(26, 95, 74, 0.08);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.next-prayer-card {
    background: linear-gradient(135deg, rgba(26, 95, 74, 0.95) 0%, rgba(45, 138, 110, 0.94) 100%);
    color: white;
}

.summary-label {
    font-size: 0.88rem;
    opacity: 0.78;
}

.summary-time {
    font-size: 1.15rem;
    font-weight: 700;
}

.summary-countdown {
    display: inline-flex;
    width: fit-content;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-weight: 700;
    letter-spacing: 0.04em;
}

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

.next-prayer-card .summary-note,
.next-prayer-card .summary-label {
    color: rgba(255, 255, 255, 0.82);
}

.prayer-times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.prayer-time-card {
    padding: 1.15rem;
    border-radius: 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #eef3f1 100%);
    border: 1px solid rgba(26, 95, 74, 0.08);
    text-align: center;
    transition: var(--transition);
}

.prayer-time-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.prayer-time-card.is-next {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    border-color: rgba(212, 175, 55, 0.8);
}

.prayer-time-name {
    display: block;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.45rem;
}

.prayer-time-value {
    display: block;
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
}

.prayer-time-meta {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.prayer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.widget-card {
    padding: 1rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #edf2f0 100%);
    border: 1px solid rgba(26, 95, 74, 0.08);
}

.widget-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.85rem;
    text-align: center;
}

.prayer-insights-list {
    display: grid;
    gap: 0.85rem;
}

.prayer-insight-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(26, 95, 74, 0.08);
}

.prayer-insight-item strong {
    color: var(--primary-color);
}

.prayer-insight-item p {
    margin-top: 0.2rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.prayer-insight-item span {
    font-weight: 700;
    color: var(--primary-dark);
    white-space: nowrap;
}

.prayer-converter-form {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.prayer-converter-form label {
    font-weight: 700;
    color: var(--primary-color);
}

.prayer-converter-form input {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(26, 95, 74, 0.18);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
}

.date-converter-result {
    display: grid;
    gap: 0.35rem;
    min-height: 90px;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(26, 95, 74, 0.08);
}

.date-converter-result strong {
    color: var(--primary-color);
    font-size: 1.08rem;
}

.date-converter-result span,
.date-converter-result p {
    color: var(--text-secondary);
}

.prayer-widget-frame {
    width: 100%;
    min-height: 358px;
    border: 1px solid rgba(26, 95, 74, 0.12);
    border-radius: 16px;
    background: white;
}

.prayer-widget-frame-small {
    min-height: 220px;
}

.sunna-item {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
}

.sunna-item:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow);
}

.sunna-icon {
    font-size: 2rem;
    min-width: 50px;
    text-align: center;
}

.sunna-content h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.sunna-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* قسم المشاعر */
.feelings-search {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.feelings-search input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--primary-light);
    border-radius: 25px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.feelings-search input:focus {
    outline: none;
    border-color: var(--gold);
}

.quick-feelings {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.feeling-tag {
    background: #f0f0f0;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.feeling-tag:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
}

.ayah-result {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    min-height: 150px;
}

.ayah-text {
    font-size: 1.8rem;
    font-family: 'Amiri', serif;
    color: var(--primary-color);
    line-height: 2.2;
    margin-bottom: 1rem;
}

.ayah-reference {
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: 600;
}

/* قسم الأحاديث */
.hadith-search {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hadith-search input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--primary-light);
    border-radius: 25px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.hadith-search input:focus {
    outline: none;
    border-color: var(--gold);
}

.hadith-results {
    display: grid;
    gap: 1rem;
}

.result {
    display: block;
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    border-right: 4px solid var(--primary-color);
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    line-height: 2;
    transition: var(--transition);
}

.result:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow);
}

/* التحميل */
.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* الفوتر */
.main-footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

.main-footer p {
    margin: 0.3rem 0;
    opacity: 0.9;
}

/* قسم آية اليوم */
.daily-ayah-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    min-height: 200px;
}

.daily-ayah-text {
    font-size: 1.6rem;
    font-family: 'Amiri', serif;
    color: var(--primary-color);
    line-height: 2.2;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 15px;
    border: 2px solid var(--gold);
}

.daily-ayah-reference {
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.daily-ayah-tafseer {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
    text-align: right;
    border-right: 4px solid var(--primary-color);
}

.daily-ayah-tafseer h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.ayah-day-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.btn-arrow {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-arrow:hover {
    background: var(--primary-color);
    color: white;
}

#ayah-day-num {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 100px;
}

.ayah-navigation {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-light);
    color: white;
}

/* أحاديث رمضان */
.hadith-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.hadith-tab {
    padding: 0.7rem 1.2rem;
    border: 2px solid var(--primary-color);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.hadith-tab:hover, .hadith-tab.active {
    background: var(--primary-color);
    color: white;
}

.hadith-item {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border-right: 4px solid var(--gold);
    transition: var(--transition);
}

.hadith-item:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow);
}

.hadith-text {
    font-size: 1.15rem;
    font-family: 'Amiri', serif;
    line-height: 2;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
}

.hadith-source {
    display: inline-block;
    background: var(--primary-light);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
}

.hadith-search-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--gold);
}

.hadith-search-section h3 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* التجاوب للجوال */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .header-content p {
        font-size: 0.9rem;
    }
    
    .main-nav {
        gap: 0.3rem;
        padding: 0 0.5rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        border-radius: 15px;
    }
    
    .section {
        padding: 1.2rem 0.8rem;
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .section-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    .section-header p {
        font-size: 0.85rem;
    }
    
    .planner-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .control-group select {
        width: 100%;
        padding: 0.7rem 1rem;
    }
    
    .btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
    }
    
    .feelings-search,
    .hadith-search {
        flex-direction: column;
    }

    .prayer-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .prayer-control-group,
    .prayer-location-btn {
        width: 100%;
        min-width: 0;
    }

    .prayer-summary-grid,
    .prayer-times-grid,
    .prayer-widgets {
        grid-template-columns: 1fr;
    }

    .today-plan-actions {
        flex-direction: column;
    }

    .plan-action-btn {
        width: 100%;
        min-width: 0;
    }

    .prayer-insight-item {
        align-items: flex-start;
        flex-direction: column;
    }
    
    .feelings-search input,
    .hadith-search input {
        width: 100%;
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }
    
    .current-time {
        font-size: 2.2rem;
    }
    
    .current-period {
        font-size: 1.1rem;
    }
    
    .ayah-text {
        font-size: 1.2rem;
    }
    
    .daily-ayah-text {
        font-size: 1.2rem;
        padding: 0.8rem;
    }
    
    .plan-container {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }
    
    .day-card {
        padding: 0.6rem 0.3rem;
    }
    
    .day-number {
        font-size: 1.1rem;
    }
    
    .day-reading {
        font-size: 0.6rem;
    }
    
    .today-reading-box {
        padding: 1rem;
    }
    
    .today-reading-box h3 {
        font-size: 1.1rem;
    }
    
    #today-content {
        font-size: 0.95rem;
    }
    
    .wird-tabs {
        gap: 0.3rem;
    }
    
    .wird-tab {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .wird-content {
        padding: 1rem;
        max-height: 350px;
    }
    
    .wird-item {
        padding: 1rem;
    }
    
    .wird-text {
        font-size: 1rem;
    }
    
    .sunnan-box {
        padding: 1rem;
    }
    
    .sunna-item {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .sunna-icon {
        min-width: auto;
    }
    
    .quick-feelings {
        gap: 0.3rem;
    }
    
    .feeling-tag {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }
    
    .ayah-result {
        padding: 1.5rem 1rem;
    }
    
    .hadith-tabs {
        gap: 0.3rem;
    }
    
    .hadith-tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .hadith-item {
        padding: 1rem;
    }
    
    .hadith-text {
        font-size: 1rem;
    }
    
    .ayah-day-selector {
        gap: 1rem;
    }
    
    .btn-arrow {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    #ayah-day-num {
        font-size: 1.1rem;
    }
    
    .ayah-navigation {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .ayah-navigation .btn {
        width: 100%;
    }
    
    .main-footer {
        padding: 1.5rem 1rem;
    }
    
    .main-footer p {
        font-size: 0.85rem;
    }
}

/* شاشات صغيرة جداً */
@media (max-width: 400px) {
    .header-content h1 {
        font-size: 1.3rem;
    }
    
    .nav-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .plan-container {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .day-number {
        font-size: 0.95rem;
    }
    
    .day-reading {
        font-size: 0.55rem;
    }
}

/* سكرول بار مخصص */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* تأثيرات إضافية */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

/* رسالة فارغة */
.empty-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* أنماط آيات المشاعر المتعددة */
.feeling-ayah-item {
    padding: 1rem 0;
}

.feeling-ayah-item.mt-2 {
    margin-top: 1rem;
}

.ayah-divider {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    margin: 1rem 0;
}

/* أنماط نتائج الأحاديث من الدرر */
.hadith-results-raw {
    padding: 1rem;
    line-height: 2;
    text-align: right;
}

.hadith-results-raw p {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-right: 4px solid var(--primary-color);
}

.hadith-results-raw .hadith {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-right: 4px solid var(--gold);
}

.hadith-results-raw a {
    color: var(--primary-color);
    text-decoration: none;
}

.hadith-results-raw a:hover {
    text-decoration: underline;
}

/* أنماط البحث في الدرر السنية */
.dorar-search-result {
    padding: 1rem;
}

.dorar-link-box {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    margin-bottom: 1.5rem;
    border: 2px solid var(--gold);
}

.dorar-link-box p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.dorar-link {
    display: inline-block;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    text-decoration: none;
    margin-top: 0.5rem;
}

.local-hadith-results {
    padding: 1rem;
    background: #fafafa;
    border-radius: 15px;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .dorar-link-box {
        padding: 1rem;
    }
    
    .dorar-link {
        padding: 0.6rem 1rem;
        font-size: 1rem;
    }
}

/* ===== قسم تصفح القرآن الكريم ===== */

/* شريط تقدم الحفظ */
.hifz-progress-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 2px solid var(--gold);
}

.hifz-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hifz-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.stat-icon {
    font-size: 1.3rem;
}

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

.stat-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.hifz-progress-bar {
    height: 12px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--gold));
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* تبويبات القرآن */
.quran-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.quran-tab {
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--primary-color);
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.quran-tab:hover, .quran-tab.active {
    background: var(--primary-color);
    color: white;
}

.quran-tab-content {
    display: none;
}

.quran-tab-content.active {
    display: block;
}

/* فلترة السور */
.surah-filter {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.surah-filter input {
    padding: 1rem 1.5rem;
    border: 2px solid var(--primary-light);
    border-radius: 25px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.surah-filter input:focus {
    outline: none;
    border-color: var(--gold);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--primary-light);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary-light);
    color: white;
}

/* شبكة السور */
.surahs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 0.5rem;
}

.surah-card {
    background: white;
    border-radius: 12px;
    padding: 1.2rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
}

.surah-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.surah-card.memorized {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #4caf50;
}

.surah-number {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.surah-name {
    font-family: 'Amiri', serif;
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
    margin-right: 35px;
}

.surah-name-en {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.surah-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.surah-type {
    background: var(--gold-light);
    color: var(--primary-dark);
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
}

.surah-type.medinan {
    background: #e3f2fd;
    color: #1565c0;
}

.hifz-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
}

/* شبكة الأجزاء */
.juz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 0.5rem;
}

.juz-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.juz-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: var(--shadow);
}

.juz-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.juz-name {
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.juz-range {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

/* شبكة الصفحات */
.page-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-navigation input {
    width: 100px;
    padding: 0.8rem;
    border: 2px solid var(--primary-light);
    border-radius: 10px;
    text-align: center;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
}

.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.8rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.page-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.page-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-light);
}

.page-card.current {
    background: var(--gold-light);
    border-color: var(--gold);
}

.page-num {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* قائمة المحفوظات */
.bookmarks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.bookmarks-header h3 {
    color: var(--primary-color);
    margin: 0;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

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

.bookmarks-list {
    display: grid;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.bookmark-item {
    background: white;
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-right: 4px solid var(--gold);
    transition: var(--transition);
}

.bookmark-item:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow);
}

.bookmark-info {
    flex: 1;
}

.bookmark-title {
    font-family: 'Amiri', serif;
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.bookmark-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bookmark-actions {
    display: flex;
    gap: 0.5rem;
}

.bookmark-actions button {
    padding: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.bookmark-actions button:hover {
    transform: scale(1.2);
}

/* البحث */
.quran-search-box {
    display: flex;
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.quran-search-box input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--primary-light);
    border-radius: 25px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.quran-search-box input:focus {
    outline: none;
    border-color: var(--gold);
}

.search-results {
    max-height: 500px;
    overflow-y: auto;
}

.empty-search {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.search-result-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-right: 4px solid var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow);
}

.search-result-ayah {
    font-family: 'Amiri', serif;
    font-size: 1.3rem;
    line-height: 2;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
}

.search-highlight {
    background: var(--gold-light);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

.search-result-ref {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* قارئ القرآن */
.quran-reader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #f5f1eb 0%, #e8e4db 100%);
    z-index: 2000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .quran-reader {
    background: #0d1117;
}

.reader-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.btn-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
    background: transparent;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-close:hover {
    background: white;
    color: var(--primary-color);
}

.reader-title {
    flex: 1;
}

.reader-title h3 {
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    margin: 0;
}

.reader-title span {
    font-size: 0.9rem;
    opacity: 0.9;
}

.reader-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    background: transparent;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover, .action-btn.active {
    background: white;
    color: var(--primary-color);
}

.full-surah-btn {
    width: auto;
    min-width: 138px;
    height: 40px;
    border-radius: 999px;
    padding: 0 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.14);
}

.full-surah-btn.active {
    background: var(--gold);
    color: var(--primary-dark);
    border-color: var(--gold);
}

/* زر حفظ الصفحة */
.save-page-btn {
    position: relative;
}

.save-page-btn.saved {
    background: var(--gold) !important;
    color: var(--primary-dark) !important;
    animation: saveSuccess 0.5s ease;
}

@keyframes saveSuccess {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.reader-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.nav-btn {
    padding: 0.5rem 1rem;
    background: var(--primary-light);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-btn:hover {
    background: var(--primary-color);
}

#current-position {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.quran-content {
    flex: 1;
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    background: var(--mushaf-bg);
    position: relative;
    border: 8px solid;
    border-image: linear-gradient(135deg, #d4af37, #aa8a2e, #d4af37) 1;
    box-shadow: 
        inset 0 0 50px rgba(212, 175, 55, 0.1),
        0 10px 40px rgba(0, 0, 0, 0.15);
}

.quran-content::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;
    border: 2px solid rgba(212, 175, 55, 0.4);
    pointer-events: none;
}

.bismillah {
    text-align: center;
    font-family: 'Amiri', serif;
    font-size: 2.5rem;
    color: var(--gold);
    margin: 1.5rem 0 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), transparent);
    border-radius: 10px;
}

.ayah-container {
    margin-bottom: 0;
    padding: 1.2rem 1rem;
    background: transparent;
    border-radius: 0;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
    border-bottom: 1px dashed rgba(212, 175, 55, 0.3);
}

.ayah-container:last-child {
    border-bottom: none;
}

.ayah-container:hover {
    background: rgba(212, 175, 55, 0.1);
}

.ayah-container.memorized {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15) 0%, rgba(76, 175, 80, 0.05) 100%);
    border-right: 4px solid #4caf50;
}

.ayah-container.needs-review {
    background: rgba(255, 152, 0, 0.1);
    border-right: 4px solid #ff9800;
}

.ayah-container.learning {
    background: rgba(33, 150, 243, 0.1);
    border-right: 4px solid #2196f3;
}

.ayah-container.difficult {
    background: rgba(244, 67, 54, 0.1);
    border-right: 4px solid #f44336;
}

.ayah-text-display {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 1.8rem;
    line-height: 2.8;
    text-align: justify;
    color: var(--text-primary);
    direction: rtl;
}

.ayah-end-mark {
    font-family: 'Amiri', serif;
    color: var(--gold);
    font-size: 0.9em;
    margin: 0 0.3rem;
    vertical-align: middle;
}

.ayah-translation {
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(26, 95, 74, 0.05);
    border-radius: 8px;
    border-right: 3px solid var(--primary-light);
    direction: ltr;
    text-align: left;
    line-height: 1.8;
}

[data-theme="dark"] .ayah-translation {
    background: rgba(255, 255, 255, 0.05);
}

.ayah-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 700;
    margin-right: 0.5rem;
    font-family: 'Cairo', sans-serif;
}

.ayah-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
    justify-content: flex-end;
}

.ayah-inline-tools {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

.tafseer-btn {
    border-color: rgba(26, 95, 74, 0.35);
    color: var(--primary-color);
    background: rgba(26, 95, 74, 0.06);
}

.audio-btn {
    border-color: rgba(212, 175, 55, 0.5);
    color: var(--primary-dark);
    background: rgba(212, 175, 55, 0.16);
}

.audio-btn.active {
    background: var(--gold);
    color: var(--primary-dark);
    border-color: var(--gold);
}

.ayah-action-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.ayah-action-btn:hover {
    background: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}

.ayah-action-btn.memorized-btn.active {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.ayah-tafseer {
    margin-top: 0.9rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(135deg, rgba(26, 95, 74, 0.08), rgba(212, 175, 55, 0.08));
    border-radius: 10px;
    border-right: 4px solid var(--gold);
    color: var(--text-primary);
    line-height: 1.9;
}

.tafseer-header {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tafseer-loading {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

[data-theme="dark"] .ayah-tafseer {
    background: linear-gradient(135deg, rgba(26, 95, 74, 0.2), rgba(212, 175, 55, 0.1));
}

[data-theme="dark"] .audio-btn {
    color: #f4d35e;
    background: rgba(244, 211, 94, 0.12);
    border-color: rgba(244, 211, 94, 0.35);
}

[data-theme="dark"] .audio-btn.active {
    color: #0d1117;
    background: #f4d35e;
    border-color: #f4d35e;
}

.reader-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

/* الهيدر العصري للقارئ المحمول */
@media (max-width: 768px) {
    .hifz-stats {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hifz-stat {
        justify-content: space-between;
    }
    
    .quran-tabs {
        gap: 0.3rem;
    }
    
    .quran-tab {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .surahs-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        max-height: 400px;
    }
    
    .surah-card {
        padding: 1rem;
    }
    
    .surah-name {
        font-size: 1.2rem;
    }
    
    .juz-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .pages-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .page-navigation {
        flex-direction: column;
    }
    
    .quran-search-box {
        flex-direction: column;
    }
    
    .reader-header {
        flex-wrap: wrap;
        padding: 0.8rem 1rem;
    }
    
    .reader-title h3 {
        font-size: 1.2rem;
    }
    
    .reader-actions {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .quran-content {
        padding: 1rem;
    }
    
    .ayah-text-display {
        font-size: 1.4rem;
        line-height: 2.2;
    }
    
    .bismillah {
        font-size: 1.5rem;
    }
    
    .reader-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .reader-footer .btn {
        width: 100%;
    }
    
    .bookmark-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .bookmark-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* عناوين السور داخل الجزء والصفحة */
.juz-surah-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin: 2rem 0 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.juz-surah-header:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow);
}

.juz-surah-header h3 {
    margin: 0;
    font-family: 'Amiri', serif;
    font-size: 1.3rem;
}

/* تحسين عرض صفحات القرآن */
.quran-page-display {
    background: #fffef5;
    border: 2px solid var(--gold);
    border-radius: var(--border-radius);
    padding: 2rem;
    min-height: 70vh;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* خط الرسم العثماني */
@font-face {
    font-family: 'Uthmanic';
    src: url('https://fonts.qurancomplex.gov.sa/wp-content/uploads/2020/09/UthmanicHafs1-Ver18.woff2') format('woff2');
    font-display: swap;
}

.quran-text-uthmanic {
    font-family: 'Uthmanic', 'Amiri', serif;
}

/* شريط تتبع القراءة */
.reading-tracker {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #e0e0e0;
    z-index: 1000;
}

.reading-tracker-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--gold));
    transition: width 0.3s ease;
}

/* تأثير التمييز للآيات */
.ayah-container.highlighted {
    background: linear-gradient(135deg, var(--gold-light) 0%, #fff8e1 100%);
    border-right: 4px solid var(--gold);
    animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.5); }
    100% { box-shadow: 0 0 0 20px rgba(212, 175, 55, 0); }
}

/* تنسيق الآيات في وضع العرض المتصل */
.continuous-reading .ayah-container {
    display: inline;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
}

.continuous-reading .ayah-number {
    display: inline-flex;
    width: 25px;
    height: 25px;
    font-size: 0.7rem;
    margin: 0 0.3rem;
    vertical-align: middle;
}

/* زر العودة للأعلى العائم */
.scroll-top-btn {
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    z-index: 999;
    display: none;
}

.scroll-top-btn.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-top-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* تحسينات للجوال */
@media (max-width: 480px) {
    .juz-surah-header h3 {
        font-size: 1.1rem;
    }
    
    .scroll-top-btn {
        width: 45px;
        height: 45px;
        bottom: 70px;
        left: 15px;
    }
    
    .ayah-number {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

/* ===== عرض المصحف مع تقليب الصفحات ===== */
.mushaf-container {
    display: none;
    perspective: 2000px;
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

.mushaf-container.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mushaf-book {
    position: relative;
    width: 100%;
    max-width: 800px;
    min-height: 600px;
    transform-style: preserve-3d;
    direction: rtl;
}

.mushaf-page {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--mushaf-bg);
    border: 3px solid var(--mushaf-border);
    border-radius: 5px 20px 20px 5px;
    padding: 2rem;
    box-shadow: 
        inset 0 0 30px rgba(0, 0, 0, 0.05),
        5px 5px 20px var(--page-shadow);
    transform-origin: right center;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
    backface-visibility: hidden;
    overflow-y: auto;
}

.mushaf-page.current {
    z-index: 10;
    transform: rotateY(0deg);
}

.mushaf-page.flipped {
    transform: rotateY(-180deg);
    z-index: 5;
}

.mushaf-page.next {
    z-index: 1;
}

/* زخرفة الصفحة */
.mushaf-page::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;
    border: 2px solid var(--gold);
    border-radius: 3px;
    pointer-events: none;
    opacity: 0.5;
}

.mushaf-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gold);
    margin-bottom: 1.5rem;
    font-family: 'Amiri', serif;
}

.mushaf-page-number {
    background: var(--gold);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.mushaf-page-content {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 1.6rem;
    line-height: 2.8;
    text-align: justify;
    color: var(--text-primary);
}

.mushaf-page-content .ayah-inline {
    cursor: pointer;
    transition: background 0.2s ease;
    padding: 2px 4px;
    border-radius: 4px;
}

.mushaf-page-content .ayah-inline:hover {
    background: rgba(212, 175, 55, 0.2);
}

.mushaf-page-content .ayah-inline.needs-review {
    background: rgba(255, 193, 7, 0.3);
    border-bottom: 2px solid #ffc107;
}

.mushaf-page-content .ayah-inline.learning {
    background: rgba(33, 150, 243, 0.3);
    border-bottom: 2px solid #2196f3;
}

.mushaf-page-content .ayah-inline.difficult {
    background: rgba(244, 67, 54, 0.3);
    border-bottom: 2px solid #f44336;
}

.mushaf-page-content .ayah-inline.memorized {
    background: rgba(76, 175, 80, 0.3);
    border-bottom: 2px solid #4caf50;
}

/* أزرار التنقل بين الصفحات */
.mushaf-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    padding: 1rem;
}

.mushaf-nav-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    background: var(--card-bg);
    color: var(--gold);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.mushaf-nav-btn:hover:not(:disabled) {
    background: var(--gold);
    color: white;
    transform: scale(1.1);
}

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

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

/* زر تبديل العرض */
.view-toggle-btn {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
}

.view-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

/* ===== إعدادات الترجمة ===== */
.translation-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(26, 95, 74, 0.1) 0%, rgba(212, 175, 55, 0.1) 100%);
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    flex-wrap: wrap;
}

.audio-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(26, 95, 74, 0.08) 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    flex-wrap: wrap;
}

.translation-label {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.translation-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.translation-toggle label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.translation-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

#translation-lang {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--primary-light);
    border-radius: 25px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 200px;
    transition: var(--transition);
}

#reciter-select {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--gold);
    border-radius: 25px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 220px;
    transition: var(--transition);
}

#translation-lang:hover {
    border-color: var(--gold);
}

#translation-lang:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

#reciter-select:hover {
    border-color: var(--primary-light);
}

#reciter-select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(26, 95, 74, 0.15);
}

.ayah-audio-player {
    width: min(680px, calc(100% - 2rem));
    margin: 1rem auto 0;
    display: block;
}

.translation-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-light);
    border-radius: 20px;
    font-family: 'Cairo', sans-serif;
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
}

.translation-text {
    display: block;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.8rem;
    padding: 0.8rem;
    background: rgba(26, 95, 74, 0.05);
    border-radius: 8px;
    border-right: 3px solid var(--primary-light);
    direction: ltr;
    text-align: left;
}

[data-theme="dark"] .translation-text {
    background: rgba(255, 255, 255, 0.05);
}

/* ===== مودال حالة الآية ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal[style*="display: flex"],
.modal.active {
    display: flex !important;
}

.ayah-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ayah-modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
}

.modal-ayah-preview {
    font-family: 'Amiri', serif;
    font-size: 1.4rem;
    text-align: center;
    padding: 1.5rem;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    line-height: 2;
}

.modal-ayah-text {
    font-family: 'Amiri', serif;
    font-size: 1.3rem;
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(26, 95, 74, 0.05));
    border-radius: 10px;
    margin-bottom: 1rem;
    line-height: 2;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.modal-ayah-ref {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.status-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.status-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-primary);
    width: 100%;
}

.status-btn:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow);
}

.status-btn.memorized {
    border-color: #4caf50;
}

.status-btn.memorized:hover {
    background: #e8f5e9;
}

.status-btn.needs-review {
    border-color: #ff9800;
}

.status-btn.needs-review:hover {
    background: #fff3e0;
}

.status-btn.learning {
    border-color: #2196f3;
}

.status-btn.learning:hover {
    background: #e3f2fd;
}

.status-btn.difficult {
    border-color: #f44336;
}

.status-btn.difficult:hover {
    background: #ffebee;
}

.status-btn.none {
    border-color: #9e9e9e;
}

.status-btn.none:hover {
    background: #f5f5f5;
}

[data-theme="dark"] .status-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.status-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.status-option:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow);
}

.status-option.active {
    border-color: var(--primary-color);
    background: rgba(26, 95, 74, 0.05);
}

.status-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.status-option.needs-review .status-icon {
    background: #fff3e0;
    color: #ff9800;
}

.status-option.learning .status-icon {
    background: #e3f2fd;
    color: #2196f3;
}

.status-option.difficult .status-icon {
    background: #ffebee;
    color: #f44336;
}

.status-option.memorized .status-icon {
    background: #e8f5e9;
    color: #4caf50;
}

.status-option.none .status-icon {
    background: #f5f5f5;
    color: #9e9e9e;
}

.status-info h4 {
    margin: 0 0 0.3rem;
    color: var(--text-primary);
}

.status-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== تبويب المراجعة ===== */
.review-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.review-filter-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid #e0e0e0;
    background: var(--card-bg);
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.review-filter-btn:hover {
    border-color: var(--primary-light);
}

.review-filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.review-filter-btn .count {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
}

.review-filter-btn.active .count {
    background: rgba(255, 255, 255, 0.2);
}

.review-list {
    max-height: 500px;
    overflow-y: auto;
}

.review-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 0.8rem;
    border-right: 4px solid #e0e0e0;
    transition: var(--transition);
    cursor: pointer;
}

.review-item:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow);
}

.review-item.needs-review {
    border-right-color: #ff9800;
}

.review-item.learning {
    border-right-color: #2196f3;
}

.review-item.difficult {
    border-right-color: #f44336;
}

.review-item-status {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.review-item.needs-review .review-item-status {
    background: #fff3e0;
}

.review-item.learning .review-item-status {
    background: #e3f2fd;
}

.review-item.difficult .review-item-status {
    background: #ffebee;
}

.review-item-content {
    flex: 1;
}

.review-item-reference {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.review-item-text {
    font-family: 'Amiri', serif;
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.review-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.review-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ===== استجابة الجوال للقائمة ===== */
@media (max-width: 768px) {
    .main-header {
        padding: 1rem 1rem 1.25rem;
    }

    .header-content {
        padding-right: 3.75rem;
        padding-left: 3.75rem;
    }

    .main-nav {
        position: fixed;
        top: 0.5rem;
        right: 0.75rem;
        width: min(86vw, 340px);
        height: calc(100vh - 1rem);
        background: linear-gradient(180deg, rgba(13, 66, 51, 0.98) 0%, rgba(26, 95, 74, 0.96) 100%);
        flex-direction: column;
        justify-content: flex-start;
        padding: 1rem;
        gap: 0.65rem;
        margin-top: 0;
        border-radius: 28px;
        transform: translateX(115%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.28s ease, opacity 0.28s ease, visibility 0.28s ease;
        z-index: 1000;
        box-shadow: -12px 0 30px rgba(0, 0, 0, 0.32);
        overflow-y: auto;
    }

    .main-nav.active {
        right: 0.75rem;
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-mobile-header {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding: 0.4rem 0.25rem 0.8rem;
        margin-bottom: 0.35rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .nav-close-btn {
        display: none;
    }

    .main-nav a {
        width: 100%;
        min-height: 52px;
        padding: 0.95rem 1rem;
        font-size: 1rem;
        border-radius: 16px;
        justify-content: flex-start;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .main-nav a:hover,
    .main-nav a.active {
        background: rgba(244, 211, 94, 0.18);
        color: white;
        transform: none;
    }

    .burger-menu {
        display: flex;
        top: 0.25rem;
        right: 0;
        width: 46px;
        height: 46px;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.14);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    }

    .nav-overlay.active {
        backdrop-filter: blur(4px);
    }
    
    .theme-toggle {
        top: auto;
        bottom: 20px;
        left: 20px;
        width: 45px;
        height: 45px;
    }
    
    .theme-icon {
        font-size: 1.2rem;
    }
    
    /* المصحف في الجوال */
    .mushaf-book {
        min-height: 450px;
    }
    
    .mushaf-page {
        padding: 1rem;
    }
    
    .mushaf-page-content {
        font-size: 1.3rem;
        line-height: 2.2;
    }
    
    .mushaf-nav-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    /* المودال في الجوال */
    .modal-content {
        margin: 1rem;
        max-height: 85vh;
    }
    
    .modal-ayah-preview {
        font-size: 1.2rem;
    }
    
    .status-option {
        padding: 0.8rem;
    }
    
    .status-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    /* إعدادات الترجمة في الجوال */
    .translation-settings,
    .audio-settings {
        flex-direction: column;
        align-items: stretch;
    }
    
    .translation-select,
    #reciter-select,
    .ayah-audio-player {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .mushaf-page-content {
        font-size: 1.1rem;
        line-height: 2;
    }
    
    .mushaf-nav {
        gap: 1rem;
    }
    
    .mushaf-nav-btn {
        width: 45px;
        height: 45px;
    }
    
    .review-filters {
        justify-content: center;
    }
    
    .review-filter-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
}
