/* --- المتغيرات الأساسية للهوية البصرية --- */
:root {
    --gold: #d4af37;
    --dark-bg: #121212;
    --card-bg: #1a1a1a;
    --hover-bg: #252525;
    --text-main: #e0e0e0;
    --text-muted: #888;
    --alert-gold: rgba(212, 175, 55, 0.15);
}

/* --- تنسيق قلب المقال الرئيسي --- */
.scrap-article {
    max-width: 950px;
    margin: 20px auto;
    background: var(--dark-bg);
    padding: 25px;
    border-radius: 12px;
    color: var(--text-main);
    line-height: 1.8;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    direction: rtl; /* التأكد من الاتجاه العربي */
}

.main-title {
    color: var(--gold);
    font-size: 1.8rem;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 10px;
}

/* --- الوسائط (صور وفيديو) --- */
.featured-image-container, .video-wrapper {
    width: 100%;
    margin: 25px 0;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #333;
    background: #000;
}

.page-featured-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- صناديق المعلومات والتحذير --- */
.ai-summary-box {
    background: var(--card-bg);
    border-right: 5px solid var(--gold);
    padding: 20px;
    margin: 30px 0;
    border-radius: 8px;
}

/* تغليف العبارة التحذيرية (تنبيه الأسعار) */
.scrap-alert-box {
    background: var(--alert-gold);
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
    color: #fff;
    text-align: center;
    font-weight: bold;
}

/* --- تنسيق الجداول --- */
.data-table-container {
    margin: 30px 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #333;
}

.scrap-table {
    width: 100%;
    border-collapse: collapse;
}

.scrap-table th {
    background: var(--gold);
    color: #000;
    padding: 15px;
}

.scrap-table td {
    padding: 15px;
    border-bottom: 1px solid #333;
    background: var(--card-bg);
}

/* تنسيق الجداول (مهم جداً للجدوى الاقتصادية) */
.economics table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background: #111;
    border: 1px solid #333;
}

.economics th, .economics td {
    padding: 15px;
    text-align: right;
    border: 1px solid #333;
}

.economics th {
    background-color: #ffd700;
    color: #000;
    font-weight: bold;
}

.economics tr:nth-child(even) {
    background-color: #1a1a1a;
}

/* تنسيق الجداول المخصص للموبايل */
@media screen and (max-width: 600px) {
    /* تحويل الجدول إلى بلوك كامل */
    .scrap-table, 
    .scrap-table thead, 
    .scrap-table tbody, 
    .scrap-table th, 
    .scrap-table td, 
    .scrap-table tr { 
        display: block; 
    }

    /* إخفاء الهيدر (العناوين العلوية) لأننا سنضعها بجانب كل معلومة */
    .scrap-table thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .scrap-table tr { 
        border: 1px solid var(--gold); 
        margin-bottom: 15px;
        background: #111; /* خلفية داكنة لتناسب التصميم */
        border-radius: 8px;
        padding: 5px;
    }

    .scrap-table td { 
        border: none;
        border-bottom: 1px solid #222; 
        position: relative;
        padding-right: 50% !important; /* مساحة للعنوان الجانبي */
        text-align: left !important;
        white-space: normal;
        font-size: 14px;
    }

    /* إضافة العناوين قبل كل معلومة باستخدام Data Attributes */
    .scrap-table td:before { 
        position: absolute;
        right: 10px;
        width: 45%; 
        padding-right: 10px; 
        white-space: nowrap;
        color: var(--gold); /* اللون الذهبي المعتمد */
        font-weight: bold;
        content: attr(data-label); /* يسحب العنوان من الخاصية في الـ HTML */
        text-align: right;
    }
    
    .scrap-table td:last-child {
        border-bottom: 0;
    }
}
/* --- تنسيق البطاقات الموحد (الروابط الداخلية) --- */
.internal-links-cluster {
    margin-top: 50px;
    padding-top: 25px;
    border-top: 1px solid #333;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scrap-card {
    background: var(--hover-bg); 
    border-right: 4px solid #333; 
    border-radius: 8px;
    padding: 12px 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.scrap-card h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.scrap-card a {
    color: #eee;
    text-decoration: none;
    display: block;
    width: 100%;
}

/* تأثير التمرير (Hover) - روح البراند */
.scrap-card:hover {
    background: #2a2a2a;
    border-right-color: var(--gold);
    transform: translateX(-5px); /* حركة لليمين بسبب RTL */
    box-shadow: 5px 5px 15px rgba(0,0,0,0.3);
}

.scrap-card:hover a {
    color: var(--gold);
}

/* أيقونة السهم الصغير في كل بطاقة */
.scrap-card::after {
    content: '\f104'; /* سهم FontAwesome اليسار */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 15px; /* يظهر جهة اليسار لأن الكتابة تبدأ من اليمين */
    top: 50%;
    transform: translateY(-50%);
    color: #444;
    transition: 0.3s;
}

.scrap-card:hover::after {
    color: var(--gold);
    left: 20px;
}

/* تحسينات الموبايل */
@media (max-width: 768px) {
    .scrap-article { padding: 15px; }
    .main-title { font-size: 1.4rem; }
}

/* تنسيقات صندوق الصور الرئيسي لصفحات الاستخراج */
.main-img-box {
    width: 100%;
    max-width: 800px;
    height: 350px;
    margin: 25px auto;
    background: #1a1a1a;
    border: 2px solid #d4af37; /* اللون الذهبي */
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.main-img-box img {
    width: 100%;
    height: auto; /* أهم سطر */
    display: block;
    object-fit: contain;
}

.main-img-box:hover img {
    transform: scale(1.05);
}

/* نمط احتياطي في حال عدم وجود صورة (للنص البديل) */
.main-img-box p {
    color: #666;
    font-size: 1.1rem;
    text-align: center;
    padding: 20px;
}

/* تنسيق متجاوب للموبايل */
@media (max-width: 768px) {
    .main-img-box {
        height: 250px;
        margin: 15px auto;
    }
}

/* تنسيق مسار التنقل العام */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 12px 15px;
    margin-bottom: 20px;
    list-style: none;
    background-color: #111; /* خلفية داكنة تناسب السكراب */
    border-radius: 5px;
    border: 1px solid #222;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 15px;
}

/* إضافة فاصل بين العناصر */
.breadcrumb-item + .breadcrumb-item::before {
    content: "«"; /* سهم يشير للمسار بالعربي */
    padding: 0 10px;
    color: var(--gold); /* لون ذهبي للفاصل */
    font-weight: bold;
}

.breadcrumb-item a {
    color: #bbb;
    text-decoration: none;
    transition: 0.3s;
}

.breadcrumb-item a:hover {
    color: var(--gold);
}

.breadcrumb-item.active {
    color: var(--gold);
    font-weight: bold;
}

/* --- تنسيق خاص للهاتف فقط --- */
@media (max-width: 768px) {
    .breadcrumb {
        padding: 8px 10px;
        font-size: 13px;
        overflow-x: auto; /* السماح بالتمرير العرضي إذا كان المسار طويلاً */
        white-space: normal; /* منع انكسار السطر */
        display: block; /* تغيير العرض لضمان انسيابية التمرير */
    }

    .breadcrumb-item {
        display: inline-block;
        font-size: 13px;
    }

    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 5px;
    }
}

/* حاوية الأزرار لضمان التنسيق */
.btn-3d-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
    font-family: 'Cairo', sans-serif;
}

/* التصميم الأساسي للزر الـ 3D */
.btn-3d {
    position: relative;
    display: inline-block;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    color: #000; /* نص أسود */
    background-color: #d4af37; /* ذهبي */
    border: none;
    border-radius: 12px;
    /* ظل يعطي إيحاء العمق 3D */
    box-shadow: 0 9px #9a7d28, 0 15px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 200px;
}

/* تأثير عند تمرير الماوس */
.btn-3d:hover {
    background-color: #e5c05b;
    box-shadow: 0 7px #9a7d28, 0 10px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(2px);
}

/* تأثير الضغط الفعلي (كأن الزر ينغمس للداخل) */
.btn-3d:active {
    box-shadow: 0 3px #6b561c, 0 5px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(6px);
}

/* أيقونات الأزرار */
.btn-3d i {
    margin-left: 10px;
}

/* ألوان مخصصة لكل منصة مع الحفاظ على تأثير الـ 3D */
.btn-prices { background-color: #d4af37; box-shadow: 0 9px #9a7d28; }
.btn-youtube { background-color: #ff0000; color: #fff; box-shadow: 0 9px #b30000; }
.btn-facebook { background-color: #1877f2; color: #fff; box-shadow: 0 9px #0d58bd; }

/* إصلاح التنسيق للهواتف */
@media (max-width: 600px) {
    .btn-3d {
        width: 100%;
        font-size: 16px;
    }
}
