/* css/home.css */

/* ===========================
   Global Section Styling
   =========================== */
section {
    border-bottom: 4px solid var(--primary);
    position: relative;
}

/* ===========================
   1. Modern Hero Section
   =========================== */
.home-hero {
    padding: 80px 0;
    min-height: 90vh;
    display: flex;
    align-items: center;
    background-color: var(--bg-body);
    position: relative;
    overflow: hidden;
}

.hero-bg-pattern {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.3;
    z-index: 0;
}

.container { position: relative; z-index: 1; }

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text { text-align: right; }

.hero-text h1 {
    font-size: 3.8rem;
    line-height: 1.2;
    margin-bottom: 25px;
    color: var(--text-main);
    font-weight: 900;
}

.highlight-name { color: var(--primary); position: relative; z-index: 1; }

.highlight-name::after {
    content: '';
    position: absolute;
    bottom: 5px; right: 0;
    width: 100%; height: 15px;
    background: rgba(217, 4, 41, 0.15);
    z-index: -1;
    transform: rotate(-2deg);
}

.hero-text p { font-size: 1.15rem; color: var(--text-gray); line-height: 1.8; margin-bottom: 40px; max-width: 550px; }

.hero-btns { display: flex; gap: 15px; margin-bottom: 40px; }

.btn-main {
    background: var(--primary);
    color: #fff;
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
    box-shadow: 0 10px 25px rgba(217, 4, 41, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 800;
    text-decoration: none;
    border: 2px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
}

.hero-image-wrapper { position: relative; display: flex; justify-content: center; }

/* إصلاح تشوه صورة الهيرو */
.image-box {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    position: relative;
}

.main-img {
    width: 100%;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    display: block;
}
/* 1. تعريف الحركة (تتحرك لأعلى ولأسفل مع دوران خفيف) */
@keyframes hero-float {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(1deg); } /* ترتفع للأعلى */
    100% { transform: translateY(0) rotate(0deg); }
}

/* 2. تطبيق الحركة على حاوية الصورة */
.image-box {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    position: relative;
    /* هذا السطر هو المسؤول عن تشغيل الحركة */
    animation: hero-float 6s ease-in-out infinite; 
}
/* --- تنسيق الكارت العائم (Floating Card) --- */
.floating-card {
    position: absolute;
    bottom: 40px;
    right: -20px;
    background: var(--bg-card); /* خلفية متغيرة (تضبط مع الدارك مود) */
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 5;
    min-width: 200px;
    border: 1px solid var(--border); /* حدود خفيفة */
    border-right: 4px solid var(--primary); /* الخط الملون الجمالي */
}

/* تنسيق الحاوية النصية (عشان الكلام يجي تحت بعض) */
.floating-card .text-box {
    display: flex;
    flex-direction: column; /* يخلي العنوان فوق والوصف تحت */
    text-align: right;      /* محاذاة لليمين */
}

/* تنسيق العنوان (نتائج مضمونة) */
.floating-card .text-box strong {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main); /* لون النص الأساسي */
    margin-bottom: 4px;      /* مسافة صغيرة تحت العنوان */
}

/* تنسيق الوصف (ROI + ROAS) */
.floating-card .text-box span {
    font-size: 0.8rem;
    color: var(--text-gray); /* لون رمادي خفيف */
    font-weight: 600;
    font-family: sans-serif; /* لضمان شكل الأرقام الإنجليزي يكون مضبوط */
}

/* تنسيق الأيقونة (علامة الصح) */
.floating-card .icon-box {
    font-size: 1.8rem;
    color: #25d366; /* أخضر */
    display: flex;
    align-items: center;
}

/* تعديل للموبايل */
@media (max-width: 768px) {
    .floating-card {
        right: 0;
        bottom: 15px;
        padding: 10px 15px;
        min-width: auto;
    }
}
/* ===========================
   2. Partners Section
   =========================== */
/* ===========================
   2. Partners Section (تحديث السلايدر السلس)
   =========================== */
.partners-section {
    padding: 60px 0;
    background: var(--bg-body);
    overflow: hidden;
}

.sec-subtitle {
    text-align: center;
    color: var(--primary);
    margin: 0 auto 30px auto;
    display: table;
    font-family: 'Tajawal', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    background: rgba(217, 4, 41, 0.1);
    padding: 8px 25px;
    border-radius: 50px;
}

.slider-area {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 20px 0;
    direction: ltr !important; /* مهم جداً لضمان اتجاه الحركة */
    /* تأثير الاختفاء المتدرج على الجانبين */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.slider-track {
    display: flex;
    width: max-content; /* يجعل العرض بحجم المحتوى بالكامل */
    flex-wrap: nowrap;
    /* السر هنا: استخدام gap بدلاً من الهوامش لضمان تساوي المسافات */
    gap: 40px; 
}

/* حركة الشعارات (لليسار) */
.business-track {
    animation: marquee-left 60s linear infinite; /* سرعة موحدة */
}

/* حركة الشخصيات (لليمين) */
.political-track {
    animation: marquee-right 60s linear infinite; /* نفس السرعة لتناسق الدخول والخروج */
}

/* إيقاف الحركة عند الوقوف بالماوس */
.slider-track:hover {
    animation-play-state: paused;
}

/* تعريف الحركات بدقة */
@keyframes marquee-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 20px)); } /* حساب دقيق لنصف المسافة + نصف الـ gap */
}

@keyframes marquee-right {
    0% { transform: translateX(calc(-50% - 20px)); }
    100% { transform: translateX(0); }
}

/* --- تنسيق الشعارات (بدون هوامش جانبية) --- */
.logo-slide {
    width: 200px;  /* عرض ثابت */
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* أزلنا الـ padding الجانبي واعتمدنا على الـ gap في الأب */
}

.logo-slide img {
    max-width: 100%;
    max-height: 100%;
    filter: grayscale(0%); /* ملون دائماً */
    opacity: 1;
    transition: 0.3s ease;
    object-fit: contain;
}

.logo-slide img:hover {
    transform: scale(1.1);
}

/* --- تنسيق الشخصيات (بدون هوامش جانبية) --- */
.person-slide {
    width: 200px;
    /* أزلنا الـ margin: 0 15px */
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 20px 10px;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.person-img {
    width: 80px !important;
    height: 80px !important;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 2px solid var(--primary);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.person-slide h5 {
    margin: 10px 0 5px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-main);
}

.person-slide span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-gray);
    font-weight: normal;
    line-height: 1.4;
}

/* ===========================
   3. Process & Calculator
   =========================== */
.process-section {
    padding: 100px 0;
    background-color: var(--bg-section);
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    position: relative;
}

.process-step {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid var(--border);
    position: relative;
    transition: 0.3s;
    overflow: hidden;
}

.process-step:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.step-number {
    position: absolute;
    top: -10px; left: -10px;
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary);
    opacity: 0.1;
    z-index: 0;
}

.step-icon {
    width: 60px; height: 60px;
    background: rgba(217, 4, 41, 0.1);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
    position: relative; z-index: 1;
}

.process-step h3 { font-size: 1.3rem; margin-bottom: 10px; color: var(--text-main); position: relative; z-index: 1; }
.process-step p { color: var(--text-gray); font-size: 0.95rem; line-height: 1.6; position: relative; z-index: 1; }

/* ===========================
   4. General Sections
   =========================== */
.features-section, .services-section, .blog-section, .reviews-section { padding: 100px 0; }

.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: 2.8rem; margin-bottom: 15px; color: var(--text-main); }
.section-header span { color: var(--primary); }
.section-header p { font-size: 1.2rem; color: var(--text-gray); }

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.feature-card, .service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 30px;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(217, 4, 41, 0.15);
}

.feature-icon {
    width: 70px; height: 70px;
    background: rgba(217, 4, 41, 0.1);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.feature-card h3, .service-card h3 { color: var(--text-main); margin-bottom: 10px; font-size: 1.3rem; }
.feature-card p, .service-card p { color: var(--text-gray); line-height: 1.6; }

.service-img {
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    margin-bottom: 20px;
    position: relative;
}

.badge {
    position: absolute; top: 15px; right: 15px;
    background: var(--primary); color: #fff;
    padding: 5px 12px; border-radius: 5px;
    font-size: 0.8rem; font-weight: bold;
    box-shadow: 0 0 15px rgba(217, 4, 41, 0.6);
}

.service-btn {
    display: block; text-align: center;
    background: #111; color: #fff;
    padding: 12px; border-radius: 8px; font-weight: bold;
    border: 1px solid var(--primary);
    transition: all 0.4s ease; text-decoration: none; cursor: pointer;
    box-shadow: 0 0 10px rgba(217, 4, 41, 0.2);
}

.service-btn:hover { 
    background: var(--primary); color: #fff;
    box-shadow: 0 0 20px rgba(217, 4, 41, 0.8), 0 0 40px rgba(217, 4, 41, 0.4);
    transform: translateY(-3px);
}

/* Blog Cards */
.blog-card {
    background: var(--bg-card);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

.blog-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }

.blog-img { height: 220px; position: relative; }
.blog-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.blog-card:hover .blog-img img { transform: scale(1.1); }

.blog-cat {
    position: absolute; bottom: 10px; right: 10px;
    background: var(--primary); color: #fff;
    padding: 5px 15px; border-radius: 50px;
    font-size: 0.8rem; font-weight: bold;
}

.blog-content { padding: 25px; flex: 1; display: flex; flex-direction: column; }
.blog-content h3 { font-size: 1.3rem; margin-bottom: 10px; line-height: 1.4; color: var(--text-main); }
.blog-content p { color: var(--text-gray); font-size: 0.95rem; margin-bottom: 20px; flex: 1; }
.read-more { color: var(--primary); font-weight: bold; margin-top: auto; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }

/* FAQ */
.faq-section {
    /* تم إضافة مسافة هنا بشكل افتراضي */
    padding-top: 80px;
}

.faq-container details {
    background: var(--bg-card);
    border: 1px solid var(--border);
    margin-bottom: 15px; padding: 20px;
    border-radius: 10px; cursor: pointer; color: var(--text-main);
}
.faq-container summary { font-weight: bold; }
.faq-container p { margin-top: 10px; color: var(--text-gray); }

/* ===========================
   5. CTA Section
   =========================== */
.cta-section { background: transparent; padding: 80px 0; }

.cta-box {
    background: linear-gradient(135deg, #D90429 0%, #b90322 100%);
    color: #ffffff; text-align: center;
    border-radius: 25px; padding: 60px 40px;
    box-shadow: 0 20px 40px rgba(217, 4, 41, 0.3);
    position: relative; overflow: hidden;
}

.cta-box::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(circle at top right, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.cta-box h2 { color: #ffffff; margin-bottom: 15px; font-size: 2.5rem; font-weight: 900; position: relative; z-index: 2; }
.cta-box p { color: rgba(255, 255, 255, 0.9); margin-bottom: 30px; font-size: 1.2rem; position: relative; z-index: 2; }

.btn-white {
    background: #ffffff; color: #D90429;
    padding: 15px 45px; border-radius: 50px; font-weight: 800;
    display: inline-block; transition: all 0.3s ease;
    text-decoration: none; box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    position: relative; z-index: 2;
}

.btn-white:hover { transform: translateY(-3px); box-shadow: 0 15px 25px rgba(0,0,0,0.2); background: #f8f8f8; }

/* ===========================
   6. Mobile Media Queries (كل التعديلات المطلوبة هنا)
   =========================== */
@media (max-width: 992px) {
    /* 1. إصلاح تباعد الأسئلة الشائعة عن الخط الأحمر */
    .faq-section {
        padding-top: 100px; /* مسافة أكبر لضمان عدم الالتصاق */
    }

    /* 2. الخدمات والمميزات (لماذا تختارني): 2 كارت جنب بعض */
    .features-section .grid-3, 
    .services-section .grid-3 {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important; /* إجبار عمودين */
        gap: 10px; /* مسافة صغيرة */
    }

    /* 3. المقالات: سلايدر أفقي (مش تحت بعض) */
    .blog-section .grid-3 {
        display: flex !important; /* تحويل لفليكس عشان السكرول */
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 20px;
        gap: 15px;
    }
    .blog-card {
        min-width: 280px; /* عرض ثابت للكارت عشان يظهر كسلايدر */
        scroll-snap-align: center;
    }

    /* 4. تصغير الخطوط والعناصر للكروت الصغيرة */
    .service-card, .feature-card { padding: 15px; }
    .service-card h3, .feature-card h3 { font-size: 1rem; }
    .service-card p, .feature-card p { font-size: 0.8rem; }
    .service-img { height: 120px; }

    /* 5. باقي التنسيقات العامة للموبايل */
    .hero-text h1 { font-size: 2rem; line-height: 1.3; }
    .section-header h2 { font-size: 1.8rem; }
    .cta-box h2 { font-size: 1.6rem; }
    .hero-text p, .section-header p, .cta-box p { font-size: 0.95rem; }

    .hero-content { grid-template-columns: 1fr; text-align: center; gap: 40px; }
    .hero-text { text-align: center; }
    .hero-btns { flex-direction: column; align-items: center; gap: 12px; }
    .btn-main, .btn-outline { width: 100%; max-width: 320px; justify-content: center; padding: 12px 25px; font-size: 1rem; }
    .hero-quick-stats { justify-content: center; }
    .highlight-name::after { left: 0; }
    .logo-slide { width: 140px; }
    .person-slide { width: 180px; margin: 0 10px; }
}

/* للشاشات الصغيرة جداً */
@media (max-width: 350px) {
    /* ترجع عمود واحد فقط لو الشاشة صغيرة جداً جداً */
    .features-section .grid-3, 
    .services-section .grid-3 {
        grid-template-columns: 1fr !important; 
    }
}

/* ===========================
   Portfolio Section Styles
   =========================== */
/* --- تنسيق شبكة المشاريع --- */
.portfolio-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.portfolio-item {
    transition: 0.4s ease;
    text-align: center;
}

/* --- تصميم الكارت وحركة السكرول --- */
.port-card {
    height: 350px; /* ارتفاع ثابت للكارت */
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 15px;
    transition: 0.3s;
}

.port-thumb {
    width: 100%;
    height: 100%;
    background-size: 100%; /* جعل الصورة تملأ العرض */
    background-position: top center; /* البداية من الأعلى */
    background-repeat: no-repeat;
    /* هذا هو السطر المسؤول عن حركة السكرول */
    transition: background-position 3s ease-in-out; 
}

/* عند الوقوف بالماوس: تحريك الصورة للأسفل */
.port-card:hover .port-thumb {
    background-position: bottom center;
}

/* --- طبقة الأوفرلاي والزر --- */
.port-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column; /* لترتيب الأزرار تحت بعض */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.3s;
    gap: 10px;
}

.port-card:hover .port-overlay { opacity: 1; }

.view-btn {
    background: var(--primary);
    color: #fff;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: bold;
    text-decoration: none;
    transform: translateY(20px);
    transition: 0.3s;
    display: inline-block;
}

.port-card:hover .view-btn { transform: translateY(0); }

/* --- النصوص أسفل الكارت --- */
.portfolio-item h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-main);
}

.cat-label {
    font-size: 0.85rem;
    color: var(--text-gray);
    background: rgba(128,128,128,0.1);
    padding: 2px 10px;
    border-radius: 4px;
    display: inline-block;
}

/* --- تحسينات للموبايل --- */
@media (max-width: 768px) {
    .portfolio-grid-container {
        grid-template-columns: 1fr; /* عمود واحد */
        padding: 0 15px;
    }
}