/* ملف: css/media-styles.css */
/* أنماط الوسائط المتقدمة للموقع */

/* ===== أنماط الصفحة الرئيسية ===== */

.articles-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px;
}

.articles-grid {
    display: grid;
    gap: 20px;
    margin: 25px 0;
}

/* العرض في صفين (افتراضي) */
.articles-grid.two-rows {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

/* العرض في صف واحد */
.articles-grid.single-row {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 25px auto;
}

.article-preview {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    direction: rtl;
    text-align: right;
    position: relative;
}

.article-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

/* أنواع الوسائط المختلفة */
.media-container {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.media-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-preview:hover .media-container img {
    transform: scale(1.03);
}

.media-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-container.youtube {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: white;
    flex-direction: column;
    gap: 12px;
}

.media-container.text-only {
    background: linear-gradient(135deg, var(--primary-color) 0%, #a07a4d 100%);
    color: white;
    flex-direction: column;
    gap: 8px;
}

.media-icon {
    font-size: 2.5em;
    opacity: 0.9;
}

.media-label {
    font-size: 1em;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
}

/* مؤشر نوع الوسائط */
.media-type-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 6px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.media-type-indicator.image {
    background: rgba(40, 167, 69, 0.9);
}

.media-type-indicator.video {
    background: rgba(220, 53, 69, 0.9);
}

.media-type-indicator.youtube {
    background: rgba(255, 0, 0, 0.9);
}

/* محتوى المقال في الصفحة الرئيسية */
.article-content {
    padding: 18px;
}

.article-preview h3 {
    font-family: 'Amiri', serif;
    font-size: 1.3em;
    margin: 0 0 12px 0;
    line-height: 1.4;
    color: var(--text-color);
}

.article-preview h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-preview h3 a:hover {
    color: var(--primary-color);
}

.article-preview p {
    font-family: 'Noto Naskh Arabic', serif;
    color: var(--secondary-text-color);
    line-height: 1.6;
    margin: 12px 0;
    font-size: 1em;
    text-align: justify;
    direction: rtl;
}

.article-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 12px 0;
    padding: 12px 0 0 0;
    border-top: 1px solid #eee;
    font-size: 0.85em;
    color: var(--secondary-text-color);
    flex-wrap: nowrap !important;
    gap: 15px;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}


/* حل بديل أقوى */
.articles-grid .article-meta {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
}

.articles-grid .article-meta span {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.read-more {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a07a4d 100%);
    color: white !important;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    margin-top: 10px;
    font-size: 0.9em;
}

.read-more:hover {
    background: linear-gradient(135deg, #a07a4d 0%, #8b6a42 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(200, 150, 92, 0.4);
}

/* نصوص الترحيب والعناوين */
.welcome-text {
    text-align: center;
    margin: 18px 0;
    padding: 18px;
    font-family: 'Cairo', sans-serif;
    color: var(--light-text-color);
    font-size: 0.95em;
    line-height: 1.6;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.section-title {
    text-align: center;
    margin: 30px 0 25px 0;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a07a4d 100%);
    color: white !important;
    border-radius: 8px;
    font-family: 'El Messiri', serif;
    font-size: 1.5em;
    box-shadow: 0 2px 10px rgba(200, 150, 92, 0.3);
}

.archive-link {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
    border-radius: 8px;
    border-left: 4px solid #2196f3;
    box-shadow: 0 2px 10px rgba(33, 150, 243, 0.1);
}

.archive-link a {
    color: #1976d2;
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    font-family: 'Cairo', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.archive-link a:hover {
    color: #0d47a1;
    transform: translateY(-1px);
}

/* ===== أنماط صفحة المقال (subject.php) ===== */

/* إعدادات الخطوط المحسنة */
.article-title {
    font-family: 'Amiri', serif !important;
    font-size: 1.9em !important;
    font-weight: 700 !important;
    color: var(--text-color) !important;
    text-align: center !important;
    margin: 25px 0 !important;
    line-height: 1.4 !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.article-content {
    font-family: 'Noto Naskh Arabic', serif !important;
    font-size: var(--font-size, 18px) !important;
    line-height: 1.8 !important;
    color: #333 !important;
    text-align: justify !important;
    margin: 25px 0 !important;
}

/* تنسيق الفقرات في المقالات */
.article-content p {
    margin-bottom: 0.75em;        /* مسافة بين الفقرات */
    text-indent: 1em;            /* مسافة بادئة للسطر الأول */
    line-height: 1.8;            /* تحسين المسافة بين الأسطر */
}


/* تنسيق إضافي للفقرات في المعاينات */
.article-preview p {
    margin-bottom: 1.2em;
    text-indent: 1.5em;
}

/* تحسين شامل لعرض الوسائط في المتن */
.article-content img,
#main img,
div[id="main"] img {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
    border-radius: 6px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.1);
    margin: 12px auto;
    display: block;
    border: 1px solid #eee;
}

.article-content video,
#main video,
div[id="main"] video {
    max-width: 100% !important;
    height: auto !important;
    width: 100% !important;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    margin: 18px auto;
    display: block;
    background: #000;
}

.article-content audio,
#main audio,
div[id="main"] audio {
    width: 100% !important;
    max-width: 500px !important;
    margin: 18px auto;
    display: block;
    border-radius: 6px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.1);
}

.article-content iframe,
#main iframe,
div[id="main"] iframe {
    max-width: 100% !important;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    margin: 18px auto;
    display: block;
    border: none;
}

.article-content div[style*="position: relative"],
#main div[style*="position: relative"] {
    margin: 20px auto !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15) !important;
}

/* قسم التنقل (Breadcrumb) المحدث */
.breadcrumb-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 18px;
    border-radius: 6px;
    margin: 18px 0;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 1px 8px rgba(0,0,0,0.1);
}

.breadcrumb-item {
    margin: 6px 0;
    font-size: 0.9em;
}

.breadcrumb-item i {
    color: var(--primary-color);
    margin-left: 6px;
}

.breadcrumb-item.subject-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a07a4d 100%);
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: none;
}

.breadcrumb-item.subject-title i {
    color: #ffffff;
    margin-left: 8px;
    font-size: 1em;
}

/* أدوات التحكم في الخط */
.top-font-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 18px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #eee;
    flex-wrap: nowrap;
}

.top-font-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 6px 8px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    text-decoration: none;
    color: #333;
    font-size: 0.7em;
    white-space: nowrap;
    flex-shrink: 0;
}

.top-font-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.top-font-btn i {
    font-size: 0.9em;
}

/* تحسين الصورة */
.article-image {
    text-align: center;
    margin: 25px 0;
}

.article-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    border: 2px solid #eee;
}

.article-author {
    text-align: left;
    font-style: italic;
    color: var(--light-text-color);
    margin-top: 25px;
    padding-top: 18px;
    border-top: 2px solid #eee;
    font-family: 'Cairo', sans-serif;
}

/* أدوات المقال المصغرة */
.article-tools-section {
    background: white;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.1);
    margin: 18px 0;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 6px;
    margin-bottom: 12px;
}

.tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    background: #f8f9fa;
    border: 2px solid #eee;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-size: 0.75em;
}

.tool-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tool-btn i {
    font-size: 1.2em;
}

/* صندوق المشاركة */
.share-section {
    background: #f0f8ff;
    padding: 18px;
    border-radius: 6px;
    border: 1px solid #b3d9ff;
    margin: 18px 0;
    text-align: center;
}

.share-section h3 {
    color: #1976d2;
    margin-bottom: 12px;
    font-family: 'El Messiri', serif;
    font-size: 1.2em;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 5px;
    text-decoration: none;
    color: white !important;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Cairo', sans-serif;
    font-size: 0.8em;
    white-space: nowrap;
}

.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/* أزرار المشاركة الرئيسية - تدرجات بنية متناسقة */
.share-btn.facebook { 
    background: linear-gradient(135deg, #c8965c 0%, #a07a4d 100%);
    border: 1px solid #a07a4d;
}

.share-btn.twitter { 
    background: linear-gradient(135deg, #b8845c 0%, #8b6914 100%);
    border: 1px solid #8b6914;
}

.share-btn.whatsapp { 
    background: linear-gradient(135deg, #cd7f32 0%, #a07a4d 100%);
    border: 1px solid #a07a4d;
}

.share-btn.telegram { 
    background: linear-gradient(135deg, #d4a76a 0%, #b8845c 100%);
    border: 1px solid #b8845c;
}

.share-btn.email { 
    background: linear-gradient(135deg, #c8965c 0%, #8b6914 100%);
    border: 1px solid #8b6914;
}

/* تأثيرات التفاعل */
.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(200, 150, 92, 0.4);
    filter: brightness(1.1);
}

.share-btn i {
    font-size: 0.9em;
}

/* التنقل بين المواضيع */
.navigation-section {
    margin: 30px 0;
    background: #f8f9fa;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}

.nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #ddd;
}

.nav-link {
    padding: 18px;
    background: white;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 90px;
}

.nav-link:hover {
    background: var(--primary-color);
    color: white;
}

.nav-link i {
    font-size: 1.8em;
    color: var(--primary-color);
}

.nav-link:hover i {
    color: white;
}

.nav-link.prev {
    text-align: right;
    justify-content: flex-end;
}

.nav-link.next {
    text-align: left;
    justify-content: flex-start;
}

/* قسم التعليقات */
.comments-section {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
    border-radius: 6px;
    padding: 20px;
    margin: 25px 0;
    text-align: center;
    border-left: 4px solid #2196f3;
}

.comments-section h3 {
    color: #1976d2;
    margin-bottom: 12px;
    font-family: 'El Messiri', serif;
    font-size: 1.2em;
}

.comment-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.comment-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #2196f3;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: bold;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9em;
}

.comment-btn:hover {
    background: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(33, 150, 243, 0.4);
}

/* زر إضافة تعليق - بني ذهبي دافئ */
.comment-btn.add {
    background: linear-gradient(135deg, #cd7f32 0%, #8b6914 100%);
    border: 2px solid #8b6914;
    color: white !important;
    font-weight: bold;
    transition: all 0.3s ease;
}

.comment-btn.add:hover {
    background: linear-gradient(135deg, #8b6914 0%, #6b5010 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(205, 127, 50, 0.4);
}

/* أزرار التعليقات الأخرى */
.comment-btn.view {
    background: linear-gradient(135deg, #d4a76a 0%, #b8845c 100%);
    border: 2px solid #b8845c;
	color: white !important;

}

.comment-btn.view:hover {
    background: linear-gradient(135deg, #b8845c 0%, #a07a4d 100%);
    box-shadow: 0 3px 12px rgba(212, 167, 106, 0.4);
}

/* الروابط الاجتماعية */
.social-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #a07a4d 100%);
    border-radius: 6px;
    padding: 20px;
    margin: 25px 0;
    text-align: center;
    color: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.social-section h3 {
    margin-bottom: 18px;
    color: white;
    font-family: 'El Messiri', serif;
    font-size: 1.2em;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 15px;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    border: 2px solid rgba(255,255,255,0.3);
    font-size: 0.85em;
    white-space: nowrap;
}

.social-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.5);
}

.social-link i {
    font-size: 1.1em;
}

/* الشريط الثابت - تحديث الأحجام */
.sticky-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a07a4d 100%);
    color: white;
    padding: 8px 0;
    box-shadow: 0 -3px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    border-top: 3px solid rgba(255,255,255,0.2);
}

.sticky-bar-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

.sticky-font-section {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sticky-font-controls {
    display: flex;
    gap: 4px;
}

.sticky-font-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8em;
}

.sticky-font-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.sticky-share-section,
.sticky-social-section {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sticky-share-label,
.sticky-social-label {
    font-size: 0.8em;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    font-family: 'Cairo', sans-serif;
}

.sticky-share-toggle,
.sticky-social-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 28px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 18px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.sticky-share-toggle:hover,
.sticky-social-toggle:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.03);
}

.sticky-share-dropdown,
.sticky-social-dropdown {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 20px;
    padding: 6px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.3);
    display: none;
    flex-direction: row;
    gap: 4px;
    border: 2px solid var(--primary-color);
}

.sticky-share-dropdown.active,
.sticky-social-dropdown.active {
    display: flex;
}

.sticky-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.8em;
}

.sticky-share-btn:hover {
    transform: scale(1.05);
}

.sticky-share-btn.facebook,
.sticky-share-btn.twitter,
.sticky-share-btn.whatsapp,
.sticky-share-btn.telegram,
.sticky-share-btn.email {
    background: var(--primary-color) !important;
}

/* تأثيرات التفاعل الموحدة */
.sticky-share-btn:hover,
.sticky-social-btn:hover {
    background: #a07a4d !important;
    transform: scale(1.05) !important;
}

.sticky-share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    filter: brightness(1.15);
}

.sticky-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.8em;
}

.sticky-social-btn:hover {
    background: #a07a4d;
    transform: scale(1.05);
}

/* تحسين تحميل الصور */
.media-container img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-container img[loading="lazy"].loaded {
    opacity: 1;
}

/* أنماط البحث */
.search-container {
    max-width: 900px;
    margin: 18px auto;
    padding: 18px;
    font-family: 'Cairo', sans-serif;
}

.search-header {
    text-align: center;
    margin-bottom: 25px;
    padding: 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.search-header h1 {
    font-family: 'El Messiri', serif;
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 1.8em;
}

.search-form-main {
    background: white;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    border: 1px solid #eee;
}

.search-form-main .form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.search-form-main input[type="text"] {
    flex: 1;
    min-width: 220px;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9em;
    transition: border-color 0.3s ease;
}

.search-form-main input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 6px rgba(200, 150, 92, 0.3);
}

.search-form-main select {
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: white;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9em;
    min-width: 180px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.search-form-main select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-form-main input[type="submit"] {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a07a4d 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: bold;
    font-size: 0.9em;
    transition: all 0.3s ease;
    min-width: 90px;
}

.search-form-main input[type="submit"]:hover {
    background: linear-gradient(135deg, #a07a4d 0%, #8b6a42 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(200, 150, 92, 0.4);
}

.search-results-header {
    background: #e3f2fd;
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 18px;
    border-left: 4px solid #2196f3;
}

.search-results-header h2 {
    color: #1976d2;
    margin: 0;
    font-family: 'El Messiri', serif;
    font-size: 1.3em;
}

.search-result-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    text-align: justify;
    direction: rtl;
}

.search-result-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.search-result-number {
    color: var(--search-number-color, #666666);
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.search-result-title {
    margin: 8px 0;
    font-size: 1.3em;
    text-align: center;
}

.search-result-title a {
    color: var(--text-color);
    text-decoration: none;
    font-family: 'Amiri', serif;
    line-height: 1.4;
}

.search-result-title a:hover {
    color: var(--primary-color);
}

.search-result-meta {
    color: var(--light-text-color);
    font-size: 0.85em;
    margin: 8px 0;
    text-align: center;
}

.search-result-meta a {
    color: var(--primary-color);
    text-decoration: none;
}

.search-result-meta a:hover {
    text-decoration: underline;
}

.search-result-content {
    line-height: 1.8;
    color: var(--text-color);
    font-size: 1em;
    margin: 12px 0;
    text-align: justify;
}

/* إصلاح تلوين البحث */
.search-highlight-title {
    background-color: var(--search-highlight-title-bg, #69a321);
    color: var(--search-highlight-title-color, #ffffff);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.search-highlight-body {
    background-color: var(--search-highlight-body-bg, #428cb7);
    color: var(--search-highlight-body-color, #ffffff);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.search-pagination {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.search-pagination a {
    color: var(--link-color);
    text-decoration: none;
    padding: 6px 10px;
    margin: 0 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.search-pagination a:hover {
    background: var(--primary-color);
    color: white;
}

.search-stats {
    text-align: left;
    margin: 20px 0;
    padding: 12px;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border-radius: 6px;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
    font-size: 0.9em;
}

.no-results {
    text-align: center;
    padding: 40px 18px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 6px;
    color: #e65100;
    margin: 25px 0;
    border-left: 4px solid #ff9800;
}

.error-message {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    padding: 18px;
    border-radius: 6px;
    text-align: center;
    margin: 18px 0;
    border-left: 4px solid #f44336;
}

/* أنماط الأرشيف */
.archive-header {
    text-align: center;
    margin: 25px 0;
    padding: 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.archive-header h1 {
    font-family: 'El Messiri', serif;
    font-size: 2em;
    color: var(--text-color);
    margin-bottom: 8px;
}

.archive-stats {
    color: var(--light-text-color);
    font-size: 1em;
    font-family: 'Cairo', sans-serif;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    margin: 25px 0;
}

.archive-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.archive-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.archive-item h3 {
    margin: 0 0 8px 0;
    font-size: 1.2em;
}

.archive-item h3 a {
    color: var(--text-color);
    text-decoration: none;
    font-family: 'Amiri', serif;
    display: flex;
    align-items: center;
    gap: 6px;
}

.archive-item h3 a:hover {
    color: var(--primary-color);
}

.archive-item p {
    color: var(--light-text-color);
    line-height: 1.6;
    margin: 8px 0;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9em;
}

.archive-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    font-size: 0.85em;
    color: #888;
    flex-wrap: wrap;
    gap: 8px;
}

.archive-date {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.archive-section {
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.archive-section:hover {
    text-decoration: underline;
}

.archive-views {
    background: var(--primary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* أنماط الأرشيف الكلاسيكي */
.archive-classic-container {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
    max-width: 900px;
    margin: 0 auto;
    padding: 18px;
}

.archive-classic-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 18px;
    border-radius: 6px;
    margin: 18px 0;
    text-align: center;
    border-left: 4px solid var(--primary-color);
}

.archive-classic-header h1 {
    font-family: 'El Messiri', serif;
    color: var(--text-color);
    font-size: 1.6em;
    margin: 0;
}

.archive-classic-content {
    background: white;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 18px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}

.archive-item {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.archive-item:hover {
    background-color: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    border-bottom: 1px solid transparent;
}

.archive-item:last-child {
    border-bottom: none;
}

.archive-item-title {
    font-weight: bold;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.archive-bullet {
    color: var(--dots-color);
    font-size: 0.6em;
}

.archive-item-title a {
    color: var(--text-color);
    text-decoration: none;
    font-family: 'Amiri', serif;
    font-size: 1em;
    line-height: 1.4;
    flex: 1;
}

.archive-item-title a:hover {
    color: var(--link-hover-color);
}

.archive-item-meta {
    font-size: 0.85em;
    color: var(--light-text-color);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.archive-item-meta a {
    color: var(--link-hover-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 3px;
}

.archive-item-meta a:hover {
    text-decoration: underline;
}

.meta-separator {
    color: var(--dots-color);
}

.archive-date {
    display: flex;
    align-items: center;
    gap: 3px;
}

.archive-pagination {
    background: #f8f9fa;
    padding: 18px;
    border-radius: 6px;
    text-align: center;
    margin: 18px 0;
    border: 1px solid #eee;
}

/* إصلاح Pagination - منع كسر الأسطر */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap !important; /* منع كسر الأسطر */
    gap: 4px;
    margin-bottom: 12px;
    overflow-x: auto; /* تمرير أفقي إذا لزم الأمر */
    padding: 5px 0;
    white-space: nowrap;
}

.pagination-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap !important; /* منع كسر الأسطر */
    white-space: nowrap;
    overflow-x: auto;
    padding: 5px 0;
}

.pagination-btn,
.pagination-num,
.current-page {
    color: var(--link-color);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 3px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: 1px solid #ddd;
    background: white;
    font-size: 0.9em;
    flex-shrink: 0 !important; /* منع تقليص العناصر */
    white-space: nowrap;
    min-width: auto;
}

.pagination-btn:hover,
.pagination-num:hover {
    background: var(--link-hover-color);
    color: white;
    border-color: var(--link-hover-color);
}

.current-page {
    background: var(--link-hover-color);
    color: white;
    font-weight: bold;
    border-color: var(--link-hover-color);
}

.pagination-ellipsis {
    color: var(--light-text-color);
    padding: 6px 3px;
    flex-shrink: 0;
}

.pagination-label {
    color: var(--light-text-color);
    font-weight: bold;
    padding: 6px 10px;
    font-size: 0.9em;
    flex-shrink: 0;
}

.archive-stats {
    color: var(--light-text-color);
    font-size: 0.85em;
    margin-top: 8px;
    line-height: 1.6;
}

/* تحسينات متجاوبة */
@media (max-width: 1200px) {
    .article-content img,
    .article-content video,
    .article-content audio,
    #main img,
    #main video,
    #main audio {
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .articles-grid.two-rows,
    .articles-grid.single-row {
        grid-template-columns: 1fr;
        max-width: 100%;
        margin: 25px 0;
    }
}
    
    .article-preview {
        margin: 0 8px;
    }
    
    .media-container {
        height: 180px;
    }
    
    .article-content {
        padding: 12px;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .section-title {
        font-size: 1.3em;
        margin: 25px 0 18px 0;
        padding: 12px;
    }
    
    .article-title {
        font-size: 1.6em !important;
    }
    
    .breadcrumb-item.subject-title {
        font-size: 1.2em;
        padding: 10px 12px;
    }
    
    .top-font-btn {
        padding: 5px 6px;
        font-size: 0.65em;
        gap: 2px;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 5px;
    }
    
    .nav-links {
        grid-template-columns: 1fr;
    }
    
    .comment-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .comment-btn {
        width: 100%;
        max-width: 220px;
        justify-content: center;
    }
    
    .social-links {
        gap: 6px;
    }
    
    .social-link {
        flex: 1 1 calc(50% - 3px);
        min-width: 110px;
        max-width: 140px;
        justify-content: center;
        padding: 8px 6px;
        font-size: 0.8em;
    }
    
    .share-buttons {
        gap: 5px;
    }
    
    .share-btn {
        flex: 1 1 calc(50% - 2px);
        min-width: 100px;
        max-width: 130px;
        justify-content: center;
        padding: 8px 6px;
        font-size: 0.75em;
    }

    .sticky-bar-content {
        gap: 10px;
        flex-wrap: wrap;
    }

    .sticky-share-label,
    .sticky-social-label {
        display: none;
    }
    
    .article-content img,
    .article-content video,
    .article-content audio,
    #main img,
    #main video,
    #main audio {
        max-width: 100% !important;
        border-radius: 4px;
        margin: 8px auto;
        box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    }
    
    /* إصلاح Pagination للهواتف */
    .pagination-container,
    .pagination-links {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .pagination-btn,
    .pagination-num,
    .current-page {
        font-size: 0.8em;
        padding: 4px 8px;
        min-width: 32px;
    }
}

@media (max-width: 480px) {
    .pagination-container {
        gap: 2px;
    }
    
    .pagination-btn,
    .pagination-num,
    .current-page {
        font-size: 0.75em;
        padding: 3px 6px;
        min-width: 28px;
    }
}

/* ===== تمييز الأقسام الرئيسية والفرعية ===== */

/* الأقسام الرئيسية */
.main-side-menu > li {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-right: 4px solid var(--primary-color);
    margin-bottom: 8px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-side-menu > li > a {
    display: block;
    padding: 15px 18px;
    font-weight: bold;
    font-size: 1.2em;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.main-side-menu > li > a:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateX(-2px);
}

/* الأقسام الفرعية */
.sub-menu {
    background: white;
    border-radius: 0 0 6px 6px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    margin-top: -5px;
    padding-top: 5px;
}

.sub-menu li {
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.sub-menu li:before {
    position: absolute;
    right: 15px;
    color: #ccc;
    font-size: 0.8em;
}

.sub-menu li a {
    display: block;
    padding: 8px 15px 8px 35px;
    font-size: 0.9em;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sub-menu li a:hover {
    background: #f5f5f5;
    color: var(--primary-color);
    padding-right: 20px;
}

/* عداد المقالات */
.sub-menu li a .count {
    float: left;
    background: var(--primary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: bold;
}

/* خلفية فاتحة متناسقة مع ألوان الموقع */
.social-icons {
    background: linear-gradient(135deg, #f8f6f3 0%, #f0ede8 100%) !important;
    border: 1px solid #e8e5e0 !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(200, 150, 92, 0.1) !important;
    padding: 18px 12px !important;
    margin: 15px 0 !important;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* تنسيق الأيقونات مع الخلفية الجديدة */
.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a07a4d 100%);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(200, 150, 92, 0.3);
}

.social-icons a:hover {
    background: linear-gradient(135deg, #a07a4d 0%, #8b6a42 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(200, 150, 92, 0.4);
}
