﻿/* ==========================================
   1. جلب الخط العربي والإعدادات العامة (RTL)
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif !important;
}

body {
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    text-align: right;
    direction: rtl; /* تفعيل القراءة من اليمين لليسار للموقع بالكامل */
}

/* ==========================================
   2. القائمة العلوية (Navbar) - التصميم الزجاجي الاحترافي
   ========================================== */
.navbar {
    /* تأثير الزجاج الضبابي الشفاف الاحترافي */
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(10px); /* تنعيم وتغبيش العناصر الخلفية أثناء السكرول */
    -webkit-backdrop-filter: blur(10px);
    display: flex !important;
    justify-content: space-between !important; /* توزيع إجبارى للطرفين */
    align-items: center !important;
    padding: 10px 5%; /* ارتفاع متناسق وأنظف */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03); /* ظلال ناعمة */
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    position: sticky;
    top: 0;
    z-index: 1000;
    direction: rtl !important;
}

    .navbar .logo {
        display: flex !important;
        align-items: center;
        text-decoration: none;
        margin: 0 !important;
    }

.logo-img {
    height: 45px; /* حجم متناسق للشعار العلوى */
    width: auto;
    display: block;
    object-fit: contain;
}

.nav-links {
    display: flex !important;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0 !important;
}

    .nav-links li {
        margin-right: 30px !important;
        margin-left: 0 !important;
    }

    .nav-links a {
        text-decoration: none;
        color: #2c3e50; /* لون داكن راقٍ وواضح للقراءة */
        font-weight: 600;
        font-size: 15px;
        white-space: nowrap;
        position: relative;
        padding: 5px 0;
        transition: color 0.3s ease;
    }

        /* تأثير خط متحرك ذكي تحت أزرار القائمة عند تمرير الماوس */
        .nav-links a::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 0;
            height: 2px;
            background-color: #3498db;
            transition: width 0.3s ease;
        }

        .nav-links a:hover::after, .nav-links a.active::after {
            width: 100%;
        }

        .nav-links a:hover, .nav-links a.active {
            color: #3498db;
        }

/* ==========================================
   3. البنر الرئيسي (Hero Slideshow) - التدرج الاحترافي لـ 5 صور
   ========================================== */
.hero {
    position: relative;
    height: 500px; /* الارتفاع الفاخر للمظهر العلوي للموقع */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    overflow: hidden;
    direction: rtl;
    background-color: #000; /* منع الوميض الأبيض أثناء التحميل وتبديل السلايدر */
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

    .hero-bg .slide {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-size: cover;
        background-position: center;
        opacity: 0;
        /* التوقيت الإجمالي 25 ثانية ليتناسب بالتساوي مع الـ 5 صور */
        animation: slideAnimation 25s infinite ease-in-out;
    }

        /* تحديد وقت ظهور كل صورة (تأخير زمني بمقدار 5 ثوانٍ تفصل بين كل صورة والأخرى) */
        .hero-bg .slide:nth-child(1) {
            animation-delay: 0s;
        }

        .hero-bg .slide:nth-child(2) {
            animation-delay: 5s;
        }

        .hero-bg .slide:nth-child(3) {
            animation-delay: 10s;
        }

        .hero-bg .slide:nth-child(4) {
            animation-delay: 15s;
        }

        .hero-bg .slide:nth-child(5) {
            animation-delay: 20s;
        }

/* طبقة حماية داكنة متدرجة احترافية فوق الصور لإبراز النصوص والكتابة */
.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 20px;
    /* تدرج لوني يبدأ داكناً خلف أزرار القائمة وينساب بذكاء لأسفل البنر */
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.6) 100%);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

    .hero-content h1 {
        font-size: 42px;
        font-weight: 700;
        margin-bottom: 20px;
        letter-spacing: 0.5px;
        text-shadow: 0 4px 15px rgba(0, 0, 0, 0.6); /* تعميق النص وإبرازه بشكل ثلاثي الأبعاد */
    }

    .hero-content p {
        font-size: 19px;
        max-width: 650px;
        opacity: 0.95;
        line-height: 1.8;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
    }

/* حركة تدرج الصور السلسة مع زووم سينمائي خفيف لـ 5 صور */
@keyframes slideAnimation {
    0% {
        opacity: 0;
        transform: scale(1);
    }

    4% {
        opacity: 1;
    }

    20% {
        opacity: 1;
    }

    24% {
        opacity: 0;
        transform: scale(1.03);
    }

    100% {
        opacity: 0;
    }
}

/* ==========================================
   4. معرض الصور (Gallery Grid)
   ========================================== */
.gallery-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    direction: rtl;
}

.gallery-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    position: relative;
    padding-bottom: 10px;
}

    .gallery-title::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 3px;
        background-color: #3498db;
    }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background-color: #fff;
    cursor: pointer;
    transition: transform 0.3s ease;
}

    .gallery-item:hover {
        transform: scale(1.03);
    }

    .gallery-item img {
        width: 100%;
        height: 250px;
        object-fit: cover;
        display: block;
        transition: transform 0.5s ease;
    }

    .gallery-item:hover img {
        transform: scale(1.1);
    }

/* الطبقة الشفافة فوق الصور (مصلحة برمجياً لمنع تشويه الأحرف العربي ولتمرير الضغط للأسفل) */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #fff;
    padding: 20px;
    text-align: center;
    direction: rtl !important;
    unicode-bidi: bidi-override;
    pointer-events: none; /* حيوية جداً لتجاوز السطح وتمرير النقرات لحدث التكبير */
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h3 {
    font-size: 20px;
    margin-bottom: 5px;
}

/* ==========================================
   5. تذييل الصفحة (Footer)
   ========================================== */
footer {
    background-color: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
    direction: rtl;
}

.social-links {
    margin-bottom: 15px;
}

    .social-links a {
        color: #fff;
        font-size: 24px; /* حجم متناسق وواضح للأيقونات الخطية الحديثة */
        margin: 0 12px;
        transition: color 0.3s, transform 0.3s;
        display: inline-block;
        text-decoration: none;
    }

        .social-links a:hover {
            color: #3498db;
            transform: translateY(-3px);
        }

footer p {
    font-size: 14px;
    opacity: 0.7;
}

/* ==========================================
   6. صندوق التكبير الاحترافي (Lightbox Overlay)
   ========================================== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

    .lightbox-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

.lightbox-image {
    max-width: 85%;
    max-height: 75%;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.4s ease;
    object-fit: contain;
}

.lightbox-overlay.active .lightbox-image {
    transform: scale(1); /* تأثير تمدد انسيابي عند الفتح الناجح */
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
    user-select: none;
}

    .lightbox-close:hover {
        color: #3498db;
        transform: scale(1.1);
    }

.lightbox-caption {
    color: #ddd;
    margin-top: 15px;
    font-size: 18px;
    text-align: center;
    direction: rtl !important;
    font-weight: 600;
    unicode-bidi: bidi-override;
}

/* ==========================================
   7. شاشات الموبيل والأجهزة الذكية (Responsive)
   ========================================== */
@media (max-width: 768px) {
    .navbar {
        background: #ffffff !important; /* خلفية بيضاء صريحة ومستقرة على الموبيل لسهولة تصفح الروابط */
        flex-direction: column !important; /* ترتيب عمودي للوجو فوق عناصر القائمة */
        gap: 15px;
        text-align: center;
        padding: 15px 20px !important;
    }

    .logo-img {
        height: 40px; /* تصغير اللوجو قليلاً ليناسب المساحات الرأسية للموبيل */
    }

    .nav-links li {
        margin: 0 10px !important; /* توزيع متساوٍ وعادل للمسافات */
    }

    .hero {
        height: 350px;
    }

    .hero-content h1 {
        font-size: 28px;
    }

    .hero-content p {
        font-size: 15px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); /* كارت واحد بعرض الشاشة بالكامل للهواتف */
        gap: 15px;
    }

    .gallery-item:hover {
        transform: none; /* إلغاء التكبير والتأثير الحركي على الهواتف لتفادي مشاكل اللمس المتعدد */
    }

    .lightbox-image {
        max-width: 95%;
        max-height: 70%;
    }

    .lightbox-close {
        top: 15px;
        right: 20px;
        font-size: 35px;
    }
}
