/* ========================================================
   متغيرات الالوان والتصميم (Design Tokens)
======================================================== */
:root {
    --primary-color: #00d2ff;     /* الازرق السماوي الخاص باللوغو */
    --primary-dark: #00b8e6;      /* درجة اغمق قليلا للتاثيرات */
    --secondary-color: #1a1c23;   /* لون داكن جدا للعناوين والفوتر */
    --bg-white: #ffffff;          /* الخلفية البيضاء الاساسية */
    --bg-light-gray: #f8f9fa;     /* خلفية رمادية فاتحة لبعض الاقسام لكسر الملل */
    --text-main: #333333;         /* لون النصوص العادية */
    --text-muted: #6c757d;        /* لون النصوص الثانوية */
    --border-color: #e9ecef;      /* لون الحدود */
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.1);
    
    --transition: all 0.3s ease;
}

/* ========================================================
   الاعدادات العامة (Global Styles)
======================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-white);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; outline: none; border: none; }

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

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

/* عناوين الاقسام المشتركة */
.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 32px;
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.title-line {
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 0 auto;
    border-radius: 2px;
}

/* ========================================================
   0. شاشة البداية (Splash Screen)
======================================================== */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    background-color: #0a0a0a; /* قيمة احتياطية قبل تحميل فايرستور */
}

#splash-logo {
    width: 160px;
    height: auto;
    opacity: 0;
    animation: splashLogoIn 0.6s ease forwards;
}

/* تلاشي ظهور الشعار */
@keyframes splashLogoIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

/* تلاشي اختفاء شاشة البداية بالكامل */
#splash-screen.splash-hide {
    animation: splashFadeOut 0.5s ease forwards;
}

@keyframes splashFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* ========================================================
   1. الهيدر (Header)
======================================================== */
.main-header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

#site-logo {
    width: 45px;
    height: auto;
}

.brand-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--secondary-color);
}

/* محول اللغات النصي */
.language-switcher {
    display: flex;
    background: var(--bg-light-gray);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--border-color);
}

.lang-btn {
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    transition: var(--transition);
}

.lang-btn:hover {
    color: var(--text-main);
}

.lang-btn.active {
    background: var(--bg-white);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* ========================================================
   2. واجهة البطل (Hero Section) — بدون ازرار التحميل
======================================================== */
.hero-section {
    padding: 100px 0;  /* مساحة عمودية اكبر بعد ازالة ازرار التحميل */
    background: linear-gradient(135deg, #ffffff 0%, #f0fbff 100%);
    overflow: hidden;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-text {
    flex: 1;
    max-width: 600px;
}

.hero-text h1 {
    font-size: 48px;
    font-weight: 900;
    color: var(--secondary-color);
    margin-bottom: 20px;
    line-height: 1.3;
}

.hero-text p {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 0; /* لا مسافة سفلية بعد ازالة الازرار */
}

.hero-image {
    flex: 1;
    text-align: left;
}

.floating-img {
    max-width: 100%;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* ========================================================
   3. المميزات (Features)
======================================================== */
.features-section {
    padding: 80px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--bg-white);
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.icon-wrapper {
    width: 70px;
    height: 70px;
    background: rgba(0, 210, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary-color);
}

.icon-wrapper .material-icons-round {
    font-size: 36px;
}

.feature-card h3 {
    font-size: 20px;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 15px;
}

/* ========================================================
   4. شاشات التطبيق (Screenshots)
======================================================== */
.screenshots-section {
    padding: 80px 0;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    justify-items: center;
}

.app-screen {
    max-width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 5px solid var(--bg-light-gray);
}

.app-screen:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* ========================================================
   5. خطوات الاستخدام (Steps)
======================================================== */
.steps-section {
    padding: 80px 0;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    position: relative;
}

.step-item {
    text-align: center;
    padding: 20px;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: var(--bg-white);
    font-size: 24px;
    font-weight: 800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
}

.step-item h3 {
    font-size: 20px;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.step-item p {
    color: var(--text-muted);
}

/* ========================================================
   6. قسم التحميل المنفصل (Download Section)
======================================================== */
#download-section {
    padding: 90px 0;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #0d1117 60%, #001a2e 100%);
    text-align: center;
    color: var(--bg-white);
}

#download-section h2 {
    font-size: 36px;
    font-weight: 900;
    margin-bottom: 15px;
    color: var(--bg-white);
}

#download-section p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
}

/* ازرار التحميل */
.download-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.store-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    transition: var(--transition);
    border: 2px solid transparent;
}

.play-store, .apple-store {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--bg-white);
    border-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
}

.play-store:hover, .apple-store:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--bg-white);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.apk-store {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.apk-store:hover {
    background-color: var(--primary-color);
    color: var(--bg-white);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 210, 255, 0.4);
}

/* ========================================================
   7. الفوتر (Footer)
======================================================== */
.main-footer {
    background-color: var(--secondary-color);
    color: var(--bg-white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    width: 120px;
    margin-bottom: 20px;
    filter: brightness(0) invert(1); /* تحويل اللوغو للون الابيض اذا كان ملونا */
}

.footer-brand p {
    color: #a0aabf;
    font-size: 15px;
}

.footer-contact h4, .footer-links h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #a0aabf;
}

.contact-list .material-icons-round {
    color: var(--primary-color);
    font-size: 20px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #25d366;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    width: fit-content;
    transition: var(--transition);
}

.btn-whatsapp:hover {
    background-color: #1ebe57;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #a0aabf;
    border: 1px solid #3a3f50;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-align: right;
    width: fit-content;
    transition: var(--transition);
}

.btn-outline:hover {
    color: var(--bg-white);
    border-color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #2a2f3e;
    color: #7a849c;
    font-size: 14px;
}

/* ========================================================
   8. النافذة المنبثقة (Modal) — مشترك بين الشروط والخصوصية
======================================================== */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-white);
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    transform: translateY(30px);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--secondary-color);
    font-size: 22px;
}

.close-btn {
    background: transparent;
    color: var(--text-muted);
    font-size: 24px;
    transition: var(--transition);
}

.close-btn:hover {
    color: #e74c3c;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    color: var(--text-main);
}

.modal-body p {
    white-space: pre-line;
}

/* ========================================================
   9. تاثيرات الظهور عند التمرير (Scroll Reveal)
======================================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================================
   10. زر الرجوع للأعلى (Scroll-to-Top)
======================================================== */
#scroll-top-btn {
    position: fixed;
    bottom: 30px;
    /* يتغير الجانب حسب اتجاه الصفحة عبر JS */
    left: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--bg-white);
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 500;
}

#scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#scroll-top-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5);
}

/* ========================================================
   11. التجاوب مع الشاشات (Responsive)
======================================================== */
@media (max-width: 992px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
    }
    .hero-text h1 { font-size: 38px; }
    .hero-text p { margin: 0 auto; }
    .hero-image { text-align: center; }
}

@media (max-width: 768px) {
    .header-container { flex-direction: column; gap: 15px; }
    .hero-section { padding: 60px 0; }
    .hero-text h1 { font-size: 32px; }
    .section-title h2 { font-size: 28px; }
    .footer-content { text-align: center; }
    .contact-list li { justify-content: center; }
    .footer-links { align-items: center; }

    /* تحميل — تكديس الازرار عموديا على الجوال */
    #download-section { padding: 60px 0; }
    #download-section h2 { font-size: 26px; }
    #download-section p { font-size: 15px; }
    .download-buttons { flex-direction: column; align-items: center; }
    .store-btn { width: 100%; max-width: 320px; justify-content: center; }
}
