/* ==========================================================================
   Theme Name: بوابة التنمية
   Description: قالب مخصص لشركة بوابة التنمية
   Author: gc tech
   Version: 1.0
   Text Domain: bawabatelTanmiya
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    --primary-blue: #152b4d;
    --gold: #c6a355;
    --bg-light: #f4f5f7;
    --text-dark: #333;
}

body {
    direction: rtl;
    font-family: 'Tajawal', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fff;
    color: var(--text-dark);
}

a { text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; }

/* ==========================================================================
   1. تنسيق الهيدر والشعار (خلفية بيضاء ونصوص زرقاء غامقة)
   ========================================================================== */

.site-header,
#masthead,
.header-bar {
    background: #ffffff !important;
    background-color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    border-bottom: 1px solid #eaeaea !important;
    padding: 15px 0;
    position: -webkit-sticky; 
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 9999;
    transition: all 0.3s ease;
}

/* التوافق مع شريط أدمن ووردبريس */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.header-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative;
}

/* صندوق الشعار العائم */
.header-logo-box,
.site-logo {
    width: 140px;
    background: #ffffff;
    padding: 15px 10px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 5%; 
    z-index: 10000;
    transition: all 0.3s ease;
}

.header-logo-box img,
.site-logo img {
    width: 100% !important;
    max-width: 140px;
    height: auto;
    display: block;
    object-fit: contain;
}

.header-logo-box:hover { transform: translateY(3px); }

/* ==========================================================================
   2. تنسيق القائمة الرئيسية (الشاشات الكبيرة)
   ========================================================================== */

.main-nav { display: block; }
.main-nav ul { display: flex; gap: 25px; margin: 0; padding: 0; }

.site-header a, 
.site-header .menu-item a,
.main-nav a {
    color: #0f2241 !important; 
    font-size: 16px;
    font-weight: 700 !important;
    transition: color 0.3s ease;
    display: inline-block;
    text-decoration: none !important;
}

.site-header a:hover, 
.site-header .menu-item a:hover,
.main-nav a:hover {
    color: var(--gold) !important;
}

/* ==========================================================================
   3. زر الخطوط الثلاثة وتنسيق الموبايل (خلفية بيضاء ونصوص زرقاء)
   ========================================================================== */

.menu-toggle {
    display: none; 
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10000;
}

.menu-toggle span,
.icon-bar,
.nav-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: #0f2241 !important; 
    border-radius: 2px;
    transition: all 0.3s ease;
}

@media (max-width: 991px) {
    .menu-toggle {
        display: flex !important; 
        margin-right: 0 !important;
        position: relative;
    }

    .site-logo {
        position: absolute !important;
        left: 3% !important;
        right: auto !important;
        top: 0;
        padding: 10px 15px;
        width: 70px;
    }
    .site-logo img { width: 70px; }

    /* القائمة الجانبية للموبايل */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: #ffffff !important;
        padding: 90px 25px 30px;
        box-shadow: -5px 0 25px rgba(0,0,0,0.15);
        transition: right 0.4s cubic-bezier(0.1, 0.7, 0.6, 1);
        z-index: 9998;
    }

    .main-nav.is-active { right: 0 !important; }
    .main-nav ul { flex-direction: column; gap: 15px; }
    
    .main-nav a {
        color: #0f2241 !important; 
        font-size: 18px;
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid rgba(15, 34, 65, 0.08);
    }
    
    .main-nav a:hover {
        color: var(--gold) !important;
    }

    .menu-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .menu-toggle.is-active span:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* ==========================================================================
   4. قسم السلايدر والنافذة المنبثقة (تم إصلاح تداخل الشرائح وهبوط الصور)
   ========================================================================== */

.hero-slider {
    width: 100%;
    height: 550px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    background-color: #000; /* خلفية سوداء مؤقتة لمنع الوميض الأبيض أثناء الانتقال */
}

/* التنسيقات الإصلاحية الهامة للشرائح */
.slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
    z-index: 1;
}

/* الشريحة النشطة المعروضة */
.slide-item.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* تظليل ذكي فوق صور السلايدر لجعل النصوص والزر واضحة وقابلة للقراءة */
.slide-item::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 3;
}

/* محتوى السلايدر (العناوين) */
.slide-content {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 80%;
    z-index: 4;
}

.slide-content h2 {
    color: #ffffff !important;
    font-size: 36px;
    font-weight: 800;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .hero-slider { height: 400px; }
    .slide-content h2 { font-size: 24px; }
}

/* تنسيق زر اتصل بنا في السلايدر */
.slider-contact-btn {
    position: absolute;
    top: 60%; /* أسفل العنوان المتمركز */
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #0f2241 !important;
    color: #ffffff !important;
    padding: 14px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 30px;
    text-decoration: none !important;
    z-index: 10; /* أعلى من طبقات الشرائح */
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}
.slider-contact-btn:hover {
    background-color: #b19467 !important;
    transform: translate(-50%, -55%);
}

/* تأثير تدرج دمج الهيدر بالسلايدر */
.hero-slider::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.6) 25%, rgba(255, 255, 255, 0) 75%);
    z-index: 5;
    pointer-events: none;
}

/* الخلفية المظلمة الشفافة وراء النافذة المنبثقة */
.custom-modal-backdrop {
    display: none; 
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 9999999 !important;
    justify-content: center;
    align-items: center;
    direction: rtl;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* عندما تصبح النافذة نشطة من الجافا سكريبت */
.custom-modal-backdrop.is-active {
    opacity: 1;
}

/* صندوق النافذة الرئيسي */
.modal-container-box {
    background: #ffffff;
    width: 90%;
    max-width: 880px;
    border-radius: 20px;
    padding: 45px 35px 35px 35px;
    position: relative;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-modal-backdrop.is-active .modal-container-box {
    transform: scale(1);
}

/* زر الإغلاق X */
.modal-close-x {
    position: absolute;
    top: 20px;
    left: 25px;
    font-size: 30px;
    font-weight: 300;
    color: #000;
    cursor: pointer;
    line-height: 1;
}
.modal-close-x:hover { color: #ff0000; }

.modal-flex-content { display: flex; gap: 40px; }
.modal-form-column { flex: 1.2; display: flex; flex-direction: column; justify-content: center; }
.modal-info-column { flex: 1; text-align: right; }

.modal-welcome-title { color: #222222; font-size: 26px; font-weight: bold; margin: 0 0 10px 0; }
.modal-welcome-desc { color: #666666; font-size: 14px; line-height: 1.6; margin-bottom: 20px; }

.contact-details-list { margin-bottom: 20px; }
.detail-item { font-size: 13.5px; color: #444444; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.detail-item i { color: #999; font-style: normal; }

.modal-input-wrapper { position: relative; margin-bottom: 18px; }
.modal-input-wrapper input, 
.modal-input-wrapper textarea {
    width: 100%;
    padding: 14px 45px 14px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background-color: #ffffff;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}
.modal-input-wrapper textarea { padding: 14px 15px; resize: none; }
.modal-input-wrapper .field-icon { position: absolute; top: 50%; right: 15px; transform: translateY(-50%); color: #a0aec0; font-size: 16px; }

.modal-submit-blue-btn {
    background-color: #0056b3;
    color: #ffffff;
    border: none;
    padding: 12px 50px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    float: left;
    transition: background 0.2s;
}
.modal-submit-blue-btn:hover { background-color: #0f2241; }

@media (max-width: 768px) {
    .modal-flex-content { flex-direction: column-reverse; gap: 25px; }
    .modal-container-box { padding: 35px 20px 25px 20px; max-height: 90vh; overflow-y: auto; }
    .modal-submit-blue-btn { width: 100%; float: none; }
}

/* ==========================================================================
   5. باقي أقسام الموقع المستقرة والجاهزة
   ========================================================================== */

.services-section {
    position: relative;
    padding-top: 50px;
    padding-bottom: 60px;
    background-color: #f8f9fa;
}
.services-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(21, 43, 77, 0.45) 0%, rgba(21, 43, 77, 0.15) 50%, rgba(21, 43, 77, 0) 100%);
    z-index: 10;
    pointer-events: none;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 35px 25px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 12px 30px rgba(21, 43, 77, 0.16);
    overflow: hidden;
}
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(21, 43, 77, 0.25);
}

.service-icon {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}
.service-icon img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
    transform: scale(1.5);
    transform-origin: center;
    transition: transform 0.3s ease;
}
.service-card:hover .service-icon img { transform: scale(1.6); }

.news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.news-card { border-radius: 10px; overflow: hidden; position: relative; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.news-card img { width: 100%; height: 250px; object-fit: cover; }
.news-content { padding: 20px; background: #fff; }
.news-tag { background: var(--gold); color: #fff; padding: 5px 15px; font-size: 12px; border-radius: 5px; position: absolute; top: 20px; right: 20px; }
.news-content h3 { color: var(--primary-blue); font-size: 18px; margin-bottom: 10px; }
.news-content p { color: #666; font-size: 14px; line-height: 1.6; }

.site-footer { background-color: #eef1f4; padding: 60px 0 0 0; direction: rtl; }
.footer-main-content { width: 100%; padding-bottom: 40px; }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 5%; display: flex; justify-content: space-between; align-items: center; }

.footer-logo-side { flex: 0 0 auto; }
.footer-logo-wrapper img { width: 140px; height: auto; display: block; object-fit: contain; transition: transform 0.3s ease; }
.footer-logo-wrapper img:hover { transform: scale(1.05); }

.footer-links-side { display: flex; gap: 70px; flex: 0 0 auto; }
.footer-info-block { text-align: right; }
.footer-info-block h3 { color: var(--primary-blue); font-size: 16px; font-weight: 700; margin-bottom: 18px; }
.footer-info-block ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-info-block ul li { font-size: 14px; color: #555555; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.ltr-text { direction: ltr; display: inline-block; }
.footer-icon { font-size: 14px; opacity: 0.7; }

@media (max-width: 768px) {
    .footer-container { flex-direction: column-reverse; gap: 40px; text-align: center; }
    .footer-links-side { flex-direction: column; gap: 35px; width: 100%; }
    .footer-info-block { text-align: center; }
    .footer-info-block ul li { justify-content: center; }
    .footer-logo-wrapper img { width: 120px; margin: 0 auto; }
}

.footer-bottom { background-color: #eef1f4; width: 100%; position: relative; overflow: hidden; border-top: 1px solid rgba(0, 0, 0, 0.05); }
.footer-bottom-container { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 0; }
.footer-social-box { 
    background-color: #e2e8f0 !important; /* تم التغيير من var(--primary-blue) إلى نفس لون الفوتر السفلي */
    padding: 15px 60px 15px 40px; 
    display: flex; 
    align-items: center; 
    border-radius: 0 40px 0 0; 
    position: relative; 
}
.social-icons-list { display: flex; gap: 20px; align-items: center; }
.social-icons-list a { display: inline-block; width: 20px; height: 20px; transition: transform 0.3s ease, opacity 0.3s ease; }
.social-icons-list a svg { width: 100%; height: 100%; fill: #ffffff; }
.social-icons-list a:hover { transform: scale(1.2); opacity: 0.8; }

.footer-copyright-box { padding: 15px 40px; }
.footer-copyright-box p { margin: 0; font-size: 14px; color: #666666; font-weight: 500; }

@media (max-width: 768px) {
    .footer-bottom-container { flex-direction: column-reverse; text-align: center; }
    .footer-social-box { width: 100%; justify-content: center; padding: 15px 0; border-radius: 0; }
    .footer-copyright-box { padding: 15px 20px; }
}

html { scroll-behavior: smooth; }
#services, #news { scroll-margin-top: 90px; }

/* ==========================================================================
   6. تنسيق قسم شركاؤنا والشريط المتحرك (Infinite Logos Marquee)
   ========================================================================== */

.partners-section {
    padding: 60px 0;
    background-color: #ffffff; /* خلفية بيضاء نقية لفصلها عن الفوتر الرمادي */
    border-top: 1px solid #eaeaea;
    position: relative;
    overflow: hidden;
}

/* تنسيق العنوان الرئيسي للشركاء */
.partners-title-box {
    text-align: center;
    margin-bottom: 40px;
}

.partners-title-box h2 {
    color: var(--primary-blue);
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

/* الخط الذهبي الزخرفي أسفل العنوان */
.partners-title-box .title-line {
    width: 60px;
    height: 3px;
    background-color: var(--gold);
    margin: 0 auto;
    border-radius: 2px;
}

/* إعدادات مسار الشريط المتحرك */
.partners-marquee-wrapper {
    overflow: hidden;
    width: 100%;
    position: relative;
    padding: 15px 0;
    direction: ltr; /* توحيد اتجاه حركة التمرير ثنائي الأبعاد برمجياً لجميع المتصفحات */
}

/* تأثير التلاشي الضوئي على الجوانب لجعل الحركة تظهر وتختفي بنعومة */
.partners-marquee-wrapper::before,
.partners-marquee-wrapper::after {
    content: "";
    height: 100%;
    position: absolute;
    top: 0;
    width: 150px;
    z-index: 2;
    pointer-events: none;
}
.partners-marquee-wrapper::before {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
}
.partners-marquee-wrapper::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
}

/* الحاوية الداخلية الديناميكية للشعارات */
.partners-track {
    display: flex;
    width: max-content;
    gap: 60px; /* المسافة الفاصلة بين كل شعار والآخر */
    animation: scrollLogosLoop 25s linear infinite; /* 25 ثانية لسرعة حركة متزنة وراقية */
}

/* إيقاف الحركة مؤقتاً عند تمرير الماوس فوق الشريط لإتاحة التركيز للمستخدم */
.partners-track:hover {
    animation-play-state: paused;
}

/* تنسيق عنصر الشعار الفردي */
.partner-logo-item {
    width: 160px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.partner-logo-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%); /* تحويل الشعارات للرمادي لتبدو متجانسة كلياً مع هوية الموقع */
    opacity: 0.5;
    transition: all 0.3s ease;
}

/* إعادة الألوان الطبيعية ووضوح الصورة الكامل عند تمرير الماوس فوق لوجو معين */
.partner-logo-item img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

/* الجداول الحركية الرياضية للشريط اللانهائي */
@keyframes scrollLogosLoop {
    0% {
        transform: translateX(0);
    }
    100% {
        /* الانتقال الدقيق بنسبة -50% يجعل الشريط يقفز لبداية المجموعة المكررة لحظياً دون ملاحظة المستخدم */
        transform: translateX(-50%);
    }
}

/* ملاءمة الشاشات الصغيرة والهواتف */
@media (max-width: 768px) {
    .partners-section { padding: 40px 0; }
    .partner-logo-item { width: 120px; height: 55px; }
    .partners-track { gap: 35px; }
    .partners-marquee-wrapper::before, .partners-marquee-wrapper::after { width: 60px; }
}

/* ==========================================================================
   تنسيق مرئي ومضمون لزر اللغة الإنجليزية
   ========================================================================== */

.custom-lang-switcher {
    display: inline-block;
    vertical-align: middle;
    margin: 0 15px;
}

/* تنسيق الزر بلون داكن ليظهر فوق الخلفيات الفاتحة والبيضاء */
.lang-btn-en {
    color: #0f2241 !important; /* لون نيلي داكن لضمان الرؤية الشاملة */
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 700 !important;
    padding: 7px 20px;
    border: 1px solid #c5a059 !important; /* الإطار الذهبي لهويتك العقارية */
    border-radius: 4px;
    background-color: transparent;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease-in-out;
    display: inline-block;
}

/* تأثير التمرير (Hover) */
.lang-btn-en:hover {
    background-color: #c5a059 !important; /* امتلاء كامل بالذهبي */
    color: #ffffff !important; /* يتحول النص للأبيض لتبدو في غاية الفخامة */
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.3);
    transform: translateY(-1px);
}

/* ملاءمة شاشات الهواتف والتابلت */
@media (max-width: 991px) {
    .custom-lang-switcher {
        margin: 15px 0;
        display: block;
        text-align: center;
    }
}
/* تنسيق زر العودة للأعلى المحدث (يمين + ألوان معكوسة + حجم أكبر) */
.back-to-top {
    position: fixed !important;
    bottom: 35px !important;
    right: 35px !important; /* نقله إلى اليمين */
    left: auto !important;   /* إلغاء التموضع السابق على اليسار */
    width: 56px;            /* تكبير الحجم (كان 50px) */
    height: 56px;           /* تكبير الحجم */
    background-color: #1a1a1a !important; /* خلفية داكنة فخمة */
    color: #ffffff !important;            /* السهم باللون الأبيض */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2); /* ظل أعمق ليناسب الخلفية الداكنة */
    z-index: 99999 !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* التحكم بالظهور والاختفاء */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

/* تأثير عند تمرير الماوس فوق الزر (عكس الألوان عند الـ Hover) */
.back-to-top:hover {
    background-color: #ffffff !important; /* تحول الخلفية للأبيض */
    color: #1a1a1a !important;            /* تحول السهم للأسود */
    transform: translateY(-5px) !important; /* حركة صعود تفاعلية */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.1);
}

/* الكلاس المسؤول عن إظهار الزر عند التمرير لأسفل */
.back-to-top.is-visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* التكيف مع شاشات الهواتف */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 25px !important;
        right: 25px !important;
        left: auto !important;
        width: 50px; /* حجم متناسق ومريح للضغط على الهاتف */
        height: 50px;
    }
}