{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    {% block meta_tags %}{% endblock %}

    <title>{% block title %}Date in Sri Lanka | Local Dating Partner Portal{% endblock %}</title>

    <!-- Favicon -->
    <link rel="icon" type="image/png" href="{% static 'expat_life/images/favicon_d.png' %}">

    <!-- Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- Bootstrap Icons -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">

    <!-- Existing Shared Main Style -->
    <link rel="stylesheet" href="{% static 'expat_life/css/style.css' %}">
    <link rel="stylesheet" href="{% static 'expat_life/css/dating.css' %}">

    <!-- Cropper JS CSS -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.6.2/cropper.min.css">

    <!-- Cropper JS -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.6.2/cropper.min.js"></script>

    {% block extra_css %}{% endblock %}
</head>

<body>

<!-- =========================================================
     TOP BAR
========================================================= -->
<div class="topbar d-none d-lg-block">
    <div class="container">
        <div class="d-flex justify-content-between align-items-center">

            <div class="topbar-left">
                <span>
                    <i class="bi bi-heart-pulse-fill"></i>
                    Safer, guided dating connections with trusted international guests
                </span>
            </div>

            <div class="topbar-right d-flex align-items-center gap-3">
                <a href="{% url 'dating_app:about_us_date' %}">
                    <i class="bi bi-info-circle-fill me-1"></i> About
                </a>

                <a href="{% url 'dating_app:contact_page' %}">
                    <i class="bi bi-envelope-fill me-1"></i> Contact
                </a>

                {% if request.user.is_authenticated and request.user.dating_profile %}
                    <a href="{% url 'dating_app:dating_partner_dashboard' %}">
                        <i class="bi bi-grid-fill me-1"></i> My Dashboard
                    </a>
                {% endif %}
            </div>

        </div>
    </div>
</div>


<!-- =========================================================
     MAIN NAVBAR
========================================================= -->
<nav class="navbar navbar-expand-lg premium-navbar sticky-top">
    <div class="container">

        <!-- BRAND -->
        <a class="navbar-brand premium-brand d-flex align-items-center gap-2"
           href="{% url 'dating_app:home_dating' %}">

            <span class="brand-logo-circle">
                <img src="{% static 'expat_life/images/ensolanka_logo_d.png' %}"
                     alt="Ensolanka Logo"
                     class="brand-logo-img">
            </span>

            <span class="brand-text-wrap d-flex flex-column">
                <span class="brand-title">Date in Sri Lanka</span>
                <small class="brand-subtitle">Connect Locally, Love Globally</small>
            </span>
        </a>

        <!-- MOBILE TOGGLER -->
        <button class="navbar-toggler premium-toggler"
                type="button"
                data-bs-toggle="collapse"
                data-bs-target="#datingMainNav"
                aria-controls="datingMainNav"
                aria-expanded="false"
                aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>


        <!-- NAV CONTENT -->
        <div class="collapse navbar-collapse" id="datingMainNav">
            <ul class="navbar-nav ms-auto align-items-lg-center">

                <!-- HOME -->
                <li class="nav-item">
                    <a class="nav-link premium-nav-link"
                       href="{% url 'dating_app:home_dating' %}">
                        Home
                    </a>
                </li>

                <!-- ABOUT -->
                <li class="nav-item">
                    <a class="nav-link premium-nav-link"
                       href="{% url 'dating_app:about_us_date' %}">
                        About
                    </a>
                </li>

                <!-- PROFILES DROPDOWN -->
                <li class="nav-item dropdown">
                    <a class="nav-link premium-nav-link dropdown-toggle"
                       href="#"
                       id="datingProfilesDropdown"
                       role="button"
                       data-bs-toggle="dropdown"
                       aria-expanded="false">
                        Browse Profiles
                    </a>

                    <ul class="dropdown-menu" aria-labelledby="datingProfilesDropdown">
                        <li>
                            <a class="dropdown-item"
                               href="{% url 'dating_app:foreigners_home' %}">
                                International Guests
                            </a>
                        </li>
                        <li>
                            <a class="dropdown-item"
                               href="{% url 'dating_app:public_partner_list' %}">
                                Local Dating Partners
                            </a>
                        </li>


                    </ul>
                </li>

                <!-- PARTNER ACCESS DROPDOWN -->
                <li class="nav-item dropdown">
                    <a class="nav-link premium-nav-link dropdown-toggle"
                       href="#"
                       id="datingPartnerAccessDropdown"
                       role="button"
                       data-bs-toggle="dropdown"
                       aria-expanded="false">
                        Partner Access
                    </a>

                    <ul class="dropdown-menu" aria-labelledby="datingPartnerAccessDropdown">

                        {% if request.user.is_authenticated and request.user.dating_profile %}

                            <li>
                                <a class="dropdown-item"
                                   href="{% url 'dating_app:dating_partner_dashboard' %}">
                                    My Dating Dashboard
                                </a>
                            </li>

                            <li>
                                <a class="dropdown-item"
                                   href="{% url 'dating_app:dating_partner_profile_page' %}">
                                    My Dating Profile
                                </a>
                            </li>

                            <li>
                                <a class="dropdown-item"
                                   href="{% url 'dating_app:interested_foreigners_list' %}">
                                    Interested Guests
                                </a>
                            </li>

                            <li>
                                <a class="dropdown-item"
                                   href="{% url 'dating_app:dating_partner_payment_center' %}">
                                    Payment Center
                                </a>
                            </li>

                        {% else %}

                            <li>
                                <a class="dropdown-item"
                                   href="{% url 'dating_app:partner_register' %}">
                                    Apply as Local Dating Partner
                                </a>
                            </li>

                            <li>
                                <a class="dropdown-item"
                                   href="{% url 'dating_app:dating_partner_login' %}">
                                    Dating Partner Sign In
                                </a>
                            </li>

                        {% endif %}

                    </ul>
                </li>

                <!-- CONTACT -->
                <li class="nav-item">
                    <a class="nav-link premium-nav-link"
                       href="{% url 'dating_app:contact_page' %}">
                        Contact
                    </a>
                </li>


                <!-- AUTHENTICATED USER AREA -->
                {% if request.user.is_authenticated %}

                    {% if request.user.dating_profile %}
                        <li class="nav-item">
                            <a class="nav-link premium-nav-link"
                               href="{% url 'dating_app:dating_partner_dashboard' %}">
                                Dashboard
                            </a>
                        </li>

                    {% elif request.user.foreigner_profile %}
                        <li class="nav-item">
                            <a class="nav-link premium-nav-link"
                               href="{% url 'expat_life:foreigner_dashboard' %}">
                                Guest Dashboard
                            </a>
                        </li>
                    {% endif %}

                    <li class="nav-item ms-lg-3 mt-3 mt-lg-0">
                        <form method="post" action="{% url 'smart_logout' %}" class="d-inline">
                            {% csrf_token %}
                            <button type="submit" class="btn btn-outline-dark premium-nav-btn">
                                Sign Out
                            </button>
                        </form>
                    </li>

                {% else %}

                    <!-- PUBLIC CTA BUTTONS -->
                    <li class="nav-item ms-lg-3 mt-3 mt-lg-0">
                        <a href="{% url 'dating_app:dating_partner_login' %}"
                           class="btn btn-outline-dark premium-nav-btn me-2">
                            Partner Sign In
                        </a>

                        <a href="{% url 'dating_app:partner_register' %}"
                           class="btn btn-warning premium-nav-btn">
                            Apply Now
                        </a>
                    </li>

                {% endif %}

            </ul>
        </div>

    </div>
</nav>


<!-- =========================================================
     DJANGO MESSAGES
========================================================= -->
{% if messages %}
<div class="container mt-3">
    {% for message in messages %}
        <div class="alert 
            {% if message.tags %}
                alert-{{ message.tags }}
            {% else %}
                alert-info
            {% endif %}
            shadow-sm rounded-4">
            {{ message }}
        </div>
    {% endfor %}
</div>
{% endif %}


<!-- =========================================================
     PAGE CONTENT
========================================================= -->
{% block content %}{% endblock %}

<!-- FLOATING DATING PARTNER CTA BUTTON -->
{% if request.user.is_authenticated and request.user.dating_profile %}
    <a href="{% url 'dating_app:dating_partner_dashboard' %}"
       class="floating-guest-btn btn btn-warning shadow">
        <i class="bi bi-speedometer2 me-1"></i>
        My Dating Dashboard
    </a>
{% elif not request.user.is_authenticated %}
    <a href="{% url 'dating_app:partner_register' %}"
       class="floating-guest-btn btn btn-warning shadow">
        <i class="bi bi-person-heart me-1"></i>
        Become a Dating Partner
    </a>
{% endif %}

<!-- =========================================================
     FOOTER
========================================================= -->
<footer class="premium-footer">

    <div class="footer-main py-5">
        <div class="container">
            <div class="row g-4">

                <!-- BRAND / INTRO -->
                <div class="col-lg-4">
                    <div class="footer-brand-block">

                        <div class="d-flex align-items-center mb-3">
                            <span class="brand-logo-circle footer-logo-circle me-3">
                                <img src="{% static 'expat_life/images/ensolanka_logo_d.png' %}"
                                     alt="Ensolanka Logo"
                                     class="brand-logo-img">
                            </span>

                            <div>
                                <h4 class="footer-brand-title mb-0">Date in Sri Lanka</h4>
                                <small class="footer-brand-subtitle">
                                    Connect Locally, Love Globally
                                </small>
                            </div>
                        </div>

                        <p class="footer-text">
                            A trust-focused portal that helps local dating partners connect with
                            international guests through a more secure, reviewed, and guided process.
                        </p>
                        <!-- Secure Trust Badge -->
                        <div class="footer-secure-trust-wrap">
                            <div class="footer-secure-trust-badge">
                                <img src="{% static 'expat_life/images/secure_https_badge.png' %}"
                                    alt="Secure HTTPS SSL TLS Protected"
                                    class="footer-secure-trust-img">

                                <div class="footer-secure-trust-text">
                                    <strong>Secure HTTPS Connection</strong>
                                    <span>SSL/TLS encrypted connection protected by a trusted certificate.</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>


                <!-- EXPLORE -->
                <div class="col-6 col-lg-2">
                    <h6 class="footer-heading">Explore</h6>

                    <ul class="footer-links list-unstyled">
                        <li>
                            <a href="{% url 'dating_app:home_dating' %}">Home</a>
                        </li>

                        <li>
                            <a href="{% url 'dating_app:about_us_date' %}">About</a>
                        </li>

                        <li>
                            <a href="{% url 'dating_app:public_partner_list' %}">
                                Partner Profiles
                            </a>
                        </li>

                        <li>
                            <a href="{% url 'dating_app:public_foreigners_list' %}">
                                Guest Profiles
                            </a>
                        </li>

                        <li>
                            <a href="{% url 'dating_app:contact_page' %}">
                                Contact
                            </a>
                        </li>
                    </ul>
                </div>


                <!-- PARTNER JOURNEY -->
                <div class="col-6 col-lg-2">
                    <h6 class="footer-heading">Partner Journey</h6>

                    <ul class="footer-links list-unstyled">

                        {% if request.user.is_authenticated and request.user.dating_profile %}

                            <li>
                                <a href="{% url 'dating_app:dating_partner_dashboard' %}">
                                    My Dashboard
                                </a>
                            </li>

                            <li>
                                <a href="{% url 'dating_app:dating_partner_profile_page' %}">
                                    My Profile
                                </a>
                            </li>

                            <li>
                                <a href="{% url 'dating_app:interested_foreigners_list' %}">
                                    Interested Guests
                                </a>
                            </li>

                            <li>
                                <a href="{% url 'dating_app:dating_partner_payment_center' %}">
                                    Payment Center
                                </a>
                            </li>

                        {% else %}

                            <li>
                                <a href="{% url 'dating_app:partner_register' %}">
                                    Partner Signup
                                </a>
                            </li>

                            <li>
                                <a href="{% url 'dating_app:dating_partner_login' %}">
                                    Partner Sign In
                                </a>
                            </li>

                            <li>
                                <a href="{% url 'dating_app:public_foreigners_list' %}">
                                    View Guest Profiles
                                </a>
                            </li>

                        {% endif %}

                    </ul>
                </div>

                <!-- LEGAL / POLICIES -->
                <div class="col-6 col-lg-2">
                    <h6 class="footer-heading">Legal & Policies</h6>

                    <ul class="footer-links list-unstyled">
                        <!--
                            These will be replaced with proper affiliate_app URLs
                            after we create the affiliate Terms, Privacy, FAQ, etc.
                        -->

                        <li><a href="{% url 'dating_app:terms_page' %}">Terms & Conditions</a></li>
                        <li><a href="{% url 'dating_app:privacy_policy_page' %}">Privacy Policy</a></li>
                        <li><a href="{% url 'dating_app:refund_payment_policy_page' %}">Refund & Payment Policy</a></li>
                        <li><a href="{% url 'dating_app:disclaimer_page' %}">Disclaimer</a></li>
                        <li><a href="{% url 'dating_app:cookie_policy_page' %}">Cookie Policy</a></li>
                        <li><a href="{% url 'dating_app:faq_page' %}">FAQ</a></li>
                    </ul>
                </div>
                


                <!-- CTA BLOCK -->
                <div class="col-6 col-lg-2">
                    <h6 class="footer-heading">Start with Confidence</h6>

                    <p class="footer-text small">
                        Join a more respectful and guided path to meeting sincere international guests.
                    </p>

                    <div class="d-grid gap-2">

                        {% if request.user.is_authenticated and request.user.dating_profile %}

                            <a href="{% url 'dating_app:dating_partner_dashboard' %}"
                               class="btn btn-warning btn-sm">
                                My Dashboard
                            </a>

                            <a href="{% url 'dating_app:public_foreigners_list' %}"
                               class="btn btn-outline-light btn-sm">
                                Browse Guests
                            </a>

                        {% else %}

                            <a href="{% url 'dating_app:partner_register' %}"
                               class="btn btn-warning btn-sm">
                                Apply as Partner
                            </a>

                            <a href="{% url 'dating_app:public_foreigners_list' %}"
                               class="btn btn-outline-light btn-sm">
                                Browse Guests
                            </a>

                        {% endif %}

                    </div>
                </div>

            </div>
        </div>
    </div>


    <!-- FOOTER BOTTOM -->
    <div class="footer-bottom py-3">
        <div class="container">
            <div class="d-flex flex-column flex-md-row justify-content-between align-items-center gap-2">

                <small>&copy; 2026 Ensolanka LLC. All rights reserved.</small>

                <small>
                    Designed to support safer, dignified, and guided international dating introductions.
                </small>

            </div>
        </div>
    </div>

</footer>


<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>

{% block extra_js %}{% endblock %}

</body>
</html>