/*
 * Landing Page CSS - RIDCOD Ecom
 * تحسينات خاصة بصفحة الهبوط للحصول على أفضل أداء وتجربة مستخدم
 */

/* تحسينات أساسية للصفحة */
body.landing-page {
    font-family: 'Tajawal', sans-serif;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* تدرجات مخصصة */
.hero-gradient {
    background: linear-gradient(135deg, #059669 0%, #10B981 25%, #3B82F6 75%, #1D4ED8 100%);
    position: relative;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

/* تحسينات الأزرار */
.btn-primary {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    z-index: 10; /* التأكد من أن الأزرار في المقدمة */
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    position: relative;
    z-index: 10; /* التأكد من أن الأزرار في المقدمة */
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #1D4ED8, #1E40AF);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

/* كروت المميزات */
.feature-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(59, 130, 246, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* مهم: السماح للنقرات بالمرور عبر هذا العنصر */
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: #10B981;
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.15);
}

/* كروت الأسعار */
.pricing-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pricing-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(59, 130, 246, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* مهم: السماح للنقرات بالمرور عبر هذا العنصر */
}

.pricing-card:hover::after {
    opacity: 1;
}

.pricing-card:hover {
    transform: scale(1.03);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* إضافات خاصة لضمان عمل الروابط داخل كروت الأسعار */
.pricing-card a, 
.feature-card a {
    position: relative;
    z-index: 20; /* أعلى من العناصر الأخرى */
    pointer-events: auto; /* التأكد من عمل النقر */
}

.pricing-card .btn-primary,
.pricing-card .btn-secondary {
    position: relative;
    z-index: 20;
    pointer-events: auto;
    cursor: pointer;
}

/* التأكد من أن النصوص والروابط مرئية وقابلة للنقر */
.pricing-card * {
    position: relative;
    z-index: 5;
}

.pricing-card a {
    z-index: 20 !important;
}

/* تحسينات محاذاة النص للقسم الخاص */
.special-section {
    text-align: center !important;
}

.special-section h3,
.special-section p {
    text-align: center !important;
    margin: 0 auto !important;
    display: block !important;
}

.special-section p {
    max-width: 600px !important;
    margin: 0 auto 1.5rem auto !important;
}

/* تحسينات محاذاة النص لصفحة الأسعار */
.pricing-section {
    text-align: center !important;
}

.pricing-section .text-center,
.pricing-section .text-center p {
    text-align: center !important;
    margin: 0 auto !important;
    display: block !important;
}

.pricing-section p {
    max-width: 600px !important;
    margin: 0 auto 1.5rem auto !important;
}

/* تحسينات للقسم الخاص في صفحة الأسعار */
.pricing-special-section {
    text-align: center !important;
}

.pricing-special-section h3,
.pricing-special-section p {
    text-align: center !important;
    margin: 0 auto !important;
    display: block !important;
}

.pricing-special-section p {
    max-width: 700px !important;
    margin: 0 auto 1.5rem auto !important;
}

/* تحسينات للشاشات الكبيرة لصفحة الأسعار */
@media (min-width: 769px) {
    .pricing-desktop-center {
        text-align: center !important;
    }
    
    .pricing-desktop-center h3,
    .pricing-desktop-center p {
        text-align: center !important;
        margin: 0 auto !important;
    }
    
    .pricing-lifetime-text {
        text-align: center !important;
        margin: 0 auto !important;
    }
}

/* تحسينات للشاشات الكبيرة لقسم المقالات */
@media (min-width: 769px) {
    .blog-desktop-center {
        text-align: center !important;
    }
    
    .blog-desktop-center h2,
    .blog-desktop-center p {
        text-align: center !important;
        margin: 0 auto !important;
    }
}

/* تحسينات للشاشات الكبيرة */
@media (min-width: 769px) {
    .desktop-text-center {
        text-align: center !important;
    }
    
    .desktop-text-center p {
        text-align: center !important;
        margin: 0 auto !important;
    }
}

/* تحسينات محاذاة النص لكروت المميزات */
.features-section {
    text-align: center !important;
}

.features-section .feature-card {
    text-align: center !important;
}

.features-section .feature-card h3,
.features-section .feature-card p {
    text-align: center !important;
    margin: 0 auto !important;
    display: block !important;
}

.features-section .feature-card p {
    max-width: 280px !important;
    margin: 0 auto !important;
    line-height: 1.6 !important;
}

/* تحسينات للشاشات الكبيرة لكروت المميزات */
@media (min-width: 769px) {
    .features-desktop-center {
        text-align: center !important;
    }
    
    .features-desktop-center .feature-card {
        text-align: center !important;
    }
    
    .features-desktop-center .feature-card h3,
    .features-desktop-center .feature-card p {
        text-align: center !important;
        margin: 0 auto !important;
    }
    
    .features-desktop-center .feature-card p {
        max-width: 280px !important;
        margin: 0 auto !important;
    }
}

/* حركات مخصصة */
.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.02);
    }
}

.floating-animation {
    animation: floating 6s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    25% { transform: translateY(-15px); }
    50% { transform: translateY(-10px); }
    75% { transform: translateY(-20px); }
}

/* العدادات */
.counter {
    font-size: 3rem;
    font-weight: 800;
    color: #10B981;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* علم الجزائر */
.algeria-flag {
    display: inline-block;
    font-size: 1.2em;
    margin-left: 0.5rem;
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* تحسينات الهاتف المحمول */
@media (max-width: 768px) {
    /* إعدادات أساسية */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        position: relative;
    }
    
    /* تحسين النصوص */
    .mobile-text-center { text-align: center !important; }
    .mobile-text-sm { font-size: 0.875rem !important; }
    .mobile-text-base { font-size: 1rem !important; }
    .mobile-text-lg { font-size: 1.125rem !important; }
    .mobile-text-xl { font-size: 1.25rem !important; }
    .mobile-text-2xl { font-size: 1.5rem !important; }
    .mobile-text-3xl { font-size: 1.875rem !important; }
    
    /* تحسين المسافات */
    .mobile-px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
    .mobile-px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
    .mobile-px-8 { padding-left: 2rem !important; padding-right: 2rem !important; }
    .mobile-py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
    .mobile-py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
    .mobile-mb-4 { margin-bottom: 1rem !important; }
    .mobile-mb-6 { margin-bottom: 1.5rem !important; }
    .mobile-hidden { display: none !important; }
    
    /* تحسين القسم البطل */
    .hero-section {
        min-height: 90vh;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    /* تحسين الحاويات */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
    }
    
    /* تحسين الأزرار للهاتف */
    .btn-primary, .btn-secondary {
        font-size: 1rem !important;
        padding: 0.875rem 1.5rem !important;
        border-radius: 0.5rem !important;
        text-align: center;
        width: auto;
        min-width: 200px;
    }
    
    /* تحسين الكروت */
    .feature-card, .pricing-card {
        margin-bottom: 1.5rem;
        transform: none !important;
    }
    
    .feature-card:hover, .pricing-card:hover {
        transform: none !important;
    }
    
    /* تحسين العدادات */
    .counter {
        font-size: 2rem !important;
    }
    
    /* إخفاء العناصر المشكلة في الخلفية */
    .floating-animation {
        display: none;
    }
    
    /* تحسين FAQ */
    .faq-toggle {
        font-size: 1rem !important;
        padding: 1rem !important;
    }
    
    .faq-content {
        padding: 1rem !important;
        font-size: 0.875rem !important;
    }
    
    /* تحسين الشهادات */
    .testimonial-card {
        margin-bottom: 1rem;
        padding: 1rem !important;
    }
    
    /* تحسين الجريد */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* تحسين الـ navbar */
    nav {
        padding: 0.5rem 1rem !important;
    }
    
    nav .container {
        padding: 0 !important;
    }
    
    /* تقليل حجم الخط في العناوين الطويلة */
    h1 {
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    h2 {
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }
    
    /* تحسين المسافات بين الأقسام */
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
}

/* تحسينات إضافية للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
    
    .hero-section p {
        font-size: 1rem !important;
        line-height: 1.5 !important;
    }
    
    .btn-primary {
        font-size: 0.9rem !important;
        padding: 0.75rem 1.25rem !important;
        min-width: 180px;
    }
    
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .feature-card, .pricing-card {
        padding: 1rem !important;
    }
    
    .counter {
        font-size: 1.5rem !important;
    }
}

/* تحسينات الأداء */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy.loaded {
    opacity: 1;
}

/* تحسين التمرير */
html {
    scroll-behavior: smooth;
}

/* تحسين التركيز للوصول */
.btn-primary:focus,
.btn-secondary:focus {
    outline: 2px solid #10B981;
    outline-offset: 2px;
}

/* تحسينات الطباعة */
@media print {
    .floating-animation,
    .pulse-animation,
    nav,
    .btn-primary,
    .btn-secondary {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
}

/* تحسينات الظلام (إذا كان مفعل) */
@media (prefers-color-scheme: dark) {
    .feature-card:hover {
        border-color: #10B981;
        background-color: rgba(255, 255, 255, 0.05);
    }
}

/* تحسينات الحركة المقللة */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-animation,
    .pulse-animation {
        animation: none !important;
    }
}
