/* =========================================================
   main-style.css - التنسيقات الخاصة بالصفحة الرئيسية
   ========================================================= */

/* --- الأزرار الأساسية والعناصر المشتركة --- */
.btn-main-action {
    font-weight: 700;
    padding: 12px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.2);
    transition: all 0.3s ease;
}
.btn-main-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(13, 110, 253, 0.3);
}

.btnw:hover {
    color: black !important;
}

/* شارة المميز الموحدة */
.feature-corner-badge {
    position: absolute;
    top: 8px;
    background: #ffc107;
    color: #000;
    padding: 5px 35px;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 5;
}
/* توجيهات الشارة حسب اللغة */
[dir="rtl"] .feature-corner-badge, html[dir="rtl"] .feature-corner-badge { left: -25px; right: auto; transform: rotate(-45deg); }
[dir="ltr"] .feature-corner-badge, html[dir="ltr"] .feature-corner-badge { right: -25px; left: auto; transform: rotate(45deg); }

/* --- قسم الهيرو (Hero Section) --- */
.hero-section {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-video, .hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-video {
    object-fit: cover;
}

.slider-image {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.carousel-indicators {
    z-index: 15;
    margin-bottom: 2rem;
}

.carousel-indicators button {
    width: 12px !important;
    height: 12px !important;
    border-radius: 50%;
    margin: 0 6px !important;
}

.glass-card {
    position: relative;
    z-index: 20;
}

/* --- قسم البحث (Search Section) --- */
.search-row-container { position: relative; z-index: 9999 !important; }
.buttons-container { position: relative; z-index: 1 !important; }
.custom-hero-search { background: #fff; border-radius: 60px !important; padding: 8px; box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08); border: 1px solid rgba(255,255,255,0.8); transition: 0.3s ease; }
.custom-hero-search:focus-within { box-shadow: 0 15px 40px rgba(13, 110, 253, 0.15); border-color: rgba(13, 110, 253, 0.2); }
.custom-hero-search .form-control { border: none; background: transparent; box-shadow: none; font-size: 1.05rem; padding: 10px 25px; border-radius: 60px !important; }
html[dir="rtl"] .custom-hero-search .form-control, [dir="rtl"] .custom-hero-search .form-control { border-left: 2px solid #f1f5f9; border-right: none; }
html[dir="ltr"] .custom-hero-search .form-control, [dir="ltr"] .custom-hero-search .form-control { border-right: 2px solid #f1f5f9; border-left: none; }
.custom-hero-search .combo-btn { background: transparent; color: #495057; font-weight: 700; font-size: 1rem; border: none; padding: 10px 20px; border-radius: 40px !important; transition: 0.2s; }
.custom-hero-search .combo-btn:hover, .custom-hero-search .combo-btn:focus { background: #f8f9fa; color: var(--primary-color, #0d6efd); }
.custom-hero-search .search-action-btn { border-radius: 50px !important; padding: 12px 35px; font-weight: bold; font-size: 1.1rem; margin-inline-start: 10px; transition: transform 0.2s, box-shadow 0.2s; }
.custom-hero-search .search-action-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(13, 110, 253, 0.3); }
.custom-search-dropdown { border-radius: 15px; padding: 10px; border: 1px solid #eee; box-shadow: 0 10px 30px rgba(0,0,0,0.1); margin-top: 15px !important; }
.custom-search-dropdown .dropdown-item { border-radius: 8px; padding: 12px 20px; margin-bottom: 5px; font-weight: 600; color: #555; transition: 0.2s; }
.custom-search-dropdown .dropdown-item:last-child { margin-bottom: 0; }
.custom-search-dropdown .dropdown-item:hover, .custom-search-dropdown .dropdown-item.active { background: #f1f5f9; color: var(--primary-color, #0d6efd); }

/* --- قسم الإحصائيات (Stats Section) --- */
.stats-section { background-color: #f8f9fa; padding: 60px 0; }
.stat-card { background: #fff; padding: 30px 15px; border-radius: 15px; box-shadow: 0 5px 20px rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.02); transition: transform 0.3s ease, box-shadow 0.3s ease; height: 100%; }
.stat-card:hover { transform: translateY(-8px); box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.stat-icon-wrapper { width: 60px; height: 60px; background: rgba(13, 110, 253, 0.1); color: var(--primary-color, #0d6efd); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 15px; }
.stat-number-wrapper { display: flex; justify-content: center; align-items: baseline; direction: ltr; }

/* --- قسم التخصصات (Categories Section) --- */
@media (min-width: 768px) {
    .col-md-5-custom { flex: 0 0 20%; max-width: 20%; }
}
.category-card { background: #fff; border-radius: 10px; transition: transform 0.3s, box-shadow 0.3s; border: 1px solid #eee; display: flex; flex-direction: column; align-items: center; justify-content: center;}
.category-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.category-icon { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 15px; }

.cat-action-btn { width: 35px; height: 35px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.9rem; transition: all 0.2s ease; border: 1px solid #eee; background: #f8f9fa; color: #555; text-decoration: none !important;}
.cat-action-btn:hover { transform: translateY(-2px); color: #fff; }
.cat-btn-projects:hover { background-color: #0d6efd; border-color: #0d6efd; }
.cat-btn-services:hover { background-color: #198754; border-color: #198754; }
.cat-btn-store:hover { background-color: #0dcaf0; border-color: #0dcaf0; }

/* --- قسم المستقلين (Freelancers Section) --- */
.freelancer-card-home {
    background: #fff; border-radius: 12px; border: 1px solid #eee; padding: 25px; text-align: center;
    transition: all 0.3s ease; position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden;
}
.freelancer-card-home:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); border-color: var(--primary-color, #0d6efd); }
.featured-fl-card { border: 2px solid #ffc107 !important; box-shadow: 0 5px 20px rgba(255, 193, 7, 0.12); }

.avatar-container { position: relative; width: 90px; height: 90px; margin: 0 auto 15px; }
.freelancer-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #f8f9fa; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }

.fl-name { font-weight: 700; font-size: 1.1rem; margin-bottom: 5px; color: var(--dark-color, #212529); }
.fl-title { color: #777; font-size: 0.9rem; margin-bottom: 10px; }
.fl-rating { color: #ffc107; font-size: 0.95rem; margin-bottom: 15px; display:flex; justify-content:center; align-items:center; gap:2px; }

.fl-footer { border-top: 1px solid #f4f4f4; padding-top: 15px; margin-top: auto; display: flex; justify-content: space-between; align-items: center; flex-direction: row; }
.fl-hourly { font-weight: 800; color: var(--primary-color, #0d6efd); font-size: 1.1rem; margin-bottom: 0; }

/* --- قسم المشاريع والخدمات (Projects & Services Section) --- */
.project-card, .service-card { transition: transform 0.3s, box-shadow 0.3s; border-radius: 12px; overflow: hidden; }
.project-card:hover, .service-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important; }
.category-badge { transition: all .2s ease-in-out; }
.category-badge:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.featured-project-card, .featured-service-card { border: 2px solid #ffc107 !important; }

/* --- قسم المتجر (Store Section) --- */
.store-item-card { transition: box-shadow .3s ease, transform .3s ease; border-radius: 12px; overflow: hidden; }
.store-item-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.08) !important; }
.featured-store-card { border: 2px solid #ffc107 !important; }
.version-badge { background-color: var(--primary-color, #0d6efd) !important; color: #fff; padding: 4px 10px; border: none; border-radius: 6px; font-size: 0.75rem; font-weight: bold; }

/* --- قسم الفيديو (Video Section) --- */
.video-wrapper { position: relative; border-radius: 20px; overflow: hidden; box-shadow: 0 15px 40px rgba(0,0,0,0.15); border: 4px solid #fff; background: #000; }

/* --- قسم آلية العمل (How It Works) --- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline-item { position: relative; padding: 20px 20px 20px 80px; margin-bottom: 20px; border-radius: 8px; background: transparent; }
.timeline-item .timeline-icon { position: absolute; left: 20px; top: 20px; width: 48px; height: 48px; border-radius: 8px; background: #0d6efd; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; box-shadow: 0 6px 18px rgba(13,110,253,0.12); }

/* توجيهات التايم لاين حسب اللغة */
[dir="rtl"] .timeline-item { padding: 20px 80px 20px 20px; }
[dir="rtl"] .timeline-item .timeline-icon { left: auto; right: 20px; }
[dir="rtl"] .timeline::before { right: 40px; left: auto; }
[dir="ltr"] .timeline::before { left: 40px; right: auto; }

.timeline-item h4 { margin: 0 0 6px 0; font-size: 1.12rem; }
.timeline-item p { margin: 0; color: #6c757d; }

@media (max-width: 767px) { 
    .timeline-item { padding-left: 70px; padding-right: 20px; } 
    [dir="rtl"] .timeline-item { padding-right: 70px; padding-left: 20px; } 
    .timeline-item .timeline-icon { width: 40px; height: 40px; font-size: 0.9rem; } 
}

/* --- قسم الضمانات (Guarantees Section) --- */
.guarantee-card { background: #fff; border-radius: 12px; padding: 30px 20px; transition: transform .18s ease, box-shadow .18s ease; min-height: 160px; border: 1px solid #eee; }
.guarantee-card:hover { transform: translateY(-6px); box-shadow: 0 18px 30px rgba(18,38,63,0.08); border-color: var(--primary-color); }
.guarantee-card i { display: inline-block; width: 56px; height: 56px; line-height: 56px; border-radius: 12px; background: rgba(13,110,253,0.08); color: #0d6efd; font-size: 22px; }
.guarantee-card h6 { margin-top: 15px; margin-bottom: 0; font-weight: 700; color: var(--dark-color);}

.featured-fl-card {
  border: 1px solid #eee !important;
}
.freelancer-card-home:hover {
  border-color: var(--primary-color, #0d6efd) !important;
}
.featured-project-card, .featured-service-card, .featured-store-card {
  border: initial !important;
}


/* الحاوية الأساسية للشبكة الخارجية */
.timeline {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* التجاوب مع شاشات الموبايل (الشبكة الخارجية) */
@media (max-width: 768px) {
    .timeline {
        grid-template-columns: 1fr;
    }
}

/* تصميم الكارت واستخدام Grid لترتيب المحتوى الداخلي */
.timeline .timeline-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px;
    position: relative;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);

    /* السر هنا: استخدام Grid لتقسيم الكارت من الداخل */
    display: grid;
    grid-template-columns: 60px 1fr; /* الأيقونة 60 بكسل، والنص ياخد باقي المساحة */
    column-gap: 20px; /* مسافة نظيفة بين الأيقونة والنص */
    row-gap: 8px; /* مسافة بين العنوان والوصف */
    align-items: start;
}

/* تأثير التمرير (Hover) */
.timeline .timeline-item:hover {
    transform: translateY(-5px);
    border-color: #1a6ff8;
    box-shadow: 0 12px 30px rgba(26, 111, 248, 0.08);
}

/* تنسيق مربع الرقم وإلغاء التداخل تماماً */
.timeline .timeline-icon {
    position: static !important; /* مهم جداً: إجبار العنصر على إلغاء أي Absolute Position جاي من الثيم */
    grid-column: 1;
    grid-row: 1 / span 2; /* جعل الأيقونة تمتد بالطول بجوار العنوان والوصف */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: #1a6ff8;
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 800;
    border-radius: 14px;
    margin: 0; /* مسح أي هوامش سابقة كانت بتسبب ترحيل */
    box-shadow: 0 6px 15px rgba(26, 111, 248, 0.3);
}

/* تنسيق العنوان */
.timeline .fw-bold {
    grid-column: 2;
    grid-row: 1;
    color: #1e293b;
    font-size: 1.25rem;
    margin: 0;
    font-weight: 700;
    align-self: center; /* لضبط محاذاة العنوان مع منتصف الأيقونة تقريباً */
}

/* تنسيق النص الوصفي */
.timeline .text-muted {
    grid-column: 2;
    grid-row: 2;
    color: #64748b;
    line-height: 1.7;
    margin: 0;
    font-size: 0.95rem;
}

/* تحسينات إضافية للشاشات الصغيرة جداً (لتوسيط المحتوى) */
@media (max-width: 480px) {
    .timeline .timeline-item {
        grid-template-columns: 1fr; /* تحويل الكارت لعمود واحد داخلياً */
        text-align: center;
        row-gap: 15px;
    }
    
    .timeline .timeline-icon {
        grid-column: 1;
        grid-row: 1;
        margin: 0 auto; /* توسيط الأيقونة */
    }

    .timeline .fw-bold {
        grid-column: 1;
        grid-row: 2;
    }

    .timeline .text-muted {
        grid-column: 1;
        grid-row: 3;
    }
}

.timeline::before {
  display: none;
}