/*
=====================================================
--- 🎨 التصميم الجديد الراقي (نسخة الترددات) 🎨 ---
=====================================================
*/

/* 1. الإعدادات الأساسية والخطوط
----------------------------------- */
:root {
    --font-primary: 'Tajawal', sans-serif;
    --font-heading: 'Amiri', serif;
    --color-bg: #f4f9ff;
    /* أزرق سماوي فاتح جداً */
    --color-card-bg: #ffffff;
    --color-text: #333;
    --color-text-light: #555;
    --color-primary: #005a78;
    /* أزرق داكن (تيلي) */
    --color-accent: #d4af37;
    /* ذهبي مطفي */
    --color-border: #e0e6f0;
    --shadow-soft: 0 4px 12px rgba(0, 90, 120, 0.05);
    --shadow-medium: 0 8px 25px rgba(0, 90, 120, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    padding-bottom: 50px;
}

/* 2. شريط التنقل (Nav)
----------------------------------- */
.main-nav {
    background-color: var(--color-card-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    padding: 15px 0;
    margin-bottom: 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.8em;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

.nav-links a {
    font-family: var(--font-primary);
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 500;
    margin-right: 25px;
    padding: 8px 0;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--color-primary);
}

.nav-links a.active {
    color: var(--color-primary);
    font-weight: 700;
    border-bottom-color: var(--color-accent);
}

/* 3. الهيكل العام ومقدمة الصفحة
----------------------------------- */
.main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 30px;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 3em;
    color: var(--color-primary);
    font-weight: 700;
    margin-bottom: 10px;
}

.page-subtitle {
    font-size: 1.2em;
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* 4. بطاقة البحث الرئيسية (Search/Frequency Card)
----------------------------------- */
.search-card {
    background-color: var(--color-card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    /* لضمان تناسق الزوايا */
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.search-card:hover {
    box-shadow: 0 12px 35px rgba(0, 90, 120, 0.15);
}

/* 5. زر فتح/إغلاق الأداة
----------------------------------- */
.search-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--color-primary), #007a9e);
    color: #ffffff;
    transition: background-color 0.3s ease;
}

.search-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--color-primary), #007a9e);
    color: #ffffff;
    transition: background-color 0.3s ease;
}

.search-toggle span {
    font-family: var(--font-primary);
    font-size: 1.5em;
    font-weight: 700;
}

.search-toggle i {
    font-size: 1.2em;
    margin-left: 10px;
}

.search-toggle .toggle-icon {
    font-size: 1.4em;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* تأثير السهم عند الفتح */
.search-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

/* 6. محتوى الأداة (الفورم)
----------------------------------- */
.search-content {
    padding: 30px;
    border-top: 1px solid var(--color-border);
    display: none;
    /* يتم إظهاره بـ slideToggle() */
}

.channel-prompt {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 15px;
}

.channel-prompt strong {
    color: var(--color-text);
    font-weight: 800;
}

/* تنسيق حقول بيانات المستخدم */
.user-details-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 0.9em;
}

.user-input-field {
    width: 100%;
    padding: 12px 40px 12px 15px;
    /* مساحة للأيقونة */
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-family: var(--font-primary);
    font-size: 1em;
    color: var(--color-text);
    background-color: #fcfdff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.user-input-field::placeholder {
    color: #999;
}

.user-input-field:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
    background-color: var(--color-card-bg);
}

/* تنسيق حقل الحلم / اسم القناة */
/* ADAPTED: Added #channel-input selector */
/* تنسيق حقل الحلم (إبقاءه كما هو إذا وجد) */
textarea#dream-input {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-family: var(--font-primary);
    font-size: 1.1em;
    color: var(--color-text);
    background-color: #fcfdff;
    resize: vertical;
    margin-bottom: 20px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* تنسيق حقل البحث عن التردد (تحسين مميز) */
input#channel-input {
    width: 100%;
    padding: 22px 25px;
    /* تكبير الحشو */
    border: 2px solid var(--color-primary);
    /* حدود ملونة واضحة */
    border-radius: 50px;
    /* تدوير الحواف بالكامل */
    font-family: var(--font-primary);
    font-size: 1.3em;
    /* تكبير الخط */
    color: var(--color-primary);
    background-color: #ffffff;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 90, 120, 0.08);
    /* ظل ناعم */
    text-align: center;
    /* توسيط النص */
}

input#channel-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.25);
    transform: translateY(-2px);
}

input#channel-input::placeholder {
    color: #999;
    font-weight: 300;
}

/* تنسيق السؤال الأمني */
.security-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    background-color: #fcfdff;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
}

.security-group .channel-prompt {
    margin-bottom: 0;
    flex-shrink: 0;
    /* لمنع النص من الانكماش */
}

.security-group .channel-prompt i {
    color: var(--color-accent);
}

.security-group input {
    flex-grow: 1;
    /* ليأخذ باقي المساحة */
    padding-right: 15px;
    /* إزالة مساحة الأيقونة */
    /* Ensuring input style matches */
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}

/* 7. زر التفسير/البحث
----------------------------------- */
.interpret-btn {
    width: 100%;
    padding: 18px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-accent), #e7c04e);
    color: var(--color-primary);
    font-family: var(--font-primary);
    font-size: 1.3em;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

.interpret-btn i {
    font-size: 1.2em;
    margin-bottom: 5px;
}

.interpret-btn small {
    font-size: 0.7em;
    font-weight: 500;
    opacity: 0.8;
}

.interpret-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

.interpret-btn:disabled {
    background: #ccc;
    color: #777;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* رسالة الخطأ */
.limit-message {
    color: #c0392b;
    font-weight: 700;
    padding: 15px;
    text-align: center;
    font-size: 1.1em;
    background-color: #fdeeee;
    border: 1px solid #c0392b;
    border-radius: 10px;
    margin-top: 20px;
    display: none;
    /* تأكد من أنه مخفي افتراضياً */
    flex-direction: column;
    /* لجعل النصوص تحت بعضها */
    align-items: center;
    /* توسيط المحتوى */
    gap: 5px;
    /* مسافة بين الأيقونة والنص والعداد */
}

.limit-message #limit-timer {
    display: none;
    /* سيتم إظهاره عبر الجافاسكريبت */
    margin-top: 8px;
    font-size: 1.1em;
    color: #a00;
    /* لون أحمر داكن */
    font-weight: 700;
}


/* 8. صندوق نتيجة التفسير
----------------------------------- */
.ai-interpretation-box {
    margin: 0;
    /* تم نقله ليصبح جزءاً من البطاقة */
    padding: 30px;
    background-color: #f7faff;
    /* خلفية بلون أزرق خفيف جداً */
    border-top: 1px dashed var(--color-border);
    /* Removed white-space pre-wrap to allow HTML rendering for Cards */
    /* white-space: pre-wrap; */
    color: var(--color-text);
}

.interpretation-title {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-accent);
    font-weight: 800;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.6em;
}

/* --- [NEW] Frequency Cards Style (Matched to Theme) --- */
.freq-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.freq-card.best-match {
    border: 2px solid var(--color-accent);
    /* Gold border for best match */
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.freq-header {
    background: #f4f9ff;
    /* Light blue header */
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

.freq-label {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.1em;
}

.freq-quality {
    background: var(--color-accent);
    color: #fff;
    /* White text on Gold */
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.freq-details {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.freq-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--color-border);
}

.freq-item i {
    color: var(--color-accent);
    /* Gold icons */
    font-size: 1.3em;
    width: 25px;
    text-align: center;
}

.freq-item span strong {
    color: var(--color-primary);
}

.freq-alternatives {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    margin-top: 20px;
    font-weight: 500;
}

.ai-intro,
.ai-outro {
    font-size: 1.1em;
    margin-bottom: 20px;
    color: var(--color-text-light);
    line-height: 1.8;
}

.ai-outro {
    margin-top: 20px;
    margin-bottom: 0;
    padding-top: 15px;
    border-top: 1px solid var(--color-border);
}


/* 9. شاشة التحميل (Modal)
----------------------------------- */
.loading-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 48, 66, 0.8);
    /* لون أزرق داكن شفاف */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-in-out;
}

.loading-modal-content {
    background: var(--color-card-bg);
    color: var(--color-primary);
    padding: 30px;
    /* Reduced padding slightly */
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    /* Scroll handling */
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
    border-top: 5px solid var(--color-accent);
    animation: slideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.8em;
    color: var(--color-primary);
    margin: 15px 0;
    font-weight: 700;
}

.loading-message {
    font-size: 1.1em;
    color: var(--color-text-light);
    margin-bottom: 20px;
    font-weight: 500;
}

.countdown-timer {
    font-weight: 700;
    color: var(--color-primary);
}

/* شريط التقدم */
.progress-bar-container {
    width: 100%;
    height: 12px;
    background-color: var(--color-border);
    border-radius: 6px;
    margin: 0 auto 20px auto;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-accent), #e7c04e);
    border-radius: 6px;
    transition: width 0.1s linear;
}

/* --- [NEW] Modal Article Cards --- */
.modal-article {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #f7faff;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text-light);
    transition: background-color 0.3s ease;
    margin: 15px 0;
    text-align: right;
}

.modal-article:hover {
    background-color: #eef5ff;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.modal-article.top-article {
    margin-bottom: 20px;
}

.modal-article.bottom-article {
    margin-top: 20px;
}

.modal-article-img {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #e0e6f0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-article-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-article-title {
    font-size: 0.95em;
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-text);
}


/* 10. تنسيق أزرار المشاركة
----------------------------------- */
.share-buttons-container {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px dashed var(--color-border);
    text-align: center;
}

.share-title {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.4em;
    margin-bottom: 20px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 10px;
    color: white !important;
    text-decoration: none !important;
    font-weight: 700;
    transition: all 0.3s ease;
    min-width: 140px;
    font-size: 1em;
}

.share-btn i {
    margin-left: 10px;
    font-size: 1.1em;
    color: white !important;
}

/* ألوان الأزرار */
.whatsapp-btn {
    background-color: #25D366;
}

.whatsapp-btn:hover {
    background-color: #128C7E;
    transform: translateY(-3px);
}

.facebook-btn {
    background-color: #1877F2;
}

.facebook-btn:hover {
    background-color: #1256b3;
    transform: translateY(-3px);
}

.messenger-btn {
    background-color: #0084FF;
}

.messenger-btn:hover {
    background-color: #0064c6;
    transform: translateY(-3px);
}


/* 11. تصميم متجاوب (Responsive)
----------------------------------- */

/* للجوال */
@media (max-width: 768px) {
    body {
        padding-bottom: 20px;
    }

    .nav-container {
        flex-direction: column;
        gap: 10px;
    }

    .nav-links a {
        margin: 0 8px;
        font-size: 1em;
    }

    .main-container {
        padding: 0 15px;
    }

    .page-title {
        font-size: 2.2em;
    }

    .page-subtitle {
        font-size: 1em;
    }

    .interpreter-toggle {
        padding: 20px;
        text-align: center;
        flex-direction: column;
        gap: 10px;
    }

    .interpreter-toggle span {
        font-size: 1.3em;
    }

    .interpreter-toggle .toggle-icon {
        display: none;
        /* إخفاء السهم على الموبايل */
    }

    .interpreter-content {
        padding: 20px;
    }

    .user-details-inputs {
        grid-template-columns: 1fr;
        /* عمود واحد فقط */
        gap: 12px;
    }

    .security-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .security-group input {
        width: 100%;
    }

    .interpret-btn {
        padding: 15px;
        font-size: 1.2em;
    }

    .loading-modal-content {
        padding: 25px;
        width: 95%;
    }

    .modal-title {
        font-size: 1.6em;
    }

    .freq-details {
        grid-template-columns: 1fr;
    }

    .stats-container {
        flex-direction: column;
        gap: 15px;
    }

    .stat-box {
        width: 100%;
        border: none;
        border-bottom: 1px solid var(--color-border);
        padding-bottom: 15px;
    }

    .stat-box:last-child {
        border-bottom: none;
    }

    .stat-box:first-of-type::after {
        display: none;
    }
}

/* 12. تأثيرات الحركة (Animations)
----------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/*
=====================================================
--- 15. تحسينات SEO وتنسيق المحتوى الإضافي ---
=====================================================
*/

/* جعل الأداة مفتوحة افتراضياً */
.interpreter-toggle.active .toggle-icon {
    transform: rotate(180deg);
    /* الوضع الطبيعي للسهم عندما تكون مفتوحة */
}

/* إزالة تأثير الفتح عند التحميل */
.interpreter-toggle:not(.active) .toggle-icon {
    transform: rotate(0deg);
}


/* تنسيق القسم النصي الإضافي */
.content-section {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 15px;
    padding: 30px;
    margin-top: 40px;
    box-shadow: var(--shadow-soft);
}

.content-section h2 {
    font-family: var(--font-heading);
    font-size: 1.8em;
    color: var(--color-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-accent);
}

.content-section p,
.content-section ul {
    font-size: 1.1em;
    color: var(--color-text-light);
    margin-bottom: 15px;
    line-height: 1.8;
}

.content-section ul {
    list-style: none;
    /* إزالة النقاط الافتراضية */
    padding-right: 20px;
    /* مسافة للداخل */
}

.content-section li {
    position: relative;
    padding-right: 25px;
    /* مسافة للأيقونة */
    margin-bottom: 10px;
}

/* إضافة أيقونة ✓ قبل كل عنصر في القائمة */
.content-section li::before {
    content: '\f00c';
    /* رمز أيقونة الصح في Font Awesome */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    /* ضروري لظهور الأيقونة */
    position: absolute;
    right: 0;
    top: 5px;
    color: var(--color-accent);
    /* لون ذهبي */
    font-size: 0.9em;
}

/* تحسين للجوال للمحتوى الإضافي */
@media (max-width: 768px) {
    .content-section {
        padding: 20px;
        margin-top: 30px;
    }

    .content-section h2 {
        font-size: 1.5em;
    }

    .content-section p,
    .content-section ul {
        font-size: 1em;
    }
}

/*
=====================================================
--- 16. تنسيق الإعلانات والمقالات العشوائية ---
=====================================================
*/

/* حاويات الإعلانات */
.ad-container {
    margin: 30px auto;
    /* هامش أعلى وأسفل */
    text-align: center;
    /* توسيط الإعلان */
    overflow: hidden;
    /* لمنع تجاوز الإعلان للحاوية */
    min-height: 50px;
    /* حد أدنى للارتفاع */
    display: flex;
    /* لمحاولة توسيط محتوى الإعلان */
    justify-content: center;
    align-items: center;
}

/* إعلان شاشة الانتظار */
.ad-container.ad-loading {
    margin: 20px auto;
    /* هامش أقل داخل المودال */
    max-width: 90%;
    /* تحديد عرض أقصى */
    padding: 10px;
    background-color: #eee;
    /* خلفية بسيطة إذا كان الإعلان لا يملأ المكان */
    border-radius: 8px;
}

/*
=====================================================
--- 18. تنسيق بطاقات المقالات (WordPress) ---
=====================================================
*/

.random-articles-section {
    /* تم تغيير اسم الكلاس في HTML */
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--color-border);
}

.random-articles-section h2 {
    font-family: var(--font-heading);
    font-size: 2em;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 30px;
}

.random-articles-grid {
    /* تم تغيير اسم الكلاس في HTML */
    display: grid;
    /* أعمدة متجاوبة */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    /* مسافة بين البطاقات */
}

/* بطاقة المقالة */
.article-card {
    /* تم تغيير اسم الكلاس في HTML */
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    /* يرث لون النص الافتراضي */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-medium);
}

/* حاوية صورة المقالة */
.article-card-image {
    /* تم تغيير اسم الكلاس في HTML */
    width: 100%;
    aspect-ratio: 16 / 9;
    /* نسبة عرض إلى ارتفاع شائعة */
    overflow: hidden;
    background-color: #eef3f8;
    /* لون للخلفية */
    display: flex;
    /* لتوسيط الأيقونة */
    justify-content: center;
    align-items: center;
}

.article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* لملء المساحة دون تشويه */
    display: block;
    transition: transform 0.4s ease-out;
}

.article-card:hover .article-card-image img {
    transform: scale(1.05);
    /* تأثير زوم بسيط */
}

/* Placeholder إذا لم تكن هناك صورة */
.article-card-image .image-placeholder {
    font-size: 2.5em;
    color: #c0d0e0;
}

/* محتوى بطاقة المقالة (العنوان) */
.article-card-content {
    /* تم تغيير اسم الكلاس في HTML */
    padding: 15px 20px;
    flex-grow: 1;
    /* لجعل المحتوى يملأ باقي البطاقة */
    display: flex;
    align-items: center;
    /* توسيط العنوان عمودياً */
}

.article-card-title {
    /* تم تغيير اسم الكلاس في HTML */
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--color-primary);
    margin: 0;
}

/* تحسين للجوال */
@media (max-width: 600px) {
    .random-articles-grid {
        grid-template-columns: 1fr;
        /* عمود واحد فقط */
    }

    .random-articles-section h2 {
        font-size: 1.6em;
    }
}


/*
=====================================================
--- 19. تنسيق الفوتر والصفحات الثابتة ---
=====================================================
*/

/* تنسيق الصفحات الثابتة (عن الموقع، اتصل بنا..) */
.static-page-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 15px;
    padding: 30px 40px;
    margin-top: -10px;
    /* لتقريبها من العنوان */
    box-shadow: var(--shadow-soft);
}

.static-page-card .page-title {
    text-align: right;
    /* محاذاة لليمين بدل الوسط */
    font-size: 2.2em;
    padding-bottom: 15px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--color-accent);
}

.static-content h2 {
    font-family: var(--font-heading);
    font-size: 1.6em;
    color: var(--color-primary);
    margin-top: 30px;
    margin-bottom: 10px;
}

.static-content p,
.static-content a {
    font-size: 1.1em;
    color: var(--color-text-light);
    line-height: 1.9;
    margin-bottom: 15px;
}

.static-content a {
    color: var(--color-primary);
    font-weight: 700;
    text-decoration: none;
}

.static-content a:hover {
    text-decoration: underline;
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #f7faff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    margin: 20px 0;
}

.contact-info i {
    color: var(--color-accent);
    font-size: 1.5em;
}

/* تنسيق الفوتر */
footer {
    background-color: #eef3f8;
    /* لون أفتح من خلفية الصفحة */
    border-top: 1px solid var(--color-border);
    padding: 30px 0;
    margin-top: 50px;
    color: var(--color-text-light);
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    color: var(--color-text-light);
    text-decoration: none;
    margin: 0 15px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.footer-copyright {
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .static-page-card {
        padding: 20px;
    }

    .footer-links a {
        display: block;
        margin: 8px 0;
    }
}

/*
=====================================================
--- 21. تنسيق عدادات الزوار والأحلام ---
=====================================================
*/

.stats-container {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    background-color: var(--color-card-bg);
    border-radius: 20px;
    padding: 25px 20px;
    max-width: 600px;
    /* تحديد عرض أقصى للبوكس */
    margin: 30px auto;
    /* توسيط البوكس */
    text-align: center;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--color-border);
    gap: 20px;
}

.stat-box {
    flex: 1;
    padding: 10px;
    position: relative;
}

/* خط فاصل بين العدادين (بجانب بعضهم) */
.stat-box:first-of-type::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 70%;
    width: 1px;
    background-color: var(--color-border);
}

.stat-box i {
    font-size: 2.8em;
    color: var(--color-accent);
    margin-bottom: 15px;
    display: block;
    /* هام جداً: لجعل الأيقونة في سطر */
}

.stat-number {
    font-size: 2.5em;
    font-weight: 800;
    color: var(--color-primary);
    display: block;
    /* هام جداً: لجعل الرقم في سطر */
    font-family: 'Tajawal', sans-serif;
    line-height: 1.2;
}

.stat-label {
    font-size: 1.1em;
    color: var(--color-text-light);
    font-family: var(--font-primary);
    font-weight: 500;
    display: block;
    /* هام جداً: لجعل الوصف في سطر */
}

/* تجاوب مع الموبايل (الفون) */
@media (max-width: 600px) {
    .stats-container {
        flex-direction: column;
        /* جعلهم فوق بعض في الفون */
        padding: 20px;
        max-width: 100%;
        /* جعل العرض 100% ليملأ الشاشة */
    }

    .stat-box {
        margin-bottom: 20px;
        padding-bottom: 20px;
        width: 100%;
    }

    .stat-box:last-of-type {
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .stat-box:first-of-type::after {
        /* تغيير الخط الفاصل إلى أفقي في الفون */
        width: 60%;
        height: 1px;
        top: auto;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
    }

    .stat-number {
        font-size: 2.2em;
    }

    .stat-box i {
        font-size: 2.4em;
    }
}

/*
=====================================================
--- 22. تنسيق أزرار التفاعل (عام للموقع) ---
=====================================================
*/

.reactions-container {
    margin-top: 20px;
    /* تقليل المسافة العلوية قليلاً */
    padding: 25px 20px;
    /* إضافة حشو داخلي */
    border-top: 1px dashed var(--color-border);
    /* خط فاصل منقط */
    text-align: center;
    background-color: #fcfdff;
    /* خلفية فاتحة جداً لتمييزه قليلاً */
    /* إزالة الحواف الحادة إذا كان داخل الصندوق الرئيسي */
    border-bottom-left-radius: 20px;
    /* يتطابق مع .interpreter-card */
    border-bottom-right-radius: 20px;
    /* يتطابق مع .interpreter-card */
}

/* حالة خاصة للحاوية التي تضاف ديناميكياً داخل صندوق التفسير */
.ai-interpretation-box .reactions-container {
    margin-top: 30px;
    /* مسافة أكبر داخل صندوق التفسير */
    padding-top: 25px;
    /* مسافة داخلية علوية */
    padding-bottom: 0;
    /* لا حاجة لحشو سفلي هنا */
    background-color: transparent;
    /* بدون خلفية إضافية */
    border-bottom-left-radius: 0;
    /* لا حاجة لحواف دائرية هنا */
    border-bottom-right-radius: 0;
}


.reactions-prompt {
    display: block;
    font-size: 1.1em;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 20px;
}

.reaction-buttons-wrapper {
    display: flex;
    justify-content: center;
    /* توسيط الأزرار */
    align-items: center;
    gap: 15px;
    /* مسافة بين الأزرار */
    flex-wrap: wrap;
    /* للسماح بالنزول في الشاشات الصغيرة */
}

.reaction-btn {
    background-color: #f8f9fa;
    /* خلفية رمادية فاتحة جداً */
    border: 1px solid var(--color-border);
    border-radius: 50px;
    /* شكل دائري/بيضاوي */
    padding: 8px 18px;
    /* حشو داخلي */
    display: flex;
    align-items: center;
    gap: 8px;
    /* مسافة بين الأيقونة والعداد */
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
    font-size: 0.95em;
    color: var(--color-text-light);
    /* لون النص والعداد الافتراضي */
}

.reaction-btn i {
    font-size: 1.3em;
    /* حجم الأيقونة */
    transition: transform 0.2s ease, color 0.2s ease;
    color: #adb5bd;
    /* لون أيقونة باهت افتراضي */
}

.reaction-count {
    font-weight: 700;
    font-size: 1em;
    min-width: 12px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    /* يحافظ على عرض الأرقام ثابتاً */
}

/* تأثيرات المرور (Hover) */
.reaction-btn:not(.active):not(:disabled):hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.reaction-btn:not(.active):not(:disabled):hover i {
    transform: scale(1.1);
}

/* ألوان الأيقونات عند المرور */
.reaction-btn[data-reaction-type="heart"]:not(.active):not(:disabled):hover i {
    color: #e53935;
}

.reaction-btn[data-reaction-type="like"]:not(.active):not(:disabled):hover i {
    color: #1e88e5;
}

.reaction-btn[data-reaction-type="angry"]:not(.active):not(:disabled):hover i {
    color: #fb8c00;
}

/* حالة الزر النشط (بعد النقر والتأكيد) */
.reaction-btn.active {
    border-color: transparent;
    cursor: default;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* ألوان مميزة للحالة النشطة */
.reaction-btn[data-reaction-type="heart"].active {
    background-color: #ffebee;
    color: #c62828;
}

.reaction-btn[data-reaction-type="heart"].active i {
    color: #e53935;
}

.reaction-btn[data-reaction-type="like"].active {
    background-color: #e3f2fd;
    color: #1565c0;
}

.reaction-btn[data-reaction-type="like"].active i {
    color: #1e88e5;
}

.reaction-btn[data-reaction-type="angry"].active {
    background-color: #fff3e0;
    color: #ef6c00;
}

.reaction-btn[data-reaction-type="angry"].active i {
    color: #fb8c00;
}

/* حالة التعطيل (أثناء التصويت أو بعده) */
.reactions-container.voting .reaction-btn,
.reactions-container.voted .reaction-btn {
    cursor: not-allowed;
    opacity: 0.7;
}

/* إخفاء الأزرار غير النشطة بعد التصويت (اختياري) */
.reactions-container.voted .reaction-btn:not(.active) {
    opacity: 0.5;
    /* جعلها باهتة */
}

/* رسالة الشكر/الخطأ */
.reaction-message {
    display: block;
    /* كان hidden */
    margin-top: 15px;
    font-size: 0.9em;
    font-weight: 500;
    color: #087f5b;
    /* لون أخضر للنجاح */
    min-height: 1.2em;
    /* حجز مساحة للرسالة حتى لو كانت مخفية */
}


/* تحسين للموبايل */
@media (max-width: 480px) {
    .reaction-btn {
        padding: 6px 14px;
        gap: 6px;
    }

    .reaction-btn i {
        font-size: 1.2em;
    }

    .reaction-count {
        font-size: 0.9em;
    }

    .reactions-prompt {
        font-size: 1em;
    }

    .reactions-container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* تنسيق نص الرصيد المتبقي على الزر */
.interpret-btn small#limit-text {
    font-size: 0.7em;
    font-weight: 500;
    opacity: 0.8;
    line-height: 1.4;
    /* لضمان ظهوره بشكل جيد */
}