/* ملف: css/style.css */

/* إعادة تعيين بسيطة لضمان التوافق بين المتصفحات */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* المتغيرات الديناميكية - محدثة وموحدة */
:root {
    --primary-color: var(--primary-color, #c8965c);
    --text-color: var(--text-color, #333);
    --link-color: var(--link-color, #007bff);
    --link-hover-color: var(--link-hover-color, #0056b3);
    --border-color: var(--border-color, #ddd);
    --secondary-text-color: #555; /* تحسين التباين */
    --light-text-color: #666; /* تحسين التباين */
}

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    direction: rtl;
    text-align: right;
    padding-bottom: 0px; /* مساحة للشريط الثابت */
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

.wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
	padding: 0;  /* إضافة هذا السطر */

}

/* Header Styles */
.main-header {
    background-color: var(--primary-color);
    text-align: center;
    padding: 0px 0;
}

.header-banner {
    max-width: 100%;
    height: auto;
	display: block;  /* إضافة هذا السطر لإزالة المساحات الإضافية */
    margin: 0;       /* إضافة هذا السطر */

}

/* Navigation Styles المحسنة */
.main-nav {
    background-color: #5a3c20;
    padding: 10px 0;
    position: relative;
}

.main-nav ul {
    list-style: none;
    text-align: center;
}

.main-nav ul li {
    display: inline-block;
    margin: 0 12px; /* تقليل المسافة */
}

.main-nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 1em; /* تقليل حجم الخط */
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    padding: 6px 12px; /* تقليل الحشو */
    border-radius: 4px; /* تقليل الانحناء */
    transition: all 0.3s ease;
}

.main-nav ul li a:hover {
    background-color: #7d5e3f;
    transform: translateY(-1px); /* تقليل الحركة */
    box-shadow: 0 2px 6px rgba(0,0,0,0.2); /* تقليل الظل */
}

/* قائمة الهامبرغر للهواتف */
.mobile-menu-toggle {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.15) 100%);
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    color: white;
    font-size: 1.3em;
    cursor: pointer;
    z-index: 1001;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    display: none; /* مخفية بشكل افتراضي */
}

/* تأثيرات التفاعل */
.mobile-menu-toggle:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.25) 100%);
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

/* إعدادات الاستجابة */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex; /* إظهار على الهواتف */
    }
    
    .main-nav ul {
        display: none; /* إخفاء القائمة العادية */
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none; /* إخفاء على الشاشات الكبيرة */
    }
    
    .main-nav ul {
        display: block; /* إظهار القائمة العادية */
    }
}


.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.mobile-nav-sidebar {
    position: fixed;
    top: 0;
    right: -280px; /* تقليل العرض */
    width: 280px;
    height: 100%;
    background: #5a3c20;
    z-index: 1001;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-nav-sidebar.active {
    right: 0;
}

.mobile-nav-header {
    background: var(--primary-color);
    padding: 10px; /* تقليل الحشو */
    text-align: center;
    color: white;
    font-family: 'El Messiri', sans-serif;
    font-size: 0.9em; /* تقليل الحجم */
    font-weight: 600;
    line-height: 1.2;
}

.mobile-nav-close {
    position: absolute;
    top: 12px;
    left: 12px;
    background: none;
    border: none;
    color: white;
    font-size: 1.3em; /* تقليل الحجم */
    cursor: pointer;
}

.mobile-nav-menu {
    list-style: none;
    padding: 15px 0; /* تقليل الحشو */
}

.mobile-nav-menu li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-nav-menu li a {
    display: block;
    padding: 12px 18px; /* تقليل الحشو */
    color: white;
    text-decoration: none;
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    font-size: 0.9em; /* تقليل الحجم */
    transition: background 0.3s ease;
}

.mobile-nav-menu li a:hover {
    background: rgba(255,255,255,0.1);
}

/* Main Content Area */
.main-content-area {
    display: flex;
    flex-grow: 1;
    flex-wrap: wrap;
    padding: 20px;
}

/* Sidebar Styles */
.sidebar {
    flex: 1;
    min-width: 250px;
    background-color: #f0f0f0;
    padding: 18px; /* تقليل الحشو */
    margin-inline-end: 18px;
}

.sidebar h3 {
    color: var(--primary-color);
    margin-bottom: 12px; /* تقليل المسافة */
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 6px; /* تقليل الحشو */
    font-family: 'El Messiri', sans-serif;
    font-size: 1.2em; /* تقليل الحجم */
    font-weight: 600;
}

.sidebar ul {
    list-style: none;
    margin-bottom: 18px; /* تقليل المسافة */
}

.sidebar ul li {
    margin-bottom: 6px; /* تقليل المسافة */
}

.sidebar ul li a {
    text-decoration: none;
    color: var(--secondary-text-color); /* تحسين التباين */
    padding: 6px 0; /* تقليل الحشو */
    display: block;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9em; /* تقليل الحجم */
    border-radius: 4px;
    padding-right: 8px; /* تقليل الحشو */
}

.sidebar ul li a:hover {
    color: var(--primary-color);
    background: rgba(200, 150, 92, 0.1);
    transform: translateX(-3px); /* تقليل الحركة */
}

/* Social Icons محسنة */
.social-icons {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 6px; /* تقليل المسافة */
    margin-bottom: 20px; /* تقليل المسافة */
    padding: 12px; /* تقليل الحشو */
    background: linear-gradient(135deg, var(--primary-color) 0%, #a07a4d 100%);
    border-radius: 8px; /* تقليل الانحناء */
    box-shadow: 0 2px 10px rgba(200, 150, 92, 0.3); /* تقليل الظل */
}

.social-icons a {
    transition: transform 0.3s ease;
    border-radius: 50%;
    overflow: hidden;
}

.social-icons a:hover {
    transform: scale(1.05) rotate(3deg); /* تقليل التأثير */
}

.social-icons img {
    width: 32px; /* تقليل الحجم */
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    box-shadow: 0 1px 6px rgba(0,0,0,0.2); /* تقليل الظل */
}

/* Search Form Sidebar محسنة */
.search-form-sidebar {
    margin-bottom: 12px; /* تقليل المسافة */
    background: white;
    padding: 10px; /* تقليل الحشو */
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* تقليل الظل */
    border: 1px solid #eee;
}

.search-form-sidebar input[type="text"] {
    width: 100%;
    padding: 6px 10px; /* تقليل الحشو */
    border: 2px solid #e0e0e0;
    border-radius: 4px; /* تقليل الانحناء */
    margin-bottom: 6px; /* تقليل المسافة */
    font-family: 'Cairo', sans-serif;
    font-size: 0.8em; /* تقليل الحجم */
    transition: all 0.3s ease;
    background: #fafafa;
}

.search-form-sidebar input[type="text"]:focus {
    border-color: var(--primary-color);
    background: white;
    outline: none;
    box-shadow: 0 0 0 2px rgba(200, 150, 92, 0.1); /* تقليل الظل */
}

.search-form-sidebar input[type="submit"] {
    width: 100%;
    padding: 6px 12px; /* تقليل الحشو */
    background: linear-gradient(135deg, var(--primary-color) 0%, #a07a4d 100%);
    color: white;
    border: none;
    border-radius: 4px; /* تقليل الانحناء */
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 0.8em; /* تقليل الحجم */
    transition: all 0.3s ease;
    margin-bottom: 6px; /* تقليل المسافة */
}

.search-form-sidebar input[type="submit"]:hover {
    background: linear-gradient(135deg, #a07a4d 0%, #8b6a42 100%);
    transform: translateY(-1px); /* تقليل الحركة */
    box-shadow: 0 2px 10px rgba(200, 150, 92, 0.4); /* تقليل الظل */
}

.search-form-sidebar select {
    width: 100%;
    padding: 6px 10px; /* تقليل الحشو */
    border: 2px solid #e0e0e0;
    border-radius: 4px; /* تقليل الانحناء */
    background-color: #fafafa;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 0.8em; /* تقليل الحجم */
    transition: all 0.3s ease;
}

.search-form-sidebar select:focus {
    border-color: var(--primary-color);
    background: white;
    outline: none;
    box-shadow: 0 0 0 2px rgba(200, 150, 92, 0.1); /* تقليل الظل */
}

/* Latest / Mixed Articles Sidebar */
.latest-articles-sidebar,
.mixed-articles-sidebar {
    margin-bottom: 20px; /* تقليل المسافة */
    background: white;
    padding: 12px; /* تقليل الحشو */
    border-radius: 8px; /* تقليل الانحناء */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* تقليل الظل */
    border: 1px solid #eee;
}

.latest-articles-sidebar ul,
.mixed-articles-sidebar ul {
    margin: 0;
}

.latest-articles-sidebar li,
.mixed-articles-sidebar li {
    padding: 6px 0; /* تقليل الحشو */
    border-bottom: 1px solid #f0f0f0;
}

.latest-articles-sidebar li:last-child,
.mixed-articles-sidebar li:last-child {
    border-bottom: none;
}

/* Statistics List */
.stats-list {
    list-style: none;
    background: white;
    padding: 15px; /* تقليل الحشو */
    border-radius: 8px; /* تقليل الانحناء */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* تقليل الظل */
    border: 1px solid #eee;
}

.stats-list li {
    font-size: 0.9em; /* تقليل الحجم */
    color: var(--secondary-text-color); /* تحسين التباين */
    margin-bottom: 8px; /* تقليل المسافة */
    padding: 6px 10px; /* تقليل الحشو */
    background: #f8f9fa;
    border-radius: 4px; /* تقليل الانحناء */
    border-right: 3px solid var(--primary-color);
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
}

/* Sidebar Banners محسنة */
.sidebar-banner {
    text-align: center;
    margin-bottom: 18px; /* تقليل المسافة */
    background: white;
    padding: 12px; /* تقليل الحشو */
    border-radius: 8px; /* تقليل الانحناء */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* تقليل الظل */
    border: 1px solid #eee;
    transition: transform 0.3s ease;
}

.sidebar-banner:hover {
    transform: translateY(-2px); /* تقليل الحركة */
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); /* تقليل الظل */
}

.sidebar-banner img {
    max-width: 100%;
    height: auto;
    border-radius: 6px; /* تقليل الانحناء */
    transition: all 0.3s ease;
    filter: brightness(0.95);
}

.sidebar-banner:hover img {
    filter: brightness(1);
    transform: scale(1.01); /* تقليل التأثير */
}

/* Content Section Styles */
.content-section {
    flex: 3;
    min-width: 300px;
    background-color: #fff;
    padding: 18px; /* تقليل الحشو */
    border: 1px solid #eee;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05); /* تقليل الظل */
}

.content-section h1,
.content-section h2 {
    color: var(--primary-color);
    margin-bottom: 18px; /* تقليل المسافة */
    font-family: 'El Messiri', sans-serif;
}

/* Separator Lines */
.separator-line {
    border-top: 1px dashed #ddd;
    margin: 15px 0; /* تقليل المسافة */
}

.search-line-separator {
    border-top: 1px solid #ccc;
    margin: 12px 0; /* تقليل المسافة */
    height: 1px;
}

/* Footer Styles */
.main-footer {
    background-color: #5a3c20;
    color: #fff;
    text-align: center;
    padding: 15px; /* تقليل الحشو */
    margin-top: 0px; /* تقليل المسافة */
	margin-bottom: 0;   /* إضافة هذا السطر */
    flex-shrink: 0;
}

.main-footer a {
    color: #fff;
    text-decoration: none;
}

.main-footer a:hover {
    text-decoration: underline;
}

/* تحسينات للصفحات الجديدة */
.main-section-header h1,
.section-header h1 {
    font-family: 'El Messiri', sans-serif;
    font-size: 1.6em; /* تقليل الحجم */
    margin: 18px 0; /* تقليل المسافة */
    border-radius: 6px; /* تقليل الانحناء */
    box-shadow: 0 1px 4px rgba(0,0,0,0.1); /* تقليل الظل */
}

.subsections-container {
    margin: 25px 0; /* تقليل المسافة */
}

.subsections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* تقليل العرض الأدنى */
    gap: 18px; /* تقليل المسافة */
    margin: 18px 0; /* تقليل المسافة */
}

.subsection-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px; /* تقليل الانحناء */
    padding: 18px; /* تقليل الحشو */
    box-shadow: 0 1px 4px rgba(0,0,0,0.05); /* تقليل الظل */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.subsection-card:hover {
    transform: translateY(-2px); /* تقليل الحركة */
    box-shadow: 0 3px 12px rgba(0,0,0,0.1); /* تقليل الظل */
}

.subsection-card h3 {
    margin: 0 0 8px 0; /* تقليل المسافة */
    font-size: 1.2em; /* تقليل الحجم */
}

.subsection-card h3 a {
    color: #333;
    text-decoration: none;
    font-family: 'Amiri', serif;
}

.subsection-card h3 a:hover {
    color: var(--primary-color);
}

.subsection-meta {
    color: var(--light-text-color); /* تحسين التباين */
    font-size: 0.85em; /* تقليل الحجم */
}

.article-count {
    background: var(--primary-color);
    color: white;
    padding: 2px 6px; /* تقليل الحشو */
    border-radius: 10px; /* تقليل الانحناء */
    font-size: 0.75em; /* تقليل الحجم */
}

.section-summary {
    text-align: center;
    margin: 25px 0; /* تقليل المسافة */
    padding: 12px; /* تقليل الحشو */
    background: #f8f9fa;
    border-radius: 6px; /* تقليل الانحناء */
    color: var(--light-text-color); /* تحسين التباين */
}

.no-content {
    text-align: center;
    padding: 30px 18px; /* تقليل الحشو */
    color: var(--light-text-color); /* تحسين التباين */
    background: #f8f9fa;
    border-radius: 6px; /* تقليل الانحناء */
    margin: 18px 0; /* تقليل المسافة */
}

.error-message {
    background: #ffe0e0;
    color: #d8000c;
    border: 1px solid #d8000c;
    padding: 18px; /* تقليل الحشو */
    border-radius: 6px; /* تقليل الانحناء */
    text-align: center;
    margin: 18px 0; /* تقليل المسافة */
}

/* تحسين الـ Pagination */
.pagination {
    margin: 30px 0; /* تقليل المسافة */
    text-align: center;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px; /* تقليل المسافة */
    margin-bottom: 12px; /* تقليل المسافة */
}

.pagination-link,
.pagination-current {
    display: inline-block;
    padding: 6px 10px; /* تقليل الحشو */
    margin: 0 1px; /* تقليل المسافة */
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 3px; /* تقليل الانحناء */
    transition: all 0.3s ease;
    font-size: 0.9em; /* تقليل الحجم */
}

.pagination-link {
    color: #333;
    background: #fff;
}

.pagination-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: bold;
}

.pagination-ellipsis {
    padding: 6px 3px; /* تقليل الحشو */
    color: var(--light-text-color); /* تحسين التباين */
}

.pagination-info {
    color: var(--light-text-color); /* تحسين التباين */
    font-size: 0.85em; /* تقليل الحجم */
    margin-top: 8px; /* تقليل المسافة */
}

/* أنماط نموذج إضافة التعليق */
.addnote-container {
    width: 100%;
    font-family: 'Cairo', sans-serif;
    font-size: 10pt;
    padding: 8px; /* تقليل الحشو */
}

.comment-form {
    max-width: 600px;
    margin: 15px auto; /* تقليل المسافة */
    border: 1px solid #eee;
    box-shadow: 0 0 6px rgba(0,0,0,0.1); /* تقليل الظل */
    background-color: #fff;
    padding: 0;
    direction: rtl;
}

.form-title {
    text-align: center;
    padding: 8px; /* تقليل الحشو */
    font-size: 11pt; /* تقليل الحجم */
    font-weight: bold;
    margin-bottom: 12px; /* تقليل المسافة */
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 6px 12px; /* تقليل الحشو */
    margin-bottom: 8px; /* تقليل المسافة */
}

.form-row.full-width {
    flex-direction: column;
    align-items: flex-start;
}

.form-label {
    flex: 0 0 110px; /* تقليل العرض */
    padding-inline-end: 8px; /* تقليل الحشو */
    font-weight: bold;
    color: #333;
    font-size: 0.9em; /* تقليل الحجم */
}

.form-input,
.form-textarea {
    flex: 1;
    padding: 6px; /* تقليل الحشو */
    border: 1px solid #ccc;
    border-radius: 3px; /* تقليل الانحناء */
    font-family: 'Cairo', sans-serif;
    font-size: 9pt; /* تقليل الحجم */
}

.form-textarea {
    min-height: 100px; /* تقليل الارتفاع */
    resize: vertical;
    width: 100%;
    margin-top: 4px; /* تقليل المسافة */
}

.form-input[type="text"] {
    max-width: calc(100% - 120px); /* تعديل العرض */
}

.form-row.full-width .form-label {
    flex: none;
    width: 100%;
    margin-bottom: 4px; /* تقليل المسافة */
    text-align: right;
}

.form-actions {
    text-align: center;
    padding: 12px; /* تقليل الحشو */
    border-top: 1px solid #eee;
    margin-top: 15px; /* تقليل المسافة */
}

.form-button {
    padding: 8px 20px; /* تقليل الحشو */
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px; /* تقليل الانحناء */
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 10pt; /* تقليل الحجم */
    transition: background-color 0.3s ease;
}

.form-button:hover {
    background-color: #a07a4d;
}

.message {
    padding: 15px; /* تقليل الحشو */
    margin: 15px auto; /* تقليل المسافة */
    text-align: center;
    border-radius: 4px; /* تقليل الانحناء */
    font-family: 'Cairo', sans-serif;
    font-size: 10pt; /* تقليل الحجم */
    max-width: 600px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1); /* تقليل الظل */
}

.error-message {
    background-color: #ffe0e0;
    color: #d8000c;
    border: 1px solid #d8000c;
}

.success-message {
    background-color: #e0ffe0;
    color: #008000;
    border: 1px solid #008000;
}

/* Responsive Design */
@media (max-width: 992px) {
    .main-content-area {
        padding: 12px; /* تقليل الحشو */
    }
    .sidebar {
        min-width: 180px; /* تقليل العرض */
        margin-inline-end: 12px; /* تقليل المسافة */
    }
    .content-section {
        padding: 12px; /* تقليل الحشو */
    }
    .main-nav ul li {
        margin: 0 8px; /* تقليل المسافة */
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-nav ul {
        display: none;
    }
    
    .main-content-area {
        flex-direction: column;
    }

    .sidebar {
        margin-inline-end: 0;
        margin-bottom: 15px; /* تقليل المسافة */
        width: 100%;
        min-width: unset;
        order: 2;
    }

    .content-section {
        width: 100%;
        min-width: unset;
        order: 1;
    }
    
    .subsections-grid {
        grid-template-columns: 1fr;
        gap: 12px; /* تقليل المسافة */
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 8px; /* تقليل المسافة */
    }
    
    .pagination-link,
    .pagination-current {
        padding: 8px 12px; /* تقليل الحشو */
        font-size: 0.9em;
    }
    
    .form-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 6px 8px; /* تقليل الحشو */
    }

    .form-label {
        flex: none;
        width: 100%;
        padding-inline-end: 0;
        margin-bottom: 4px; /* تقليل المسافة */
    }

    .form-input,
    .form-textarea {
        width: 100%;
        max-width: 100%;
    }

    .form-actions {
        padding: 8px; /* تقليل الحشو */
    }
}

@media (max-width: 480px) {
    body {
        font-size: 0.85em; /* تقليل الحجم */
    }

    .sidebar h3 {
        font-size: 1em; /* تقليل الحجم */
    }

    .content-section h1,
    .content-section h2 {
        font-size: 1.3em; /* تقليل الحجم */
    }
    
    .mobile-nav-sidebar {
        width: 260px; /* تقليل العرض */
        right: -260px;
    }
    
    .social-icons {
        flex-wrap: wrap;
        gap: 4px; /* تقليل المسافة */
    }
    
    .social-icons img {
        width: 28px; /* تقليل الحجم */
        height: 28px;
    }
    
    .addnote-container {
        padding: 4px; /* تقليل الحشو */
    }
    .comment-form {
        margin: 8px auto; /* تقليل المسافة */
    }
    .form-title {
        font-size: 10pt; /* تقليل الحجم */
        padding: 6px; /* تقليل الحشو */
    }
    .form-input,
    .form-textarea {
        font-size: 8pt; /* تقليل الحجم */
        padding: 4px; /* تقليل الحشو */
    }
    .form-button {
        font-size: 9pt; /* تقليل الحجم */
        padding: 6px 15px; /* تقليل الحشو */
    }
}
