/* ==========================================================================
   Google Fonts & Variables
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    --navy: #06192b;
    --navy-light: #0d2b4a;
    --gold: #C5A25A;
    --gold-hover: #b39149;
    --bg-light: #F5F6F8;
    --white: #FFFFFF;
    --text-dark: #222222;
    --text-gray: #555555;
    --border-color: #E0E0E0;
    
    --font-heading: 'Tajawal', 'IBM Plex Sans Arabic', sans-serif;
    --font-body: 'IBM Plex Sans Arabic', sans-serif;
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { 
    scroll-behavior: smooth; 
    overflow-x: hidden; /* منع اللفة الجانبية للموقع بالكامل */
    width: 100%;
}
body {
    font-family: var(--font-body);
    background-color: var(--white);
    color: var(--text-dark);
    direction: rtl;
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden; /* تأكيد منع اللفة جهة اليسار في الجوال */
    width: 100%;
}
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 700; line-height: 1.4; }

/* ==========================================================================
   Helpers & Layout
   ========================================================================== */
.custom-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }
.section-padding { padding: 80px 0; }
.bg-light { background-color: var(--bg-light); }
.bg-navy { background-color: var(--navy); }
.text-white { color: var(--white); }
.text-gray { color: var(--text-gray); }
.gold-text { color: var(--gold); }
.navy-text { color: var(--navy); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-bold { font-weight: 700; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-4 { margin-top: 40px; }
.p-4 { padding: 30px; }
.w-100 { width: 100%; }
.w-75 { width: 75%; }
.mx-auto { margin-left: auto; margin-right: auto; }
.rounded { border-radius: 8px; }
.position-relative { position: relative; z-index: 2; }
.d-flex { display: flex; }
.d-flex-col { display: flex; flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.gap-4 { gap: 40px; }
.h-100 { height: 100%; }

/* Grid Systems */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 15px; }

/* Section Headers */
.section-title { font-size: 2.2rem; margin-bottom: 10px; color: var(--navy); }
.section-header.light .section-title { color: var(--white); }
.section-subtitle { font-size: 1.1rem; color: var(--text-gray); max-width: 800px; margin: 0 auto; }
.section-header.light .section-subtitle { color: #ccc; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 12px 28px; border-radius: 4px; font-weight: 600;
    cursor: pointer; border: 1px solid transparent; transition: 0.3s;
    font-family: var(--font-heading);
    white-space: nowrap;
}
.btn-gold { background-color: var(--gold); color: var(--navy); }
.btn-gold:hover { background-color: var(--white); color: var(--navy); border-color: var(--gold); }
.btn-outline { background-color: transparent; border-color: var(--gold); color: var(--gold); }
.btn-outline:hover { background-color: var(--gold); color: var(--navy); }
.btn-navy { background-color: var(--navy); color: var(--white); border-color: var(--navy); }
.btn-navy:hover { background-color: var(--gold); color: var(--navy); }
.btn-lg { font-size: 1.1rem; padding: 14px 35px; }

/* Basic Card & Lists Fix */
.card {
    background: var(--white); padding: 30px; border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.04); border: 1px solid var(--border-color);
}
.small-text { font-size: 0.9rem; line-height: 1.6; color: var(--text-gray); }
.gold-icon { color: var(--gold); }
.border-bottom { border-bottom: 1px solid var(--border-color); }
.border-light { border-color: rgba(255,255,255,0.1); }

.check-list { width: 100%; }
.check-list li { 
    margin-bottom: 12px; 
    font-size: 0.95rem; 
    color: var(--text-dark) !important; 
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.check-list i { color: var(--gold); font-size: 1rem; margin-top: 4px; }

.bg-navy .card .check-list li { color: var(--text-dark) !important; }
.bg-navy .investor-block.bg-navy .check-list li { color: var(--white) !important; }
.bg-navy .investor-block.bg-navy .check-list i { color: var(--gold); }

/* ==========================================================================
   Hero Section 
   ========================================================================== */
.hero {
    position: relative; 
    min-height: 75vh; 
    background-color: var(--navy);
    display: flex; 
    align-items: center; 
    color: white; 
    overflow: hidden;
    width: 100%;
}
.hero-bg-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to left, rgba(6, 25, 43, 0.95) 0%, rgba(6, 25, 43, 0.6) 100%); z-index: 1; }
.hero-content { position: relative; z-index: 2; max-width: 800px; padding: 100px 0 160px; }
.hero-content h1 { font-size: 3.5rem; line-height: 1.3; margin-bottom: 20px; color: white; }
.hero-content p { font-size: 1.15rem; line-height: 1.8; color: #e0e0e0; }

.hero-features-bar {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background-color: rgba(6, 25, 43, 0.95); padding: 25px 0; z-index: 3; border-top: 1px solid rgba(197, 162, 90, 0.3);
}
.features-flex { display: flex; justify-content: space-between; gap: 20px; }
.feature-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; color: white; flex: 1; }
.feature-item i { color: var(--gold); font-size: 1.5rem; }
.feature-item span { font-size: 0.85rem; font-weight: 600; font-family: var(--font-heading); }

/* ==========================================================================
   Stats Bar 
   ========================================================================== */
.stats-bar { background-color: var(--navy-light); padding: 30px 0; color: white; border-bottom: 3px solid var(--gold); }
.stats-flex { display: flex; justify-content: space-between; align-items: center; }
.stat-box { display: flex; align-items: center; gap: 15px; }
.stat-icon { font-size: 2.5rem; color: var(--gold); }
.stat-text h3 { font-size: 2rem; color: var(--gold); line-height: 1; margin-bottom:5px; }
.stat-text p { font-size: 0.85rem; color: #ccc; line-height: 1.3; margin:0;}
.stat-divider { width: 1px; height: 50px; background-color: rgba(255,255,255,0.1); }

/* ==========================================================================
   About, Services, Projects, Gallery, Brands
   ========================================================================== */
.vision-mission-box { background: var(--bg-light); padding: 30px; border-radius: 8px; border-right: 4px solid var(--gold); }
.values-grid .value-item {
    background: var(--bg-light); padding: 20px 10px; border-radius: 8px;
    display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 600; font-size: 0.9rem;
    transition: 0.3s; border: 1px solid var(--border-color);
}
.values-grid .value-item:hover { background: var(--navy); color: white; border-color: var(--navy); }
.values-grid .value-item i { font-size: 1.8rem; color: var(--gold); }

.ceo-message-box { background: var(--bg-light); padding: 40px; border-radius: 12px; border: 1px solid var(--border-color); }
.ceo-img-container img { border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); width: 100%; object-fit: cover;}

.service-card {
    background: var(--navy-light); padding: 30px; border-radius: 8px;
    border: 1px solid rgba(197,162,90,0.2); transition: 0.3s;
    display: flex; flex-direction: column;
}
.service-card:hover { transform: translateY(-5px); border-color: var(--gold); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.s-icon { width: 60px; height: 60px; background: rgba(197,162,90,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; margin-left: auto; margin-right: auto;}
.s-icon i { color: var(--gold); font-size: 1.5rem; }
.service-card h4 { color: var(--gold); margin-bottom: 10px; font-size: 1.2rem; text-align: center;}
.service-card p { font-size: 0.85rem; color: #ccc; margin-bottom: 15px; flex-grow: 1; text-align: center;}
.s-list { margin-bottom: 20px; padding-right: 15px; list-style-type: disc; color: #aaa; font-size: 0.85rem; }
.s-list li { margin-bottom: 5px; text-align: right;}
.s-kpi {
    margin-top: auto; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem; color: #ccc; text-align: center;
}
.s-kpi span { color: var(--gold); font-weight: bold; font-size: 1rem; display: block; }

.project-card { background: var(--white); border-radius: 8px; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.05); border: 1px solid var(--border-color); }
.p-img { height: 220px; overflow: hidden; }
.p-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.project-card:hover .p-img img { transform: scale(1.05); }
.p-content { padding: 20px; }
.p-content h4 { margin-bottom: 5px; color: var(--navy); }
.p-meta { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-color); padding-top: 10px; font-size: 0.85rem; }

.gallery-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; }
.gallery-item { border-radius: 8px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.08); aspect-ratio: 1 / 1; cursor: pointer; background-color: #eee; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery-item:hover img { transform: scale(1.1); }

.brand-card { background: var(--white); padding: 30px; border-radius: 8px; border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
.brand-card img { max-height: 60px; filter: grayscale(100%); transition: 0.3s; opacity: 0.7;}
.brand-card:hover img { filter: grayscale(0%); opacity: 1;}

.partners-section { background: white; padding: 30px 0; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.logos-flex { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.partner-logo { max-height: 40px; object-fit: contain; filter: grayscale(100%); opacity: 0.5; transition: 0.3s; }
.partner-logo:hover { filter: grayscale(0%); opacity: 1; }

/* ==========================================================================
   Responsive & Media Queries
   ========================================================================== */
@media (max-width: 1200px) {
    .grid-6 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .gallery-grid { grid-template-columns: repeat(4, 1fr); }
    .stats-flex { flex-wrap: wrap; justify-content: center; gap: 30px; }
    .stat-divider { display: none; }
    .hero-content h1 { font-size: 2.8rem; }
}

@media (max-width: 992px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
    
    .hero { 
        min-height: auto; 
        display: block; 
        padding-bottom: 0;
        width: 100%;
    }
    .hero-content { 
        padding: 50px 0 30px 0; 
        text-align: center !important; 
        max-width: 100%;
    }
    .hero-features-bar { 
        position: relative; 
        bottom: auto; 
        left: auto; 
        width: 100%; 
        margin-top: 20px;
    }
}

/* ==========================================================================
   Mobile Setting Fixes (توسيط كامل وثبات الشاشة بدون اهتزاز أو لفة)
   ========================================================================== */
@media (max-width: 768px) {
    .custom-container { padding: 0 15px; max-width: 100%; overflow: hidden; } /* حماية الكونتنت */
    .section-padding { padding: 45px 0; }
    .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; gap: 15px; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    
    /* منع خروج عناصر الهيرو عن الحدود */
    .hero-content h1 { 
        font-size: 1.8rem; 
        line-height: 1.4; 
        text-align: center !important;
        word-wrap: break-word;
    }
    .hero-content p {
        font-size: 1rem;
        text-align: center !important;
        line-height: 1.7;
    }
    .hero-buttons { 
        display: flex; 
        flex-direction: column; 
        gap: 12px; 
        align-items: center; 
        justify-content: center;
        width: 100%;
    }
    .hero-buttons .btn { 
        width: 100%; 
        margin: 0 !important; 
        font-size: 1rem;
        padding: 12px 20px;
        white-space: normal; 
        text-align: center;
    }
    
    /* شريط الميزات يتحول لـ العمودي المنظم لعدم التسبب في الاسكرول الجانبي */
    .features-flex { 
        display: grid; 
        grid-template-columns: 1fr; 
        gap: 12px; 
        padding: 0 10px; 
    }
    .feature-item { 
        padding: 12px; 
        border: 1px solid rgba(197,162,90,0.2); 
        border-radius: 8px;
        flex-direction: row; 
        justify-content: center;
        gap: 12px;
    }
    
    /* فرض التوسيط المطلق */
    .text-right { text-align: center !important; }
    .mobile-text-center { text-align: center !important; margin: 0 auto; }
    .mobile-center-grid > div { text-align: center !important; }
    
    .vision-mission-box { border-right: none; border-top: 4px solid var(--gold); text-align: center; }
    .ceo-text { text-align: center; margin-top: 15px; }
    .news-card-mobile { flex-direction: column; text-align: center; }

    /* توسيط القوائم وثبات الكلمات في الكروت */
    .check-list li {
        justify-content: center; 
        text-align: center;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .hero-content h1 { font-size: 1.6rem; }
}

@media (max-width: 768px) {
    .hero-logo {
        display: none !important;
    }
}
