/* =============== المتغيرات والإعدادات الأساسية =============== */
:root {
    --primary-color: #1a365d;
    --secondary-color: #2c5282;
    --accent-color: #d4af37;
    --gold-gradient: linear-gradient(135deg, #d4af37, #f4e4bc, #d4af37);
    --dark-bg: #0a1628;
    --card-bg: rgba(26, 54, 93, 0.85);
    --text-light: #f7fafc;
    --text-muted: #a0aec0;
}

/* زر تبديل الوضع */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    background: transparent;
    color: var(--accent-color);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: rotate(30deg);
}

/* =============== الوضع النهاري (الفاتح) =============== */
/* --- المتغيرات الفاتحة --- */
body.light-mode {
    --primary-color: #1e3a5f;
    --secondary-color: #2c5282;
    --accent-color: #996515;
    --gold-gradient: linear-gradient(135deg, #996515, #c9a227, #996515);
    --dark-bg: #f5f0e8;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-light: #2d3748;
    --text-muted: #5a6577;
}

/* --- الخلفية --- */
body.light-mode .stars-container {
    background: linear-gradient(180deg, #e8dcc8 0%, #f5f0e8 50%, #ddd3c1 100%);
}
body.light-mode #stars,
body.light-mode #stars2,
body.light-mode #stars3 { opacity: 0.06; }

/* --- النافبار --- */
body.light-mode .navbar {
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid rgba(153, 101, 21, 0.2);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
}
body.light-mode .nav-links a { color: #4a5568; }
body.light-mode .nav-links a:hover { color: #996515; background: rgba(153, 101, 21, 0.08); }
body.light-mode .hamburger span { background: #996515; }

/* --- قسم الترحيب --- */
body.light-mode .hero-subtitle { color: #5a6577; }
body.light-mode .hero-verse {
    background: rgba(255, 255, 255, 0.9);
    border-color: #996515;
    box-shadow: 0 4px 20px rgba(153, 101, 21, 0.1);
}
body.light-mode .btn-secondary {
    color: #996515;
    border-color: #996515;
}
body.light-mode .btn-secondary:hover { background: rgba(153, 101, 21, 0.08); }
body.light-mode .scroll-indicator i { color: #996515; }
body.light-mode .hero-title {
    background: linear-gradient(135deg, #5c3d10, #8b6914, #5c3d10);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(92, 61, 16, 0.3));
}
body.light-mode .btn-primary {
    background: linear-gradient(135deg, #5c3d10, #8b6914, #5c3d10);
    color: #fff;
    box-shadow: 0 4px 20px rgba(92, 61, 16, 0.3);
}
body.light-mode .btn-primary:hover {
    box-shadow: 0 6px 30px rgba(92, 61, 16, 0.45);
}

/* --- عارض الكتاب --- */
body.light-mode .page-flip-container {
    background: linear-gradient(135deg, #fff, #f7f3ed);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}
body.light-mode .nav-btn {
    background: #996515;
    border-color: #996515;
    color: #fff;
    box-shadow: 0 4px 12px rgba(153, 101, 21, 0.25);
}
body.light-mode .control-btn {
    background: rgba(255, 255, 255, 0.9);
    border-color: #996515;
    color: #996515;
}
body.light-mode .control-btn:hover { background: #996515; color: #fff; }
body.light-mode .page-info { color: #4a5568; }
body.light-mode .page-info input {
    background: #fff;
    color: #2d3748;
    border-color: #996515;
}
body.light-mode .progress-bar { background: rgba(0, 0, 0, 0.08); }
body.light-mode .section-header p { color: #5a6577; }

/* --- التبويبات --- */
body.light-mode .adhkar-tabs-container {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(153, 101, 21, 0.15);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
body.light-mode .adhkar-tab-btn {
    background: rgba(0, 0, 0, 0.04);
    color: #5a6577;
}
body.light-mode .adhkar-tab-btn:hover { background: rgba(0, 0, 0, 0.07); }
body.light-mode .adhkar-tab-btn.active { color: #fff; }

/* --- البحث --- */
body.light-mode .adhkar-search-box input {
    background: #fff;
    color: #2d3748;
    border-color: rgba(153, 101, 21, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
body.light-mode .adhkar-search-box input::placeholder { color: #a0aab4; }
body.light-mode .adhkar-search-box i { color: #996515; }

/* --- حجم الخط --- */
body.light-mode .font-size-control {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(153, 101, 21, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
body.light-mode .font-size-label { color: #5a6577; }
body.light-mode .font-size-label i { color: #996515; }
body.light-mode .font-size-btn {
    border-color: rgba(153, 101, 21, 0.3);
    color: #996515;
    background: rgba(153, 101, 21, 0.06);
}
body.light-mode .font-size-btn:hover { background: rgba(153, 101, 21, 0.15); }
body.light-mode .font-size-value { color: #2d3748; }
body.light-mode .font-size-btn.font-reset-btn {
    color: #5a6577;
    border-color: rgba(0, 0, 0, 0.12);
}

/* --- البطاقات --- */
body.light-mode .adhkar-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
}
body.light-mode .adhkar-card:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
}
body.light-mode .adhkar-card .card-text { color: #1a202c; }
body.light-mode .adhkar-card .narrator { color: #718096; }
body.light-mode .adhkar-card .count-badge {
    background: rgba(0, 0, 0, 0.05);
    color: #5a6577;
}
body.light-mode .adhkar-card .benefit-box {
    background: linear-gradient(135deg, rgba(153, 101, 21, 0.06), rgba(153, 101, 21, 0.02));
}
body.light-mode .adhkar-card .benefit-box p { color: #4a5568; }

/* --- أزرار البطاقة --- */
body.light-mode .card-actions { border-top-color: rgba(0, 0, 0, 0.06); }
body.light-mode .card-action-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #5a6577;
}
body.light-mode .copy-btn:hover { background: rgba(153, 101, 21, 0.1); color: #996515; }
body.light-mode .whatsapp-btn:hover { background: rgba(37, 211, 102, 0.1); color: #128c7e; }
body.light-mode .counter-btn:hover { background: rgba(109, 40, 217, 0.08); color: #6d28d9; }
body.light-mode .image-btn:hover { background: rgba(99, 102, 241, 0.1); color: #4f46e5; }

/* --- التذييل --- */
body.light-mode .footer {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(153, 101, 21, 0.15);
}
body.light-mode .footer-content p { color: #5a6577; }

/* --- زر الرجوع --- */
body.light-mode .back-to-top {
    background: rgba(255, 255, 255, 0.95);
    border-color: #996515;
    color: #996515;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
body.light-mode .back-to-top:hover { background: #996515; color: #fff; }

/* --- قسم الأذكار الخلفية --- */
body.light-mode .adhkar-section {
    background: linear-gradient(180deg, transparent 0%, rgba(153, 101, 21, 0.04) 50%, transparent 100%);
}

/* --- سكرولبار --- */
body.light-mode ::-webkit-scrollbar-track { background: #f5f0e8; }
body.light-mode ::-webkit-scrollbar-thumb { background: #c9a227; }
body.light-mode ::-webkit-scrollbar-thumb:hover { background: #996515; }

/* --- البادجات في الوضع الفاتح --- */
body.light-mode .adhkar-card.type-dua .type-badge { background: rgba(13,148,136,0.12); color: #0d7468; }
body.light-mode .adhkar-card.type-dhikr .type-badge { background: rgba(5,150,105,0.12); color: #047857; }
body.light-mode .adhkar-card.type-fadl .type-badge { background: rgba(217,119,6,0.12); color: #b45309; }
body.light-mode .adhkar-card.type-hadith .type-badge { background: rgba(37,99,235,0.12); color: #1d4ed8; }

body.light-mode .source-bukhari { background: rgba(5,150,105,0.1); color: #047857; border-color: rgba(5,150,105,0.25); }
body.light-mode .source-muslim { background: rgba(37,99,235,0.1); color: #1d4ed8; border-color: rgba(37,99,235,0.25); }
body.light-mode .source-both { background: rgba(180,83,9,0.1); color: #b45309; border-color: rgba(180,83,9,0.25); }
body.light-mode .source-other { background: rgba(153,101,21,0.1); color: #7c6514; border-color: rgba(153,101,21,0.25); }

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', 'Amiri', sans-serif;
    background: var(--dark-bg);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

/* =============== خلفية النجوم المتحركة =============== */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(ellipse at bottom, #1B2838 0%, #090A0F 100%);
}

#stars, #stars2, #stars3 {
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
    contain: layout style;
    right: 0;
    bottom: 0;
    animation: animateStars 50s linear infinite;
}

#stars {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle fill="%23fff" cx="50" cy="50" r="1" opacity="0.8"/></svg>');
    background-size: 100px 100px;
}

#stars2 {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle fill="%23d4af37" cx="50" cy="50" r="0.8" opacity="0.6"/></svg>');
    background-size: 150px 150px;
    animation-duration: 100s;
}

#stars3 {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle fill="%23fff" cx="50" cy="50" r="1.2" opacity="0.4"/></svg>');
    background-size: 200px 200px;
    animation-duration: 150s;
}

@keyframes animateStars {
    from { transform: translateY(0); }
    to { transform: translateY(-100%); }
}

/* =============== شريط التنقل =============== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.nav-brand i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background: rgba(212, 175, 55, 0.2);
    color: var(--accent-color);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2.5px;
    background: var(--accent-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

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

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

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 22, 40, 0.98);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        border-bottom: 1px solid rgba(212, 175, 55, 0.3);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        padding: 0 1rem;
    }

    .nav-links.open {
        max-height: 300px;
        padding: 1rem;
    }

    .nav-links a {
        width: 100%;
        justify-content: center;
        padding: 0.8rem;
        font-size: 1rem;
    }

    body.light-mode .nav-links {
        background: rgba(255, 255, 255, 0.98);
    }
}

/* =============== قسم الترحيب =============== */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 6rem 2rem 2rem;
    position: relative;
}

.hero-content {
    max-width: 800px;
}

.hero-icon {
    font-size: 4rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.hero-title {
    font-family: 'Amiri', serif;
    font-size: 4rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.2s backwards;
}

.hero-verse {
    background: var(--card-bg);
    padding: 1.5rem 3rem;
    border-radius: 15px;
    border: 2px solid var(--accent-color);
    margin-bottom: 2.5rem;
    animation: fadeInUp 1s ease 0.4s backwards;
}

.hero-verse p {
    font-family: 'Amiri', serif;
    font-size: 2rem;
    color: var(--accent-color);
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.6s backwards;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gold-gradient);
    color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(212, 175, 55, 0.6);
}

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

.btn-secondary:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-3px);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    animation: bounce 2s infinite;
}

.scroll-indicator i {
    font-size: 2rem;
    color: var(--accent-color);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

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

/* =============== العناوين المشتركة =============== */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-family: 'Amiri', serif;
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* =============== قسم عارض الكتاب =============== */
.book-section {
    padding: 6rem 2rem;
    min-height: 100vh;
}

/* وضع ملء الشاشة */
.book-section:fullscreen {
    background: var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.book-section:fullscreen .book-viewer {
    max-width: 100%;
}

.book-section:fullscreen .page-flip-container img {
    max-height: 85vh;
}

.book-section:fullscreen .book-controls {
    margin-top: 0.5rem;
}

.book-viewer {
    max-width: 900px;
    margin: 0 auto;
}

.book-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.book-page-wrapper {
    position: relative;
    perspective: 1500px;
}

.page-flip-container {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-radius: 10px;
    padding: 10px;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(212, 175, 55, 0.1);
    transition: transform 0.6s ease;
}

.page-flip-container img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 5px;
    display: block;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.page-flip-container.flip-right {
    animation: flipRight 0.6s ease;
}

.page-flip-container.flip-left {
    animation: flipLeft 0.6s ease;
}

@keyframes flipRight {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(-15deg); }
    100% { transform: rotateY(0deg); }
}

@keyframes flipLeft {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(15deg); }
    100% { transform: rotateY(0deg); }
}

.navigation-buttons {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    align-items: center;
}

.nav-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    background: var(--accent-color);
    color: var(--primary-color);
    font-size: 1.6rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

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

/* عناصر التحكم بالكتاب */
.book-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.page-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.page-info input {
    width: 45px;
    padding: 0.3rem;
    text-align: center;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    background: rgba(26, 54, 93, 0.8);
    color: var(--text-light);
    font-size: 1rem;
}

.progress-bar {
    width: 100%;
    max-width: 400px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gold-gradient);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 1%;
}

.control-buttons {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--accent-color);
    background: rgba(26, 54, 93, 0.8);
    color: var(--accent-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* =============== عارض الكتاب المنبثق (Overlay) =============== */
.book-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.book-overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
}

/* زر الإغلاق ✕ */
.overlay-close-btn {
    position: absolute;
    top: 1.2rem;
    left: 1.2rem;
    z-index: 10;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* رسالة النجاح الخضراء */
.overlay-success-msg {
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    z-index: 10;
    font-family: 'Cairo', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(90deg, #22c55e, #4ade80, #86efac);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.5s ease;
    pointer-events: none;
}

.overlay-success-msg.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* منطقة الصورة */
.overlay-image-area {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: calc(100% - 70px);
    padding: 4.5rem 1rem 0.5rem;
}

.overlay-image-area img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    animation: overlayZoomIn 0.4s ease;
}

@keyframes overlayZoomIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* أزرار التنقل السفلية */
.overlay-bottom-controls {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    height: 65px;
    padding: 0 1.5rem;
    direction: rtl;
}

.overlay-nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.6);
    background: rgba(0, 0, 0, 0.4);
    color: #d4af37;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.overlay-nav-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: #d4af37;
    transform: scale(1.1);
}

.overlay-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.overlay-page-num {
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    min-width: 80px;
    text-align: center;
    direction: ltr;
}


@media (max-width: 768px) {
    .overlay-close-btn {
        top: 0.8rem;
        left: 0.8rem;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    .overlay-success-msg {
        font-size: 1rem;
        top: 1rem;
    }
    .overlay-image-area {
        padding: 3.5rem 0.5rem 0.5rem;
        height: calc(100% - 60px);
    }
    .overlay-bottom-controls {
        height: 55px;
        padding: 0 1rem;
    }
    .overlay-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* =============== قسم الأذكار =============== */
.adhkar-section {
    padding: 6rem 2rem;
    background: linear-gradient(180deg, transparent 0%, rgba(26, 54, 93, 0.3) 50%, transparent 100%);
}

/* ألوان التصنيفات */
.adhkar-section {
    --dua-color: #0d9488;
    --dhikr-color: #059669;
    --fadl-color: #d97706;
    --hadith-color: #2563eb;
}

/* التبويبات */
.adhkar-tabs-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(212, 175, 55, 0.2);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}
.adhkar-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}
.adhkar-tab-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
}
.adhkar-tab-btn:hover { background: rgba(255,255,255,0.1); }
.adhkar-tab-btn.active { color: white; }
.adhkar-tab-btn[data-tab="all"].active { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.adhkar-tab-btn[data-tab="dua"].active { background: var(--dua-color); }
.adhkar-tab-btn[data-tab="dhikr"].active { background: var(--dhikr-color); }
.adhkar-tab-btn[data-tab="fadl"].active { background: var(--fadl-color); }
.adhkar-tab-btn[data-tab="hadith"].active { background: var(--hadith-color); }

/* البحث */
.adhkar-search-box {
    margin: 1.5rem auto;
    position: relative;
    max-width: 1400px;
}
.adhkar-search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    background: rgba(0,0,0,0.3);
    color: white;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
}
.adhkar-search-box input:focus { outline: none; border-color: var(--accent-color); }
.adhkar-search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

/* التحكم بحجم الخط */
.font-size-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem auto 1.5rem;
    max-width: 1400px;
    padding: 0.6rem 1.2rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 12px;
    width: fit-content;
    direction: ltr;
}

.font-size-label {
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.font-size-label i {
    color: #d4af37;
}

.font-size-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.font-size-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.font-size-btn:hover {
    background: rgba(212, 175, 55, 0.25);
    border-color: #d4af37;
    transform: scale(1.1);
}

.font-size-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.font-size-btn.font-reset-btn {
    font-size: 0.75rem;
    width: 32px;
    height: 32px;
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
}

.font-size-btn.font-reset-btn:hover {
    color: #d4af37;
    border-color: rgba(212, 175, 55, 0.4);
}

.font-size-value {
    color: white;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    min-width: 45px;
    text-align: center;
    font-weight: 600;
}

/* الشبكة */
.adhkar-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* البطاقة */
.adhkar-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(212, 175, 55, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: adhkarFadeUp 0.5s ease forwards;
}
.adhkar-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
@keyframes adhkarFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* رأس البطاقة */
.adhkar-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.adhkar-card .card-number {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
}
body.light-mode .adhkar-card .card-number { color: rgba(0,0,0,0.35); }

.adhkar-card .type-badge {
    font-size: 0.75rem; padding: 0.25rem 0.6rem;
    border-radius: 20px; font-weight: 600;
}
.adhkar-card.type-dua .type-badge { background: rgba(13,148,136,0.2); color: #5eead4; }
.adhkar-card.type-dhikr .type-badge { background: rgba(5,150,105,0.2); color: #6ee7b7; }
.adhkar-card.type-fadl .type-badge { background: rgba(217,119,6,0.2); color: #fcd34d; }
.adhkar-card.type-hadith .type-badge { background: rgba(37,99,235,0.2); color: #93c5fd; }

/* النص والتفاصيل */
.adhkar-card .card-text {
    font-family: 'Amiri', serif;
    font-size: 1.4rem; line-height: 2;
    color: var(--text-light); margin-bottom: 1rem;
}
.adhkar-card .narrator {
    font-size: 0.9rem; color: #64748b;
    margin-bottom: 0.5rem;
    display: flex; align-items: center; gap: 0.3rem;
}
.adhkar-card .count-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: rgba(255,255,255,0.08);
    padding: 0.2rem 0.6rem; border-radius: 15px;
    font-size: 0.7rem; color: #94a3b8; margin-bottom: 0.5rem;
}

/* شارات المصدر */
.adhkar-card .source-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.15rem 0.5rem; border-radius: 15px;
    font-size: 0.65rem; font-weight: 600;
    margin-left: 0.3rem; margin-bottom: 0.3rem;
}
.source-bukhari { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.source-muslim { background: rgba(34,197,94,0.15); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }
.source-both { background: rgba(251,191,36,0.15); color: #fde68a; border: 1px solid rgba(251,191,36,0.3); }
.source-other { background: rgba(139,92,246,0.15); color: #c4b5fd; border: 1px solid rgba(139,92,246,0.3); }

/* صندوق الفائدة */
.adhkar-card .benefit-box {
    background: linear-gradient(135deg, rgba(212,175,55,0.1), rgba(212,175,55,0.05));
    border-radius: 10px; padding: 1rem;
    margin-top: 0.5rem;
}
.adhkar-card .benefit-box p { font-size: 0.95rem; color: #cbd5e1; line-height: 1.8; }
.adhkar-card .benefit-box strong { color: var(--accent-color); }

/* أزرار البطاقة (نسخ - واتساب - عداد) */
.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

.card-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-action-btn:hover {
    transform: translateY(-2px);
}

.copy-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.4);
    color: #d4af37;
}

.whatsapp-btn:hover {
    background: rgba(37, 211, 102, 0.15);
    border-color: rgba(37, 211, 102, 0.4);
    color: #25d366;
}

.image-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #818cf8;
}

.twitter-btn:hover {
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}
body.light-mode .twitter-btn:hover { background: rgba(0, 0, 0, 0.08); color: #000; }

.counter-btn {
    margin-right: auto;
    min-width: 70px;
    justify-content: center;
}

.counter-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
    color: #a78bfa;
}

.counter-btn.counter-pulse {
    transform: scale(1.15);
}

.counter-val {
    min-width: 18px;
    text-align: center;
    font-weight: 700;
}

/* رسالة تأكيد النسخ */
.copy-toast {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(5, 150, 105, 0.4);
}

.copy-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* لا توجد نتائج */
.adhkar-no-results {
    text-align: center; padding: 4rem;
    color: #64748b; display: none;
}
.adhkar-no-results i { font-size: 3rem; margin-bottom: 1rem; }

/* =============== التذييل =============== */
.footer {
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(10, 22, 40, 0.9);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.footer-content p {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.footer-content i {
    color: #e53e3e;
}

.footer-credit {
    color: var(--accent-color);
    font-size: 0.9rem;
}

/* =============== التصميم المتجاوب =============== */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
        position: relative;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-verse {
        padding: 1rem 1.5rem;
    }

    .hero-verse p {
        font-size: 1.4rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .book-container {
        flex-direction: column;
    }

    .nav-btn {
        width: 44px;
        height: 44px;
    }

    .navigation-buttons {
        gap: 0.8rem;
    }

    .page-flip-container img {
        max-height: 50vh;
    }

    .adhkar-cards-grid {
        grid-template-columns: 1fr;
    }

    .adhkar-tab-btn { padding: 0.6rem 1rem; font-size: 0.85rem; }

    .adhkar-card .card-text {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .hero-icon {
        font-size: 3rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .nav-brand span {
        display: none;
    }

    .control-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* =============== تأثيرات الظهور عند التمرير =============== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =============== تأثيرات خاصة =============== */
.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px var(--accent-color), 0 0 10px var(--accent-color);
    }
    to {
        text-shadow: 0 0 10px var(--accent-color), 0 0 20px var(--accent-color), 0 0 30px var(--accent-color);
    }
}

/* =============== زر الرجوع للأعلى =============== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    background: rgba(10, 22, 40, 0.9);
    color: var(--accent-color);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent-color);
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* شريط التمرير المخصص */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

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

::-webkit-scrollbar-thumb:hover {
    background: #c9a227;
}

