/* =========================================
   🏠 6. تنسيقات الصفحة الرئيسية (Home Page)
   ========================================= */

/* --- 1. قسم الواجهة (Hero Section) --- */
.hero-section {
    position: relative;
    /* التعديل هنا: جعل الارتفاع 100% من ارتفاع الشاشة */
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    background-size: cover;
    background-position: center;
    
    /* ✂️ التعديل السحري: سحبنا الهيرو لفوق عشان يغطي الفراغ */
    /* جرب تزود الرقم أو تنقصه لحد ما يظبط معاك بالمللي */
    margin-top: -35px; 
    
    padding-top: 0; 
}

/* طبقة تعتيم فوق الصورة لضمان قراءة النص */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 40, 85, 0.7); /* أزرق غامق شفاف */
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-title .highlight {
    color: var(--secondary-color); /* ذهبي */
    position: relative;
    display: inline-block;
}

.hero-title .highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 10px;
    background: rgba(255, 215, 0, 0.3);
    z-index: -1;
    border-radius: 5px;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-main {
    padding: 15px 40px;
    font-size: 18px;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 40px;
    border: 2px solid #fff;
    color: #fff;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: 0.3s;
}

.btn-outline:hover {
    background: #fff;
    color: var(--primary-dark);
}

/* --- 2. الأقسام العامة --- */
.section-padding {
    padding: 80px 0;
}

.text-center {
    text-align: center;
}

.bg-light {
    background-color: var(--bg-light);
}

.section-header {
    margin-bottom: 50px;
}

.section-subtitle {
    color: #006E96 /* WCAG AA ✓ */;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    display: block;
    margin-bottom: 10px;
}

.section-title {
    font-size: 2.5rem;
    color: var(--primary-dark);
    font-weight: 800;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

/* --- 3. قسم من نحن --- */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 25px;
    font-size: 17px;
}

.check-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.check-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.check-list i {
    color: var(--secondary-color);
    background: rgba(255, 215, 0, 0.15);
    padding: 5px;
    border-radius: 50%;
    font-size: 14px;
}

.placeholder-img {
    width: 100%;
    height: 400px;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    font-size: 20px;
    color: #888;
    position: relative;
    overflow: hidden;
}

.placeholder-img::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 100px;
    height: 100px;
    background: var(--secondary-color);
    z-index: -1;
    border-radius: 10px;
    opacity: 0.5;
}

/* --- 4. قسم الخدمات (Services Grid) - التنسيق الهندسي الثابت 📐 --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: #fff;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: 0.3s;
    text-align: center;
    border-bottom: 4px solid transparent;

    /* 🔒 التثبيت الهندسي الصارم */
    height: 450px; /* طول ثابت */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* توزيع العناصر بانتظام */
    overflow: hidden; /* إخفاء الزيادات */
}

.service-card:hover {
    transform: translateY(-10px);
    border-bottom-color: var(--secondary-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.icon-box {
    width: 80px;
    height: 80px;
    /* منع الانكماش */
    flex-shrink: 0; 
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: var(--primary-color);
    transition: 0.3s;
}

.service-card:hover .icon-box {
    background: var(--primary-color);
    color: #fff;
}

.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--primary-dark);
    min-height: 60px; /* حجز مكان لسطرين */
    
    /* قص العنوان لو زاد عن سطرين */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-line-clamp: 2; /* تكرار لبعض المتصفحات */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.service-card p {
    color: var(--text-light);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
    
    /* قص الوصف لو زاد عن 3 سطور */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* زر التفاصيل */
.btn-text {
    margin-top: auto;
    display: inline-block;
    color: #006E96; /* WCAG AA ✓ 5.1:1 on white — was var(--secondary-color) */
    font-weight: bold;
    text-decoration: none;
    transition: 0.3s;
}

.btn-text:hover {
    color: var(--primary-dark);
    transform: translateX(-5px);
}

/* --- 5. قسم الدعوة للعمل --- */
.cta-section {
    background: var(--primary-dark);
    padding: 80px 0;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05));
    transform: skewX(-20deg);
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.8;
}

.btn-large {
    padding: 15px 50px;
    font-size: 20px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .grid-2-col {
        grid-template-columns: 1fr;
    }

    .about-image {
        order: -1;
    }

    .hero-section {
        /* التعديل هنا: إجبار الهيرو على ملء الشاشة في الموبايل أيضاً */
        height: 100vh;
        padding: 60px 0; /* تقليل البادينج قليلاً ليتناسب مع الشاشة الكاملة */
    }

    .section-title {
        font-size: 2rem;
    }
}
/* --- تأثيرات زر اقرأ المزيد (Expandable Content) --- */

/* 1. الحالة الافتراضية (مخفي) */
.hidden-content {
    display: none; /* مخفي في البداية */
    padding-top: 10px;
    animation: fadeIn 0.6s ease; /* أنيميشن ظهور ناعم */
}

/* 2. كلاس الظهور (يضاف بالجافاسكريبت) */
.hidden-content.show {
    display: block;
}

/* 3. تعريف حركة الظهور */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px); /* ييجي من فوق شوية */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 5. قسم الأسئلة الشائعة (FAQ) --- */
.faq-container {
    max-width: 800px; /* عرض مناسب للقراءة */
    margin: 0 auto;
}

.faq-item {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid #eee;
    overflow: hidden;
    transition: 0.3s;
}

.faq-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-color: var(--secondary-color);
}

/* زر السؤال */
.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 20px;
    text-align: right; /* للعربي */
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
    font-family: var(--main-font);
}

.faq-question:hover {
    color: var(--secondary-color);
}

/* الأيقونة (السهم) */
.faq-question .icon {
    width: 30px;
    height: 30px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: 0.3s;
}

/* حالة الفتح (Active) */
.faq-question.active {
    color: var(--secondary-color);
    background: #fdfdfd;
}

.faq-question.active .icon {
    transform: rotate(180deg); /* لف السهم */
    background: var(--secondary-color);
    color: #fff;
}

/* صندوق الإجابة (مخفي افتراضياً) */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out; /* أنيميشن ناعم جداً */
    background: #fff;
}

.answer-content {
    padding: 0 20px 25px;
    color: var(--text-light);
    line-height: 1.8;
    font-size: 16px;
    border-top: 1px solid #f5f5f5;
}

/* ==========================================================
   📱 6. إصلاحات تجاوب الموبايل الشاملة (Mobile Fixes)
   ========================================================== */

/* 1. منع السكرول الأفقي تماماً (لمنع خروج المحتوى عن الشاشة) */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* 2. إجبار النصوص الطويلة والروابط على الانكسار (يحل مشكلة الأرقام الطويلة) */
body, p, a, h1, h2, h3, h4, h5, h6, .hero-title, .section-title, span {
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    -webkit-hyphens: auto;
    hyphens: auto;
}

/* 3. ضمان عدم خروج الصور والفيديوهات عن الإطار */
img, iframe, video, figure {
    max-width: 100% !important;
    height: auto !important;
}

/* 4. تعديلات آمنة للشاشات الصغيرة */
@media (max-width: 768px) {
    /* هوامش داخلية آمنة لمنع التصاق الكلام بحواف الموبايل */
    .hero-content, .about-text, .cta-content, .faq-container, .snippet-box, .visible-faq-section {
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    /* 🛠️ تعديل كروت الخدمات للموبايل: توسيط دقيق + تصغير بسيط + منع التمدد */
    .service-card {
        height: auto !important;
        min-height: 400px !important; /* تصغير الطول حاجة بسيطة */
        width: 100% !important;
        max-width: 340px !important; /* منع الكارت من التمدد لنهاية الشاشة */
        margin: 0 auto !important; /* التوسيط */
        justify-self: center !important; /* إجبار الجريد على التوسيط */
        padding: 25px 20px !important;
    }
}