/* General Styling & Font */
:root {
    --primary-color: #0d47a1; /* Dark Blue */
    --secondary-color: #1a237e; /* Deeper Blue */
    --accent-color: #fbc02d; /* Amber/Gold for highlights */
    --text-color: #333;
    --light-text-color: #f8f8f8;
    --bg-light: #f4f7f6;
    --bg-dark: #2c3e50; /* Darker background for some sections */
}

body {
    font-family: 'Cairo', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    direction: rtl; /* Right-to-left for Arabic */
    text-align: right; /* Default text alignment for RTL */
    background-color: var(--bg-light);
    color: var(--text-color);
    overflow-x: hidden; /* Prevent horizontal scroll due to animations */
}

h1, h2, h3, h4 {
    color: var(--secondary-color);
    font-weight: 700;
}

p {
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}
a:hover {
    color: var(--accent-color);
}

/* Header & Hero Section */
.hero-section {
    position: relative;
    height: 40vh; /* Full viewport height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    color: var(--light-text-color);
    text-align: center;
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 90%;
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.9), rgba(138, 146, 235, 0.9));
    z-index: 1;
    /* Parallax effect - will be handled by JS for more complex interaction */
    transform: translateZ(0); /* For 3D hardware acceleration */
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 10px;
    max-width: 800px;
    margin-bottom: 20px;
    animation: fadeInScale 1s ease-out forwards;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.main-title {
    font-size: 3em;
    margin-bottom: 20px;
    color: var(--light-text-color);
    line-height: 1.2;
}

.intro-text {
    font-size: 1.2em;
    max-width: 700px;
    margin: 0 auto;
    color: var(--light-text-color);
}



/* Companies Section */
.companies-section {
    padding: 10px 20px;
    text-align: center;
    background-color: var(--bg-light);
}

.section-title {
    font-size: 2.5em;
    margin-bottom: 40px;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.company-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-bottom: 50px;
}

/* تعديلات هنا لـ company-logo و محتوياته */
.company-logo {
    /* أزل الارتفاع والعرض الثابتين هنا للسماح للمحتوى بتحديد الحجم */
    /* width: 150px;
    height: 100px; */
    
    display: flex;
    flex-direction: column; /* لجعل المحتوى (الصورة والاسم) يترتب عمودياً */
    justify-content: center;
    align-items: center;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 15px; /* أضف padding للحاوية لتعطي مساحة للصورة والنص */
    min-width: 120px; /* حد أدنى للعرض لكل شعار */
    max-width: 180px; /* حد أقصى للعرض لكل شعار */
    flex-grow: 1; /* للسماح للعناصر بالنمو وتعبئة المساحة المتاحة */
}

.company-logo:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.company-logo img {
    max-width: 100%; /* تأكد أن الصورة لا تتجاوز عرض الحاوية */
    height: auto; /* حافظ على نسبة أبعاد الصورة */
    max-height: 80px; /* لضبط أقصى ارتفاع للصورة */
    object-fit: contain;
    margin-bottom: 10px; /* مسافة بين الصورة والاسم */
}

.company-logo h3 {
    margin: 0; /* إزالة الهوامش الافتراضية لـ h3 */
    font-size: 0.9em; /* حجم خط مناسب لاسم الشركة */
    color: var(--secondary-color); /* لون لاسم الشركة */
    text-align: center; /* محاذاة النص في المنتصف */
    white-space: nowrap; /* منع النص من الالتفاف */
    overflow: hidden; /* إخفاء أي نص زائد */
    text-overflow: ellipsis; /* إضافة نقاط (...) للنص الزائد */
    padding: 0 5px; /* بعض التباعد الأفقي إذا كان الاسم طويلاً */
}


/* Job Listings / Accordion */
.job-listings-container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.company-jobs {
    display: none; /* Hidden by default, shown by JS */
    animation: fadeIn 0.8s ease-out forwards;
}

.job-card {
    background-color: var(--bg-light);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-right: 5px solid var(--primary-color); /* Highlight border */
}

.job-card h3 {
    margin-top: 0;
    font-size: 1.8em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.job-card ul {
    list-style: none;
    padding: 0;
    margin-bottom: 15px;
}
.job-card ul li {
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.job-card ul li i {
    color: var(--accent-color);
    font-size: 1.2em;
}

.job-card p {
    margin-bottom: 10px;
    font-size: 1em;
}
.job-card strong {
    color: var(--secondary-color);
}

.job-details-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    margin-top: 15px;
    transition: color 0.3s ease;
}
.job-details-toggle:hover {
    color: var(--accent-color);
}
.job-details-toggle i {
    font-size: 1em;
}

.job-details {
    display: none; /* Hidden by default */
    margin-top: 20px;
    border-top: 1px dashed #eee;
    padding-top: 20px;
    animation: fadeInDown 0.5s ease-out forwards;
}
.job-details h4 {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: var(--secondary-color);
}
.job-details ul li {
    font-size: 0.95em;
}

/* Application Form */
.application-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px dashed #eee;
}

.application-form input[type="text"],
.application-form input[type="tel"],
.application-form input[type="number"],
.application-form select,
.application-form textarea {
    width: calc(100% - 20px);
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: 'Cairo', sans-serif;
    color: var(--text-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    text-align: right; /* Ensure input text is RTL */
}

.application-form input:focus,
.application-form select:focus,
.application-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(13, 71, 161, 0.2);
    outline: none;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
    transform: scale(1.2);
}
.checkbox-group label {
    font-size: 1em;
    color: var(--text-color);
}

.submit-btn {
    background-color: var(--accent-color);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%; /* هذا مهم ليتجاوب مع العرض ويتم توسيطه */

    /* التعديلات هنا لجعله في المنتصف */
    display: block; /* يجب أن يكون عنصر كتلة ليأخذ عرض 100% ويتم توسيطه */
    margin-left: auto; /* يدفعه لليمين */
    margin-right: auto; /* يدفعه لليسار */
    max-width: 300px; /* لتقييد عرضه الأقصى وجعله يبدو جيدًا في المنتصف */
}

.submit-btn:hover {
    background-color: #fdd835; /* Slightly darker amber */
    transform: translateY(-2px);
}

/* في الميديا كويري الخاص بالأجهزة الصغيرة */
@media (max-width: 768px) {
    .submit-btn {
        max-width: 250px; /* تقليل العرض الأقصى على الشاشات الأصغر */
    }
}

@media (max-width: 480px) {
    .submit-btn {
        max-width: 200px; /* تقليل العرض الأقصى أكثر على الشاشات الصغيرة جداً */
        padding: 10px 20px; /* تقليل ال padding ليتناسب */
        font-size: 1em; /* تقليل حجم الخط */
    }
}




/* Footer */
footer {
    background-color: var(--secondary-color);
    color: var(--light-text-color);
    padding: 30px 20px;
    text-align: center;
    font-size: 0.9em;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
}

.footer-links a {
    color: var(--light-text-color);
    margin: 0 10px;
    transition: color 0.3s ease;
}
.footer-links a:hover {
    color: var(--accent-color);
}
.footer-links .separator {
    color: #777;
}

.social-icons {
    margin-top: 20px;
}
.social-icons a {
    color: var(--light-text-color);
    font-size: 1.5em;
    margin: 0 10px;
    transition: color 0.3s ease;
}
.social-icons a:hover {
    color: var(--accent-color);
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.2em;
    }
    .intro-text {
        font-size: 1em;
    }
    
    .section-title {
        font-size: 2em;
    }
    /* تعديلات هنا للأجهزة الصغيرة */
    .company-logo {
        /* إزالة العرض والارتفاع الثابتين */
        /* width: 120px;
        height: 80px; */
        margin: 10px; /* يمكن أن تبقى هذه القيمة */
        min-width: 100px; /* حد أدنى للعرض أصغر */
        max-width: 150px; /* حد أقصى للعرض أصغر */
        padding: 10px; /* تقليل ال padding */
    }
    .company-logo img {
        max-height: 70px; /* تقليل أقصى ارتفاع للصورة */
        margin-bottom: 8px; /* تقليل المسافة بين الصورة والاسم */
    }
    .company-logo h3 {
        font-size: 0.8em; /* تقليل حجم الخط لأسماء الشركات */
    }

    .job-card {
        padding: 20px;
    }
    .job-card h3 {
        font-size: 1.5em;
    }
    .job-card ul li {
        font-size: 0.9em;
    }
    .application-form input,
    .application-form select,
    .application-form textarea {
        padding: 10px;
        font-size: 0.9em;
    }
    .submit-btn {
        padding: 12px 25px;
        font-size: 1em;
    }
    .additional-image-section {
        height: 300px;
    }
    .additional-image-section h2 {
        font-size: 2em;
    }
    .testimonials-carousel {
        flex-wrap: nowrap; /* Keep cards in a single row for carousel */
        overflow-x: scroll; /* Allow horizontal scrolling */
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    .testimonial-card {
        min-width: 80%; /* Make cards wider on small screens */
        margin: 0 10px;
    }
    .carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }
    .footer-links, .social-icons {
        margin-top: 15px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.8em;
    }
    .intro-text {
        font-size: 0.9em;
    }
    .hero-slider-container {
        height: 0vh;
    }
    /* تعديلات هنا للأجهزة الصغيرة جداً */
    .company-logo {
        min-width: 90px; /* حد أدنى أصغر جداً */
        max-width: 120px; /* حد أقصى أصغر جداً */
        padding: 8px; /* تقليل ال padding أكثر */
    }
    .company-logo img {
        max-height: 60px; /* تقليل أقصى ارتفاع للصورة أكثر */
        margin-bottom: 5px; /* تقليل المسافة أكثر */
    }
    .company-logo h3 {
        font-size: 0.75em; /* تقليل حجم الخط أكثر */
    }
    .additional-image-section {
        height: 250px;
    }
    .additional-image-section h2 {
        font-size: 1.8em;
    }
    .testimonial-card {
        min-width: 90%;
    }
}