/* Force light mode and prevent browser/system dark mode */
:root {
    color-scheme: light only;
}

/* Global gradient text fixes */
[class*="gradient-text"] {
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* Base styles */
body {
    font-family: 'Cairo', sans-serif;
    background-color: #f8fafc;
    transition: background 0.5s ease-in-out;
    overflow-x: hidden;
    /* Additional enforcement of light mode */
    forced-color-adjust: none;
}
.theme-bg-container {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    display: none;
    transition: opacity 0.5s ease-in-out;
    opacity: 0;
    pointer-events: none; /* Prevent background from capturing mouse events */
}
.theme-bg-container.active { display: block; opacity: 1; }
.theme-bg-container.interactive { pointer-events: auto; }
header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-color: #e2e8f0;
}
.main-gradient-text {
    background: linear-gradient(to right, #3b82f6, #1e40af);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
}
.subject-card {
    border: 1px solid #e2e8f0;
    background-color: white;
    border-radius: 1.25rem;
    padding: 2rem 1.5rem;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 700;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    color: #1e293b;
    display: block; /* Ensure <a> tags behave like divs */
}
@media (min-width: 768px) { .subject-card { font-size: 1.25rem; } }
.subject-card:not(.cursor-not-allowed):hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
    color: #2563eb;
}
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    z-index: 50;
    min-width: 220px;
    transition: all 0.3s ease-in-out;
    transform-origin: top right;
}
.dropdown-menu.hidden { transform: scale(0.95); opacity: 0; pointer-events: none; }

/* Unified Module Button Style */
.module-btn {
    width: 100%;
    max-width: 20rem; /* max-w-xs */
    font-weight: 700; /* font-bold */
    font-size: 1.125rem; /* text-lg */
    padding: 0.75rem 2rem; /* py-3 px-8 */
    border-radius: 0.75rem; /* rounded-xl */
    transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    color: white;
}
.module-btn:hover {
    transform: scale(1.05);
}

/* Keyframes */
@keyframes nebula-flow { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
@keyframes wave-flow { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }
@keyframes twinkle { 0%,100%{opacity:0} 50%{opacity:1} }
@keyframes shooting-star { 0% { transform: translateX(300vw) translateY(-50vh) rotate(225deg); opacity: 1; } 100% { transform: translateX(-50vw) translateY(100vh) rotate(225deg); opacity: 0; } }
@keyframes crystal-rotate { from { transform: rotate(0deg) scale(1); } to { transform: rotate(360deg) scale(1); } }
@keyframes garden-dream-flow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }


/* --- Base Theme System --- */
html[class*="theme-"] body { color: #e5e5e5; }
html[class*="theme-"] header { background-color: rgba(18, 18, 18, 0.7); border-color: rgba(255, 255, 255, 0.1); }
html[class*="theme-"] .subject-card { background-color: rgba(28, 28, 28, 0.5); border-color: rgba(255, 255, 255, 0.1); color: #d4d4d4;}
html[class*="theme-"] .subject-card.cursor-not-allowed { background-color: rgba(28, 28, 28, 0.2); color: #525252; }
html[class*="theme-"] .dropdown-menu { background-color: rgba(25, 25, 25, 0.8); border-color: rgba(255, 255, 255, 0.15); backdrop-filter: blur(10px); }
html[class*="theme-"] .dropdown-menu a, html[class*="theme-"] .dropdown-menu button { color: #d4d4d4; }
html[class*="theme-"] .dropdown-menu a:hover, html[class*="theme-"] .dropdown-menu button:hover { background-color: rgba(255, 255, 255, 0.05); }
html[class*="theme-"] #logout-btn:hover { color: #ef4444; background-color: rgba(239, 68, 68, 0.1); }
html[class*="theme-"] #login-btn, html[class*="theme-"] #guest-login-btn, html[class*="theme-"] .text-gray-600, html[class*="theme-"] .text-gray-500, html[class*="theme-"] .font-semibold { color: #d4d4d4; }
html[class*="theme-"] .module-btn { color: white; }
html[class*="theme-"] #install-app-btn:hover { background-color: rgba(255, 255, 255, 0.05); }

/* Additional theme compatibility for text elements */
html[class*="theme-"] h1 { color: #d4d4d4; }
html[class*="theme-"] h2 { color: #d4d4d4; }
html[class*="theme-"] h3 { color: #d4d4d4; }
html[class*="theme-"] p { color: #d4d4d4; }
html[class*="theme-"] .text-gray-800 { color: #d4d4d4; }
html[class*="theme-"] .text-gray-700 { color: #d4d4d4; }
html[class*="theme-"] .text-gray-900 { color: #d4d4d4; }

/* --- Islamic Mode Theme Compatibility --- */
/* Light mode (default) */
.islamic-side-card {
    background: rgba(249, 250, 251, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Dark mode compatibility for all themes */
html[class*="theme-"] .islamic-side-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

/* Islamic elements in light mode */
#islamic-hadith-text { color: #1e293b; }
#islamic-hadith-sharh { color: #64748b; }
#islamic-hadith-source { color: #2563eb; }
#dua-title { color: #2563eb; }
#dua-text { color: #1e293b; }
#tasbeeh-text { color: #1e293b; }
#tasbeeh-count { color: #1e293b; }
#islamic-prayer-footer {
    display: none;
}
#islamic-prayer-times-grid { color: #1e293b; }

/* Islamic elements color adaptation */
html[class*="theme-"] #islamic-hadith-text { color: #d4d4d4; }
html[class*="theme-"] #islamic-hadith-sharh { color: #a3a3a3; }
html[class*="theme-"] #islamic-hadith-source { color: #fbbf24; }
html[class*="theme-"] #dua-title { color: #fbbf24; }
html[class*="theme-"] #dua-text { color: #d4d4d4; }
html[class*="theme-"] #tasbeeh-text { color: #d4d4d4; }
html[class*="theme-"] #tasbeeh-count { color: #d4d4d4; }
html[class*="theme-"] #islamic-prayer-footer { background-color: rgba(0, 0, 0, 0.5); border-color: rgba(255, 255, 255, 0.1); }
html[class*="theme-"] #islamic-prayer-times-grid { color: #d4d4d4; }

/* Theme-specific Islamic element colors */
html.theme-golden-charcoal #islamic-hadith-source,
html.theme-golden-charcoal #dua-title { color: #fbbf24; }

html.theme-space #islamic-hadith-source,
html.theme-space #dua-title { color: #f472b6; }

html.theme-ocean #islamic-hadith-source,
html.theme-ocean #dua-title { color: #67e8f9; }

html.theme-fireflies #islamic-hadith-source,
html.theme-fireflies #dua-title { color: #fde047; }

html.theme-dream-garden #islamic-hadith-source,
html.theme-dream-garden #dua-title { color: #fce7f3; }

html.theme-focus-study #islamic-hadith-source,
html.theme-focus-study #dua-title { color: #67e8f9; }

/* Theme-specific Islamic prayer footer colors */
html.theme-golden-charcoal #islamic-prayer-footer { background-color: rgba(217, 119, 6, 0.1); }
html.theme-space #islamic-prayer-footer { background-color: rgba(147, 51, 234, 0.1); }
html.theme-ocean #islamic-prayer-footer { background-color: rgba(2, 132, 199, 0.1); }
html.theme-fireflies #islamic-prayer-footer { background-color: rgba(202, 138, 4, 0.1); }
html.theme-dream-garden #islamic-prayer-footer { background-color: rgba(164, 80, 139, 0.1); }
html.theme-focus-study #islamic-prayer-footer { background-color: rgba(8, 145, 178, 0.1); }

/* Mobile Improvements for Islamic Mode */
@media (max-width: 768px) {
    /* إخفاء الدعاء في الموبايل */
    #islamic-dua-side-panel {
        display: none !important;
    }
    
    /* تحسين سلوك الهيدر في الامتحان */
    .header-hidden {
        transform: translateY(-100%) !important;
        transition: transform 0.3s ease-in-out !important;
    }
    
    /* تحسين الهيدر في الامتحان */
    header {
        transition: transform 0.3s ease-in-out !important;
    }
    
    /* تحسين العنوان في الهيدر */
    #quiz-header-title {
        font-size: 0.8rem !important;
        line-height: 1.2 !important;
        max-width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        padding: 0 0.3rem !important;
    }
    
    /* تحسين عنوان المحاضرة في الهيدر */
    #quiz-header-title {
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
        max-width: 100% !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        hyphens: auto !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        padding: 0 0.5rem !important;
    }
    
    /* تصغير التسبيح وجعله فقاعة صغيرة */
    #islamic-tasbeeh-side-panel {
        position: fixed !important;
        top: auto !important;
        bottom: 90px !important;
        right: 10px !important;
        transform: none !important;
        z-index: 40 !important;
    }
    
    #tasbeeh-btn {
        width: 60px !important;
        height: 60px !important;
        background: rgba(255,255,255,0.95) !important;
        border: 2px solid #2563eb !important;
        box-shadow: 0 2px 8px 0 rgba(59,130,246,0.10) !important;
    }
    
    #tasbeeh-text {
        font-size: 0.7rem !important;
        line-height: 1 !important;
    }
    
    #tasbeeh-count {
        font-size: 1.2rem !important;
    }
    
    /* تحسين مواقيت الصلاة */
    #islamic-prayer-footer {
        position: fixed !important;
        bottom: 48px !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 30 !important;
        padding: 1.2rem 1rem 1.2rem 1rem !important;
        min-height: 110px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background-color: rgba(255, 255, 255, 0.9) !important;
        backdrop-filter: blur(10px) !important;
        border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    }
    
    #islamic-prayer-times-grid {
        display: grid !important;
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 0.5rem !important;
        width: 100% !important;
        max-width: 600px !important;
        margin: 0 auto !important;
    }
    
    #islamic-prayer-times-grid p {
        font-size: 0.7rem !important;
        text-align: center !important;
    }
    
    /* إضافة مساحة أسفل المحتوى لتجنب تداخل مواقيت الصلاة */
    main {
        padding-bottom: 60000rem !important;
    }
    
    /* إخفاء مواقيت الصلاة عندما لا يكون الوضع الإسلامي مفعل */
    #islamic-prayer-footer:not(.active) {
        display: none !important;
    }
    
    /* تحسين مواقيت الصلاة في الثيمات المختلفة */
    html[class*="theme-"] #islamic-prayer-footer {
        background-color: rgba(0, 0, 0, 0.8) !important;
        backdrop-filter: blur(15px) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    html[class*="theme-"] #islamic-prayer-times-grid p {
        color: #d4d4d4 !important;
    }
    
    /* تحسين الساعة الإسلامية */
    #islamic-clock {
        font-size: 3rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* تحسين زر التسبيح في الثيمات المختلفة */
    html[class*="theme-"] #tasbeeh-btn {
        background-color: rgba(28,28,28,0.7) !important;
        border-color: #fbbf24 !important;
        backdrop-filter: blur(10px) !important;
    }
    
    html[class*="theme-"] #tasbeeh-text,
    html[class*="theme-"] #tasbeeh-count {
        color: #fbbf24 !important;
    }
    
    /* تحسين الحديث */
    #islamic-hadith-text {
        font-size: 1.1rem !important;
        line-height: 1.6 !important;
    }
    
    #islamic-hadith-sharh {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
    }
    
    #islamic-hadith-source {
        font-size: 0.8rem !important;
    }
}

/* Islamic Mode Toggle Theme Compatibility */
.toggle-switch {
    width: 50px;
    height: 26px;
    appearance: none;
    background-color: #d1d5db;
    border-radius: 9999px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.toggle-switch:checked {
    background-color: #2563eb;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease-in-out;
}

.toggle-switch:checked::after {
    transform: translateX(24px);
}

/* Theme-specific toggle colors */
html.theme-golden-charcoal .toggle-switch:checked { background-color: #d97706; }
html.theme-space .toggle-switch:checked { background-color: #9333ea; }
html.theme-ocean .toggle-switch:checked { background-color: #0284c7; }
html.theme-fireflies .toggle-switch:checked { background-color: #ca8a04; }
html.theme-dream-garden .toggle-switch:checked { background-color: #a4508b; }
html.theme-focus-study .toggle-switch:checked { background-color: #0891b2; }

/* Theme-specific tasbeeh ring colors */
html.theme-golden-charcoal #tasbeeh-progress-ring { stroke: #fbbf24; }
html.theme-space #tasbeeh-progress-ring { stroke: #f472b6; }
html.theme-ocean #tasbeeh-progress-ring { stroke: #67e8f9; }
html.theme-fireflies #tasbeeh-progress-ring { stroke: #fde047; }
html.theme-dream-garden #tasbeeh-progress-ring { stroke: #fce7f3; }
html.theme-focus-study #tasbeeh-progress-ring { stroke: #67e8f9; }

/* --- Theme Specific Button Colors --- */
/* Default button colors are set via Tailwind in index.html */

/* Golden Charcoal Theme */
html.theme-golden-charcoal .module-btn { background-color: #d97706; }
html.theme-golden-charcoal .module-btn:hover { background-color: #b45309; }

/* Space Theme */
html.theme-space .module-btn { background-color: #9333ea; }
html.theme-space .module-btn:hover { background-color: #7e22ce; }

/* Ocean Theme */
html.theme-ocean .module-btn { background-color: #0284c7; }
html.theme-ocean .module-btn:hover { background-color: #0369a1; }

/* Fireflies Theme */
html.theme-fireflies .module-btn { background-color: #ca8a04; }
html.theme-fireflies .module-btn:hover { background-color: #a16207; }

/* Dream Garden Theme */
html.theme-dream-garden .module-btn { background-color: #a4508b; }
html.theme-dream-garden .module-btn:hover { background-color: #853c6f; }

/* Focus Study Theme */
html.theme-focus-study .module-btn { background-color: #0891b2; }
html.theme-focus-study .module-btn:hover { background-color: #0e7490; }


/* Theme: Golden Charcoal */
html.theme-golden-charcoal body { background-color: #121212; }
.theme-golden-charcoal #bg-golden-charcoal { background-image: radial-gradient(ellipse 80% 80% at 5% 50%,hsla(40,90%,55%,.15) 0,transparent 50%),radial-gradient(ellipse 80% 80% at 95% 50%,hsla(38,90%,55%,.15) 0,transparent 50%),url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj48ZmlsdGVyIGlkPSJub2lzZSI+PGZlVHVyYnVsZW5jZSB0eXBlPSJmcmFjdGFsTm9pc2UiIGJhc2VGcmVxdWVuY3k9IjAuNzUiIG51bU9jdGF2ZXM9IjIiIHN0aXRjaFRpbGVzPSJzdGl0Y2giLz48L2ZpbHRlcj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZHRoPSIxMDAlIiBmaWx0ZXI9InVybCgjbm9pc2UpIiBvcGFjaXR5PSIwLjAyNSIvPjwvc3ZnPg=='); }
.theme-golden-charcoal h1 { color: #fff; }
.theme-golden-charcoal .main-gradient-text { background: linear-gradient(to right, #f59e0b, #fbbf24); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.theme-golden-charcoal .subject-card:not(.cursor-not-allowed):hover { border-color: #f59e0b; color: #fbbf24; }

/* Theme: Space */
html.theme-space body { background-color: #000; }
.theme-space #bg-space::before { content:''; position:absolute; width:200%; height:200%; top:-50%; left:-50%; z-index:1; background:radial-gradient(circle,hsla(260,100%,80%,.3) 0,hsla(330,100%,80%,.2) 40%,transparent 70%); animation:nebula-flow 45s linear infinite; }
.theme-space #bg-space::after { content:''; position:absolute; top:0; left:0; right:0; bottom:0; z-index:0; background-image:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAwIiBoZWlnaHQ9IjIwMDAiPjxkZWZzPjxyYWRpYWxHcmFkaWVudCBpZD0iZ3JhZCIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNTAlIj48c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjEiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMCIvPjwvcmFkaWFsR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9ImJsYWNrIi8+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCwwKSI+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjIiIGhlaWdodD0iMiIgZmlsbD0idXJsKCNncmFkKSIvPjwvZz48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1MDAsMjAwKSI+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEuNSIgaGVpZ2h0PSIxLjUiIGZpbGw9InVybCgjZ3JhZCkiLz48L2c+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTUwMCwxODAwKSI+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkKSIvPjwvZz48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMDAwLDEwMDApIj48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMS4yIiBoZWlnaHQ9IjEuMiIgZmlsbD0idXJsKCNncmFkKSIvPjwvZz48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg4MDAsMTYwMCkiPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIwLjgiIGhlaWdodD0iMC44IiBmaWxsPSJ1clIoI2dyYWQpIi8+PC9nPjwvZz48L3N2Zz4=') }
.star { position:absolute; background-color:#fff; border-radius:50%; animation-name:twinkle; animation-timing-function:ease-in-out; animation-iteration-count:infinite }
.shooting-star { position:fixed; width:2px; height:100px; background:linear-gradient(to top,transparent,#fff); animation-name:shooting-star; animation-timing-function:linear; animation-iteration-count:infinite; z-index:0 }
.theme-space .main-gradient-text { background: linear-gradient(to right, #a78bfa, #f472b6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.theme-space .subject-card:not(.cursor-not-allowed):hover { border-color: #a78bfa; color: #f472b6; }

/* Theme: Ocean */
html.theme-ocean body { background-color: #020617; }
.wave { position:absolute; left:0; bottom:0; width:200%; height:100vh; background-repeat:repeat-x; background-position: bottom; }
#wave1 { background-image:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjAwIDMwMCI+PHBhdGggZmlsbD0iIzA4MmY0OSIgb3BhY2l0eT0iMC41IiBkPSJNMCAyNTBDMzAwIDMwMCA0MDAgMjAwIDYwMCAyNDBDODAwIDI4MCA5MDAgMjIwIDEyMDAgMjUwVjMwMEgweiIvPjwvc3ZnPg=='); animation:wave-flow 25s linear infinite; }
#wave2 { background-image:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjAwIDMwMCI+PHBhdGggZmlsbD0iIzBjNGE2ZSIgb3BhY2l0eT0iMC41IiBkPSJNMCAyNjBDMjgwIDMxMCA0MjAgMjEwIDYwMCAyNTBDNzgwIDI5MCA5MjAgMjMwIDEyMDAgMjYwVjMwMEgweiIvPjwvc3ZnPg=='); animation:wave-flow 20s linear infinite reverse; }
.theme-ocean .main-gradient-text { background: linear-gradient(to right, #38bdf8, #67e8f9); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.theme-ocean .subject-card:not(.cursor-not-allowed):hover { border-color: #38bdf8; color: #67e8f9; }

/* --- New Animated Themes --- */
/* Fireflies Theme */
html.theme-fireflies body { background-color: #011422; }
.theme-fireflies .main-gradient-text { background: linear-gradient(to right, #fef08a, #fde047); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.theme-fireflies .subject-card:not(.cursor-not-allowed):hover { border-color: #fef08a; color: #fde047; }

/* Dream Theme */
html.theme-dream-garden body {
    background: linear-gradient(-45deg, #4c0d6b, #a4508b, #e9a8a8, #a4508b, #4c0d6b);
    background-size: 400% 400%;
    animation: garden-dream-flow 15s ease infinite;
}
html.theme-dream-garden .main-gradient-text { background: linear-gradient(to right, #fbcfe8, #fce7f3); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
html.theme-dream-garden .subject-card:not(.cursor-not-allowed):hover { border-color: #fbcfe8; color: #fce7f3; }
.crystal-item { position: absolute; animation: crystal-rotate 30s linear infinite; filter: drop-shadow(0 0 15px white); transition: transform 0.3s; width: 60px; height: 60px; pointer-events: auto; }
.crystal-item:hover { transform: scale(1.2) rotate(15deg) !important; }

/* Focus Theme */
html.theme-focus-study body { background: #282a36; }
.theme-focus-study .main-gradient-text { background: linear-gradient(to right, #a5f3fc, #67e8f9); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.theme-focus-study .subject-card:not(.cursor-not-allowed):hover { border-color: #a5f3fc; color: #67e8f9; }

/* Islamic clock glow for each theme */
html.light #islamic-clock.islamic-glow {
    text-shadow: none !important;
    background: linear-gradient(to right, #3b82f6, #1e40af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}
html.theme-golden-charcoal #islamic-clock.islamic-glow {
    text-shadow: 0 0 18px #fbbf24, 0 0 8px #fff;
}
html.theme-space #islamic-clock.islamic-glow {
    text-shadow: 0 0 18px #a78bfa, 0 0 8px #f472b6;
}
html.theme-ocean #islamic-clock.islamic-glow {
    text-shadow: 0 0 18px #38bdf8, 0 0 8px #67e8f9;
}
html.theme-fireflies #islamic-clock.islamic-glow {
    text-shadow: 0 0 18px #fde047, 0 0 8px #fef08a;
}
html.theme-dream-garden #islamic-clock.islamic-glow {
    text-shadow: 0 0 18px #fbcfe8, 0 0 8px #a4508b;
}
html.theme-focus-study #islamic-clock.islamic-glow {
    text-shadow: 0 0 18px #67e8f9, 0 0 8px #a5f3fc;
}

/* --- Mixer Modal Custom Style --- */
#mixer-modal .mixer-step-title {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #2563eb;
    gap: 0.75rem;
}
#mixer-modal .mixer-step-number {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 60%, #1e40af 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 2px 8px 0 rgba(59,130,246,0.10);
}
#mixer-modal .mixer-source-card {
    background: #f1f5f9;
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1.5px solid #e0e7ef;
    transition: border 0.2s, box-shadow 0.2s;
}
#mixer-modal .mixer-source-card:hover {
    border: 1.5px solid #2563eb;
    box-shadow: 0 2px 8px 0 rgba(59,130,246,0.08);
}
#mixer-modal .mixer-source-card input[type="checkbox"] {
    accent-color: #2563eb;
    width: 1.3rem;
    height: 1.3rem;
}
#mixer-modal .mixer-source-card label {
    flex: 1;
    font-size: 1rem;
    color: #1e293b;
    cursor: pointer;
}
#mixer-modal .mixer-input {
    width: 3.5rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 0.75rem;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    margin: 0 0.5rem;
    padding: 0.3rem 0.2rem;
    transition: border 0.2s;
}
#mixer-modal .mixer-input:focus {
    border: 1.5px solid #2563eb;
    outline: none;
}
#mixer-modal .control-btn {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: #e0e7ef;
    color: #2563eb;
    font-size: 1.3rem;
    font-weight: bold;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}
#mixer-modal .control-btn:hover {
    background: #2563eb;
    color: #fff;
}
#mixer-modal #mixer-start-btn {
    font-size: 1.25rem;
    font-weight: bold;
    padding: 1rem 0;
    border-radius: 1rem;
    background: linear-gradient(90deg, #6366f1 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 4px 16px 0 rgba(59,130,246,0.10);
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    margin-top: 1.5rem;
}
#mixer-modal #mixer-start-btn:hover {
    background: linear-gradient(90deg, #2563eb 0%, #6366f1 100%);
    transform: scale(1.03);
    box-shadow: 0 8px 24px 0 rgba(59,130,246,0.13);
}
#mixer-modal .mixer-error {
    color: #ef4444;
    font-weight: bold;
    text-align: center;
    margin-top: 0.5rem;
    min-height: 1.5rem;
}
#mixer-modal .mixer-max-questions-info {
    color: #64748b;
    font-size: 0.95rem;
    text-align: center;
    margin-top: 0.3rem;
}
/* دعم الثيمات */
html[class*="theme-"] #mixer-modal .mixer-source-card {
    background: rgba(28,28,28,0.7);
    border-color: #444;
}
html[class*="theme-"] #mixer-modal .mixer-source-card label {
    color: #d4d4d4;
}
html[class*="theme-"] #mixer-modal .mixer-input {
    background: #222;
    color: #fff;
    border-color: #444;
}
html[class*="theme-"] #mixer-modal .control-btn {
    background: #333;
    color: #67e8f9;
}
html[class*="theme-"] #mixer-modal .control-btn:hover {
    background: #67e8f9;
    color: #222;
}
html[class*="theme-"] #mixer-modal #mixer-start-btn {
    background: linear-gradient(90deg, #6366f1 0%, #2563eb 100%);
    color: #fff;
}
html[class*="theme-"] #mixer-modal #mixer-start-btn:hover {
    background: linear-gradient(90deg, #2563eb 0%, #6366f1 100%);
}

/* دعم الثيمات لجملة الحقوق المثبتة في الأسفل */
html[class*="theme-"] #islamic-copyright-bar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0.7rem 0.5rem !important;
    min-height: 48px !important;
    background: rgba(28,28,28,0.85) !important;
    color: #fff !important;
    z-index: 100 !important;
    text-align: center !important;
    font-size: 1rem !important;
    border-top: 1px solid rgba(255,255,255,0.12) !important;
    transform: none !important;
}

/* مساحة أسفل الصفحة حتى لا يغطي شريط الحقوق أي محتوى */
main {
    padding-bottom: 48px !important;
}

/* إخفاء مواقيت الصلاة افتراضيًا */
#islamic-prayer-footer {
    display: none;
}

/* === شريط تواقيت الصلاة ملاصق وممتد === */
html:not([class*="theme-"]) #islamic-prayer-footer {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0.7rem 0.5rem !important;
    min-height: 48px !important;
    background: #fff !important;
    color: #2563eb !important;
    z-index: 100 !important;
    transform: none !important;
}

/* === الوضع النهاري: نص أزرق متدرج وخلفية بيضاء === */
html:not([class*="theme-"]) #islamic-prayer-footer {
    background: #fff !important;
    color: #2563eb !important;
}
html:not([class*="theme-"]) #islamic-prayer-footer #islamic-prayer-times-grid p {
    background: none !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-image: linear-gradient(to right, #3b82f6, #1e40af) !important;
    color: transparent !important;
    font-weight: bold !important;
}

html[class*="theme-"] #islamic-prayer-footer {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0.7rem 0.5rem !important;
    min-height: 48px !important;
    z-index: 100 !important;
    transform: none !important;
}

#islamic-copyright-bar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0.7rem 0.5rem !important;
    min-height: 48px !important;
    background: #fff !important;
    color: #2563eb !important;
    z-index: 100 !important;
    text-align: center !important;
    font-size: 1rem !important;
    border-top: 1px solid rgba(0,0,0,0.08) !important;
    transform: none !important;
}
html:not([class*="theme-"]) #islamic-copyright-bar {
    background: #fff !important;
    color: #2563eb !important;
    border-top: 1px solid rgba(0,0,0,0.08) !important;
}
html[class*="theme-"] #islamic-copyright-bar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0.7rem 0.5rem !important;
    min-height: 48px !important;
    background: rgba(28,28,28,0.85) !important;
    color: #fff !important;
    z-index: 100 !important;
    text-align: center !important;
    font-size: 1rem !important;
    border-top: 1px solid rgba(255,255,255,0.12) !important;
    transform: none !important;
}
