:root {
    --primary-color: #292929;
    --basic-color: #05a59f;
    --secondary-color: #e74c3c;
    --accent-color: #f39c12;
    --light-color: #ecf0f1;
    --dark-color: #5a5a5a;
    --text-color: #fff;
    --text-light: #777;
    --black: #000;
    --font-primary: 'Tajawal', sans-serif;
    --transition: all 0.3s ease;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    padding: 3px;
}

body {
    font-family: var(--font-primary);
    color: var(--text-color);
    line-height: 1.6;
    direction: rtl;
    background-color: black;
}

/* إعدادات اللغة العربية */
body.ar {
    direction: rtl;
    text-align: right;
}

/* إعدادات اللغة الإنجليزية */
body.en {
    direction: ltr;
    text-align: left;
}


/* إضافة مساحة لنص hero */
.header {
    position: relative;
    padding-top: 60px; /* مساحة كافية لتجنب حجب النصوص */
}

header .logo {
    position: absolute;
    left: 10px;
    top: 10px;
}

.language-switcher {
    position: absolute; /* وضع محدد لتحديد المواقع */
    top: 120px; /* تحت الشعار والقائمة */
    left: 50%; /* توسيط أفقياً */
    transform: translateX(-50%); /* تأكيد التوسيط الكامل */
    display: flex; /* ترتيب الروابط بجانب بعضها */
    flex-direction: row; /* ترتيب الروابط في صف */
    justify-content: center; /* توسيط الروابط داخل الحاوية */
    gap: 15px; /* مسافة بين الروابط */
    z-index: 10; /* ضمان ظهور الروابط فوق العناصر الأخرى */
}

.language-switcher a {
    text-decoration: none; /* إزالة التسطير */
    color: var(--text-color, #000); /* لون النص */
    font-weight: bold; /* جعل النص بارزًا */
    font-size: 14px; /* حجم النص */
    background: none; /* إزالة أي خلفية */
    padding: 0; /* إزالة أي حشوة إضافية */
    transition: color 0.3s ease; /* تأثير تغيير اللون */
}

/* زر اللغة النشطة */
.language-switcher a.active {
    color: var(--basic-color); /* تغيير لون النص للزر النشط */
    border-color: var(--basic-color); /* تغيير لون الإطار */
    font-weight: bold; /* جعل النص أكثر وضوحًا */
}

/* تأثير التحويم */
.language-switcher a:hover {
    color: var(--accent-color); /* تغيير لون النص عند التحويم */
    border-color: var(--accent-color); /* تغيير لون الإطار عند التحويم */
    background: transparent; /* التأكد من عدم وجود خلفية */
}



/* التنسيق العام */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section {
    padding: 30px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title, .about-title {
    font-size: 2.2rem;
    color: var(--dark-color);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

/* إعدادات الفاصل (divider) الافتراضية */
.divider {
    width: 80px;
    height: 3px;
    background: var(--basic-color);
    margin: 0 auto 20px;
    transition: all 0.3s ease-in-out; /* لإضافة تأثير سلس */
}

/* التأثير عند اللغة العربية */
body.ar .divider {
    width: 120px; /* زيادة العرض */
    background: var(--basic-color);
}

/* التأثير عند اللغة الإنجليزية */
body.en .divider {
    width: 60px; /* تقليل العرض */
    background: var(--basic-color);
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--basic-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.btn-secondary {
    background: var(--basic-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--basic-color);
    color: var(--basic-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* الرأس */
.header {
    position: relative;
    background: 
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), 
        url('../images/blueblack.jpg') center/cover no-repeat fixed;
    color: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

/* تنسيق الشعار */
.logo {
    position: absolute;
    top: 10px;
    z-index: 1000;
    transition: var(--transition);
}

/* اتجاه الشعار حسب اللغة */
body.ar .logo {
    position: absolute;
    left: 10px;
    right:auto;
}

body.en .logo {
    position: absolute;
    right: 10px;
    left: auto;
}

.logo img {
    height: 50px;
    width: auto;
    max-width: 150px;
    transition: var(--transition);
}


/* القائمة الرئيسية */
body.en .main-nav {
    position: absolute;
    left: 10px; /* القائمة يسار */
    right: auto; /* تحييد اليمين */
}

body.ar .main-nav {
    position: absolute;
    right: 10px; /* القائمة يمين */
    left: auto; /* تحييد اليسار */
}

.main-nav {
    position: fixed;
    top: 0;
    right: 0; /* اجعل القائمة ظاهرة */
    z-index: 1000;
}

.main-nav li a:hover {
    color: #ecf0f1;
}

.main-nav.open {
    right: 0; /* عرض القائمة عند الفتح */
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-list .nav-link {
    text-decoration: none;
    color: #05a59f;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    top: 10px;
}

.nav-list .nav-link:hover,
.nav-list .nav-link.active {
    color: #ecf0f1;
    background-color: #292929;
}

/* تصميم القائمة الجانبية للموبايل */
.main-nav.mobile {
    position: fixed;
    top: 0;
    right: 0;
    background-color: #fff;
    width: 250px;
    height: 100vh;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    padding: 20px;
}

.main-nav.mobile.open {
    transform: translateX(0);
}

.nav-list.mobile {
    flex-direction: column;
    gap: 15px;
}


.nav-list {
    display: flex;
    list-style: none;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    padding: 10px 15px;
    margin: 0 5px;
    font-weight: 500;
    transition: var(--transition);
    border-radius: 4px;
}

.nav-link:hover, .nav-link.active {
    background: var(--basic-color);
}

.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-text {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* قسم من نحن */
.about-content {
    margin-bottom: 30px;
}

.about-text {
    margin-bottom: 20px;
    font-size: 1.1rem;
    text-align: justify;
}

/* قسم الخدمات */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--basic-color);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    height: auto;
    min-height: 120px; /* ارتفاع عند الطي */
}

.service-header {
    padding: 20px;
    cursor: pointer;
    display: flex;
    text-align: center;
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.service-icon {
    font-size: 1.8rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
    padding-right: 10px;
}

.service-title {
    font-size: 1.3rem;
    color: var(--light-color);
    margin: 0;
    transition: all 0.3s ease;
    text-align: center;
}

.service-text {
    color: var(--light-color);
    line-height: 1.6;
    margin: 0;
    padding-bottom: 20px;
    text-align: justify;
}

.service-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.3s ease;
    padding: 0;
}

.service-card.active .service-icon {
    transform: rotate(15deg);
}

.service-card.active .service-content {
    max-height: 200px; /* يمكن تعديل القيمة حسب المحتوى */
    padding: 15px 0;
}

/* تأثيرات التحويم */
.service-card:hover .service-header {
    background: rgba(231, 76, 60, 0.05);
}

/* قسم العملاء */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
    align-items: center;
}

.client-logo img {
    width: 100%;
    height: auto;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: var(--transition);
}

.client-logo:hover img {
    filter: grayscale(0);
    opacity: 1;
}

/* التجاوب */
@media (max-width: 992px) {
    .section {
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
}


@media (max-width: 768px) {

    .logo img {
        height: 50px;
        max-width: 170px;
    }

    .language-switcher {
        position: relative; /* وضع الروابط ضمن السياق الطبيعي */
        margin-top: 100px;
        left: 0; /* إزالة التوسيط الأفقي */
        transform: none; /* إلغاء الترجمة */
        display: flex; /* ترتيب الروابط في صف */
        flex-direction: row !important; /* تأكد من أن الروابط بجانب بعضها */
        justify-content: center; /* توسيط الروابط */
        gap: 10px; /* تقليل المسافة بين الروابط */
    }

    .language-switcher a {
        font-size: 12px; /* تصغير حجم النص قليلاً */
    }

    
    .menu-toggle {
        display: flex; /* عرض زر القائمة على الشاشات الصغيرة */
    }

    .main-nav {
        display: none; /* إخفاء القائمة الأساسية */
    }

    .main-nav.mobile {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }
    
    .nav-list {
        position: fixed;
        top: 80px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--dark-color);
        flex-direction: column;
        align-items: center;
        padding-top: 40px;
        transition: var(--transition);
    }

    .header {
        background-attachment: scroll;
    }
    
    .header {
        min-height: 80vh;
        padding-top: 5px;
    }
    
    .nav-list.active {
        right: 0;
    }
    
    .nav-link {
        margin: 10px 0;
        font-size: 1.1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-text {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    
    .language-switcher {
        position: absolute; /* وضع الأزرار في الأعلى */
        top: 10%; /* مسافة صغيرة من أعلى الشاشة */
        left: 50%; /* توسيط أفقياً */
        transform: translateX(-50%); /* توسيط كامل */
        display: flex; /* ترتيب الأزرار بجانب بعضها البعض */
        gap: 10px; /* مسافة صغيرة بين الأزرار */
        z-index: 10; /* ضمان الظهور فوق العناصر الأخرى */
    }

    .section {
        padding: 50px 0;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }

    .language-switcher {
        top: 15px; /* تقليل المسافة أكثر من الأعلى */
        right: 10px; /* تثبيت الأزرار بمحاذاة اليمين */
        flex-direction: column; /* ترتيب الأزرار عموديًا */
        gap: 5px; /* تقليل المسافة بين الأزرار */
    }

    .language-switcher a {
        padding: 6px 10px; /* تقليل حجم الأزرار بشكل أكبر */
        font-size: 12px; /* تقليل حجم الخط */
    }
    

    .logo img {
        height: 40px;
        max-width: 150px;
    }
}
