/* =========================================
   المتغيرات العامة (الألوان والخطوط)
   ========================================= */
:root {
    --primary-color: #4c1d95; /* بنفسجي داكن */
    --secondary-color: #3b82f6; /* أزرق ساطع */
    --bg-color: #f8fafc; /* رمادي فاتح جداً للخلفية */
    --text-dark: #1e293b; /* لون النصوص الأساسية */
    --text-muted: #64748b; /* لون النصوص الفرعية */
    --white: #ffffff;
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

/* =========================================
   الإعدادات الأساسية
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
}

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

/* =========================================
   تمديد المحتوى لدفع الفوتر للأسفل (شاشات اللابتوب فقط)
   ========================================= */
@media (min-width: 769px) {
    body {
        display: flex;
        flex-direction: column;
        min-height: 100vh; /* يأخذ ارتفاع الشاشة بالكامل كحد أدنى */
    }
    
    main {
        flex: 1 0 auto; /* يجعل قسم المحتوى يتمدد لملء الفراغ المتبقي */
    }
}

/* =========================================
   الرأس (Header)
   ========================================= */
.header {
    background-color: var(--white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    padding: 7px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo img {
    height: 80px;
    object-fit: contain;
    display: block;
}

/* القائمة الأفقية للشاشات الكبيرة (اللابتوب) */
.desktop-nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.desktop-nav a {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.1rem;
    position: relative;
    padding-bottom: 5px;
}

.desktop-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 3px;
    background: var(--gradient);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.desktop-nav a:hover, .desktop-nav a.active {
    color: var(--primary-color);
}

.desktop-nav a:hover::after, .desktop-nav a.active::after {
    width: 100%;
}

/* زر القائمة */
.menu-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    display: none; /* مخفي في اللابتوب */
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.menu-btn:hover {
    transform: scale(1.1);
}

/* =========================================
   القائمة الجانبية (Sidebar)
   ========================================= */
.sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 250px;
    max-width: 60vw;
    height: 100vh;
    background-color: var(--white);
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    left: 0;
}

.close-btn {
    align-self: flex-start;
    background: none;
    border: none;
    font-size: 2.2rem;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 30px;
    transition: var(--transition);
    line-height: 1;
    padding: 0;
}

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

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.sidebar-nav a {
    display: block;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    padding: 14px 20px;
    border-radius: 12px;
    transition: var(--transition);
    text-align: right;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background-color: #f5f3ff;
    color: var(--primary-color);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

/* =========================================
   قسم الترحيب (Hero Section)
   ========================================= */
.hero {
    padding: 50px 20px 30px;
    background: linear-gradient(135deg, #f0f4ff 0%, var(--white) 100%);
    position: relative;
    overflow: hidden;
}

/* حاوية الشبكة التقنية (Particles) المشتركة */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* خلف المحتوى */
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    position: relative; /* ضروري ليعمل الـ z-index */
    z-index: 2; /* فوق الشبكة التقنية */
}

.hero-text {
    flex: 1;
    text-align: right;
}

.hero-text h1 {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.3;
    color: var(--text-dark);
}

.hero-text h1 span {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* تأثير الكتابة التلقائية */
.typing-text {
    color: var(--secondary-color) !important;
    -webkit-text-fill-color: var(--secondary-color) !important;
    background: none !important;
}

.cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--text-dark);
    margin-right: 5px;
    animation: blink 0.8s infinite;
    -webkit-text-fill-color: var(--text-dark) !important;
    background: var(--text-dark) !important;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-text p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 550px;
}

/* إعدادات الصورة وتأثير التتبع 3D */
.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    perspective: 1000px; /* ضروري لتأثير الـ 3D */
}

.hero-image img {
    max-width: 80%;
    max-height: 480px;
    object-fit: contain;
    filter: drop-shadow(0 20px 30px rgba(76, 29, 149, 0.15));
    position: relative;
    z-index: 2;
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
    will-change: transform;
}

/* تأثير الهالة المضيئة (Aura Glow) */
.aura-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, rgba(76, 29, 149, 0.15) 40%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
    animation: pulse-glow 4s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes pulse-glow {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.btn-primary {
    display: inline-block;
    background: var(--gradient);
    color: var(--white);
    padding: 15px 45px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
    color: var(--white);
}

/* =========================================
   العناوين المشتركة للأقسام
   ========================================= */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 40px;
    color: var(--text-dark);
    position: relative;
}

/* =========================================
   قسم خطوات العمل (في الرئيسية)
   ========================================= */
.steps-section {
    padding: 60px 0;
    background: var(--bg-color);
}

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

.step-card {
    background: var(--white);
    padding: 40px 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.02);
    border-top: 4px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.step-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 25px 50px rgba(76, 29, 149, 0.1);
    border-top-color: var(--secondary-color);
}

.step-icon {
    width: 80px;
    height: 80px;
    background: #f5f3ff;
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    transition: var(--transition);
}

.step-card:hover .step-icon {
    background: var(--gradient);
    color: var(--white);
    transform: scale(1.1) rotate(5deg);
}

.step-card h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.step-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.step-link {
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: underline;
}

/* =========================================
   قسم الأسئلة الشائعة (FAQ)
   ========================================= */
.faq-section {
    padding: 60px 0 40px;
    background: var(--white);
    position: relative; /* ضروري لاحتواء الشبكة التقنية */
    overflow: hidden; /* لمنع خروج الشبكة عن القسم */
}

.faq-section .container {
    position: relative;
    z-index: 2; /* لضمان بقاء النصوص فوق الشبكة التقنية */
}

.accordion {
    max-width: 800px;
    margin: 0 auto;
}

.accordion-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: var(--transition);
    background: var(--white);
}

.accordion-header {
    width: 100%;
    text-align: right;
    padding: 20px 25px;
    background: transparent;
    border: none;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
}

.accordion-header:hover {
    background: #f8fafc;
}

.accordion-header .icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: transform 0.4s ease;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    background: #f8fafc;
    transition: max-height 0.4s ease;
}

.accordion-content p {
    padding: 20px 25px;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.8;
}

.accordion-item.active {
    border-color: var(--secondary-color);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.1);
}

.accordion-item.active .accordion-header {
    color: var(--primary-color);
}

.accordion-item.active .icon {
    transform: rotate(45deg);
}

/* =========================================
   حركات التمرير (Scroll Animations) والدخول المتدرج
   ========================================= */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), 
                transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: opacity, transform;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* تأخير زمني للدخول المتدرج */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.3s; }
.stagger-3 { transition-delay: 0.5s; }
.stagger-4 { transition-delay: 0.7s; }

/* =========================================
   شكل الموجة والفوتر (Footer)
   ========================================= */
.footer-wave {
    width: 100%;
    line-height: 0;
    background: var(--white);
    margin-bottom: -1px;
}

/* إعدادات الموجة الافتراضية (للشاشات الكبيرة) */
.footer-wave .wave-desktop {
    display: block;
    width: 100%;
    height: auto;
}

.footer-wave .wave-mobile {
    display: none;
}

.footer {
    background: #0f172a;
    color: var(--white);
    padding: 0 0 15px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

/* جعل حاوية الشعار والأيقونات متمركزة عمودياً */
.footer-info {
    display: flex;
    flex-direction: column;
    align-items: center; /* توسيط الشعار والأيقونات */
}

/* تنسيق شعار الفوتر */
.footer-logo {
    height: 110px;
    object-fit: contain;
    margin-bottom: 15px;
    display: block;
    filter: brightness(0) invert(1); 
    opacity: 0.9;
    transition: var(--transition);
}

.footer-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* تنسيق أيقونات التواصل الاجتماعي */
.social-icons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-icons a svg {
    width: 22px;
    height: 22px;
}

.social-icons a:hover {
    background: var(--gradient);
    color: var(--white);
    transform: translateY(-5px);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #cbd5e1;
    font-weight: 600;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid #1e293b;
    color: #64748b;
    font-size: 0.9rem;
}

/* =========================================
   تنسيقات الصفحات النصية (شروط الخدمة، الخصوصية، طريقة العمل)
   ========================================= */
.page-header {
    text-align: center;
    padding: 30px 20px;
    background: var(--white);
    border-bottom: 1px solid #e2e8f0;
}
.page-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
}
.page-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}
.text-content-section {
    padding: 30px 0 60px;
}
.text-card {
    background: var(--white);
    padding: 50px 80px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin: 0 auto;
    border: 1px solid rgba(0,0,0,0.02);
    text-align: right;
}

.intro-text {
    font-size: 1.25rem !important;
    color: var(--primary-color) !important;
    font-weight: 800 !important;
    margin-bottom: 40px !important;
    line-height: 1.8;
    background: #f8fafc;
    padding: 20px 25px;
    border-radius: 12px;
    border-right: 4px solid var(--primary-color);
}

.term-section {
    padding-bottom: 35px;
    margin-bottom: 35px;
    border-bottom: 1px solid #e2e8f0;
}
.term-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.text-card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.text-card h3::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: var(--secondary-color);
    border-radius: 50%;
}

.text-card p {
    color: var(--text-dark);
    font-size: 1.15rem;
    line-height: 1.9;
    margin-bottom: 15px;
    font-weight: 600;
}

/* =========================================
   تنسيقات الفيديوهات وأزرار النسخ (داخل البطاقة البيضاء)
   ========================================= */
.videos-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin-top: 25px;
}

.video-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.short-video-wrapper {
    width: 100%;
    width: 280px; /* عرض ثابت ومناسب للـ Shorts */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 4px solid #f1f5f9;
    background: #000;
    position: relative;
    padding-top: 177.77%; /* نسبة 9:16 */
}

.short-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-title {
    text-align: center;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 12px;
    font-size: 1.05rem;
    background: #f0f7ff;
    padding: 5px 15px;
    border-radius: 20px;
}

.admins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 30px;
}

.copy-admin-btn {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-align: right;
    width: 100%;
}

.copy-admin-btn:hover {
    border-color: var(--secondary-color);
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(59, 130, 246, 0.1);
}

.admin-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 5px;
    pointer-events: none;
}

.admin-id {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    font-family: monospace;
    pointer-events: none;
}

.copy-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
    background: #e0f2fe;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.copy-admin-btn:hover .copy-icon {
    background: var(--secondary-color);
    color: var(--white);
}

.copy-success-msg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2;
}

.copy-admin-btn.copied .copy-success-msg {
    opacity: 1;
    visibility: visible;
}

/* =========================================
   استعلامات الوسائط (الهواتف المحمولة)
   ========================================= */
@media (max-width: 768px) {
    /* الهيدر */
    .desktop-nav {
        display: none;
    }
    .menu-btn {
        display: flex;
    }
    .header {
        padding: 10px 15px;
    }
    .logo img {
        height: 55px;
    }

    /* قسم الترحيب */
    .hero {
        padding: 30px 15px 20px;
    }
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .hero-text {
        text-align: center;
    }
    .hero-text h1 {
        font-size: 1.4rem;
        line-height: 1.4;
        margin-bottom: 15px;
    }
    .hero-text p {
        font-size: 0.9rem;
        margin-bottom: 25px;
    }
    .hero-image img {
        max-width: 85%;
        transform: none !important;
    }
    .btn-primary {
        padding: 12px 30px;
        font-size: 1rem;
    }

    /* العناوين المشتركة */
    .section-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    /* قسم خطوات العمل (الرئيسية) */
    .steps-section {
        padding: 30px 0;
    }
    .steps-grid {
        gap: 15px;
    }
    .step-card {
        padding: 25px 15px;
        border-radius: 15px;
    }
    .step-icon {
        width: 55px;
        height: 55px;
        margin: 0 auto 15px;
    }
    .step-icon svg {
        width: 24px;
        height: 24px;
    }
    .step-card h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    .step-card p {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }
    .step-link {
        font-size: 0.85rem;
    }
    
    /* قسم الأسئلة الشائعة */
    .faq-section {
        padding: 30px 0 15px;
    }
    .accordion-header {
        font-size: 0.95rem;
        padding: 12px 15px;
    }
    .accordion-header .icon {
        font-size: 1.2rem;
    }
    .accordion-content p {
        padding: 12px 15px;
        font-size: 0.85rem;
        line-height: 1.6;
    }

    /* الفوتر والموجة */
    .footer-wave .wave-desktop {
        display: none;
    }
    .footer-wave .wave-mobile {
        display: block;
        width: 100%;
        height: auto;
    }
    .footer-logo {
        height: 70px;
        margin-bottom: 15px;
    }
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    .social-icons a {
        width: 38px;
        height: 38px;
    }
    .social-icons a svg {
        width: 18px;
        height: 18px;
    }
    .footer-links {
        justify-content: center;
        font-size: 0.9rem;
    }
    .footer-bottom {
        font-size: 0.8rem;
    }

    /* تنسيقات الصفحات النصية للموبايل */
    .page-header {
        padding: 20px 15px;
    }
    .page-header h1 {
        font-size: 1.4rem;
    }
    .page-header p {
        font-size: 0.9rem;
    }
    .text-content-section {
        padding: 20px 0 40px;
    }
    .text-card {
        padding: 20px 15px;
        border-radius: 15px;
    }
    .intro-text {
        font-size: 1rem !important;
        padding: 15px !important;
        margin-bottom: 25px !important;
    }
    .term-section {
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
    .text-card h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    .text-card h3::before {
        width: 8px;
        height: 8px;
    }
    .text-card p {
        font-size: 0.9rem;
        line-height: 1.7;
        margin-bottom: 10px;
    }

    /* الفيديوهات وأزرار النسخ للموبايل */
    .short-video-wrapper {
        width: 240px;
    }
    .video-title {
        font-size: 0.95rem;
    }
    .admin-name {
        font-size: 0.95rem;
    }
    .admin-id {
        font-size: 1rem;
    }
    .copy-icon {
        padding: 6px;
    }
    .copy-icon svg {
        width: 16px;
        height: 16px;
    }
}
