{% extends 'service_partner_app/base_service_partner.html' %}
{% load static %}

{% block title %}Sri Lanka Service Partners | Trusted Drivers, Helpers, Translators & Local Assistants{% endblock %}

{% block content %}

<!-- HERO -->
<section class="service-hero-section py-5 py-lg-6 bg-light position-relative overflow-hidden">
    <div class="container">
        <div class="row align-items-center g-5">
            <div class="col-lg-7">
                <span class="text-uppercase text-primary fw-semibold">Trusted Local Support</span>

                <h1 class="display-4 fw-bold mt-2 mb-3">
                    Find Reliable Local Service Partners in Sri Lanka
                </h1>

                <p class="lead text-muted mb-4">
                    Connect with approved drivers, housekeepers, helpers, translators, and local assistants
                    ready to support your lifestyle in Sri Lanka. Ideal for foreigners, digital nomads,
                    retirees, and long-stay visitors who need dependable local assistance.
                </p>

                <div class="d-flex gap-3 flex-wrap mt-4">
                    <a href="{% url 'service_partner_app:public_assistant_list' %}" class="btn btn-primary btn-lg px-4">
                        Browse Services
                    </a>
                    {% if is_foreigner_user %}
                        <a href="{% url 'expat_life:foreigner_dashboard' %}" class="btn btn-outline-dark btn-lg px-4">
                            My Dashboard
                        </a>
                    {% else %}
                        <a href="{% url 'expat_life:foreigner_signup' %}" class="btn btn-outline-dark btn-lg px-4">
                            Free Foreigner Signup
                        </a>
                    {% endif %}
                </div>

                <div class="row g-3 mt-3">
                    <div class="col-sm-4">
                        <div class="bg-white rounded-4 shadow-sm p-3 h-100">
                            <div class="fw-bold text-primary fs-5 mb-1">Verified</div>
                            <div class="small text-muted">Profiles reviewed before public visibility</div>
                        </div>
                    </div>
                    <div class="col-sm-4">
                        <div class="bg-white rounded-4 shadow-sm p-3 h-100">
                            <div class="fw-bold text-primary fs-5 mb-1">Flexible</div>
                            <div class="small text-muted">Part-time, full-time, and lifestyle-friendly support</div>
                        </div>
                    </div>
                    <div class="col-sm-4">
                        <div class="bg-white rounded-4 shadow-sm p-3 h-100">
                            <div class="fw-bold text-primary fs-5 mb-1">Practical</div>
                            <div class="small text-muted">Useful help for daily life, travel, and relocation</div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-lg-5">
                <div class="bg-white rounded-4 shadow-lg overflow-hidden">
                    <img src="{% static 'expat_life/images/service_partners_hero.webp' %}"
                         alt="Local service support in Sri Lanka"
                         class="img-fluid w-100"
                         style="height: 320px; object-fit: cover;">

                    <div class="p-4">
                        <h4 class="fw-bold mb-3">Why this section matters</h4>

                        <div class="mb-3">
                            <strong>Support for easier living</strong>
                            <p class="text-muted mb-0 small">
                                Helpful for transport, household support, language assistance, and local coordination.
                            </p>
                        </div>

                        <div class="mb-3">
                            <strong>Ideal for foreigners in Sri Lanka</strong>
                            <p class="text-muted mb-0 small">
                                Especially useful for new arrivals, long-stay visitors, retirees, and remote workers.
                            </p>
                        </div>

                        <div>
                            <strong>Better trust and structure</strong>
                            <p class="text-muted mb-0 small">
                                A more guided way to discover dependable local support instead of searching randomly.
                            </p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- TRUST STRIP -->
<section class="py-4 bg-white border-top border-bottom">
    <div class="container">
        <div class="row text-center g-4">
            <div class="col-md-3">
                <div class="fw-semibold">Reviewed Profiles</div>
            </div>
            <div class="col-md-3">
                <div class="fw-semibold">Multiple Service Types</div>
            </div>
            <div class="col-md-3">
                <div class="fw-semibold">Daily Lifestyle Support</div>
            </div>
            <div class="col-md-3">
                <div class="fw-semibold">Foreigner-Friendly Assistance</div>
            </div>
        </div>
    </div>
</section>

<!-- SERVICE TYPES -->
<section class="py-5">
    <div class="container">
        <div class="text-center mb-5">
            <span class="text-uppercase text-primary fw-semibold">Service Categories</span>
            <h2 class="fw-bold mt-2">Local Support You Can Explore</h2>
            <p class="text-muted mb-0">
                A premium local assistance section for everyday convenience in Sri Lanka.
            </p>
        </div>

        <div class="row g-4">
            <div class="col-md-6 col-lg-4">
                <div class="bg-light rounded-4 p-4 h-100 shadow-sm border-0">
                    <h5 class="fw-bold mb-2">Drivers</h5>
                    <p class="text-muted mb-0">
                        Find local driving support for airport pickups, private transport, routine travel, and lifestyle mobility.
                    </p>
                </div>
            </div>

            <div class="col-md-6 col-lg-4">
                <div class="bg-light rounded-4 p-4 h-100 shadow-sm border-0">
                    <h5 class="fw-bold mb-2">Housekeepers</h5>
                    <p class="text-muted mb-0">
                        Explore trusted housekeeping support for comfort, cleanliness, and easier daily living.
                    </p>
                </div>
            </div>

            <div class="col-md-6 col-lg-4">
                <div class="bg-light rounded-4 p-4 h-100 shadow-sm border-0">
                    <h5 class="fw-bold mb-2">Helpers</h5>
                    <p class="text-muted mb-0">
                        General support for errands, local coordination, home-related help, and practical assistance.
                    </p>
                </div>
            </div>

            <div class="col-md-6 col-lg-4">
                <div class="bg-light rounded-4 p-4 h-100 shadow-sm border-0">
                    <h5 class="fw-bold mb-2">Translators</h5>
                    <p class="text-muted mb-0">
                        Useful for local communication, document assistance, travel situations, and cultural understanding.
                    </p>
                </div>
            </div>

            <div class="col-md-6 col-lg-4">
                <div class="bg-light rounded-4 p-4 h-100 shadow-sm border-0">
                    <h5 class="fw-bold mb-2">Local Assistants</h5>
                    <p class="text-muted mb-0">
                        Practical personal support for appointments, everyday tasks, settling in, and local navigation.
                    </p>
                </div>
            </div>

            <div class="col-md-6 col-lg-4">
                <div class="bg-light rounded-4 p-4 h-100 shadow-sm border-0">
                    <h5 class="fw-bold mb-2">Flexible Availability</h5>
                    <p class="text-muted mb-0">
                        Depending on the partner, you may find short-term, part-time, or ongoing support options.
                    </p>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- FEATURED -->
<section id="featured-services" class="py-5 py-lg-6 bg-light">
    <div class="container">
        <div class="d-flex flex-column flex-lg-row justify-content-between align-items-lg-end mb-4">
            <div>
                <span class="text-uppercase text-primary fw-semibold">Featured Local Professionals</span>
                <h2 class="fw-bold mt-2 mb-2">Featured Service Partners</h2>
                <p class="text-muted mb-0">
                    Selected local profiles prepared to support foreigners with practical and dependable assistance.
                </p>
            </div>
        </div>

        <div class="row g-4">
            {% for profile in featured_profiles %}
                <div class="col-md-6 col-xl-4">
                    <div class="card h-100 shadow-sm border-0 rounded-4 overflow-hidden">
                        <div class="position-relative">
                            {% if profile.profile_photo %}
                                <img src="{{ profile.profile_photo.url }}"
                                     class="card-img-top"
                                     style="height: 280px; object-fit: cover;"
                                     alt="{{ profile.full_name }}">
                            {% else %}
                                <img src="{% static 'expat_life/images/default-profile-neutral.png' %}"
                                     class="card-img-top"
                                     style="height: 280px; object-fit: cover;"
                                     alt="Service Partner">
                            {% endif %}

                            <div class="position-absolute top-0 start-0 m-3">
                                <span class="badge bg-white text-dark rounded-pill px-3 py-2 shadow-sm">
                                    Verified Partner
                                </span>
                            </div>
                        </div>

                        <div class="card-body p-4 d-flex flex-column">
                            <h5 class="fw-bold mb-1">{{ profile.full_name }}</h5>

                            <p class="text-muted mb-2">
                                {{ profile.get_service_type_display }}{% if profile.city %} | {{ profile.city }}{% endif %}
                            </p>


                            <div class="mt-auto">
                                <a href="{% url 'service_partner_app:public_assistant_detail' profile.pk %}" class="btn btn-primary px-3">View Profile</a>
                            </div>
                        </div>
                    </div>
                </div>
            {% empty %}
                <div class="col-12">
                    <div class="bg-white rounded-4 p-5 text-center shadow-sm">
                        <h5 class="fw-bold mb-2">Featured partners will appear here soon</h5>
                        <p class="text-muted mb-0">
                            We are preparing approved local service profiles for foreigners looking for trusted assistance in Sri Lanka.
                        </p>
                    </div>
                </div>
            {% endfor %}
        </div>
    </div>
</section>

<!-- HOW IT WORKS -->
<section class="py-5">
    <div class="container">
        <div class="text-center mb-5">
            <span class="text-uppercase text-primary fw-semibold">Simple Guided Process</span>
            <h2 class="fw-bold mt-2">How It Works</h2>
            <p class="text-muted mb-0">
                A smoother way to discover local support for life in Sri Lanka.
            </p>
        </div>

        <div class="row g-4">
            <div class="col-md-4">
                <div class="bg-light rounded-4 shadow-sm p-4 h-100 text-center">
                    <div class="fs-2 fw-bold text-primary mb-3">1</div>
                    <h5 class="fw-bold">Browse Service Profiles</h5>
                    <p class="text-muted mb-0">
                        Explore local support categories such as drivers, translators, helpers, housekeepers, and assistants.
                    </p>
                </div>
            </div>

            <div class="col-md-4">
                <div class="bg-light rounded-4 shadow-sm p-4 h-100 text-center">
                    <div class="fs-2 fw-bold text-primary mb-3">2</div>
                    <h5 class="fw-bold">Create Your Foreigner Profile</h5>
                    <p class="text-muted mb-0">
                        Register to begin your guided Sri Lanka journey with better access to support-related services.
                    </p>
                </div>
            </div>

            <div class="col-md-4">
                <div class="bg-light rounded-4 shadow-sm p-4 h-100 text-center">
                    <div class="fs-2 fw-bold text-primary mb-3">3</div>
                    <h5 class="fw-bold">Move Forward with Local Support</h5>
                    <p class="text-muted mb-0">
                        Build a more comfortable and manageable daily routine with trusted local assistance.
                    </p>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- LATEST -->
<section class="py-5 bg-light">
    <div class="container">
        <div class="mb-4">
            <span class="text-uppercase text-primary fw-semibold">Recently Added</span>
            <h2 class="fw-bold mt-2 mb-1">Latest Service Partners</h2>
            <p class="text-muted mb-0">New local support profiles added to the platform</p>
        </div>

        <div class="row g-4">
            {% for profile in latest_profiles %}
                <div class="col-md-6 col-lg-3">
                    <div class="card h-100 border-0 shadow-sm rounded-4 overflow-hidden">
                        {% if profile.profile_photo %}
                            <img src="{{ profile.profile_photo.url }}"
                                 class="card-img-top"
                                 style="height:220px; object-fit:cover;"
                                 alt="{{ profile.full_name }}">
                        {% else %}
                            <img src="{% static 'expat_life/images/default-profile-neutral.png' %}"
                                 class="card-img-top"
                                 style="height:220px; object-fit:cover;"
                                 alt="Service Partner">
                        {% endif %}

                        <div class="card-body p-3">
                            <h6 class="fw-bold mb-1">{{ profile.full_name }}</h6>
                            <small class="text-muted d-block">
                                {{ profile.get_service_type_display }}
                            </small>
                            {% if profile.city %}
                                <small class="text-muted">{{ profile.city }}</small>
                            {% endif %}
                        </div>
                    </div>
                </div>
            {% empty %}
                <div class="col-12">
                    <div class="bg-white rounded-4 p-4 text-center shadow-sm">
                        <p class="mb-0 text-muted">Latest service partners will appear here soon.</p>
                    </div>
                </div>
            {% endfor %}
        </div>
    </div>
</section>



<!-- FINAL CTA -->
<section class="py-5">
    <div class="container">
        <div class="rounded-4 p-4 p-lg-5 text-white"
             style="background: linear-gradient(135deg, #198754 0%, #0f5132 100%);">
            <div class="row align-items-center g-4">
                <div class="col-lg-8">
                    <h2 class="fw-bold mb-3">Make Life in Sri Lanka Easier with Trusted Local Support</h2>
                    <p class="lead mb-0">
                        Explore local service partners, create your foreigner profile, and build a more comfortable and supported lifestyle in Sri Lanka.
                    </p>
                </div>
                <div class="col-lg-4 text-lg-end">
                    <div class="hero-action-buttons d-grid gap-3 d-lg-flex justify-content-lg-end">
                        <a href="{% url 'service_partner_app:public_assistant_list' %}" class="btn btn-warning btn-lg w-100">
                            Browse Services
                        </a>

                        {% if is_foreigner_user %}
                            <a href="{% url 'expat_life:foreigner_dashboard' %}" class="btn btn-light btn-lg w-100">
                                My Dashboard
                            </a>
                        {% else %}
                            <a href="{% url 'expat_life:foreigner_signup' %}" class="btn btn-light btn-lg w-100">
                                Free Signup
                            </a>
                        {% endif %}
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

{% endblock %}