/* ===================================
   إعدادات عامة
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
}

/* ===================================
   شريط التنقل
   =================================== */

.navbar {
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #ffd700 !important;
}

/* ===================================
   قسم Hero
   =================================== */

.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-buttons {
    margin-top: 2rem;
}

.hero-image {
    text-align: center;
    opacity: 0.9;
}

/* ===================================
   Animations
   =================================== */

.animate-fade-in {
    animation: fadeIn 1s ease-in;
}

.animate-fade-in-delay {
    animation: fadeIn 1s ease-in 0.3s backwards;
}

.animate-fade-in-delay-2 {
    animation: fadeIn 1s ease-in 0.6s backwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* ===================================
   بطاقات الكورسات
   =================================== */

.course-card {
    border: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15) !important;
}

.course-card .course-icon {
    font-size: 4rem;
    color: #667eea;
    transition: transform 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.course-card .course-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.course-card:hover .course-icon {
    transform: scale(1.1) rotate(5deg);
}

.course-card:hover .course-logo {
    transform: scale(1.15);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.course-badge img {
    filter: brightness(0) invert(1);
}

.course-badge {
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.course-card-detailed {
    border: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    height: 100%;
}

.course-card-detailed:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.course-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
}

.course-features li {
    padding: 0.3rem 0;
}

/* ===================================
   العناوين والأقسام
   =================================== */

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

.section-subtitle {
    font-size: 1.1rem;
}

.page-header {
    padding: 100px 0 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ===================================
   الميزات (Features)
   =================================== */

.feature-box {
    padding: 2rem;
    transition: transform 0.3s ease;
}

.feature-box:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3.5rem;
    color: #667eea;
    margin-bottom: 1rem;
    display: block;
}

.feature-box h4 {
    color: #333;
    margin-bottom: 1rem;
}

/* ===================================
   صفحة الدروس
   =================================== */

.sidebar {
    min-height: calc(100vh - 76px);
    border-left: 1px solid #e0e0e0;
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
}

.sidebar h4 {
    color: #333;
    font-weight: 700;
    border-bottom: 2px solid #667eea;
    padding-bottom: 1rem;
}

.lesson-link {
    border: none !important;
    border-radius: 8px !important;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.lesson-link:hover {
    background-color: #e7f1ff !important;
    transform: translateX(-5px);
}

.lesson-link.active {
    background-color: #667eea !important;
    color: white !important;
}

.lesson-link.active i {
    color: white;
}

.main-content {
    min-height: calc(100vh - 76px);
}

.lesson {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.lesson.active {
    display: block;
}

.lesson-body {
    line-height: 1.8;
}

.lesson-body h4 {
    color: #667eea;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.lesson-body h5 {
    color: #555;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.lesson-body p {
    margin-bottom: 1rem;
    text-align: justify;
}

.lesson-body ul, .lesson-body ol {
    margin: 1rem 0;
    padding-right: 2rem;
}

.lesson-body li {
    margin-bottom: 0.5rem;
}

.lesson-body code {
    background-color: #f4f4f4;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.lesson-body pre {
    background-color: #2d2d2d;
    border-radius: 10px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    direction: ltr;
    text-align: left;
}

.lesson-body pre code {
    background: none;
    color: #f8f8f2;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.lesson-body table {
    margin: 1.5rem 0;
    width: 100%;
    border-collapse: collapse;
}

.lesson-body table th {
    background-color: #667eea;
    color: white;
    padding: 1rem;
    text-align: right;
}

.lesson-body table td {
    padding: 0.8rem;
    border-bottom: 1px solid #e0e0e0;
}

.lesson-body table tr:hover {
    background-color: #f8f9fa;
}

/* ===================================
   التنبيهات (Alerts)
   =================================== */

.alert {
    border-radius: 10px;
    border: none;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.alert-info {
    background-color: #e7f3ff;
    color: #004085;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

/* ===================================
   Footer
   =================================== */

footer {
    margin-top: auto;
}

footer h5 {
    margin-bottom: 1rem;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .sidebar {
        position: relative;
        top: 0;
        min-height: auto;
        max-height: none;
        border-left: none;
        border-bottom: 1px solid #e0e0e0;
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .course-card .course-icon {
        font-size: 3rem;
    }
    
    .feature-icon {
        font-size: 2.5rem;
    }
    
    .lesson-body pre {
        padding: 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .sidebar h4 {
        font-size: 1.25rem;
    }
}

/* ===================================
   Scrollbar Styling
   =================================== */

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* ===================================
   تحسينات إضافية
   =================================== */

.btn {
    border-radius: 25px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card {
    border-radius: 15px;
    border: none;
    overflow: hidden;
}

.shadow-sm {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ===================================
   تحسينات إضافية للتصميم
   =================================== */

.course-card-detailed {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.course-card-detailed:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15) !important;
}

.course-badge img {
    vertical-align: middle;
    filter: brightness(0) invert(1);
}

/* تحسينات للبطاقات */
.card:hover {
    transform: translateY(-5px);
}

/* تحسينات للشريط الجانبي */
.sidebar {
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

/* تحسينات للأزرار */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
}

/* تحسينات للتنبيهات */
.alert {
    border-right: 4px solid;
}

.alert-info {
    border-right-color: #0dcaf0;
}

.alert-success {
    border-right-color: #198754;
}

.alert-warning {
    border-right-color: #ffc107;
}

/* تحسينات للجداول */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
}

/* ===================================
   قسم النصائح (Tips Section)
   =================================== */

.tip-card {
    transition: all 0.3s ease;
    background: white;
    border-radius: 15px;
    overflow: hidden;
}

.tip-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
}

.tip-icon {
    font-size: 3rem;
    color: #667eea;
    text-align: center;
    margin-bottom: 1rem;
}

.tip-card .card-title {
    color: #333;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: right;
}

.tip-card .card-text {
    text-align: right;
    line-height: 2;
    color: #555;
}

.tip-card .card-text br {
    line-height: 2.5;
}

/* ===================================
   Programming Fields Section
   =================================== */

.field-card {
    transition: all 0.3s ease;
    border-radius: 15px !important;
}

.field-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.field-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.field-card .card-title {
    color: #333;
    font-weight: 700;
    font-size: 1.5rem;
}

.field-card .card-text {
    line-height: 1.8;
    color: #666;
    font-size: 0.95rem;
}

.field-card .list-unstyled li {
    padding: 0.5rem 0;
    color: #555;
}

/* ===================================
   About Platform Section
   =================================== */

#about {
    background-color: #f8f9fa;
}

#about .section-title {
    color: #667eea;
}

#about .lead {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #555;
}

#about ul {
    padding-right: 1.5rem;
}

#about ul li {
    padding: 0.3rem 0;
    color: #666;
}

/* ===================================
   Enhanced Tips Section
   =================================== */

#tips .tip-card {
    border-radius: 15px !important;
    transition: all 0.3s ease;
}

#tips .tip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

#tips .tip-icon {
    font-size: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

#tips .card-title {
    font-weight: 700;
    color: #333;
    font-size: 1.3rem;
}

#tips .card-text {
    line-height: 1.9;
    color: #555;
}

#tips .card-text strong {
    color: #333;
    font-weight: 600;
}

#tips .alert-info {
    border-radius: 15px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#tips .alert-info h4 {
    color: #1976d2;
    font-weight: 700;
}

#tips .alert-info .lead {
    color: #424242;
    font-style: italic;
    line-height: 1.8;
}

/* ===================================
   Responsive improvements
   =================================== */

@media (max-width: 768px) {
    .course-logo {
        width: 60px !important;
        height: 60px !important;
    }
    
    .tip-icon {
        font-size: 2.5rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .field-icon i {
        font-size: 3rem !important;
    }
    
    #about .lead {
        font-size: 1.1rem;
    }
}

/* ===================================
   Dark Mode
   =================================== */

body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .navbar {
    background-color: #2d2d2d !important;
}

body.dark-mode .card {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .sidebar {
    background-color: #2d2d2d !important;
    color: #e0e0e0;
}

body.dark-mode .lesson-body {
    color: #e0e0e0;
}

body.dark-mode .lesson-body h4,
body.dark-mode .lesson-body h5 {
    color: #667eea;
}

body.dark-mode .lesson-link {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
}

body.dark-mode .lesson-link:hover {
    background-color: #3d3d3d !important;
}

body.dark-mode .lesson-link.active {
    background-color: #667eea !important;
}

body.dark-mode .modal-content {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .form-control {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode .form-control:focus {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border-color: #667eea;
}

body.dark-mode .dropdown-menu {
    background-color: #2d2d2d;
    border-color: #444;
}

body.dark-mode .dropdown-item {
    color: #e0e0e0;
}

body.dark-mode .dropdown-item:hover {
    background-color: #3d3d3d;
    color: #e0e0e0;
}

/* ===================================
   Lesson Navigation Buttons
   =================================== */

.lesson-navigation {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

body.dark-mode .lesson-navigation {
    border-top-color: #444;
}

/* ===================================
   Navbar - لون أزرق خافت
   =================================== */

.navbar {
    background: linear-gradient(135deg, #4a6fa5 0%, #3d5a8f 100%) !important;
    transition: all 0.3s ease;
}

body.dark-mode .navbar {
    background: linear-gradient(135deg, #2d3f5f 0%, #1e2a3f 100%) !important;
}

/* ===================================
   Dark Mode - تحسينات احترافية
   =================================== */

body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode .card {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-color: #404040;
    transition: all 0.3s ease;
}

body.dark-mode .sidebar {
    background-color: #2d2d2d !important;
    color: #e0e0e0;
    border-color: #404040 !important;
}

body.dark-mode .lesson-body {
    color: #e0e0e0;
}

body.dark-mode .lesson-body h4,
body.dark-mode .lesson-body h5 {
    color: #7c9eff;
}

body.dark-mode .lesson-link {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
    border-color: #404040 !important;
}

body.dark-mode .lesson-link:hover {
    background-color: #3d3d3d !important;
}

body.dark-mode .lesson-link.active {
    background-color: #4a6fa5 !important;
    color: #ffffff !important;
}

body.dark-mode .modal-content {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-color: #404040;
}

body.dark-mode .form-control {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border-color: #404040;
    transition: all 0.3s ease;
}

body.dark-mode .form-control:focus {
    background-color: #1a1a1a;
    color: #e0e0e0;
    border-color: #4a6fa5;
    box-shadow: 0 0 0 0.2rem rgba(74, 111, 165, 0.25);
}

body.dark-mode .form-label {
    color: #e0e0e0;
}

body.dark-mode .dropdown-menu {
    background-color: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .dropdown-item {
    color: #e0e0e0;
}

body.dark-mode .dropdown-item:hover {
    background-color: #3d3d3d;
    color: #ffffff;
}

body.dark-mode .btn-primary {
    background: linear-gradient(135deg, #4a6fa5 0%, #3d5a8f 100%);
    border: none;
}

body.dark-mode .btn-primary:hover {
    background: linear-gradient(135deg, #5a7fb5 0%, #4d6a9f 100%);
}

body.dark-mode .page-header {
    background: linear-gradient(135deg, #4a6fa5 0%, #3d5a8f 100%);
}

body.dark-mode .hero-section {
    background: linear-gradient(135deg, #4a6fa5 0%, #3d5a8f 100%);
}

body.dark-mode .alert {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-mode .table {
    color: #e0e0e0;
}

body.dark-mode .table thead th {
    background-color: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .table tbody tr {
    border-color: #404040;
}

body.dark-mode .table tbody tr:hover {
    background-color: #3d3d3d;
}

body.dark-mode pre {
    background-color: #1a1a1a !important;
    border-color: #404040;
}

body.dark-mode code {
    color: #e0e0e0;
}

body.dark-mode .lesson-navigation {
    border-top-color: #404040;
}

/* Animation للتحويل بين الوضعين */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ===================================
   تحسينات النماذج
   =================================== */

.form-control:focus {
    border-color: #4a6fa5;
    box-shadow: 0 0 0 0.2rem rgba(74, 111, 165, 0.25);
}

.form-control.is-valid {
    border-color: #198754;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: block;
    font-size: 0.875rem;
    color: #dc3545;
}

.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 2px solid #e9ecef;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 2px solid #e9ecef;
}

body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: #404040;
}

/* ===================================
   تمييز بصري بين الدورات والكورسات
   =================================== */

/* الدورات المجانية */
.course-card-detailed:not(.paid-course) {
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.course-card-detailed:not(.paid-course):hover {
    border-color: #4a6fa5;
    transform: translateY(-5px);
}

.course-card-detailed:not(.paid-course) .course-badge {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

/* الكورسات المدفوعة */
.course-card-detailed.paid-course,
.course-card-detailed.border-warning {
    border: 3px solid #ffc107 !important;
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.3) !important;
}

.course-card-detailed.paid-course:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(255, 193, 7, 0.4) !important;
}

.course-card-detailed.paid-course .course-badge {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%) !important;
}

/* تحسينات Dark Mode */
body.dark-mode .course-card-detailed:not(.paid-course) {
    border-color: #404040;
}

body.dark-mode .course-card-detailed.paid-course {
    border-color: #ffc107 !important;
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.2) !important;
}

/* Toast Notifications */
.toast {
    z-index: 9999;
    min-width: 300px;
}

/* تحسينات النماذج */
.form-control-lg {
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
}

.input-group .btn {
    border-color: #dee2e6;
}

body.dark-mode .input-group .btn {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-mode .input-group .btn:hover {
    background-color: #3d3d3d;
}

/* ===================================
   تحسينات صفحة المشاريع
   =================================== */

.project-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15) !important;
    border-color: #4a6fa5;
}

.project-icon {
    transition: transform 0.3s ease;
}

.project-card:hover .project-icon {
    transform: scale(1.1) rotate(5deg);
}

/* ===================================
   تحسينات صفحة الكتب
   =================================== */

.book-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15) !important;
    border-color: #4a6fa5;
}

.book-icon {
    transition: transform 0.3s ease;
}

.book-card:hover .book-icon {
    transform: scale(1.15) rotate(-5deg);
}

/* Dark Mode للمشاريع والكتب */
body.dark-mode .project-card,
body.dark-mode .book-card {
    background-color: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .project-card:hover,
body.dark-mode .book-card:hover {
    border-color: #4a6fa5;
}

/* ===================================
   تحسينات صفحة المقالات
   =================================== */

.article-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15) !important;
    border-color: #4a6fa5;
}

.article-card .card-title {
    color: #333;
    font-weight: 600;
    transition: color 0.3s ease;
}

.article-card:hover .card-title {
    color: #4a6fa5;
}

/* Dark Mode للمقالات */
body.dark-mode .article-card {
    background-color: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .article-card:hover {
    border-color: #4a6fa5;
}

body.dark-mode .article-card .card-title {
    color: #e0e0e0;
}

body.dark-mode .article-card:hover .card-title {
    color: #7c9eff;
}

/* ===================================
   إصلاح Dropdown في الشاشات الصغيرة
   =================================== */

@media (max-width: 991.98px) {
    /* ضمان أن dropdown يعمل بشكل صحيح داخل القائمة المطوية */
    .navbar-collapse .dropdown-menu {
        position: static !important;
        float: none !important;
        width: 100% !important;
        margin-top: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        background-color: rgba(0, 0, 0, 0.2) !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0.5rem 0 !important;
        display: none !important;
        opacity: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: all 0.3s ease !important;
        visibility: hidden !important;
    }
    
    /* إظهار القائمة عند إضافة class "show" */
    .navbar-collapse .dropdown-menu.show {
        display: block !important;
        opacity: 1 !important;
        max-height: 500px !important;
        margin-top: 0.5rem !important;
        visibility: visible !important;
    }
    
    .navbar-collapse .dropdown-item {
        padding: 0.75rem 1.5rem !important;
        color: rgba(255, 255, 255, 0.9) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        display: block !important;
        width: 100% !important;
        text-align: right !important;
        white-space: nowrap !important;
    }
    
    .navbar-collapse .dropdown-item:hover,
    .navbar-collapse .dropdown-item:focus {
        background-color: rgba(255, 255, 255, 0.1) !important;
        color: #fff !important;
    }
    
    .navbar-collapse .dropdown-item:last-child {
        border-bottom: none !important;
    }
    
    .navbar-collapse .dropdown-divider {
        margin: 0.5rem 1.5rem !important;
        border-color: rgba(255, 255, 255, 0.2) !important;
        opacity: 1 !important;
    }
    
    /* إصلاح أيقونة dropdown */
    .navbar-collapse .dropdown-toggle::after {
        float: left !important;
        margin-top: 0.5rem !important;
        transition: transform 0.3s ease !important;
    }
    
    .navbar-collapse .dropdown-toggle[aria-expanded="true"]::after {
        transform: rotate(180deg) !important;
    }
}

/* Dark Mode للـ dropdown في الشاشات الصغيرة */
@media (max-width: 991.98px) {
    body.dark-mode .navbar-collapse .dropdown-menu {
        background-color: rgba(0, 0, 0, 0.4) !important;
    }
    
    body.dark-mode .navbar-collapse .dropdown-menu.show {
        background-color: rgba(0, 0, 0, 0.5) !important;
    }
    
    body.dark-mode .navbar-collapse .dropdown-item {
        color: rgba(255, 255, 255, 0.9) !important;
    }
    
    body.dark-mode .navbar-collapse .dropdown-item:hover,
    body.dark-mode .navbar-collapse .dropdown-item:focus {
        background-color: rgba(255, 255, 255, 0.15) !important;
        color: #fff !important;
    }
}
