/* ===================================================================
   🎨 مدونتي الجامعية - تنسيقات كاملة ومدمجة ومحدثة لهوية المنصة
   =================================================================== */

/* ========== 1. الأساسيات ومتغيرات الألوان المحدثة ========== */
:root {
    /* التموج البرتقالي المعتمد للمنصة */
    --gradient-start: #f19332;
    --gradient-end: #ee7711;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dark {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cairo', sans-serif;
}

/* ========== 2. المكونات الأساسية والعناصر الزجاجية ========== */
#loading-indicator i { color: #ee7711 !important; } /* تم التحديث للبرتقالي */
.home-subtitle { font-family: 'Cairo', sans-serif !important; }

.glass-card {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.gradient-bg { background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); }
.gradient-text {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text; 
    background-clip: text; 
    -webkit-text-fill-color: transparent;
}

/* ========== 3. الشريط الجانبي والأنماط والحركات ========== */
#sidebar { transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.sidebar-overlay { transition: opacity 0.3s ease; }

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(238, 119, 17, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(238, 119, 17, 0); }
    100% { box-shadow: 0 0 0 0 rgba(238, 119, 17, 0); }
}
@keyframes slideIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slide-down { from { opacity: 0; transform: translateY(-100%); } to { opacity: 1; transform: translateY(0); } }
.animate-slide-down { animation: slide-down 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

.hero-pattern { 
    background-color: var(--bg-primary);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ee7711' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ========== 4. أداء وتناسق تباعد بطاقات المحتوى ========== */
.content-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100% !important; 
    display: flex !important; 
    flex-direction: column !important;
}
.content-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 20px 40px -12px rgba(238, 119, 17, 0.25); 
}
.content-card .p-5 { 
    flex-grow: 1 !important; 
    display: flex !important; 
    flex-direction: column !important; 
    justify-content: space-between !important; 
}

.book-cover, .quiz-cover, .article-cover {
    aspect-ratio: 16 / 7 !important; 
    height: auto !important; 
    width: 100% !important; 
    object-fit: cover !important;
}

/* ========== 5. التقييم والنجوم ========== */
.rating-star { cursor: pointer; transition: all 0.2s ease; }
.rating-star:hover { transform: scale(1.2); }
.star-rating { color: #fbbf24; }
.star-btn { cursor: pointer; transition: transform 0.1s; }
.star-btn:hover { transform: scale(1.2); }

/* ========== 6. أشرطة التمرير الأنيقة ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); border-radius: 4px; }

.no-scrollbar::-webkit-scrollbar { height: 5px; width: 5px; }
.no-scrollbar::-webkit-scrollbar-track { background: transparent; }
.no-scrollbar::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.2); border-radius: 10px; }

.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: var(--bg-primary); border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); border-radius: 10px; }

/* ========== 7. قص وعرض النصوص ========== */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ========== 8. حقلونتائج البحث المتقدم المطور ========== */
.search-results {
    position: absolute; top: 100%; right: 0; left: 0; background: var(--bg-secondary);
    border: 1px solid var(--border-color); border-radius: 1rem; box-shadow: var(--card-shadow);
    max-height: 500px; overflow-y: auto; z-index: 40; margin-top: 8px;
}
#search-context-indicator { transition: all 0.3s ease; }
#mobile-search:disabled { opacity: 0.6; cursor: not-allowed; background-color: var(--bg-primary); }
.search-result-item { transition: all 0.2s ease; }
.search-result-item:hover { transform: translateX(-4px); background: var(--bg-primary); }
.search-type-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: 600; margin-right: 8px; }
.search-result-meta { font-size: 11px; opacity: 0.7; }
.search-options-btn { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); transition: all 0.2s; }
.search-options-btn:hover { color: var(--gradient-end); }
.search-options-panel { position: absolute; top: 100%; left: 0; width: 280px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 1rem; padding: 1rem; box-shadow: var(--card-shadow); z-index: 60; margin-top: 8px; }
.search-filter-option { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-color); }
.search-filter-option:last-child { border-bottom: none; }
.current-page-badge { background: var(--gradient-end); color: white; font-size: 10px; padding: 2px 8px; border-radius: 10px; margin-right: 8px; }

/* ========== 9. القوائم المنسدلة البرمجية الثابتة ========== */
.dropdown-menu {
    position: absolute; top: 100%; left: 0; background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: 1rem; box-shadow: var(--card-shadow); min-width: 200px; z-index: 50;
    opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.2s ease;
}
.dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(5px); }
.dropdown-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; color: var(--text-primary); text-decoration: none; transition: all 0.2s; border-bottom: 1px solid var(--border-color); }
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: var(--bg-primary); }
.dropdown-item i { width: 20px; text-align: center; }

/* ========== 10. تبويبات لوحات التحكم ========== */
.admin-tabs-dropdown { position: relative; display: inline-block; }
.admin-tabs-dropdown-btn { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 0.75rem; color: var(--text-primary); cursor: pointer; font-weight: 500; transition: all 0.2s; }
.admin-tabs-dropdown-btn:hover { background: var(--bg-primary); }
.admin-tabs-dropdown-content { position: absolute; top: 100%; right: 0; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 1rem; box-shadow: var(--card-shadow); min-width: 200px; z-index: 50; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.2s ease; }
.admin-tabs-dropdown-content.show { opacity: 1; visibility: visible; transform: translateY(5px); }

/* ========== 11. الجداول الإدارية الموحدة ========== */
.admin-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.admin-table th { background: var(--bg-primary); padding: 1rem; font-weight: 600; font-size: 0.875rem; color: var(--text-secondary); border-bottom: 2px solid var(--border-color); text-align: right; }
.admin-table td { padding: 1rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.admin-table tr:hover { background: var(--bg-primary); }

/* ========== 12. النماذج والأزرار التفاعلية ========== */
.form-input { width: 100%; padding: 0.75rem 1rem; border-radius: 0.75rem; border: 1px solid var(--border-color); background: var(--bg-secondary); color: var(--text-primary); outline: none; transition: all 0.2s; }
.form-input:focus { border-color: #ee7711; box-shadow: 0 0 0 3px rgba(238, 119, 17, 0.1); }
.btn-primary { background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); color: white; padding: 0.75rem 1.5rem; border-radius: 0.75rem; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(238, 119, 17, 0.2); }

/* ========== 13. الرتب وشارات الصلاحيات ========== */
.nav-item i { transition: transform 0.3s ease; }
.nav-item:hover i { transform: scale(1.2) rotate(-5deg); }
.role-badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 11px; font-weight: 800; margin-top: 6px; }
.badge-super_admin { background: #fee2e2; color: #ef4444; border: 1px solid #fecaca; }
.badge-admin { background: #e0f2fe; color: #0284c7; border: 1px solid #bae6fd; }
.badge-editor { background: #fef3c7; color: #d97706; border: 1px solid #fde68a; }
.badge-viewer { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.comment-bubble { background: var(--bg-primary); border-radius: 1.5rem; padding: 1.25rem; border: 1px solid var(--border-color); margin-bottom: 1rem; }

/* ========== 14. قوة كلمة المرور والتحقق ========== */
.password-strength { height: 4px; border-radius: 2px; margin-top: 4px; transition: all 0.3s; }
.strength-weak { background: #ef4444; width: 25%; }
.strength-medium { background: #f59e0b; width: 50%; }
.strength-strong { background: #10b981; width: 75%; }
.strength-very-strong { background: #3b82f6; width: 100%; }
.confirm-password-match { color: #10b981; font-size: 0.75rem; margin-top: 0.25rem; }
.confirm-password-mismatch { color: #ef4444; font-size: 0.75rem; margin-top: 0.25rem; }
.email-validation { margin-top: 0.25rem; font-size: 0.75rem; }
.email-validation.valid { color: #10b981; }
.email-validation.invalid { color: #ef4444; }
.email-checking { color: #f59e0b; }

/* ========== 15. سجل النشاطات الإدارية ========== */
.activity-log-item { padding: 1rem; border-bottom: 1px solid var(--border-color); transition: all 0.2s; }
.activity-log-item:hover { background: var(--bg-primary); }
.activity-badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; text-align: center; }
.activity-create { background-color: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.activity-update { background-color: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.activity-delete { background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.activity-login { background-color: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.activity-logout { background-color: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }

/* ========== 16. الفلاتر ولوحات الإحصائيات ========== */
.filter-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 1rem; padding: 1rem; margin-bottom: 1rem; }
.date-picker { border: 1px solid var(--border-color); border-radius: 0.75rem; padding: 0.5rem 1rem; background: var(--bg-secondary); color: var(--text-primary); width: 100%; }
.stats-card { background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); color: white; border-radius: 1rem; padding: 1rem; text-align: center; }

/* ========== 17. جدول المحتويات والقرائة المتقدمة ========== */
.toc-nav .toc-link { transition: all 0.2s ease; border-right-width: 2px; }
.toc-nav .toc-link:hover { padding-right: 0.9rem; border-right-color: #ee7711; }
.toc-nav .active-toc-item { background: rgba(238, 119, 17, 0.08); border-right-color: #ee7711 !important; }
#reading-progress-container { z-index: 45; }
.scroll-mt-24 { scroll-margin-top: 100px; }
body.overflow-hidden { overflow: hidden; }
.active\:scale-98:active { transform: scale(0.98); }

/* ========== 18. تنسيقات هيكلة المقالات والأكواد ========== */
.article-content { font-family: 'Cairo', sans-serif; line-height: 1.8; }
.article-content h2 { font-size: 1.75rem; font-weight: 800; margin-top: 2rem; margin-bottom: 1rem; padding-right: 0.75rem; border-right: 4px solid #ee7711; }
.article-content h3 { font-size: 1.4rem; font-weight: 700; margin-top: 1.5rem; margin-bottom: 0.75rem; }
.article-content h4 { font-size: 1.2rem; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.5rem; color: #ee7711; }
.article-content p { margin-bottom: 1.25rem; font-size: 1.05rem; line-height: 1.75; }
.article-content ul, .article-content ol { margin: 1rem 0 1.5rem 0; padding-right: 1.5rem; }
.article-content li { margin-bottom: 0.5rem; line-height: 1.6; }
.article-content blockquote { border-right: 4px solid #ee7711; background: rgba(238, 119, 17, 0.05); padding: 1rem 1.5rem; margin: 1.5rem 0; border-radius: 1rem; font-style: italic; }
.article-content img { max-width: 100%; height: auto; border-radius: 1rem; margin: 1.5rem 0; }
.article-content code { background: #f1f5f9; padding: 0.2rem 0.4rem; border-radius: 0.5rem; font-family: monospace; font-size: 0.9rem; color: #ef4444; }
.dark .article-content code { background: #1e293b; color: #f87171; }
.dark .article-content blockquote { background: rgba(238, 119, 17, 0.1); }

/* ========== 19. تباعد وحشو الشبكة العامة ========== */
#page-container .grid, #page-container .grid-cols-1, #page-container .grid-cols-2, #page-container .grid-cols-3, #page-container .grid-cols-4 {
    display: grid !important; row-gap: 1rem !important; column-gap: 0.5rem !important; align-items: stretch !important;
}

/* ========== 20. تأثيرات وتوهج تصنيفات الأقسام ========== */
.glow-red { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.08); }
.glow-blue { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.08); }
.glow-green { box-shadow: 0 4px 20px rgba(34, 197, 94, 0.08); }
.glow-purple { box-shadow: 0 4px 20px rgba(168, 85, 247, 0.08); }
.glow-amber { box-shadow: 0 4px 20px rgba(245, 158, 11, 0.08); }
.glow-orange { box-shadow: 0 4px 20px rgba(238, 119, 17, 0.08); }

.outline-red-500 { background-color: #ef4444; }
.outline-blue-500 { background-color: #3b82f6; }
.outline-emerald-500 { background-color: #10b981; }
.outline-purple-500 { background-color: #a855f7; }
.outline-amber-500 { background-color: #f59e0b; }
.outline-orange-500 { background-color: #ee7711; }

.bg-blue-500\/10 { background-color: rgba(59, 130, 246, 0.1); }
.bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.1); }
.bg-red-500\/10 { background-color: rgba(239, 68, 68, 0.1); }
.bg-amber-500\/10 { background-color: rgba(245, 158, 11, 0.1); }
.bg-purple-500\/10 { background-color: rgba(168, 85, 247, 0.1); }
.bg-orange-500\/10 { background-color: rgba(238, 119, 17, 0.1); }

.text-blue-400 { color: #60a5fa; }
.text-emerald-400 { color: #34d399; }
.text-red-400 { color: #f87171; }
.text-amber-400 { color: #fbbf24; }
.text-purple-400 { color: #c084fc; }
.text-orange-400 { color: #fb923c; }

.border-blue-500\/20 { border-color: rgba(59, 130, 246, 0.2); }
.border-emerald-500\/20 { border-color: rgba(16, 185, 129, 0.2); }
.border-red-500\/20 { border-color: rgba(239, 68, 68, 0.2); }
.border-amber-500\/20 { border-color: rgba(245, 158, 11, 0.2); }
.border-purple-500\/20 { border-color: rgba(168, 85, 247, 0.2); }
.border-orange-500\/20 { border-color: rgba(238, 119, 17, 0.2); }

/* ===================================================================
   21. 📅 FullCalendar - تنسيقات موحدة ومصلحة تماماً للتاريخين
   =================================================================== */

/* شريط توزيع خلايا أرقام الأيام لمنع تداخل الميلادي بالهجري */
.fc .fc-daygrid-day-number {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2px !important;
    gap: 0 !important;
    font-size: 12px !important; 
    font-weight: 700 !important; 
    font-family: 'Cairo', sans-serif !important;
    color: var(--text-secondary) !important;
}

.fc-miladi-day {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: var(--text-secondary) !important;
    line-height: 1.2 !important;
}

/* --- اليوم الحالي - تلوين الخلفية للميلادي فقط وحمايته من التمدد --- */
.fc .fc-day-today .fc-daygrid-day-number {
    background: transparent !important;
    border-radius: 0 !important;
    width: auto !important;
    height: auto !important;
    padding: 2px !important;
}

.fc .fc-day-today .fc-miladi-day {
    background-color: #f59e0b !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}
.dark .fc .fc-day-today .fc-miladi-day { background-color: #fbbf24 !important; color: #1e293b !important; }

/* التاريخ الهجري تحت الرقم - مستقل بدون خلفية ملونة وتناغم ألوان مريح */
.fc-hijri-month-label {
    text-align: center !important; font-size: 13px !important; font-weight: 600 !important;
    color: #64748b !important; margin-top: 3px !important; font-family: 'Cairo', sans-serif !important;
}
.dark .fc-hijri-month-label { color: #94a3b8 !important; }

.fc-hijri-date {
    display: block !important; font-size: 10px !important; font-weight: 600 !important;
    color: #64748b !important; line-height: 1.2 !important; text-align: center !important;
    margin-top: 1px !important; font-family: 'Cairo', sans-serif !important;
}
.dark .fc-hijri-date { color: #94a3b8 !important; }
.fc .fc-day-today .fc-hijri-date { margin-top: 2px !important; color: #64748b !important; background: transparent !important; }
.dark .fc .fc-day-today .fc-hijri-date { color: #94a3b8 !important; }

/* --- العناوين والأزرار والأيام للتقويم --- */
.fc .fc-toolbar-title {
    font-family: 'Cairo', sans-serif !important; font-size: 16px !important; font-weight: 800 !important;
    color: var(--text-primary) !important; text-align: center !important; white-space: nowrap !important;
}
.fc .fc-col-header-cell-cushion {
    font-family: 'Cairo', sans-serif !important; font-size: 12px !important; font-weight: 700 !important;
    color: #1e293b !important; white-space: nowrap !important; display: block !important;
    text-align: center !important; padding: 4px 0 !important; text-decoration: none !important;
}
.dark .fc .fc-col-header-cell-cushion { color: #e2e8f0 !important; }

.fc .fc-button {
    font-size: 12px !important; font-weight: 700 !important; font-family: 'Cairo', sans-serif !important;
    padding: 5px 10px !important; height: 30px !important; border-radius: 6px !important;
}
.fc .fc-button-primary { background-color: rgba(238, 119, 17, 0.08) !important; border: 1px solid rgba(238, 119, 17, 0.2) !important; color: #ee7711 !important; }
.fc .fc-button-primary:hover { background-color: #ee7711 !important; color: #ffffff !important; }
.fc .fc-button-active { background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)) !important; color: #ffffff !important; border-color: transparent !important; }

.fc .fc-col-header { background-color: #f1f5f9 !important; }
.dark .fc .fc-col-header { background-color: #1e293b !important; }
.fc .fc-col-header-cell { background-color: #f8fafc !important; border-bottom: 2px solid #e2e8f0 !important; padding: 8px 2px !important; }
.dark .fc .fc-col-header-cell { background-color: #0f172a !important; border-bottom: 2px solid #334155 !important; }

.fc .fc-day-today { background-color: rgba(251, 191, 36, 0.15) !important; border: 2px solid #f59e0b !important; }
.dark .fc .fc-day-today { background-color: rgba(251, 191, 36, 0.12) !important; border-color: #fbbf24 !important; }
.fc .fc-daygrid-day { transition: background-color 0.2s ease; }
.fc .fc-daygrid-day:hover { background-color: rgba(238, 119, 17, 0.02) !important; }
.fc .fc-daygrid-day-frame { min-height: 60px !important; }

.fc td, .fc th { border-color: var(--border-color) !important; }
.fc-theme-standard .fc-scrollgrid { border-color: var(--border-color) !important; border-radius: 0.75rem !important; overflow: hidden; }
.dark .fc td, .dark .fc th { border-color: #334155 !important; }
.dark .fc-theme-standard .fc-scrollgrid { border-color: #334155 !important; }
.dark .fc .fc-daygrid-day.fc-day-other { background-color: #0f172a !important; }

.fc-daygrid-event {
    font-size: 9px !important; font-weight: 700 !important; font-family: 'Cairo', sans-serif !important;
    padding: 2px 5px !important; border-radius: 4px !important; margin: 1px 2px !important;
    cursor: pointer !important; border: none !important;
}
.fc-daygrid-event:hover { transform: scale(1.02); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.fc .fc-daygrid-more-link { font-size: 0.7rem !important; font-weight: 700 !important; color: #ee7711 !important; }
.fc .fc-toolbar { display: flex !important; flex-wrap: nowrap !important; align-items: center !important; justify-content: space-between !important; gap: 4px !important; padding: 4px 2px !important; }

.fc .fc-list-day-cushion { background-color: rgba(238, 119, 17, 0.05) !important; padding: 10px 16px !important; font-weight: 700 !important; font-size: 0.85rem !important; color: #ee7711 !important; }
.dark .fc .fc-list-day-cushion { background-color: rgba(238, 119, 17, 0.1) !important; color: #fb923c !important; }
.fc .fc-list-event { cursor: pointer !important; padding: 10px 16px !important; border-bottom: 1px solid #e5e7eb !important; }
.dark .fc .fc-list-event { border-bottom-color: #374151 !important; }
.fc .fc-list-event-title { font-weight: 700 !important; font-size: 0.85rem !important; color: #1f2937 !important; }
.dark .fc .fc-list-event-title { color: #e5e7eb !important; }
.fc .fc-list-event-time { font-size: 0.75rem !important; color: #6b7280 !important; font-weight: 500 !important; }

/* ===================================================================
   22. 🔧 إصلاحات وثبات كلاسات الوضع الليلي الشاملة
   =================================================================== */

/* أزرار المظهر */
.fa-sun { display: none !important; }
.fa-moon { display: block !important; }
.dark .fa-sun { display: block !important; }
.dark .fa-moon { display: none !important; }

/* تصحيح صرامة ألوان المظهر الداكن الهجين */
.dark .text-gray-800 { color: #f1f5f9 !important; }
.dark .text-gray-700 { color: #e2e8f0 !important; }
.dark .text-gray-600 { color: #cbd5e1 !important; }
.dark .text-gray-500 { color: #94a3b8 !important; }
.dark .text-gray-400 { color: #94a3b8 !important; }

.dark .bg-gray-100 { background-color: #1e293b !important; }
.dark .bg-gray-50 { background-color: #0f172a !important; }
.dark .bg-white { background-color: #1e293b !important; }

.dark .border-gray-200 { border-color: #334155 !important; }
.dark .border-gray-100 { border-color: #1e293b !important; }

.dark input, .dark textarea, .dark select { background-color: #1e293b !important; color: #f1f5f9 !important; border-color: #334155 !important; }
.dark #mobile-search { background-color: #1e293b !important; color: #f1f5f9 !important; }
.dark ::placeholder { color: #64748b !important; }

.dark .dropdown-menu, .dark .admin-tabs-dropdown-content { background-color: #1e293b !important; border-color: #334155 !important; }
.dark .dropdown-item { color: #f1f5f9 !important; border-color: #334155 !important; }
.dark .dropdown-item:hover { background-color: #0f172a !important; }

.dark .admin-table th { background-color: #0f172a !important; }
.dark .admin-table td { border-color: #334155 !important; }
.dark .admin-table tr:hover { background-color: #1e293b !important; }

.dark #sidebar { background-color: #0f172a !important; }

/* ===================================================================
   23. 🔔 كتل إشعارات التوست المدعومة بالبلور والتأثير الزجاجي
   =================================================================== */
.toast {
    padding: 12px 20px !important;
    border-radius: 12px !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    animation: slideInRight 0.3s ease-out;
}

.toast-success, .toast.success, [class*="toast"][class*="success"] {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.toast-error, .toast.error, [class*="toast"][class*="error"] {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.toast-warning, .toast.warning, [class*="toast"][class*="warning"] {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.toast-info, .toast.info, [class*="toast"][class*="info"] {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

#toast-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    z-index: 9999 !important;
}

/* ===================================================================
   24. 📱 مرونة التجاوب الكامل مع الهواتف والشاشات الصغيرة
   =================================================================== */
@media (max-width: 480px) {
    #page-container .grid { row-gap: 1rem !important; column-gap: 0.5rem !important; }
    .content-card h3 { font-size: 0.85rem; line-height: 1.3; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
    .content-card p { font-size: 0.7rem; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
    .content-card .flex.gap-1 i, .content-card .flex.gap-1 span { font-size: 0.6rem; }
    .content-card .absolute.top-2.right-2 span { font-size: 0.6rem; padding: 0.2rem 0.4rem; }
    .content-card .bg-gradient-to-br i { font-size: 2rem; }
    .book-cover, .quiz-cover, .article-cover { aspect-ratio: 3/4; }
    .content-card button, .content-card a { padding: 0.5rem 0.25rem !important; font-size: 0.65rem !important; }
    .content-card button i, .content-card a i { font-size: 0.6rem !important; }
}

@media (max-width: 640px) {
    .glass-card select { font-size: 14px !important; padding: 0.5rem 0.75rem !important; }
    .flex.flex-col.md\\:flex-row.md\\:items-center.justify-between { margin-bottom: 1rem !important; }
    .pt-24 { padding-top: 5rem !important; }
    .px-4 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
    .fc .fc-col-header-cell-cushion { font-size: 10px !important; }
    .fc .fc-daygrid-day-number { font-size: 10px !important; }
    .fc-hijri-date { font-size: 8px !important; }
    .fc-daygrid-event { font-size: 7px !important; padding: 1px 3px !important; }
    .fc .fc-toolbar-title { font-size: 14px !important; }
    .fc-hijri-month-label { font-size: 11px !important; }
}

@media (max-width: 480px) {
    .fc .fc-button { font-size: 10px !important; padding: 4px 6px !important; height: 26px !important; }
    .fc .fc-toolbar-title { font-size: 13px !important; }
    .fc .fc-col-header-cell-cushion { font-size: 9px !important; }
    .fc .fc-daygrid-day-number { font-size: 9px !important; }
    .fc-hijri-date { font-size: 7px !important; }
    .fc .fc-day-today .fc-miladi-day { width: 18px !important; height: 18px !important; font-size: 10px !important; }
}

@media (min-width: 641px) and (max-width: 768px) {
    #page-container .grid { row-gap: 1rem !important; column-gap: 0.75rem !important; }
    .content-card h3 { font-size: 1rem; }
    .content-card p { font-size: 0.8rem; -webkit-line-clamp: 2; }
}

@media (min-width: 1024px) { #page-container .grid { row-gap: 1rem !important; column-gap: 0.75rem !important; } }
@media (min-width: 1536px) { .container { max-width: 1400px !important; } #page-container .grid { row-gap: 1.25rem !important; column-gap: 1rem !important; } }
@media (max-width: 360px) { .fc .fc-button { font-size: 8px !important; padding: 3px 5px !important; height: 24px !important; } .fc .fc-toolbar-title { font-size: 11px !important; } }
