/* إعادة تعيين التنسيقات الأساسية */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', Arial, sans-serif;
}

body {
    background: #f4f4f4;
    color: #525252;
    direction: rtl;
    line-height: 1.6;
    overflow-x: hidden; /* منع التمرير الأفقي على مستوى الصفحة */
}

/* تنسيق الهيدر */
header {
    background: url('../images/header-bg.jpg') no-repeat center center/cover;
    height: 200px;
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: fadeIn 1.5s ease-in-out;
    width: 100%; /* ضمان أن الهيدر لا يتجاوز عرض الشاشة */
    max-width: 100vw; /* تحديد الحد الأقصى لعرض الشاشة */
}

.header-logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 10px;
}

header h1 {
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: slideIn 1s ease-in-out;
}

/* تأثيرات الرسوم المتحركة */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* تنسيق زر القائمة (Hamburger) */
.menu-toggle {
    display: none;
    font-size: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    position: absolute;
    top: 20px;
    right: 20px;
    transition: background 0.3s;
}

.menu-toggle:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* تنسيق شريط التنقل */
.navbar {
    background: #525252; /* لون أخضر ثابت */
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    gap: 10px; /* تقليل المسافة بين الروابط */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%; /* ضمان أن التنقل لا يتجاوز عرض الشاشة */
    max-width: 100vw; /* تحديد الحد الأقصى */
    flex-wrap: wrap; /* السماح بانتقال الروابط إلى سطر جديد إذا كانت كثيرة */
    overflow-x: hidden; /* منع التمرير الأفقي */
}

/* تخصيص ألوان شريط التنقل بناءً على الدومين باستخدام فئات */
.navbar.subdomain1 {
    background: #1abc9c; /* لون ثابت للدومين الفرعي الأول */
}

.navbar.subdomain2 {
    background: #e74c3c; /* لون ثابت للدومين الفرعي الثاني */
}

.navbar a {
    color: white;
    text-decoration: none;
    font-size: 1.2em;
    padding: 8px 15px;
    border-radius: 25px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
}

/* تخصيص أنماط الروابط بناءً على الدومين */
.navbar.subdomain1 a {
    font-weight: bold;
    border-radius: 5px;
}

.navbar.subdomain1 a:hover {
    background-color: #16a085;
}

.navbar.subdomain2 a {
    border-bottom: 2px solid transparent;
    transition: border-bottom 0.3s;
}

.navbar.subdomain2 a:hover {
    border-bottom: 2px solid #fff;
    background-color: transparent;
}

/* النمط الافتراضي للروابط عند التحويم */
.navbar a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* تنسيق رسالة الإغلاق */
.closure-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    text-align: center;
    margin: 10px 0;
    width: 100%;
    max-width: 100vw; /* ضمان عدم التجاوز */
}

/* إعلانات الـ Header */
.header-ad {
    text-align: center;
    padding: 20px;
    width: 100%;
    max-width: 100vw; /* ضمان أن الإعلان لا يتجاوز عرض الشاشة */
    overflow-x: hidden; /* منع التمرير الأفقي */
}

.header-ad-container {
    text-align: center;
    margin: 20px auto;
    padding: 0 10px;
    max-width: 100%; /* تغيير من 1000px إلى 100% ليكون متجاوبًا */
    width: 100%; /* ضمان ملء العرض */
    box-sizing: border-box; /* التأكد من احتساب padding ضمن العرض */
}

.header-ad-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.header-ad-image:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.header-ad-text {
    margin-top: 10px;
    font-size: 16px;
    font-family: 'Tajawal', sans-serif;
}

.header-ad-text a {
    color: #dc3545;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.header-ad-text a:hover {
    color: #525252;
    text-decoration: underline;
}

/* التصميم المتجاوب للإعلان والهيدر */
@media (max-width: 768px) {
    .header-ad-container {
        margin: 10px auto;
        padding: 0 5px;
    }

    .header-ad-image {
        max-width: 100%;
        height: auto;
    }

    .header-ad-text {
        font-size: 14px;
    }

    header {
        height: 150px;
        padding: 15px;
        width: 100%;
        max-width: 100vw; /* ضمان عدم التجاوز */
    }

    .header-logo {
        max-width: 100px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .navbar {
        display: none;
        flex-direction: column;
        width: 100%;
        max-width: 100vw; /* ضمان عدم التجاوز */
        position: absolute;
        top: 150px;
        left: 0;
        z-index: 999;
        gap: 15px;
        overflow-x: hidden; /* منع التمرير الأفقي */
    }

    .navbar.subdomain1 {
        background: #1abc9c;
    }

    .navbar.subdomain2 {
        background: #e74c3c;
    }

    .navbar.active {
        display: flex;
    }

    .navbar a {
        font-size: 1em;
        padding: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        display: block;
        border-radius: 0;
    }

    .navbar.subdomain2 a {
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .menu-toggle {
        display: block;
        top: 15px;
        right: 15px;
        font-size: 24px;
    }
}

/* تنسيق الحاوية الرئيسية */
.container {
    display: flex;
    flex-wrap: wrap;
    max-width: 100%; /* تغيير من 1200px إلى 100% */
    width: 100%;
    margin: 0 auto;
    padding: 30px 15px; /* تقليل padding على الهاتف */
    gap: 25px;
    justify-content: space-between;
    min-height: calc(100vh - 350px);
    box-sizing: border-box; /* ضمان احتساب padding */
}

/* تنسيق الشريط الجانبي */
.sidebar {
    flex: 1;
    min-width: 250px;
    max-width: 100%; /* ضمان عدم التجاوز */
    width: 100%;
}

.left-sidebar {
    order: 1;
}

.right-sidebar {
    order: 3;
}

.block {
    background: linear-gradient(145deg, #ffffff, #f1f1f1);
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-right: 5px solid #525252;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 100%; /* ضمان عدم التجاوز */
}

.block:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.block h3 {
    font-size: 1.4em;
    margin-bottom: 15px;
    color: #525252;
    border-bottom: 3px solid #525252;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.block h3 i {
    font-size: 1.3em;
    color: #525252;
    transition: transform 0.3s ease;
}

.block:hover h3 i {
    transform: rotate(360deg);
}

.block-content {
    font-size: 1em;
    color: #444;
}

.block-content a {
    color: #525252;
    text-decoration: none;
    display: block;
    margin: 8px 0;
    transition: color 0.3s ease, padding-right 0.3s ease;
}

.block-content a:hover {
    color: #0056b3;
    padding-right: 10px;
}

/* تنسيق شريط البحث داخل الكتل */
.block .search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.block .search-form input[type="text"] {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    width: 100%;
    max-width: 100%; /* ضمان عدم التجاوز */
    transition: border-color 0.3s ease;
}

.block .search-form input[type="text"]:focus {
    border-color: #525252;
    outline: none;
}

.block .search-form button {
    padding: 12px;
    background: linear-gradient(90deg, #525252, #0056b3);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s ease, transform 0.2s ease;
}

.block .search-form button:hover {
    background: linear-gradient(90deg, #0056b3, #003d82);
    transform: scale(1.02);
}

/* تنسيق المحتوى الرئيسي */
.main-content {
    flex: 2;
    order: 2;
    min-width: 0; /* إصلاح مشكلة min-width على الهاتف */
    width: 100%;
    max-width: 100%; /* ضمان عدم التجاوز */
    margin: 0 auto;
}

.main-content h2 {
    font-size: 2.2em;
    margin-bottom: 25px;
    color: #525252;
    text-align: center;
    border-bottom: 3px solid #525252;
    padding-bottom: 12px;
    position: relative;
}

.main-content h2::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 3px;
    background-color: #525252;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
}

/* تنسيق بطاقة المقال */
.article-card {
    background: linear-gradient(145deg, #ffffff, #f8f8f8);
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 100%; /* ضمان عدم التجاوز */
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.article-card h3 {
    font-size: 1.6em;
    margin-bottom: 12px;
    color: #525252;
    transition: color 0.3s ease;
}

.article-card:hover h3 {
    color: #525252;
}

.article-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.article-card:hover .article-image {
    transform: scale(1.02);
}

.meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 12px;
    font-style: italic;
}

.article-card p {
    font-size: 1em;
    color: #444;
    margin-bottom: 12px;
}

.read-more {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(90deg, #525252, #0056b3);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: background 0.3s ease, transform 0.2s ease;
}

.read-more:hover {
    background: linear-gradient(90deg, #0056b3, #003d82);
    transform: scale(1.05);
}

/* تنسيق صفحة المقال */
.article-container {
    background: linear-gradient(145deg, #ffffff, #f8f8f8);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%; /* ضمان عدم التجاوز */
}

.article-title {
    font-size: 2.8em;
    color: #525252;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
}

.article-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background-color: #525252;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.article-content {
    font-size: 1.2em;
    line-height: 1.8;
    color: #444;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 15px 0;
}

/* تنسيق قسم الإعجاب */
.like-section {
    margin-top: 25px;
    text-align: center;
}

.like-button {
    padding: 12px 25px;
    background: linear-gradient(90deg, #525252, #0056b3);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s ease, transform 0.2s ease;
}

.like-button:hover {
    background: linear-gradient(90deg, #0056b3, #003d82);
    transform: scale(1.05);
}

.like-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.like-section p {
    margin-top: 12px;
    font-size: 1em;
    color: #525252;
}

/* تنسيق قسم التعليقات */
.comments-section {
    margin-top: 50px;
}

.comments-section h3 {
    font-size: 1.8em;
    color: #525252;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
}

.comments-section h3::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 3px;
    background-color: #525252;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
}

.comment-form {
    margin-bottom: 35px;
    text-align: center;
}

.comment-form textarea {
    width: 100%;
    max-width: 600px;
    height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    direction: rtl;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.comment-form textarea:focus {
    border-color: #525252;
    outline: none;
}

.comment-form button {
    margin-top: 12px;
    padding: 12px 25px;
    background: linear-gradient(90deg, #28a745, #218838);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s ease, transform 0.2s ease;
}

.comment-form button:hover {
    background: linear-gradient(90deg, #218838, #1c7430);
    transform: scale(1.05);
}

.comment {
    border-bottom: 1px solid #eee;
    padding: 20px 0;
    transition: background 0.3s ease;
}

.comment:hover {
    background: #f9f9f9;
}

.comment-meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
    font-style: italic;
}

.comment-content {
    font-size: 1em;
    color: #444;
}

/* تنسيق الفوتر */
.footer {
    background: linear-gradient(90deg, #525252, #444);
    color: white;
    padding: 50px 20px;
    text-align: center;
    margin-top: 30px;
    width: 100%;
    max-width: 100vw; /* ضمان عدم التجاوز */
}

.footer-content {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 100%;
    margin: 0 auto;
}

.footer-section {
    flex: 1;
    min-width: 200px;
    max-width: 100%; /* ضمان عدم التجاوز */
}

.footer-section h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #525252;
    position: relative;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background-color: #525252;
    bottom: -5px;
    left: 0;
}

.footer-section a {
    color: #ddd;
    text-decoration: none;
    display: block;
    margin: 10px 0;
    transition: color 0.3s ease, padding-right 0.3s ease;
}

.footer-section a:hover {
    color: #525252;
    padding-right: 10px;
}

.footer-bottom {
    margin-top: 30px;
    border-top: 1px solid #555;
    padding-top: 15px;
}

.footer-bottom p {
    font-size: 0.9em;
    color: #bbb;
}

/* تنسيق زر العودة إلى الأعلى */
#back-to-top {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(90deg, #525252, #0056b3);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2em;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease, transform 0.2s ease;
    z-index: 1000;
}

#back-to-top:hover {
    background: linear-gradient(90deg, #0056b3, #003d82);
    transform: scale(1.1);
}

#back-to-top i {
    line-height: 50px;
}

/* تنسيق صفحة حول الموقع */
.about-section {
    margin-bottom: 50px;
}

.about-content {
    background: linear-gradient(145deg, #ffffff, #f8f8f8);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%; /* ضمان عدم التجاوز */
}

.about-content p {
    font-size: 1.1em;
    color: #444;
    margin-bottom: 20px;
}

.about-content h3 {
    font-size: 1.6em;
    color: #525252;
    margin: 20px 0 10px;
    position: relative;
}

.about-content h3::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background-color: #525252;
    bottom: -5px;
    left: 0;
}

/* تنسيق صفحة اتصل بنا */
.contact-section {
    margin-bottom: 50px;
}

.contact-content {
    background: linear-gradient(145deg, #ffffff, #f8f8f8);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%; /* ضمان عدم التجاوز */
}

.contact-content p {
    font-size: 1.1em;
    color: #444;
    margin-bottom: 20px;
}

.success-message {
    color: #28a745;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

.error-message {
    color: #dc3545;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 1.1em;
    color: #525252;
}

.form-group input,
.form-group textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    width: 100%;
    max-width: 100%; /* ضمان عدم التجاوز */
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #525252;
    outline: none;
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

.contact-form button {
    padding: 12px 25px;
    background: linear-gradient(90deg, #525252, #0056b3);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s ease, transform 0.2s ease;
    align-self: center;
}

.contact-form button:hover {
    background: linear-gradient(90deg, #0056b3, #003d82);
    transform: scale(1.05);
}

/* تنسيق قسم المشاركة */
.share-section {
    margin-top: 30px;
    text-align: center;
}

.share-section h3 {
    font-size: 1.6em;
    color: #525252;
    margin-bottom: 20px;
    position: relative;
}

.share-section h3::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 3px;
    background-color: #525252;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 1em;
    transition: transform 0.2s ease, opacity 0.3s ease;
}

.share-button:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.share-button i {
    font-size: 1.2em;
}

.share-button.facebook {
    background-color: #3b5998;
}

.share-button.twitter {
    background-color: #1da1f2;
}

.share-button.linkedin {
    background-color: #0077b5;
}

/* تنسيق الجداول */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 100%; /* ضمان عدم التجاوز */
}

table th,
table td {
    padding: 0.75rem;
    border: 1px solid #ddd;
    text-align: right;
}

table th {
    background: #2c3e50;
    color: #fff;
}

table tr:nth-child(even) {
    background: #f9f9f9;
}

/* تنسيق الأزرار */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 1rem;
    transition: background 0.3s ease;
}

.btn:hover {
    background: #2980b9;
}

/* تنسيق النماذج في لوحة الإدارة */
form {
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    max-width: 500px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

form input[type="text"],
form input[type="password"],
form input[type="number"],
form textarea,
form select {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    max-width: 100%; /* ضمان عدم التجاوز */
}

form textarea {
    height: 200px;
}

form button {
    padding: 0.5rem 1rem;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

form button:hover {
    background: #3498db;
}

/* تصميم متجاوب */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        align-items: center;
        padding: 20px 10px;
    }

    .sidebar,
    .main-content {
        flex: 1;
        width: 100%;
        max-width: 100%;
        min-width: 0; /* إصلاح مشكلة min-width */
    }

    .left-sidebar,
    .right-sidebar {
        order: 0;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
    }

    .footer-section {
        margin-bottom: 30px;
        max-width: 100%; /* ضمان عدم التجاوز */
    }

    header h1 {
        font-size: 2.5em;
    }
}

/* تنسيق قسم التقييم */
.rating-section {
    margin-top: 30px;
    text-align: center;
}

.rating-section h3 {
    font-size: 1.6em;
    color: #525252;
    margin-bottom: 20px;
    position: relative;
}

.rating-section h3::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 3px;
    background-color: #525252;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
}

.rating-stars {
    margin-top: 10px;
    direction: ltr;
}

.stars {
    display: inline-block;
    font-size: 0;
}

.stars input {
    display: none;
}

.stars label {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    display: inline-block;
    padding: 0 5px;
}

.stars label i {
    transition: color 0.3s ease;
}

.stars input:checked ~ label i,
.stars label:hover i,
.stars label:hover ~ label i {
    color: #f5c518;
}

.rating-button {
    margin-top: 10px;
    padding: 10px 20px;
    background: linear-gradient(90deg, #f1c40f, #e67e22);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s ease, transform 0.2s ease;
}

.rating-button:hover {
    background: linear-gradient(90deg, #e67e22, #d35400);
    transform: scale(1.05);
}

/* تنسيق التحميل التدريجي */
.pagination {
    text-align: center;
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
}

.pagination-link {
    padding: 10px 20px;
    background: linear-gradient(90deg, #525252, #0056b3);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: background 0.3s ease, transform 0.2s ease;
}

.pagination-link:hover {
    background: linear-gradient(90deg, #0056b3, #003d82);
    transform: scale(1.05);
}

.pagination span {
    font-size: 1em;
    color: #525252;
}

/* إضافة متغيرات CSS */
:root {
    --background-color: #f8f9fa;
    --text-color: #525252;
    --card-background: linear-gradient(145deg, #ffffff, #f8f8f8);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --link-color: #525252;
    --link-hover-color: #0056b3;
    --header-bg: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)), url('../images/header-bg.jpg') no-repeat center center/cover;
    --navbar-bg: #525252;
    --footer-bg: linear-gradient(90deg, #525252, #444);
}

body.dark-mode {
    --background-color: #1a1a1a;
    --text-color: #e0e0e0;
    --card-background: linear-gradient(145deg, #2a2a2a, #1f1f1f);
    --shadow-color: rgba(255, 255, 255, 0.1);
    --link-color: #66b0ff;
    --link-hover-color: #99ccff;
    --header-bg: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../images/header-bg.jpg') no-repeat center center/cover;
    --navbar-bg: #525252;
    --footer-bg: linear-gradient(90deg, #111, #222);
}

body {
    background: var(--background-color);
    color: var(--text-color);
}

header {
    background: var(--header-bg);
}

.navbar {
    background: var(--navbar-bg);
}

.navbar.subdomain1 {
    background: #1abc9c;
}

.navbar.subdomain2 {
    background: #e74c3c;
}

.article-card,
.article-container,
.block,
.about-content,
.contact-content {
    background: var(--card-background);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.block-content a,
.footer-section a {
    color: var(--link-color);
}

.block-content a:hover,
.footer-section a:hover {
    color: var(--link-hover-color);
}

.footer {
    background: var(--footer-bg);
}

#theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-color);
    z-index: 1000;
    transition: transform 0.3s ease;
}

#theme-toggle:hover {
    transform: scale(1.1);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    max-width: 100%; /* ضمان عدم التجاوز */
}

.admin-table th,
.admin-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: center;
}

.admin-table th {
    background: var(--navbar-bg);
    color: white;
}

.admin-table td {
    background: var(--card-background);
}

.action-button {
    padding: 5px 10px;
    margin: 0 5px;
    text-decoration: none;
    border-radius: 5px;
    color: white;
    transition: background 0.3s ease;
}

.action-button.activate {
    background: #28a745;
}

.action-button.activate:hover {
    background: #218838;
}

.action-button.deactivate {
    background: #dc3545;
}

.action-button.deactivate:hover {
    background: #c82333;
}

.action-button.delete {
    background: #6c757d;
}

.action-button.delete:hover {
    background: #5a6268;
}

/* أنماط زر البحث */
.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-form input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 100%;
    max-width: 100%; /* ضمان عدم التجاوز */
    font-family: 'Tajawal', sans-serif;
    transition: border-color 0.3s ease;
}

.search-form input:focus {
    border-color: #525252;
    outline: none;
}

.search-form button {
    padding: 10px 20px;
    background: linear-gradient(90deg, #525252, #0056b3);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
}

.search-form button:hover {
    background: linear-gradient(90deg, #0056b3, #003f7f);
    transform: scale(1.05);
}

/* أنماط زر إضافة مقال */
.add-article-button {
    display: block;
    padding: 10px 20px;
    background: linear-gradient(90deg, #28a745, #218838);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    text-align: center;
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    transition: background 0.3s ease, transform 0.1s ease, box-shadow 0.3s ease;
    margin: 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-width: 100%; /* ضمان عدم التجاوز */
}

.add-article-button:hover {
    background: linear-gradient(90deg, #218838, #525252);
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .add-article-button {
    background: linear-gradient(90deg, #34c759, #2ba847);
}

body.dark-mode .add-article-button:hover {
    background: linear-gradient(90deg, #2ba847, #23903c);
}

/* أنماط زر تفاصيل أكثر */
.read-more-button {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(90deg, #ff6f61, #ff4d40);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    transition: background 0.3s ease, transform 0.1s ease, box-shadow 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.read-more-button:hover {
    background: linear-gradient(90deg, #ff4d40, #ff2e1f);
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .read-more-button {
    background: linear-gradient(90deg, #ff8a80, #ff6659);
}

body.dark-mode .read-more-button:hover {
    background: linear-gradient(90deg, #ff6659, #ff443a);
}

/* أنماط الصور في لوحة الإدارة */
.table-container .admin-table .article-thumbnail {
    width: 50px !important;
    height: 50px !important;
    border-radius: 5px;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.edit-article-form .article-preview {
    width: 100px;
    height: 100px;
    border-radius: 5px;
    object-fit: cover;
    display: block;
    margin: 10px auto;
}

/* أنماط Quill.js */
.quill-editor {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    min-height: 200px;
    margin-bottom: 10px;
    max-width: 100%; /* ضمان عدم التجاوز */
}

.quill-editor .ql-container {
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    direction: rtl;
}

.quill-editor .ql-toolbar {
    direction: ltr;
}

/* أنماط قسم التقييم */
.rating-section {
    margin: 20px 0;
}

.rating-section h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.rating-stars p {
    margin-bottom: 10px;
}

.rating-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Tajawal', sans-serif;
    background-color: #fff;
    cursor: pointer;
    width: 150px;
    max-width: 100%; /* ضمان عدم التجاوز */
}

.rating-select:focus {
    outline: none;
    border-color: #525252;
}

.rating-button {
    padding: 8px 16px;
    background: linear-gradient(90deg, #525252, #0056b3);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.rating-button:hover {
    background: linear-gradient(90deg, #0056b3, #003f7f);
}

body.dark-mode .rating-select {
    background-color: #525252;
    color: white;
    border-color: #444;
}

body.dark-mode .rating-button {
    background: linear-gradient(90deg, #0056b3, #003f7f);
}

/* تنسيق رسالة الغلق */
.closure-message {
    max-width: 100%;
    margin: 20px auto;
    padding: 20px;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../public/images/closure-bg.jpg') no-repeat center center/cover;
    color: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--shadow-color);
    text-align: center;
    font-size: 1.2em;
    line-height: 1.8;
}

.closure-message p {
    margin: 10px 0;
    font-family: 'Tajawal', sans-serif;
}

/* استبدال <font> بأنماط CSS */
.closure-message font[color="white"] {
    color: white;
    font-size: 1.5em;
}

.closure-message font[color="green"] {
    color: green;
    font-size: 1.5em;
}

.closure-message font[color="red"] {
    color: red;
    font-size: 1.5em;
}

.closure-message img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

body.dark-mode .closure-message {
    background: linear-gradient(145deg, #ff6659, #ff443a);
    color: #e0e0e0;
}

/* تنسيق خاص لصفحة تسجيل الدخول */
.login-container {
    background: var(--card-background);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--shadow-color);
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.login-container h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: var(--text-color);
    border-bottom: 3px solid #525252;
    padding-bottom: 10px;
    position: relative;
}

.login-container h2::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 3px;
    background-color: #525252;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
}

.login-container form {
    max-width: 100%;
}

.login-container .form-group {
    margin-bottom: 15px;
}

.login-container .form-group label {
    font-size: 1.1em;
    color: var(--text-color);
    margin-bottom: 8px;
}

.login-container .form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    max-width: 100%; /* ضمان عدم التجاوز */
}

.login-container .form-group input:focus {
    border-color: #525252;
    outline: none;
}

.login-container button {
    padding: 10px 20px;
    background: linear-gradient(90deg, #525252, #0056b3);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s ease, transform 0.2s ease;
}

.login-container button:hover {
    background: linear-gradient(90deg, #0056b3, #003d82);
    transform: scale(1.05);
}

.login-container p {
    margin-top: 15px;
    font-size: 1em;
    color: var(--text-color);
}

.login-container p a {
    color: var(--link-color);
    text-decoration: none;
}

.login-container p a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* تنسيق محتوى الصفحة */
.page-content {
    background: var(--card-background);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--shadow-color);
    font-size: 1.2em;
    line-height: 1.8;
    color: var(--text-color);
    width: 100%;
    max-width: 100%; /* ضمان عدم التجاوز */
}

.page-content p {
    margin-bottom: 20px;
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 15px 0;
}

.page-content h1,
.page-content h2,
.page-content h3 {
    margin: 20px 0;
}

.page-content ul,
.page-content ol {
    margin: 20px 0;
    padding-right: 20px;
}

.page-content a {
    color: #525252;
    text-decoration: none;
}

.page-content a:hover {
    text-decoration: underline;
}

.page-content iframe {
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 15px 0;
    border-radius: 12px;
}

.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    max-width: 100%; /* ضمان عدم التجاوز */
}

.page-content table,
.page-content th,
.page-content td {
    border: 1px solid var(--border-color, #ddd);
}

.page-content th,
.page-content td {
    padding: 12px;
    text-align: right;
}

.page-content th {
    background-color: var(--card-background, #f8f9fa);
    font-weight: bold;
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4,
.page-content h5,
.page-content h6 {
    margin: 20px 0;
}

.page-content ul,
.page-content ol {
    margin: 20px 0;
    padding-right: 20px;
}

.page-content blockquote {
    border-right: 4px solid #525252;
    padding: 10px 20px;
    margin: 20px 0;
    background-color: var(--card-background, #f8f9fa);
}

.page-content code {
    background-color: #f4f4f4;
    padding: 2px 4px;
    border-radius: 4px;
}

.page-content pre {
    background-color: #f4f4f4;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}