/* ===== SIDEBAR INFO CSS ===== */
/* تصميم موحد للشريط الجانبي في صفحات info.php و faq.php */

/* الشريط الجانبي الأساسي */
.sidebar {
    width: 320px;
    background: linear-gradient(180deg, #1a202c 0%, #2d3748 100%);
    position: fixed;
    right: 0;
    top: 0;
    height: calc(100vh - 70px);
    overflow-y: auto;
    z-index: 1000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    visibility: visible;
    opacity: 1;
}

/* حالة الإخفاء للsidebar */
.sidebar.collapsed {
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed + .faq-content-area,
.sidebar.collapsed + .info-content-area {
    margin-right: 0;
}

/* تحديث margin للمحتوى عند إخفاء الsidebar */
.faq-content-area,
.info-content-area {
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* محتوى الشريط الجانبي */
.sidebar-content {
    padding: 1.5rem 1rem;
}

/* أقسام الشريط الجانبي */
.sidebar-section {
    position: relative;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-section:hover {
    transform: translateX(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.sidebar-section.active {
    background: var(--ai-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.sidebar-section.active .section-link {
    background: transparent;
    color: white;
}

.sidebar-section.active .section-desc {
    color: rgba(255, 255, 255, 0.9);
}

/* رابط القسم */
.section-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    gap: 1rem;
}

.section-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.section-link::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background: var(--ai-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    transition: width 0.3s ease;
    z-index: -1;
    border-radius: 12px;
}

.section-link:hover::before {
    width: 100%;
}

/* أيقونة القسم */
.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.section-link:hover .section-icon {
    transform: scale(1.1);
}

/* محتوى القسم */
.section-content {
    flex: 1;
    min-width: 0;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.section-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* إحصائيات القسم */
.section-stats {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.stat-value {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75rem;
    min-width: 24px;
    text-align: center;
}

.sidebar-section.active .stat-value {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile Sidebar Overlay */
.sidebar-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1999;
    display: none;
    cursor: pointer;
    pointer-events: none;
}

.sidebar-mobile-overlay.show {
    pointer-events: all;
}

/* ضبط الـ sidebar للعمل مع الهايدر الموحد */
.sidebar {
    top: 70px;
    height: calc(100vh - 70px);
    z-index: 999;
}

/* ضبط الشريط الجانبي للمسجلين */
.has-modern-header .sidebar {
    top: 70px !important;
    height: calc(100vh - 70px) !important;
    z-index: 999 !important;
}

.has-modern-header .sidebar.show {
    top: 60px !important;
    height: calc(100vh - 70px) !important;
    transform: translateX(0) !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ضبط الشريط الجانبي للزوار غير المسجلين */
.guest-layout .sidebar {
    top: 140px !important;
    height: calc(100vh - 140px) !important;
    z-index: 999 !important;
}

.guest-layout .sidebar.show {
    top: 140px !important;
    height: calc(100vh - 140px) !important;
    transform: translateX(0) !important;
    visibility: visible !important;
    opacity: 1 !important;
}



.guest-layout .faq-content-area,
.guest-layout .info-content-area {
    margin-right: 320px !important;
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* تجاوب الجوال */
@media (max-width: 1200px) {
    .sidebar {
        transform: translateX(100%);
        z-index: 2000;
        transition: transform 0.3s ease;
        display: block !important;
        /* إخفاء الشريط الجانبي افتراضياً في الجوال */
    }
    
    .sidebar.show {
        transform: translateX(0) !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 2001 !important;
    }
    
    .faq-content-area,
    .info-content-area {
        margin-right: 0;
    }
    
    .guest-layout .faq-content-area,
    .guest-layout .info-content-area {
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .sidebar-mobile-overlay.show {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: all !important;
    }
    
    /* إظهار زر الشريط الجانبي في الجوال */
    .mobile-sidebar-toggle {
        display: inline-flex !important;
        margin-left: 8px !important;
        background: var(--ai-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%)) !important;
        color: #fff !important;
    }
    
    .mobile-sidebar-toggle i {
        color: #fff !important;
    }
    
    /* ضبط ترتيب الأزرار في الجوال */
    .header-right {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex-direction: row !important;
    }
    
    .mobile-menu-toggle {
        order: 1 !important;
    }
    
    .mobile-sidebar-toggle {
        order: 2 !important;
    }
    
    /* ضبط ترتيب الأزرار في الجوال للزوار */
    .navbar .navbar-toggler {
        order: 2 !important;
    }
    
    .navbar .mobile-sidebar-toggle {
        order: 1 !important;
    }
}

@media (max-width: 768px) {
    .sidebar-content {
        padding: 1rem 0.75rem;
    }
    
    .section-link {
        padding: 0.75rem 1rem;
    }
    
    .section-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 0.9rem;
    }
    
    .section-desc {
        font-size: 0.75rem;
    }
}

/* تحسينات للتمرير */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* متغيرات CSS */
:root {
    --ai-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* إصلاح مشكلة الفراغ العلوي للمستخدمين المسجلين */
/* إلغاء تأثير site-mode-alert للمستخدمين المسجلين */
.has-modern-header header {
    top: 0 !important;
}

/* ضمان عدم وجود فراغ إضافي للمستخدمين المسجلين */
.has-modern-header .main-container {
    margin-top: 0 !important;
}

.has-modern-header .info-content-area,
.has-modern-header .faq-content-area {
    margin-top: 0 !important;
} 

.mobile-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ai-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: #fff !important;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    margin-right: 8px;
    margin-left: 8px;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    cursor: pointer;
    z-index: 1001;
    order: 2;
    flex-shrink: 0;
}

/* ضبط لون الأيقونة داخل الزر */
.mobile-sidebar-toggle i {
    color: #fff !important;
}
.mobile-sidebar-toggle:hover {
    background: var(--ai-gradient, linear-gradient(135deg, #764ba2 0%, #667eea 100%));
    color: #fff;
}

/* ضبط ترتيب الأزرار في الهايدر */
.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ضبط ترتيب الأزرار في الهايدر للمسجلين */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-menu-toggle {
    order: 1;
    flex-shrink: 0;
}

.mobile-sidebar-toggle {
    order: 2;
    flex-shrink: 0;
}

/* ضبط الحاوية لتكون flex */
.header-right,
.navbar-nav,
.header-controls {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-direction: row !important;
}

/* ضبط لون الزر للمسجلين */
.header-right .mobile-sidebar-toggle {
    background: var(--ai-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%)) !important;
    color: #fff !important;
}

.header-right .mobile-sidebar-toggle i {
    color: #fff !important;
}

/* ضبط ترتيب الأزرار في الهايدر للزوار */
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ضبط ترتيب الأزرار في الهايدر للزوار */
.navbar .navbar-toggler {
    order: 2;
}

.navbar .mobile-sidebar-toggle {
    order: 1;
}
@media (min-width: 1200px) {
    .mobile-sidebar-toggle {
        display: none !important;
    }
    
    .sidebar {
        display: block !important;
    }
} 