/* الأنماط المخصصة لمدونة أدوات AI */

/* تفعيل الخطوط الرسمية بناءً على لغة المستند */
html[lang="ar"], 
html[lang="ar"] body, 
html[lang="ar"] h1, 
html[lang="ar"] h2, 
html[lang="ar"] h3, 
html[lang="ar"] p, 
html[lang="ar"] li, 
html[lang="ar"] span, 
html[lang="ar"] button, 
html[lang="ar"] a {
    font-family: 'Tajawal', sans-serif !important;
}

html[lang="en"], 
html[lang="en"] body, 
html[lang="en"] h1, 
html[lang="en"] h2, 
html[lang="en"] h3, 
html[lang="en"] p, 
html[lang="en"] li, 
html[lang="en"] span, 
html[lang="en"] button, 
html[lang="en"] a {
    font-family: 'Outfit', sans-serif !important;
}

/* شريط تقدم القراءة */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #047857, #059669);
    z-index: 100;
    transition: width 0.3s ease;
}

/* زر العودة للأعلى */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(45deg, #047857, #059669);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 50;
    border: none;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(5, 150, 105, 0.3);
}

/* محتوى المقال الإملائي وتنسيق الخطوط */
.article-content {
    line-height: 1.85;
    font-size: 1.125rem;
}

.article-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    font-size: 1.625rem;
    font-weight: 700;
    color: #047857;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.dark .article-content h2 {
    color: #34d399;
    border-bottom-color: #334155;
}

.article-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
}

.dark .article-content h3 {
    color: #f1f5f9;
}

.article-content p,
.article-content li {
    margin-bottom: 1.25rem;
    color: #4b5563;
}

.dark .article-content p,
.dark .article-content li {
    color: #cbd5e1;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
}

html[dir="rtl"] .article-content ul,
html[dir="rtl"] .article-content ol {
    padding-right: 1.5rem;
    padding-left: 0;
}

html[dir="ltr"] .article-content ul,
html[dir="ltr"] .article-content ol {
    padding-left: 1.5rem;
    padding-right: 0;
}

/* وسوم المقال */
.tag {
    display: inline-block;
    background: rgba(5, 150, 105, 0.1);
    color: #047857;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.25rem;
    transition: all 0.3s ease;
}

.dark .tag {
    background: rgba(5, 150, 105, 0.2);
    color: #34d399;
}

.tag:hover {
    background: #059669;
    color: white;
}

/* تأثيرات الظهور التدريجي ومربعات التنبيه */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}

.notification {
    animation: slideIn 0.3s ease-out forwards, fadeOut 0.5s ease-in 2.5s forwards;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* الشفافية والانتقالات العامة */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* تنسيق النافذة المنبثقة لمنع أخطاء العرض والوميض */
#newsletter-modal-overlay {
    transition: opacity 0.3s ease-in-out;
}

body.modal-open {
    overflow: hidden;
}/* تنسيقات ثابتة ومحمية لأزرار المشاركة لمنع اختفاء الألوان */
.share-btn-container {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
}

.share-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem !important; /* حواف دائرية متناسقة */
    font-size: 0.875rem !important; /* text-sm */
    font-weight: 600 !important;
    color: #ffffff !important;
    transition: all 0.2s ease-in-out !important;
    cursor: pointer !important;
    border: none !important;
    outline: none !important;
}

.share-btn:hover {
    opacity: 0.9 !important;
    transform: translateY(-1px) !important;
}

.share-btn i {
    font-size: 1rem !important;
    display: inline-block !important;
}

/* الألوان الرسمية للمنصات الاجتماعية */
.btn-twitter { background-color: #1DA1F2 !important; }
.btn-facebook { background-color: #1877F2 !important; }
.btn-linkedin { background-color: #0A66C2 !important; }
.btn-whatsapp { background-color: #25D366 !important; }
.btn-copy { background-color: #64748B !important; }
/* تنسيق وحماية حاويات الإعلانات لضمان ثبات أبعادها ومظهرها في كل الأوضاع */
.ad-container-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    margin-top: 2rem !important;    /* مسافة علوية متناسقة */
    margin-bottom: 2rem !important; /* مسافة سفلية متناسقة */
    background-color: #f9fafb !important; /* خلفية رمادية خفيفة في الوضع المضيء */
    border: 1px dashed #e5e7eb !important; /* حدود منقطة رمادية */
    border-radius: 0.5rem !important; /* حواف دائرية ناعمة */
    overflow: hidden !important;
    min-height: 120px !important; /* ارتفاع أدنى للهواتف يمنع انهيار الحاوية */
}

/* التنسيق المتوافق مع الوضع المظلم */
.dark .ad-container-wrapper {
    background-color: rgba(30, 41, 59, 0.4) !important; /* خلفية داكنة مريحة للعين */
    border-color: #334155 !important; /* حدود منقطة متناسقة مع الوضع المظلم */
}

/* تعديل الارتفاع الأدنى ليناسب شاشات الأجهزة المكتبية والتابلت */
@media (min-width: 768px) {
    .ad-container-wrapper {
        min-height: 250px !important; /* ارتفاع مناسب للإعلانات الكبيرة على الديسكتوب */
    }
}