/* =========================================
   1. المتغيرات والإعدادات العامة (Variables & Reset)
   ========================================= */
:root {
    --primary-color: #1b5e20; /* أخضر إسلامي عميق */
    --primary-light: #2e7d32;
    --text-dark: #2c3e50;
    --text-gray: #546e7a;
    --bg-light: #f8f9fa;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--white);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.mt-3 { margin-top: 20px; }
.section-padding { padding: 80px 0; }
.bg-light { background-color: var(--bg-light); }
.section-title { text-align: center; font-size: 32px; margin-bottom: 50px; color: var(--primary-color); }

/* =========================================
   2. الأزرار (Buttons)
   ========================================= */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}
.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: 2px solid var(--primary-color);
}
.btn-primary:hover {
    background-color: var(--white);
    color: var(--primary-color);
}
.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}
.btn-small { padding: 8px 20px; font-size: 14px; }

/* =========================================
   3. الشريط العلوي (Navbar & Header)
   ========================================= */
.navbar {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

/* الشعار */
.logo { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    font-size: 24px; 
    color: var(--primary-color); 
    font-weight: 800;
}
.logo-img {
    height: 35px;
    width: auto;
    transition: filter 0.3s ease;
}

/* القوائم وزر الوضع الليلي */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}
.navbar nav a {
    margin-right: 20px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
}
.navbar nav a:hover { color: var(--primary-color); }
.theme-toggle {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle:hover { transform: scale(1.15); }

/* =========================================
   4. القسم الرئيسي (Hero Section)
   ========================================= */
.hero {
    position: relative;
    padding: 100px 0;
    text-align: center;
    border-bottom: 1px solid #eee;
    overflow: hidden; /* لمنع خروج حواف الصورة بعد عمل الضبابية */
    background-color: var(--bg-light); 
}
.hero h2 { 
    font-size: 42px; 
    margin-bottom: 20px; 
    color: #ffffff; /* أبيض ثابت ليظل واضحاً دائماً فوق الصورة */
    font-weight: 800;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); /* ظل لزيادة التباين وعزل النص عن الصورة */
}

.hero p { 
    font-size: 20px; 
    color: rgba(255, 255, 255, 0.95); /* أبيض بشفافية طفيفة جداً ليكون مريحاً للعين */
    max-width: 700px; 
    margin: 0 auto 35px; 
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

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

/* تخصيص زر (استعرض المنصات) داخل القسم الرئيسي ليكون باللون الأبيض */
.hero .btn-outline {
    color: #ffffff;
    border: 2px solid #ffffff;
    text-shadow: none; /* إزالة ظل النص من الزر ليكون مظهره نظيفاً */
}

/* تأثير تمرير الماوس (Hover) للزر الأبيض */
.hero .btn-outline:hover {
    background-color: #ffffff;
    color: var(--primary-color); /* يعود النص للون الأخضر لتسهيل القراءة */
}

/* تنسيق صورة الخلفية والضبابية */
.hero-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0; /* لجعلها في الخلف */
    filter: blur(3px) opacity(0.90); /* درجة الضبابية والشفافية (يمكنك تعديل الأرقام) */
    transform: scale(1.1); /* تكبير بسيط لمنع ظهور حواف بيضاء بسبب الـ Blur */
}

.hero-content {
    position: relative;
    z-index: 1; /* لرفع النصوص والأزرار فوق الصورة */
}

/* =========================================
   5. معرض الواجهات (App Showcase & Galleries)
   ========================================= */
.app-showcase {
    background: linear-gradient(to bottom, var(--bg-light) 0%, var(--white) 100%);
    padding-bottom: 60px;
}
.showcase-galleries {
    display: flex;
    justify-content: center;
    gap: 80px; 
    flex-wrap: wrap;
    margin-top: 30px;
}
.gallery-group {
    cursor: pointer;
    text-align: center;
    transition: transform 0.3s ease;
    padding: 20px;
}
.gallery-group:hover { transform: translateY(-10px); }
.gallery-group h3 {
    font-size: 26px;
    margin-bottom: 25px;
    color: var(--text-dark);
    font-weight: 800;
    
    /* جعل النص والأيقونة على نفس الخط الأفقي */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px; /* المسافة بين النص والأيقونة */
}

.gallery-group h3 img {
    width: 35px; /* حجم الأيقونة */
    height: auto;
    object-fit: contain;
}

.horizontal-stack {
    position: relative;
    width: 380px; 
    height: 240px; 
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}
.stack-img {
    position: absolute;
    width: 320px; 
    height: 200px; 
    border-radius: 12px;
    object-fit: cover;
    object-position: top; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid var(--white);
}
.stack-img.center { z-index: 3; transform: scale(1); }
.stack-img.left {
    z-index: 2;
    transform: translateX(-70px) scale(0.85);
    opacity: 0.6;
    filter: brightness(0.7);
}
.stack-img.right {
    z-index: 2;
    transform: translateX(70px) scale(0.85);
    opacity: 0.6;
    filter: brightness(0.7);
}
.gallery-group:hover .stack-img.left {
    transform: translateX(-110px) scale(0.9);
    opacity: 0.9;
    filter: brightness(0.9);
}
.gallery-group:hover .stack-img.right {
    transform: translateX(110px) scale(0.9);
    opacity: 0.9;
    filter: brightness(0.9);
}

/* =========================================
   6. نافذة عرض الصور (Lightbox Modal)
   ========================================= */
.modal {
    display: none; 
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.modal-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    max-height: 80vh;
    position: relative;
}
#modal-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border: 2px solid #333;
}
.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}
.close-modal:hover { color: #aaa; }
.nav-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 30px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 50%;
    margin: 0 20px;
    transition: background 0.3s;
}
.nav-btn:hover { background: rgba(255,255,255,0.3); }
.image-counter {
    color: white;
    margin-top: 15px;
    font-size: 16px;
    letter-spacing: 2px;
}

/* =========================================
   7. قسم المميزات (Features)
   ========================================= */
.grid-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; 
    gap: 30px;
}
.feature-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    text-align: center;
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease, border-color 0.3s ease;
    flex: 0 1 320px; 
    max-width: 100%; 
}
.feature-card:hover { transform: translateY(-5px); }
.feature-card h3 { font-size: 20px; margin-bottom: 10px; }
.feature-card p { font-size: 15px; color: var(--text-gray); }
.feature-card p b { color: var(--primary-color); }
.feature-card .icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    height: 60px; 
    font-size: 40px; 
}
.feature-card .icon img {
    width: 80px; 
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.feature-card:hover .icon img { transform: scale(1.1); }

/* =========================================
   8. قسم المنصات (Platforms)
   ========================================= */
.platforms-flex {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}
.platform-box {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.platform-box h3 { margin-bottom: 15px; font-size: 22px; color: var(--primary-color); }
.platform-box p { margin-bottom: 20px; color: var(--text-gray); }
.platform-box .note { font-size: 13px; color: #e67e22; margin-top: auto; padding-top: 15px; }

/* =========================================
   9. قسم المصادر والشكر (Credits)
   ========================================= */
.credits-intro {
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 18px;
    color: var(--text-gray);
    line-height: 1.8;
}
.credits-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
}
.credit-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    text-align: right;
    border: 1px solid #f0f0f0;
    flex: 0 1 320px;
    max-width: 100%;
}
.credit-card h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 10px;
}
.credit-card p { font-size: 15px; color: var(--text-gray); }
.developer-thanks {
    background: rgba(27, 94, 32, 0.05);
    border: 1px dashed var(--primary-color);
    padding: 20px;
    border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-dark);
}
.developer-thanks h3 { font-size: 20px; }
.thanks-links a { text-decoration: none; font-weight: 500; }

/* =========================================
   10. تذييل الموقع (Footer)
   ========================================= */
footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 50px 0 30px; 
    transition: background-color 0.3s ease;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; 
    flex-wrap: wrap;
    gap: 40px;
}
.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}
.footer-logo {
    height: 40px;
    width: auto;
    opacity: 0.9;
}
.footer-links-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.footer-links-group h4 {
    color: var(--white);
    font-size: 18px;
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}
.footer-links-group a {
    color: #b0bec5;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s;
}
.footer-links-group a:hover {
    color: var(--white);
    text-decoration: underline;
}

/* تنسيقات أيقونات التواصل الاجتماعي في الفوتر */
.social-icons {
    display: flex;
    gap: 18px;
    margin-top: 5px;
}

.social-icons a {
    color: #b0bec5;
    font-size: 26px; /* حجم الأيقونة */
    transition: color 0.3s ease, transform 0.3s ease;
    text-decoration: none;
}

/* تأثير عند تمرير الماوس */
.social-icons a:hover {
    color: var(--white);
    transform: translateY(-4px); /* رفع الأيقونة للأعلى قليلاً */
}

/* تمييز لون اليوتيوب والإيميل عند التمرير (اختياري لجمالية أكثر) */
.social-icons a:hover .fa-youtube {
    color: #ff0000;
}
.social-icons a:hover .fa-envelope {
    color: #4caf50;
}

/* =========================================
   11. الصفحات القانونية (Legal Pages)
   ========================================= */
.legal-container {
    max-width: 800px;
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
}
.legal-header { text-align: center; margin-bottom: 30px; }
.legal-header h2 { color: var(--primary-color); font-size: 28px; margin-bottom: 10px; }
.updated { color: var(--text-gray); font-size: 14px; }
.intro-text { font-size: 16px; line-height: 1.8; }
.legal-divider { border: 0; border-top: 2px dashed #e0e0e0; margin: 30px 0; }
.section-heading {
    color: var(--primary-color);
    font-size: 22px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 10px;
}
.sub-heading { font-size: 18px; margin: 25px 0 10px; color: var(--text-dark); }
.legal-list { padding-right: 20px; margin-bottom: 20px; }
.legal-list li { margin-bottom: 8px; }
.legal-note {
    background: rgba(46, 125, 50, 0.05);
    border-right: 4px solid var(--primary-color);
    padding: 15px;
    border-radius: 4px 8px 8px 4px;
    margin: 20px 0;
    font-size: 15px;
}
/* جداول الصفحات القانونية */
.table-responsive { overflow-x: auto; margin: 20px 0; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.legal-table th, .legal-table td {
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    text-align: right;
    vertical-align: top;
}
.legal-table th { background-color: var(--bg-light); color: var(--primary-color); font-weight: 700; }
.legal-table td { background-color: var(--white); }
.legal-table a { color: var(--primary-color); text-decoration: none; }
.legal-table a:hover { text-decoration: underline; }
/* القسم الإنجليزي (LTR) */
.eng-section {
    direction: ltr;
    text-align: left;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 3px double #e0e0e0;
    font-family: Arial, sans-serif;
}
.eng-section h3, .eng-section h4 { color: var(--primary-color); margin: 20px 0 10px; }
.eng-section ul { padding-left: 20px; padding-right: 0; }

/* =========================================
   12. الوضع الليلي (Dark Mode Theme)
   ========================================= */
body.dark-mode {
    --text-dark: #e0e0e0;
    --text-gray: #a0aab2;
    --bg-light: #121212;
    --white: #1e1e1e;
    background-color: var(--bg-light);
}
body.dark-mode .hero {
    background: linear-gradient(rgba(18, 18, 18, 0.95), rgba(18, 18, 18, 0.95)), url('hero-bg.jpg') center/cover;
    border-bottom: 1px solid #2c2c2c;
}
body.dark-mode .feature-card,
body.dark-mode .platform-box,
body.dark-mode .credit-card {
    border-color: #2c2c2c;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
body.dark-mode .credit-card h3 { border-bottom-color: #2c2c2c; }
body.dark-mode .developer-thanks {
    background: rgba(255, 255, 255, 0.03);
    border-color: #2c2c2c;
}
body.dark-mode .developer-thanks h3 { color: #90caf9 !important; }
body.dark-mode footer {
    background: #0a0a0a;
    border-top: 1px solid #222;
}
/* معرض الواجهات في الوضع الليلي */
body.dark-mode .gallery-group h3 { color: var(--text-dark); }
body.dark-mode .stack-img { border-color: #1e1e1e; }

/* الصفحات القانونية في الوضع الليلي */
body.dark-mode .legal-container { border-color: #2c2c2c; }
body.dark-mode .legal-divider,
body.dark-mode .section-heading,
body.dark-mode .eng-section { border-color: #333; }
body.dark-mode .legal-note {
    background: rgba(255, 255, 255, 0.05);
    border-right-color: #66bb6a;
}
body.dark-mode .legal-table th, 
body.dark-mode .legal-table td { border-color: #333; }
body.dark-mode .legal-table th {
    background-color: #1a1a1a;
    color: #66bb6a;
}
body.dark-mode .legal-table td { background-color: var(--white); }

/* =========================================
   13. التجاوب مع شاشات الهواتف (Responsive)
   ========================================= */
@media (max-width: 768px) {
    .navbar nav { display: none; /* يمكن إضافة قائمة برجر لاحقاً */ }
    .hero h2 { font-size: 32px; }
    .hero-buttons { flex-direction: column; }
    
    /* تصغير حجم معرض الواجهات ليتناسب مع الهواتف ولا يسبب سكرول أفقي */
    .horizontal-stack { transform: scale(0.7); }
    .showcase-galleries { gap: 20px; }
    .gallery-group { padding: 5px; }
    
    .footer-content { flex-direction: column; gap: 25px; text-align: center; }
    .footer-brand { align-items: center; }
    .footer-links-group { align-items: center; }
}