/* ------------------------------------ */
/* 0. تنسيق الشاشة الافتتاحية (Preloader) - مظهر فاخر */
/* ------------------------------------ */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-dark); /* خلفية داكنة جداً */
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0s 0.5s;
    /* إضافة ظل داخلي خفيف لتعميق اللون الداكن */
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5); 
}

/* حالة الاختفاء (تضاف عبر JavaScript) */
#preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    /* لضمان أن العناصر تظهر فوق الحركة */
    position: relative; 
}

/* تنسيق الشعار (SVG) */
#preloader svg {
    display: block;
    width: 500px; /* تم تكبير الحجم */
    height: 500px; /* تم تكبير الحجم */
    margin: 0 auto;
    /* لجعل الشعار في وسط العنصر */
    transform: translate(0, 0) scale(0.1); 
    overflow: visible; /* هام لرؤية الـ Stroke */
}


.loader-content h1 {
    font-size: 1.3em; /* زيادة حجم الخط */
    color: var(--text-light); /* نص أبيض واضح */
    margin-top: 10px;
    font-weight: bold;
    /* ظل نص خفيف جداً لمزيد من العمق */
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.1); 
}

.loader-content p {
    color: var(--primary-color); /* لون برتقالي بارز للرسالة الثانوية */
    font-size: 1.1em;
    font-family: var(--font-family);
    margin-top: 10px;
    font-style: italic;
}

/* حركة الرسم (Draw Animation) */
@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}
/* إزالة الـ Spinner القديم */
.spinner {
    display: none;
}


/* ------------------------------------ */
/* 1. التنسيقات الأساسية والتهيئة */
/* ------------------------------------ */
:root {
    --primary-color: #f7931e; /* اللون الأساسي (برتقالي مميز) */
    --accent-color: #FFC107; /* لون ثانوي (برتقالي فاتح/ذهبي) */
    --background-dark: #202020; /* خلفية داكنة جداً للبطاقات والرأس */
    --background-light: #2c2c2c; /* خلفية أفتح قليلاً للأقسام الأخرى */
    --text-light: #ffffff; /* نص فاتح للخلفيات الداكنة */
    --text-dark: #cccccc; /* نص رمادي فاتح للخلفيات الداكنة */
    --font-family: Tahoma, Arial, sans-serif; /* خطوط النظام القياسية */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    background-color: var(--background-light); /* خلفية الجسم الأساسية داكنة */
    color: var(--text-dark); /* لون النص الافتراضي */
    direction: rtl; /* دعم اللغة العربية */
    text-align: right;
    overflow-x: hidden; /* لمنع ظهور شريط التمرير الأفقي بسبب AOS */
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

ul {
    list-style: none;
}

h1, h2, h3 {
    color: var(--text-light); /* العناوين باللون الأبيض */
    font-family: var(--font-family); /* استخدام خط النظام */
    margin-bottom: 15px;
}

.section {
    padding: 60px 20px; /* زيادة التباعد بين الأقسام */
    text-align: center;
}

/* زر الدعوة لاتخاذ إجراء */
.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 14px 30px; 
    border-radius: 4px; /* زوايا مستطيلة قليلاً */
    margin-top: 30px;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4); 
    transition: background-color 0.3s, transform 0.3s;
    border: none;
}

.cta-button:hover {
    background: var(--accent-color);
    transform: translateY(-2px); 
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}

/* ------------------------------------ */
/* 2. تنسيق الرأس وشريط التنقل (للموبايل) */
/* ------------------------------------ */
header {
    background-color: var(--background-dark); /* خلفية داكنة جداً */
    color: var(--text-light);
    padding: 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed; 
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background-color 0.4s ease, color 0.4s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
}

header .logo {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color); 
}

/* إخفاء قائمة التنقل على الموبايل افتراضياً */
nav ul {
    display: none; 
}

nav ul a {
    color: var(--text-light);
    transition: color 0.3s;
}

nav ul a:hover {
    color: var(--primary-color);
}

/* 9. تأثيرات JavaScript / التمرير (Scrolled Header) */
header.scrolled {
    background-color: var(--background-dark); 
    color: var(--text-light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); 
}

header.scrolled nav ul a {
    color: var(--text-light); 
}

/* ------------------------------------ */
/* 3. تنسيق القسم الترحيبي (Hero) */
/* ------------------------------------ */
.hero {
    padding-top: 120px; 
    background-color: var(--background-dark); 
    color: var(--text-light);
    padding-bottom: 0; 
    text-align: center;
    
    /* ************* تصحيح 16:9 ************* */
    /* إزالة min-height الثابتة تمامًا والاعتماد على padding-bottom في الـ wrapper */
    min-height: auto; 
    max-height: 100vh; /* لتجنب الزيادة غير المنطقية على شاشات الموبايل الطويلة جداً */
    /* *************************************** */
    
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    align-items: center;
    position: relative; 
    overflow: hidden; 
}

/* 🆕 الحاوية المسؤولة عن تثبيت النسبة (16:9) */
.hero-aspect-ratio-wrapper {
    position: relative;
    width: 100%;
    /* النسبة: 9/16 * 100 = 56.25% */
    padding-bottom: 56.25%; 
    
    /* ************* تصحيح 16:9 ************* */
    /* ضمان أن الـ padding-bottom يسيطر على الارتفاع الداخلي */
    height: 0; 
    overflow: hidden;
    /* *************************************** */
}

/* طبقة التعتيم على الصور */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* يجب أن تكون الطبقة بنفس ارتفاع الـ wrapper */
    height: 100%; 
    background: rgba(0, 0, 0, 0.7); 
    z-index: 1;
}

/* تنسيق حاوية الصور المتغيرة */
.hero-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* تنسيق الصورة الواحدة داخل الكاروسيل */
.hero-carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out; 
}

.hero-carousel-item.active {
    opacity: 1;
}

/* تنسيق محتوى النص والأزرار (لضمان ظهوره فوق الصور) */
.hero-content {
    position: absolute; /* وضعه فوق الـ wrapper */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* جعله يتوسط تماماً */
    z-index: 1;
    padding: 20px; /* زيادة بسيطة لضمان تباعد النص عن حواف الشاشة الصغيرة */
    width: 100%; 
}

/* ************* تصحيح مرونة الخط ************* */
.hero h1 {
    /* تطبيق clamp() لمرونة الخط: الحد الأدنى 2.5rem، الحجم المرن 8vw، الحد الأقصى 4.5rem */
    font-size: clamp(1rem, 7vw, 4.5rem); 
    color: var(--text-light); 
    font-weight: bold;
    margin-bottom: 5px;
}

.hero p {
    /* تطبيق clamp() للفقرة: الحد الأدنى 1rem، الحجم المرن 3vw، الحد الأقصى 1.2rem */
    font-size: clamp(0.5rem, 3vw, 1.2rem); 
    font-weight: 300;
}
/* ******************************************* */


/* تنسيق زر الدعوة لاتخاذ إجراء الجديد في قسم HERO */
/* يتم تحديد موقعه بالنسبة للـ Section.hero الأصلية */
.hero .cta-button {
    padding: 10px 20px; 
    font-size: 0.95em;
    margin-top: 0; 
    position: absolute; 
    bottom: 30px; 
    right: 30px; 
    left: auto; 
    z-index: 3;
}


/* تنسيقات الشاشات الأكبر */
@media (min-width: 768px) {
    /* ... (تنسيقات أخرى) ... */
    
    .hero {
        /* ************* تصحيح 16:9 ************* */
        /* إلغاء الارتفاع الثابت وضبط المسافات */
        min-height: auto; 
        max-height: 900px; /* ارتفاع أقصى على الشاشات الكبيرة جداً */
        padding-top: 150px;
        padding-bottom: 120px;
        /* *************************************** */
    }
    
    /* ************* تصحيح مرونة الخط ************* */
    /* حذف التحديد الثابت لتجنب التعارض مع clamp() */
    .hero h1 {
        /* تم حذفه */
    }
    
    .hero p {
        /* تم حذفه */
    }
    /* ******************************************* */
    
    .hero .cta-button {
        bottom: 40px; 
        right: 50px; 
        left: auto;
    }
    
    /* ------------------------------------ */
    /* 2. تنسيق قسم فلسفتنا (About Us) - مصحح */
    /* ... (احتفظ بالتنسيقات التالية كما هي) ... */
}
/* ------------------------------------ */
/* 2. تنسيق قسم فلسفتنا (About Us) - مصحح */
/* ------------------------------------ */
#about {
    background-color: var(--background-dark); /* خلفية داكنة */
    color: var(--text-light);
    padding-top: 80px;
    padding-bottom: 80px;
}

#about h2 {
    color: var(--primary-color);
}

.about-container {
    display: flex;
    flex-direction: column; /* الترتيب العمودي على الموبايل */
    gap: 30px;
    margin-top: 40px;
    text-align: right;
}

.about-text h3 {
    color: var(--text-light);
    font-size: 1.8em;
    margin-bottom: 25px;
}

.about-text p {
    color: var(--text-dark);
    font-size: 1.1em;
    line-height: 1.8;
}

.about-text ul {
    margin-top: 25px;
    padding-right: 0; 
    /* تنسيق الشبكة لتوزيع العناصر النقطية في عمودين على الكمبيوتر */
    display: grid;
    grid-template-columns: 1fr; /* عمود واحد على الموبايل */
    gap: 15px; 
}

.about-text ul li {
    padding: 10px 0;
    color: var(--text-light); /* تغيير لون النص ليكون أفتح */
    border-bottom: 1px solid rgba(247, 147, 30, 0.1);
    font-weight: 300;
    transition: transform 0.3s ease;
}

.about-text ul li:hover {
    transform: translateX(-5px); /* تأثير تحريك بسيط عند المرور */
}

/* تنسيق الأيقونات الجديدة */
.about-text ul li i {
    color: var(--primary-color);
    margin-left: 10px;
    font-size: 1.2em;
    transition: color 0.3s ease;
}

/* ------------------------------------ */
/* 4. تنسيق قسم الخدمات (تعديل العناوين الفرعية) */
/* ------------------------------------ */

.category-title {
    color: var(--primary-color); /* اللون البرتقالي */
    font-size: 1.8em;
    font-weight: bold;
    margin-top: 40px;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid rgba(247, 147, 30, 0.3); /* خط فاصل خفيف */
    padding-bottom: 10px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.services-container {
    display: flex;
    flex-direction: column; 
    gap: 30px; 
    margin-top: 40px;
}

.service-card {
    background: var(--background-dark); 
    padding: 30px;
    border-radius: 12px; 
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none; 
    text-align: center; 
    color: var(--text-dark); 
}

.service-card:hover {
    transform: translateY(-8px); 
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6); 
}

.service-card .service-icon {
    font-size: 3em; 
    color: var(--primary-color); 
    margin-bottom: 20px;
}

.service-card h3 {
    color: var(--primary-color); 
    font-weight: bold;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.service-card p {
    color: var(--text-dark); 
    font-size: 1em;
    line-height: 1.8;
}

/* ------------------------------------ */
/* 5. تنسيق قسم البورتفوليو (مكتبة صور) */
/* ------------------------------------ */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 عمود على الموبايل */
    gap: 20px;
    margin-top: 30px;
}

.portfolio-item {
    background: var(--background-dark); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    color: var(--text-dark); 
    transition: transform 0.3s, box-shadow 0.3s;
    border-radius: 12px;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

.portfolio-item:hover {
    transform: scale(1.05); 
    box-shadow: 0 10px 25px rgba(247, 147, 30, 0.5); 
}

/* تنسيق خاص للصور المخفية لضمان عدم إخلالها بالتخطيط */
.portfolio-item a[style*="display: none"] {
    position: absolute; 
    visibility: hidden; 
}


/* تنسيق وسم الرابط داخل العنصر */
.portfolio-item a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

/* تنسيق الصورة الفعلية */
.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* لضمان تغطية الصورة للمساحة دون تشويه */
    display: block;
    transition: opacity 0.3s;
    border-radius: 12px;
}

/* تنسيق النص (اسم المشروع) */
.portfolio-item p {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(32, 32, 32, 0.8); 
    padding: 10px 0;
    margin: 0;
    color: var(--text-light);
    font-weight: bold;
    font-size: 1.1em;
    opacity: 0; /* إخفاء النص مبدئياً */
    transition: opacity 0.3s;
    text-align: center;
}

.portfolio-item:hover p {
    opacity: 1; /* إظهار النص عند المرور */
}


/* ------------------------------------ */
/* 6. تنسيق قسم التواصل الجديد (Social Links) */
/* ------------------------------------ */
.contact-subtitle {
    font-size: 1.1em;
    color: var(--text-dark);
    margin-bottom: 30px;
}

/* الصف الرئيسي (واتساب واتصال) */
.contact-main-btns {
    display: flex;
    justify-content: center; /* وضع الأزرار في المنتصف */
    gap: 25px; /* مسافة كبيرة بين زر الاتصال وواتساب */
    margin-bottom: 40px;
    flex-wrap: wrap; /* للسماح بالنزول على سطر جديد على الموبايل */
}

/* الأزرار العادية (Social-btn) لصف واتساب واتصال */
.contact-main-btns .social-btn {
    min-width: 150px;
    padding: 18px 25px;
}

.social-contact-links {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--text-light);
    border-radius: 8px;
    padding: 15px 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.social-btn i {
    font-size: 1.5em;
    margin-left: 10px;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* ألوان الأزرار المخصصة */
.whatsapp-btn {
    background-color: #25D366; 
}
.phone-btn {
    background-color: var(--primary-color); 
}
.instagram-btn {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    width: 60px; 
    height: 60px;
    padding: 0;
}
.facebook-btn {
    background-color: #4267B2;
    width: 60px; 
    height: 60px;
    padding: 0;
}
.tiktok-btn {
    background-color: #000000;
    width: 60px; 
    height: 60px;
    padding: 0;
}

.instagram-btn i, .facebook-btn i, .tiktok-btn i {
    margin: 0;
}

.social-contact-links span {
    color: var(--text-light);
}

.social-note {
    margin-top: 30px;
    font-size: 0.9em;
    color: var(--text-dark);
}

/* ------------------------------------ */
/* 7. تنسيق التذييل (Footer) */
/* ------------------------------------ */
footer {
    background: var(--background-dark); 
    color: var(--text-light);
    text-align: center;
    padding: 30px 20px;
    font-size: 0.9em;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}


/* ------------------------------------ */
/* 8. Media Query: التنسيق للشاشات الأكبر */
/* ------------------------------------ */
@media (min-width: 768px) {
    
    .about-container {
        flex-direction: row; /* الترتيب الأفقي على الكمبيوتر */
        text-align: right;
        align-items: flex-start; /* محاذاة العناصر للأعلى */
        justify-content: space-between; /* توزيع المساحة بين النص والصورة */
        max-width: 1200px; /* تحديد أقصى عرض للحاوية */
        margin: 0 auto;
    }
    
    .about-text {
        flex: 2; /* النص يأخذ ضعف مساحة الصورة تقريباً */
        padding-left: 50px; /* تباعد عن الصورة */
        padding-right: 0;
    }
    
    .about-image {
        flex: 1; /* الصورة تأخذ مساحة أقل */
        max-width: 350px; /* تحديد أقصى عرض للصورة */
        margin-top: 0;
    }
    
    /* تحسين عرض القائمة النقطية */
    .about-text ul {
        grid-template-columns: 1fr 1fr; /* توزيع العناصر على عمودين */
        padding-right: 0;
    }
    
    nav ul {
        display: flex;
        gap: 20px;
    }

    header {
        padding: 20px 50px;
    }

    .hero {
        min-height: auto; /* تم إزالته */
        max-height: 900px; /* ارتفاع أقصى على الشاشات الكبيرة جداً */
        padding-top: 150px;
        padding-bottom: 120px;
    }

    /* ************* تصحيح مرونة الخط ************* */
    /* تم حذف تحديد الحجم هنا ليتولى clamp() الأمر */
    /* ******************************************* */
    
    .services-container {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap; 
        max-width: 1200px; 
        margin: 0 auto;
    }
    
    .service-card {
        flex-basis: calc(33.33% - 40px); /* 3 بطاقات في الصف */
        max-width: 350px;
        margin: 10px; 
    }

    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 أعمدة لمكتبة الصور */
        padding: 0 50px;
    }
    
    .social-contact-links {
        gap: 20px;
        max-width: 800px;
        margin: 20px auto;
    }
}