/* متغيرات CSS لتحكم أفضل في التصميم */
:root {
    --primary-color: #4a69bd; /* أزرق أكثر هدوءًا واحترافية */
    --dark-color: #2c3e50;
    --light-color: #f9f9f9;
    --text-color: #333;
    --grey-color: #666;
    --white-color: #ffffff;
    --font-family-main: 'Cairo', 'Segoe UI', sans-serif;
}

/* إعدادات عامة وتصفير القيم الافتراضية */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-display: swap; /* اطلب من المتصفح عرض النص بخط بديل حتى يتم تحميل الخط المخصص */
    font-family: var(--font-family-main);
}

body {
    background-color: var(--light-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* تنسيق الحاويات العامة */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

/* شريط التنقل */
header {
    /* تم تغيير الوضع إلى fixed ليبقى ثابتاً في الأعلى */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.8s ease, box-shadow 0.8s ease; /* زيادة مدة الانتقال لجعلها أكثر انسيابية */
}

/* كلاس يضاف عند التمرير */
header.header-scrolled {
    background: var(--white-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px; /* تم تعديل ارتفاع الهيدر ليتناسب مع الشعار الأكبر */
}

.logo {
    text-decoration: none;
    /* إضافة خلفية دائرية للشعار لجعله يبرز */
    background-color: var(--white-color);
    border-radius: 50px; /* تغيير الشكل إلى بيضاوي */
    padding: 5px 20px 5px 5px; /* تعديل الحشوة لتناسب النص */
    display: flex;
    align-items: center; /* لمحاذاة الشعار والنص عمودياً */
    gap: 10px; /* إضافة مسافة بين الشعار والنص */
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.logo span {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-color);
}

.logo img {
    height: 70px;    /* تم تكبير الشعار لزيادة وضوحه */
    width: auto;     /* يحافظ على تناسب أبعاد الصورة تلقائياً */
    display: block;  /* يمنع ظهور مسافات فارغة غير مرغوبة أسفل الصورة */
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--white-color); /* تغيير اللون الافتراضي إلى الأبيض */
    font-weight: 600;
    /* إضافة تنسيقات المربع */
    padding: 5px 15px;
    border: 2px solid var(--white-color);
    border-radius: 50px;
    transition: color 0.5s ease, background-color 0.5s ease, border-color 0.5s ease; /* زيادة مدة الانتقال لجعلها أكثر انسيابية */
}

/* تغيير لون النص عند التمرير لأسفل وظهور الشريط الأبيض */
header.header-scrolled .nav-links a {
    color: var(--grey-color);
    border-color: var(--grey-color);
}

header.header-scrolled .nav-links a:hover, .nav-links a:hover {
    /* تأثير التعبئة عند التمرير */
    background-color: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* القسم الرئيسي (Hero) */
.hero {
    /* استبدال التدرج اللوني بصورة خلفية مع طبقة لونية داكنة لتحسين وضوح النص */
    /* تأكد من أن مسار الصورة صحيح. هنا نفترض أن الصورة موجودة في مجلد images */
    background-image: 
        linear-gradient(rgba(44, 62, 80, 0.7), rgba(44, 62, 80, 0.7)), /* الطبقة اللونية الداكنة */
        url('images/hero-background.jpg'); /* صورة الخلفية الأصلية */
    background-size: cover, cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--white-color);
    text-align: center;
    /* زيادة الـ padding-top لتعويض ارتفاع الهيدر الثابت */
    padding: 220px 20px 140px 20px; /* تم زيادة الحجم لجعل القسم أكبر */
    position: relative; /* ضروري لتثبيت الشعار في الخلفية */
    overflow: hidden; /* يمنع أي عناصر متحركة من الخروج عن حدود القسم */
}

.hero-background-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px; /* تم تكبير حجم الشعار في الخلفية */
    height: 350px; /* تم تكبير حجم الشعار في الخلفية */
    background-image: url('images/logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.15; /* جعل الشعار شبه شفاف */
    z-index: 0;
    /* تطبيق حركة النبض */
    animation: pulse 6s infinite ease-in-out; /* إبطاء حركة النبض */
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    /* إضافة حركة النبض للعنوان الرئيسي */
    animation: title-pulse 5s infinite ease-in-out;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative; /* لضمان بقاء المحتوى فوق الشعار */
    z-index: 1;
}

.hero-content .btn {
    position: relative;
    z-index: 1;
}

/* الأزرار المشتركة */
.btn {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white-color);
    padding: 10px 25px;
    border-radius: 50px; /* جعل الحواف دائرية بالكامل */
    text-decoration: none;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background-color 0.5s ease, transform 0.5s ease; /* زيادة مدة الانتقال لجعلها أكثر انسيابية */
}

.btn:hover {
    background: #3b56a1; /* درجة أغمق من اللون الأساسي */
    transform: translateY(-2px);
}

/* الأقسام العامة */
section {
    padding: 60px 0;
    text-align: center;
}

section h2 {
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--dark-color);
    position: relative;
    padding-bottom: 15px;
    /* إضافة حركة النبض لعناوين الأقسام */
    animation: title-pulse 5s infinite ease-in-out;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* قسم من نحن */
.about p {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: var(--grey-color);
}

/* قسم الخدمات */
.services {
    /* إضافة خلفية بيضاء لفصل القسم عن الأقسام الأخرى */
    background-color: var(--white-color);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.service-card {
    background: var(--white-color);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    /* زيادة مدة الانتقال لجعلها أكثر انسيابية */
    transition: transform 0.5s ease, box-shadow 0.5s ease, background-color 0.5s ease, color 0.5s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    background-color: var(--primary-color); /* تغيير الخلفية عند التمرير */
    color: var(--white-color);
}

.service-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    transition: color 0.5s ease; /* زيادة مدة الانتقال لجعلها أكثر انسيابية */
}

.service-card h3 {
    margin-bottom: 10px;
    color: var(--dark-color);
    transition: color 0.5s ease; /* زيادة مدة الانتقال لجعلها أكثر انسيابية */
}

/* تغيير لون الأيقونة والعنوان عند تمرير الفأرة فوق البطاقة */
.service-card:hover i,
.service-card:hover h3 {
    color: var(--white-color);
}

/* قسم المنتجات */
.products {
    background-color: var(--light-color); /* لجعل القسم مميزاً عن الأقسام ذات الخلفية البيضاء */
}

.product-card {
    background: var(--white-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.5s ease, box-shadow 0.5s ease, background-color 0.5s ease, color 0.5s ease; /* زيادة مدة الانتقال لجعلها أكثر انسيابية */
    text-align: center; /* تغيير المحاذاة للمركز لتناسب الأيقونة */
    padding: 30px;
    height: 100%; /* تأكد من أن البطاقات تملأ ارتفاع الشريحة */
    display: flex; flex-direction: column; justify-content: center; /* توسيط المحتوى عمودياً */
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    background-color: var(--primary-color);
    color: var(--white-color);
}

.product-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    transition: color 0.5s ease; /* زيادة مدة الانتقال لجعلها أكثر انسيابية */
}

.product-card h3 {
    padding: 0;
    margin-bottom: 10px;
    transition: color 0.5s ease; /* زيادة مدة الانتقال لجعلها أكثر انسيابية */
}

.product-card p {
    padding: 0 20px 20px 20px;
}

/* تغيير لون الأيقونة والعنوان عند تمرير الفأرة فوق البطاقة */
.product-card:hover i,
.product-card:hover h3 {
    color: var(--white-color);
}

/* تنسيقات معرض الصور المتحرك (Swiper) */
.product-slider {
    padding: 10px 0 40px 0; /* إضافة حشوة سفلية لنقاط التنقل */
}

.swiper-slide {
    height: auto; /* السماح للشرائح بتحديد ارتفاعها بناءً على المحتوى */
}

/* تنسيق أزرار ونقاط التنقل في Swiper */
.swiper-button-next,
.swiper-button-prev {
    color: var(--primary-color); /* استخدام اللون الأساسي للموقع */
}

.swiper-pagination-bullet-active {
    background-color: var(--primary-color); /* استخدام اللون الأساسي للنقطة النشطة */
}

/* قسم اتصل بنا */
.contact {
    background-color: var(--white-color);
}

.contact-intro {
    max-width: 600px;
    margin: -20px auto 40px auto;
    color: var(--grey-color);
}

/* طرق التواصل المباشرة */
.contact-methods {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.contact-card {
    background: var(--white-color);
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column; /* تغيير الاتجاه إلى عمودي */
    align-items: center;
    gap: 10px; /* تقليل المسافة بين العناصر */
    text-decoration: none;
    color: var(--grey-color); /* تغيير لون النص الافتراضي */
    font-weight: 600;
    transition: transform 0.5s ease, box-shadow 0.5s ease; /* زيادة مدة الانتقال لجعلها أكثر انسيابية */
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.contact-card i {
    font-size: 1.8rem;
    color: var(--primary-color);
    transition: color 0.5s ease; /* زيادة مدة الانتقال لجعلها أكثر انسيابية */
}

.contact-card:hover i {
    color: var(--primary-color);
}

/* تنسيق العنوان الرئيسي داخل بطاقة التواصل */
.contact-card span {
    color: var(--dark-color);
    font-size: 1.1rem;
    font-weight: 700;
}

/* قسم اتصل بنا */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.5s ease, box-shadow 0.5s ease; /* زيادة مدة الانتقال لجعلها أكثر انسيابية */
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 105, 189, 0.2);
}

/* تذييل الصفحة */
footer {
    background: var(--dark-color);
    color: var(--white-color);
    text-align: center;
    padding: 40px 0;
}

footer p {
    color: #bdc3c7;
    font-size: 0.9rem;
}

footer p:first-of-type {
    font-weight: 600;
    color: var(--white-color);
    margin-bottom: 5px;
}

.social-links {
    margin-bottom: 20px;
}

.social-links a {
    color: var(--white-color);
    margin: 0 10px;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* التجاوب مع الهواتف (Responsive) */
@media (max-width: 768px) { /* تطبيق التنسيقات على الشاشات التي عرضها 768 بكسل أو أقل */
    .container {
        width: 95%; /* استخدام عرض أكبر قليلاً للحاوية على الشاشات الصغيرة */
    }

    .nav-container {
        height: 70px; /* تقليل ارتفاع شريط التنقل على الجوال */
    }

    .logo {
        padding: 5px 10px 5px 5px; /* تعديل حشوة الشعار */
        gap: 5px; /* تقليل المسافة بين الشعار والنص */
    }

    .logo img {
        height: 50px; /* تقليل حجم صورة الشعار */
    }

    .logo span {
        font-size: 1rem; /* تعديل حجم نص اسم الشركة */
    }

    .nav-container {
        position: relative;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px; /* مطابقة ارتفاع شريط التنقل الجديد */
        right: 0;
        background: var(--white-color);
        width: 100%;
        padding: 15px 0; /* تعديل الحشوة للقائمة المنسدلة */
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        text-align: center;
        gap: 0;
    }

    .nav-links li {
        padding: 8px 0; /* تعديل حشوة عناصر القائمة */
    }

    .nav-links a {
        padding: 5px 10px; /* تعديل حشوة الروابط داخل القائمة */
        font-size: 0.9rem; /* تعديل حجم خط الروابط */
    }

    .nav-links.active a { /* عند فتح قائمة الجوال */
        border-color: var(--primary-color); /* ضمان ظهور الإطار على الخلفية البيضاء */
        color: var(--primary-color); /* ضمان ظهور النص على الخلفية البيضاء */
    }

    .nav-links.active a:hover {
        background-color: #3b56a1;
        color: var(--white-color);
        border-color: var(--primary-color);
    }

    .menu-toggle {
        display: block;
    }

    .hero {
        padding: 150px 20px 80px 20px; /* تقليل حشوة القسم الرئيسي */
    }

    .hero-content h1 {
        font-size: 2rem;
    }
    .nav-links.active {
        display: flex;
    }

    .hero-content p {
        font-size: 1rem; /* تقليل حجم خط الفقرات في القسم الرئيسي */
    }

    .hero-background-logo {
        width: 250px; /* تقليل حجم الشعار في الخلفية */
        height: 250px;
        opacity: 0.1; /* جعل الشعار أكثر شفافية */
    }

    section {
        padding: 40px 0; /* تقليل حشوة الأقسام العامة */
    }

    section h2 {
        font-size: 1.8rem; /* تعديل حجم خط عناوين الأقسام */
        margin-bottom: 30px;
    }

    .about p {
        font-size: 1rem; /* تعديل حجم خط فقرة "من نحن" */
    }


    .service-card,
    .product-card {
        padding: 20px; /* تقليل حشوة بطاقات الخدمات والمنتجات */
    }

    .service-card i,
    .product-card i {
        font-size: 2rem; /* تعديل حجم أيقونات البطاقات */
        margin-bottom: 10px;
    }

    .service-card h3,
    .product-card h3 {
        font-size: 1.1rem; /* تعديل حجم خط عناوين البطاقات */
    }

    .contact-intro {
        font-size: 1rem; /* تعديل حجم خط مقدمة قسم التواصل */
        margin-bottom: 30px;
    }

    .contact-methods {
        flex-direction: column; /* جعل بطاقات التواصل تظهر عمودياً */
        gap: 10px; /* تقليل المسافة بين بطاقات التواصل */
    }

    .contact-card {
        padding: 15px 20px; /* تعديل حشوة بطاقات التواصل */
        width: 100%; /* جعل بطاقات التواصل تأخذ العرض الكامل */
        justify-content: center; /* توسيط المحتوى داخل البطاقة */
    }

    .contact-form input,
    .contact-form textarea {
        padding: 10px; /* تقليل حشوة حقول النموذج */
    }

    .btn {
        padding: 8px 20px; /* تعديل حشوة الأزرار */
        font-size: 0.9rem; /* تعديل حجم خط الأزرار */
    }

    footer p {
        font-size: 0.8rem; /* تعديل حجم خط نصوص التذييل */
    }
}

/* تأثيرات الحركة عند التمرير */
.fade-in {
    opacity: 0;
    transform: scale(0.9); /* تبدأ بحجم أصغر قليلاً */
    transition: opacity 1.2s ease-out, transform 1.2s ease-out; /* زيادة مدة الانتقال لجعلها أكثر انسيابية */
}

.fade-in.visible {
    opacity: 1;
    transform: scale(1); /* العودة إلى الحجم الطبيعي */
}
 
/* تعريف حركة النبض */
@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* تعريف حركة النبض للعناوين */
@keyframes title-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03); /* نبض خفيف */
    }
}

/* زر العودة للأعلى */
#back-to-top-btn {
    position: fixed;
    bottom: 25px;
    right: 25px; /* استخدام 'right' مناسب للمواقع التي تدعم القراءة من اليمين لليسار (RTL) */
    width: 45px;
    height: 45px;
    background-color: var(--primary-color);
    color: var(--white-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-decoration: none;
    z-index: 999;
    opacity: 0; /* إخفاء الزر افتراضياً */
    visibility: hidden; /* إخفاء الزر افتراضياً */
    transform: translateY(10px); /* إزاحة بسيطة للأسفل */
    transition: opacity 0.5s ease, visibility 0.5s ease, transform 0.5s ease; /* زيادة مدة الانتقال لجعلها أكثر انسيابية */
}

#back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}