/* ملف: css/style.css - النسخة الكاملة والنهائية مع لوحة الألوان الخضراء */

/* إعادة تعيين بسيطة لضمان التوافق بين المتصفحات */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 
  المتغيرات الديناميكية - هذه القيم الافتراضية سيتم تجاوزها
  بواسطة المتغيرات التي يتم إنشاؤها في ملف temp.php 
  من ملف إعدادات الألوان (JSON).
  تم توحيد الأسماء لاستخدام الشرطة السفلية (_) لتتوافق مع ملف JSON.
*/
:root {
    --primary_color: #c89d3a;
    --primary_dark_color: #a67d25; /* درجة أغمق للهوفر والتدرجات */
    --secondary_color: #b1460d;
    --text_color: #4c1e18;
    --secondary_text_color: #8b5a3c;
    --light_text_color: #a89682;
    --link_color: #b1460d;
    --link_hover_color: #8d3708;
    --border_color: #e8dcc4;
    --background_color: #fdfbf7;
    --white_color: #ffffff;
}

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    background-color: var(--background_color);
    color: var(--text_color);
    direction: rtl;
    text-align: right;
    padding-bottom: 0px;
	
	background-image: url('../images/page-bg.png');
    background-repeat: repeat;      /* التكرار */
    background-position: center top;  /* التموضع في الوسط من الأعلى */
    background-attachment: fixed;     /* تثبيت الخلفية أثناء التمرير */
    min-height: 100vh; /* يضمن أن الجسم يمتد لارتفاع الشاشة بالكامل */

}

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: var(--white_color);
    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;
}

.header-banner {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

/* Navigation Styles المحسنة */
.main-nav {
	background-color: transparent; 
    padding: 0px 0;
    position: relative;
	margin-left: 2px; /* مسافة 2 بيكسل بعده */

}

.main-nav ul {
    list-style: none;
    text-align: center;
	display: none !important; /* إخفاء قائمة الكمبيوتر */
}

.main-nav ul li {
    display: inline-block;
    margin: 0 2px;
}

.main-nav ul li a {
    color: var(--white_color);
    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: var(--primary_color);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.mobile-menu-toggle {
    position: absolute;
    top: calc(50% - 6px); /* ← إضافة 2 بيكسل للأسفل */
    right: 20px;
    transform: translateY(-50%);
    background: var(--primary_dark_color); /* استخدم لونًا ثابتًا من المتغيرات */
    border: none; /* إزالة الحدود */
    border-radius: 6px; /* جعلها مربعة بحواف دائرية خفيفة */
    color: var(--white_color);
    font-size: 1.6em;
    cursor: pointer;
    z-index: 1001;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    box-shadow: none; /* إزالة الظل */
    backdrop-filter: none; /* إزالة تأثير الفلتر */
    display: flex !important; /* إظهار زر الهمبرغر دائماً */
    margin-bottom: 10px; /* ← أضف هذا السطر */

}

.mobile-menu-toggle:hover {
    background: var(--primary_color); /* لون hover أبسط */
    border-color: none;
    transform: translateY(-50%) scale(1.05); /* تأثير تكبير بسيط */
    box-shadow: none;
}

/* إعدادات الاستجابة للقائمة */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav ul {
    display: none;
    }
	
    .main-nav {
        /* background-color: transparent; */ /* تم التعطيل */
        /* padding: 0; */                 /* تم التعطيل */
    }

}

@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: var(--primary_dark_color);
    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: var(--white_color);
    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: var(--white_color);
    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: var(--white_color);
    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: 18px;
	background-color: #f3eedc;
}

/* Sidebar Styles */
.sidebar {
    flex: 1;
    min-width: 250px;
    background-color: #f0f0f0; /* يمكنك ربط هذا بالمتغير --right_bg_color */
    padding: 18px;
    margin-inline-end: 18px;
}

.sidebar h3 {
    color: var(--primary_dark_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: 2px;
}

.sidebar ul li a {
    text-decoration: none;
    color: var(--secondary_text_color);
    padding: 2px 0;
    display: block;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9em;
    border-radius: 4px;
    padding-right: 3px;
}

.sidebar ul li a:hover {
    color: var(--primary_color);
    /* background: rgba(96, 125, 107, 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%, var(--primary_dark_color) 100%);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(96, 125, 107, 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(96, 125, 107, 0.1);
}

.search-form-sidebar input[type="submit"] {
    width: 100%;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--primary_color) 0%, var(--primary_dark_color) 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, var(--primary_dark_color) 0%, var(--primary_color) 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(96, 125, 107, 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(96, 125, 107, 0.1);
}

/* Latest / Mixed Articles Sidebar */
.latest-articles-sidebar,
.mixed-articles-sidebar {
    margin-bottom: 20px;
    background: white;
    padding: 10px;
    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: 0px 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);
	border-radius: 12px;
}

.content-section h1,
.content-section h2 {
    color: var(--primary_dark_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: var(--primary_dark_color);
    color: #fff;
    text-align: center;
    padding: 15px;
    margin-top: auto;
    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: var(--primary_dark_color);
}

.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);
}

.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) {
    .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;
    }
}
/* Desktop Dropdown Menus - أنماط القوائم المنسدلة للكمبيوتر */
.main-nav ul li.has-dropdown {
    position: relative;
}

.main-nav ul li.has-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%; /* تضع القائمة المنسدلة أسفل الرابط الرئيسي */
    right: 0; /* محاذاة لليمين في وضع RTL */
    background-color: var(--primary_dark_color);
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
    z-index: 1000;
    list-style: none; /* إزالة النقاط */
    padding: 0;
    margin: 0; /* إزالة الهامش الافتراضي */
    border-radius: 0 0 5px 5px; /* حواف سفلية مستديرة */
    overflow: hidden; /* لحواف ناعمة */
	margin-top: 5px; 

}

.main-nav ul li.has-dropdown:hover .dropdown-menu {
    display: block; /* إظهار القائمة عند تمرير المؤشر */
}

.main-nav ul li.has-dropdown .dropdown-menu li {
    display: block; /* كل عنصر فرعي يأخذ عرضاً كاملاً */
    margin: 0; /* إعادة تعيين الهامش للعناصر الفرعية */
}

.main-nav ul li.has-dropdown .dropdown-menu li a {
    padding: 10px 15px;
    color: #fff;
    font-size: 0.9em;
    text-align: right; /* محاذاة النص لليمين */
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: block; /* لجعل المنطقة بأكملها قابلة للنقر */
}

.main-nav ul li.has-dropdown .dropdown-menu li:last-child a {
    border-bottom: none; /* إزالة الحد السفلي من العنصر الأخير */
}

.main-nav ul li.has-dropdown .dropdown-menu li a:hover {
    background-color: var(--primary_color);
    transform: none; /* إزالة أي تحويلات */
    box-shadow: none; /* إزالة أي ظلال */
}

/* Dropdown Toggle Icon for desktop - أيقونة التبديل للقائمة المنسدلة على الكمبيوتر */
.main-nav ul li.has-dropdown .dropdown-toggle-icon {
    font-size: 0.7em; /* حجم أصغر للأيقونة */
    margin-inline-start: 5px; /* مسافة من النص */
    transition: transform 0.3s ease; /* انتقال ناعم للدوران */
}

.main-nav ul li.has-dropdown:hover .dropdown-toggle-icon {
    transform: rotate(180deg); /* تدوير الأيقونة عند التمرير */
}

/* Mobile Sub-menu Styles (Accordion) - أنماط القوائم الفرعية للهاتف (الأكورديون) */
.mobile-nav-menu .mobile-sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0,0,0,0.1); /* خلفية مختلفة قليلاً للعناصر الفرعية */
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    overflow: hidden; /* لطمس الانتقال عند الطي */
}

.mobile-nav-menu .mobile-sub-menu li a {
    padding: 10px 30px; /* مسافة بادئة للعناصر الفرعية */
    font-size: 0.85em;
    background: rgba(0,0,0,0.05); /* خلفية أغمق قليلاً للعناصر الفرعية الفرعية */
}

.mobile-nav-menu .mobile-sub-menu li a:hover {
    background: rgba(0,0,0,0.15);
}

/* Mobile Toggle Icon (for both main and sidebar for consistency) - أيقونة التبديل للهاتف (للقائمة الرئيسية والقائمة الجانبية للتناسق) */
.mobile-toggle-icon,
.sidebar .toggle-icon {
    float: left; /* محاذاة لليسار في RTL */
    margin-inline-start: 0; /* إعادة تعيين */
    margin-inline-end: auto; /* دفع لليمين */
    font-size: 0.7em;
    transition: transform 0.3s ease;
    line-height: inherit; /* محاذاة مع ارتفاع السطر النصي */
    vertical-align: middle;
    padding-inline-start: 10px; /* مساحة للنقر */
    color: rgba(255,255,255,0.7); /* لون أفتح */
}

.sidebar .toggle-icon {
    color: var(--secondary_text_color); /* لون أيقونة الشريط الجانبي */
    float: right; /* إعادة تعيين المحاذاة لليمين للشريط الجانبي */
    padding-inline-start: 0;
    padding-inline-end: 10px;
}

/* Icon rotation for active/open state - تدوير الأيقونة للحالة النشطة/المفتوحة */
.mobile-toggle-icon.rotated,
.sidebar .toggle-icon.rotated {
    transform: rotate(180deg);
}


/* إضافة مسافة سفلية لصفحة subject.php فقط */
body[class*="subject"], 
.subject-page,
html[data-page="subject"] body {
    padding-bottom: 0px !important;
}


    /* ============================================== */
    /* == أنماط عرض عينة التعليقات في صفحة المقال == */
    /* ============================================== */

    .comments-list-preview {
        margin-top: 30px;
        border-top: 1px solid #e9ecef; /* خط فاصل علوي */
        padding-top: 20px;
text-align: right;
    }

    .comment-item-preview {
        padding: 20px;
        margin-bottom: 20px;
        border-radius: 8px;
        border: 1px solid #e0e0e0; /* استخدام إطار بدلاً من الظل ليتناسب مع أي خلفية */
        border-right: 4px solid var(--primary_color, #607d6b);
    }

    .comment-header-preview {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        padding-bottom: 10px;
        margin-bottom: 15px;
        border-bottom: 1px solid #f1f1f1;
    }

    .comment-number-preview {
        background: var(--primary_color, #607d6b);
        color: white;
        min-width: 28px;
        height: 28px;
        border-radius: 50%; /* شكل دائري */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9em;
        font-weight: bold;
    }

    .comment-meta-preview {
        color: #555;
        font-size: 0.9em;
    }

    .comment-author-preview a {
        font-weight: bold;
        color: #111;
        text-decoration: none;
    }
    .comment-author-preview a:hover {
        color: var(--primary_color, #607d6b);
    }

    .comment-subject-preview {
        color: var(--primary_color, #607d6b);
        font-weight: bold;
        font-size: 1.1em;
        margin: 0 0 10px 0;
    }

    .comment-body-preview {
        line-height: 1.7;
        color: #333;
        word-wrap: break-word;
text-align: justify;
    }

 /* ايقونة التشغيل لليوتيوب في الصفحة الرئيسية */
 
 .media-container {
    position: relative;
    overflow: hidden; /* يضمن عدم خروج الصورة من الإطار الدائري */
}

.media-container .play-icon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4em;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.article-preview:hover .media-container .play-icon-overlay {
    opacity: 1;
}


/* === بداية: الحل النهائي لمشكلة فيديو يوتيوب على الهاتف === */

.responsive-iframe-container,
.article-content div[style*="padding-bottom: 56.25%"] {
    position: relative;
    overflow: hidden;
    width: 100%;
    border-radius: 8px; 
    margin-bottom: 1.5em; 
}

.responsive-iframe-container iframe,
.article-content div[style*="padding-bottom: 56.25%"] iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 768px) {
    #article-content {
        padding-left: 5px;
        padding-right: 5px;
    }
}
/* === نهاية: الحل النهائي لمشكلة فيديو يوتيوب === */

/* === بداية: الحل النهائي لقسم التنقل بين المواضيع === */

.improved-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 0px;
    padding-top: 0px;
}

.improved-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 15px; 
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 15px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0;
}

.improved-nav .nav-link:hover {
    border-color: var(--primary_color, #607d6b);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-4px);
}

.improved-nav .nav-thumb {
    width: 180px;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0; 
    transition: transform 0.3s ease;
}

.improved-nav .nav-link:hover .nav-thumb {
    transform: scale(1.05); 
}

.improved-nav .nav-text {
    line-height: 1.5;
}

.improved-nav .nav-text strong {
    font-size: 0.9em;
    color: #555;
    display: block;
    margin-bottom: 5px;
}

.improved-nav .nav-text span {
    font-size: 1em;
    font-weight: 500;
    color: #222;
}

.improved-nav .nav-link.next {
    text-align: left;
}

@media (max-width: 768px) {
    .improved-nav {
        flex-direction: column; 
    }

    .improved-nav .nav-thumb {
        width: 140px;
        height: 100px;
    }

    .improved-nav .nav-text span {
        font-size: 0.9em; 
    }
}
/* === نهاية: الحل النهائي لقسم التنقل === */


/* تنسيقات حاوية البحث المرنة الجديدة */
.search-flex-container {
    display: flex;         /* تفعيل نظام Flexbox */
    flex-wrap: wrap;       /* السماح للعناصر بالنزول لسطر جديد عند ضيق المساحة */
    gap: 15px;             /* مسافة ثابتة بين العناصر */
}

/* جعل حقل البحث وقائمة الأقسام ينموان ليملآ المساحة */
.search-flex-container > input[type="text"],
.search-flex-container > select {
    flex-grow: 1;          /* السماح للعنصر بالنمو */
    flex-basis: 200px;     /* تحديد عرض أساسي قبل الالتفاف (مفيد للشاشات الصغيرة) */
}

/* تنسيق زر البحث ليكون متناسقاً */
.search-flex-container > input[type="submit"] {
    flex-shrink: 0;        /* منع الزر من التقلص */
}


/* تنسيق حاوية خيار البحث الدقيق */
.checkbox-wrapper {
    display: flex;         /* لمحاذاة الصندوق والعنوان */
    align-items: center;   /* توسيط عمودي */
    gap: 8px;              /* مسافة بين الصندوق والعنوان */
    flex-shrink: 0;        /* منعه من التقلص ليحافظ على شكله */
    white-space: nowrap;   /* لمنع التفاف النص داخل العنوان */
}

.checkbox-wrapper label {
    margin: 0;             /* إزالة أي هوامش افتراضية من العنوان */
    cursor: pointer;
}


/*
 * تنسيقات تلوين نتائج البحث (نسخة محسنة وأكثر تحديدًا)
 * ========================================================
*/

/* 1. تلوين الكلمة في نص النتيجة */
.search-result-item .search-result-content .search-highlight-body {
    background-color: #FFF9C4 !important; /* لون خلفية أصفر فاتح */
    color: #5D4037 !important;             /* لون نص بني داكن */
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

/* 2. تلوين الكلمة في عنوان النتيجة (إذا كان رابطًا) */
.search-result-item .search-result-title a .search-highlight-title {
    color: var(--primary_color) !important; /* استخدام اللون الرئيسي للموقع */
    background-color: transparent !important;
    text-decoration: underline;
    font-weight: bold;
}

/* 3. تلوين الكلمة في عنوان النتيجة (إذا لم يكن رابطًا) */
.search-result-item .search-result-title .search-highlight-title {
    color: var(--primary_color) !important;
    background-color: transparent !important;
    font-weight: bold;
}

/* لتعدد الصفحات - تم تعديل الألوان لتكون متوافقة مع ألوان الموقع */
.multiplepages-container {
    background: var(--background_color);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

/* تأكيد اللون داخل القائمة فقط */
.multiplepages-container a,
.multiplepages-container .multiplepages-button {
    color: var(--link_color) !important;
    text-decoration: none !important;
}

.multiplepages-links {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.multiplepages-button {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid var(--border_color);
    border-radius: 4px;
    background: var(--white_color);
    color: var(--link_color);
    text-decoration: none; 
    font-size: 14px;
    transition: 
        background 0.2s, 
        color 0.2s, 
        border-color 0.2s,
        transform 0.2s;
}

.multiplepages-button:hover {
    background: var(--primary_color);
    border-color: var(--primary_color);
    color: var(--white_color) !important;
    text-decoration: none;
	transform: translateY(-3px);
}

.multiplepages-current {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid var(--primary_color);
    border-radius: 4px;
    background: var(--primary_color);
    color: var(--white_color);
    font-size: 14px;
    font-weight: bold;
}

.multiplepages-dots {
    padding: 8px 4px;
    color: var(--secondary_text_color);
}

.multiplepages-info {
    margin-top: 15px;
    font-size: 14px;
    color: var(--text_color);
}

.multiplepages-info i {
    margin-left: 5px;
    color: var(--primary_color);
}

/* Responsive video styles for vertical videos on desktop */
@media (min-width: 769px) {
    .article-content video,
    .article-content iframe {
        max-height: 80vh; /* Limit video height to 80% of the viewport height */
        width: auto;      /* Allow width to adjust automatically */
        display: block;   /* Needed to apply margin auto */
        margin: 0 auto;   /* Center the video horizontally */
    }
}




/* ==================================================================
   تحسينات الصفحة الرئيسية والموقع - إضافات نوفمبر 2025
   ================================================================== */

/* ================================================================== */
/* 1. تحسين التمرير السلس للموقع */
/* ================================================================== */
html {
    scroll-behavior: smooth;
}

/* ================================================================== */
/* 2. تحسينات بطاقات المقالات (Article Cards) */
/* ================================================================== */

/* إضافة شريط ملون علوي للتصنيف يظهر عند التمرير */
.article-preview {
    position: relative;
    overflow: visible;
}

.article-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary_color) 0%, var(--secondary_color) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-preview:hover::before {
    opacity: 1;
}

/* تحسين عرض التاريخ والمشاهدات */
.article-meta {
    background: linear-gradient(to top, rgba(0,0,0,0.03), transparent);
    padding-top: 15px;
}



/* ================================================================== */
/* 4. تأثير التحميل المتحرك (Skeleton Loading) */
/* ================================================================== */

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

/* يظهر عند تحميل الصور */
.article-preview.loading .media-container {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}


/* ================================================================== */
/* 6. تحسين زر "اقرأ المزيد" بتأثير حركي */
/* ================================================================== */

.read-more {
    position: relative;
    overflow: hidden;
}

.read-more::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.read-more:hover::before {
    width: 300px;
    height: 300px;
}

/* ================================================================== */
/* 7. تحسين الوصولية (Accessibility) - Focus States */
/* ================================================================== */

/* إطار واضح عند التركيز بالكيبورد */
.article-preview:focus-within {
    outline: 3px solid var(--primary_color);
    outline-offset: 2px;
}

.read-more:focus,
.sidebar a:focus {
    outline: 2px solid var(--primary_color);
    outline-offset: 3px;
}


/* ================================================================== */
/* نهاية التحسينات */
/* ================================================================== */









/* ==================================================================
   تحسينات جمالية متقدمة للصفحة الرئيسية - نسخة محسّنة
   ================================================================== */

/* ================================================================== */
/* 1. تحسين بطاقات المقالات - تصميم أنيق ومميز */
/* ================================================================== */

.article-preview {
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid rgba(200, 157, 58, 0.15) !important;
    background: linear-gradient(to bottom, #ffffff 0%, #fdfbf9 100%) !important;
    overflow: hidden !important;
}

.article-preview:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 12px 35px rgba(200, 157, 58, 0.25) !important;
    border-color: var(--primary_color) !important;
}

/* شريط جانبي ملون مميز */
.article-preview::after {
    content: '' !important;
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 5px !important;
    background: linear-gradient(180deg, var(--primary_color) 0%, var(--secondary_color) 100%) !important;
    opacity: 0 !important;
    transition: opacity 0.4s ease !important;
}

.article-preview:hover::after {
    opacity: 1 !important;
}

/* ================================================================== */
/* 2. تحسين صور/فيديوهات المقالات */
/* ================================================================== */

.media-container {
    position: relative !important;
    overflow: hidden !important;
    border-radius: 8px 8px 0 0 !important;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%) !important;
}

.media-container::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.1) 100%) !important;
    opacity: 0 !important;
    transition: opacity 0.4s ease !important;
    z-index: 1 !important;
}

.article-preview:hover .media-container::before {
    opacity: 1 !important;
}

.media-container img,
.media-container video {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
    filter: brightness(0.98) !important;
}

.article-preview:hover .media-container img,
.article-preview:hover .media-container video {
    transform: scale(1.08) !important;
    filter: brightness(1) !important;
}

/* ================================================================== */
/* 3. تحسين عناوين المقالات */
/* ================================================================== */

.article-title {
    color: var(--text_color) !important;
    font-weight: 700 !important;
    font-size: 1.15em !important;
    line-height: 1.5 !important;
    margin-bottom: 12px !important;
    transition: all 0.3s ease !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.03) !important;
}

.article-preview:hover .article-title {
    color: var(--primary_color) !important;
    transform: translateX(-3px) !important;
}




/* ================================================================== */
/* 7. تحسين الـ Grid للمقالات */
/* ================================================================== */

.articles-grid {
    gap: 25px !important;
    padding: 10px !important;
}

/* ================================================================== */
/* 8. تحسين Sidebar */
/* ================================================================== */

.sidebar {
    background: linear-gradient(to bottom, #ffffff 0%, #fdfbf9 100%) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08) !important;
    border: 1px solid rgba(200, 157, 58, 0.15) !important;
    padding: 20px !important;
}

.sidebar h3 {
    color: var(--primary_color) !important;
    font-weight: 700 !important;
    font-size: 1.2em !important;
    margin-bottom: 15px !important;
    padding-bottom: 10px !important;
    border-bottom: 3px solid var(--primary_color) !important;
    position: relative !important;
}

.sidebar h3::after {
    content: '' !important;
    position: absolute !important;
    bottom: -3px !important;
    right: 0 !important;
    width: 60px !important;
    height: 3px !important;
    background: var(--secondary_color) !important;
}

.sidebar ul li {
    padding: 8px 10px !important;
    margin-bottom: 8px !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    border-right: 3px solid transparent !important;
}

.sidebar ul li:hover {
    background: rgba(200, 157, 58, 0.1) !important;
    border-right-color: var(--primary_color) !important;
    transform: translateX(-5px) !important;
}

.sidebar ul li a {
    color: var(--text_color) !important;
    /* font-weight: 500 !important; */
    transition: color 0.3s ease !important;
}

.sidebar ul li:hover a {
    color: var(--primary_color) !important;
}

/* ================================================================== */
/* 9. تحسين الـ Header */
/* ================================================================== */

.main-header {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12) !important;
	border-bottom: none !important;
    background: linear-gradient(to bottom, #ffffff 0%, #fdfcfa 100%) !important;
}

.header-banner img {
    filter: brightness(0.95) contrast(1.05) !important;
    transition: all 0.5s ease !important;
}

.header-banner:hover img {
    filter: brightness(1) contrast(1.1) !important;
    transform: scale(1.02) !important;
}


/* ================================================================== */
/* 11. تحسين التفاعل مع بطاقات Sidebar */
/* ================================================================== */

.sidebar-card {
    background: white !important;
    border-radius: 10px !important;
    padding: 15px !important;
    margin-bottom: 15px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06) !important;
    transition: all 0.3s ease !important;
}

.sidebar-card:hover {
    box-shadow: 0 4px 15px rgba(200, 157, 58, 0.2) !important;
    transform: translateY(-3px) !important;
}


/* ================================================================== */
/* 13. تحسينات الاستجابة للموبايل */
/* ================================================================== */

@media screen and (max-width: 768px) {
    .article-preview {
        border-radius: 10px !important;
        margin-bottom: 20px !important;
    }
    
    .article-preview:hover {
        transform: translateY(-4px) !important;
    }
    
    .article-title {
        font-size: 1.05em !important;
    }
    
    .read-more {
        padding: 8px 20px !important;
        font-size: 0.9em !important;
    }
    
    .sidebar {
        margin-top: 25px !important;
    }
    
    .articles-grid {
        gap: 20px !important;
    }
}

/* ================================================================== */
/* 14. إضافة حركة ناعمة لكل العناصر */
/* ================================================================== */

* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ================================================================== */
/* 15. تحسين التباعد والمسافات */
/* ================================================================== */

.article-content {
    padding: 15px !important;
}

.article-header {
    padding: 15px 18px 10px !important;
}

/* ================================================================== */
/* نهاية التحسينات الجمالية */
/* ================================================================== */





/* الفوتر الرئيسي */
.main-footer {
    background: linear-gradient(135deg, var(--text_color, #4c1e18) 0%, #3a1612 100%);
    color: var(--background_color, #fdfbf7);
    padding: 30px 20px 20px;
    margin-top: 0px;
    box-shadow: 0 -3px 20px rgba(76, 30, 24, 0.2);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

/* روابط التواصل الاجتماعي */
.footer-social {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-social a {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, rgba(200, 157, 58, 0.2), rgba(166, 125, 37, 0.15));
    border: 2px solid var(--primary_color, #c89d3a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary_color, #c89d3a);
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(200, 157, 58, 0.2);
    position: relative;
}

.footer-social a::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.footer-social a:hover::before {
    opacity: 1;
}

.footer-social a:hover {
    background: linear-gradient(135deg, var(--primary_color, #c89d3a), var(--primary_dark_color, #a67d25));
    border-color: var(--primary_dark_color, #a67d25);
    color: var(--white_color, #ffffff);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 20px rgba(200, 157, 58, 0.4);
}

.footer-social a i {
    font-size: 1.2em;
    position: relative;
    z-index: 1;
}

.footer-social a:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(200, 157, 58, 0.3);
}

/* خط فاصل */
.footer-divider {
    height: 1px;
    background: linear-gradient(to right, 
        transparent, 
        rgba(200, 157, 58, 0.5) 20%, 
        rgba(200, 157, 58, 0.5) 80%, 
        transparent
    );
    margin: 15px auto;
    max-width: 600px;
}

/* النصوص الرئيسية */
.footer-text-main {
    margin-bottom: 12px;
}

.footer-text-main p {
    margin: 5px 0;
    font-size: 0.95em;
    line-height: 1.4;
    color: var(--border_color, #e8dcc4);
}

.footer-text-main strong {
    color: var(--primary_color, #c89d3a);
    font-weight: 600;
}

.footer-year {
    color: var(--primary_color, #c89d3a) !important;
    font-weight: 500;
    font-size: 0.9em !important;
}

.footer-permissions {
    color: var(--light_text_color, #a89682) !important;
    font-size: 0.9em !important;
    font-style: italic;
    margin-top: 6px !important;
}

/* حقوق التصميم */
.footer-credits {
    margin-top: 12px;
}

.footer-credits p {
    font-size: 0.85em;
    color: var(--light_text_color, #a89682);
    margin: 0;
}

.footer-credits a {
    color: var(--primary_color, #c89d3a);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.footer-credits a:hover {
    color: var(--white_color, #ffffff);
    text-decoration: underline;
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .main-footer {
        padding: 25px 15px 15px;
    }
    
    .footer-social {
        gap: 12px;
        margin-bottom: 15px;
    }
    
    .footer-social a {
        width: 40px;
        height: 40px;
    }
    
    .footer-social a i {
        font-size: 1em;
    }
    
    .footer-divider {
        margin: 12px auto;
    }
    
    .footer-text-main {
        margin-bottom: 10px;
    }
    
    .footer-text-main p {
        font-size: 0.9em;
        margin: 4px 0;
    }
    
    .footer-credits {
        margin-top: 10px;
    }
    
    .footer-credits p {
        font-size: 0.8em;
    }
}
