{% extends 'expat_life/base.html' %}
{% load static %}

{% block title %}My Interested Dating Profiles{% endblock %}

{% block content %}

<style>
    /* =========================================================
       INTERESTED DATING PROFILES - PREMIUM LIVE IN SRI LANKA THEME
    ========================================================= */

    :root {
        --lis-deep: #07131c;
        --lis-navy: #0b2638;
        --lis-blue: #0d6efd;
        --lis-blue-dark: #0b3d91;
        --lis-teal: #0f766e;
        --lis-teal-bright: #20c997;
        --lis-gold: #ffc107;
        --lis-gold-light: #ffd45f;
        --lis-soft-blue: #f5f9ff;
        --lis-sand: #fff8ed;
        --lis-white: #ffffff;
        --lis-text: #102033;
        --lis-muted: #64748b;
        --lis-border: rgba(15, 42, 64, 0.10);
        --lis-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
        --lis-shadow-strong: 0 28px 70px rgba(15, 23, 42, 0.16);
    }

    .interested-dating-section {
        position: relative;
        overflow: hidden;
        min-height: 88vh;
        padding: 90px 0;
        background:
            radial-gradient(circle at 10% 12%, rgba(255, 193, 7, 0.13), transparent 28%),
            radial-gradient(circle at 88% 14%, rgba(13, 110, 253, 0.10), transparent 30%),
            radial-gradient(circle at 82% 86%, rgba(15, 118, 110, 0.12), transparent 32%),
            linear-gradient(180deg, #f5f9ff 0%, #ffffff 100%);
    }

    .interested-dating-section::before {
        content: "";
        position: absolute;
        width: 430px;
        height: 430px;
        right: -210px;
        top: -210px;
        border-radius: 50%;
        background: rgba(255, 193, 7, 0.11);
        pointer-events: none;
    }

    .interested-dating-section::after {
        content: "";
        position: absolute;
        width: 360px;
        height: 360px;
        left: -170px;
        bottom: -180px;
        border-radius: 50%;
        background: rgba(13, 110, 253, 0.07);
        pointer-events: none;
    }

    .interested-dating-wrap {
        position: relative;
        z-index: 2;
    }

    .interested-page-hero {
        position: relative;
        overflow: hidden;
        border-radius: 36px;
        padding: 2.4rem 2.3rem;
        margin-bottom: 2.2rem;
        background:
            radial-gradient(circle at top right, rgba(255, 193, 7, 0.18), transparent 34%),
            radial-gradient(circle at bottom left, rgba(32, 201, 151, 0.18), transparent 34%),
            linear-gradient(135deg, #061b2a 0%, #0b3d91 52%, #0f766e 100%);
        color: #ffffff;
        box-shadow: 0 30px 70px rgba(15, 23, 42, 0.20);
    }

    .interested-page-hero::before {
        content: "";
        position: absolute;
        top: -95px;
        right: -70px;
        width: 280px;
        height: 280px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.08);
        pointer-events: none;
    }

    .interested-page-hero::after {
        content: "";
        position: absolute;
        bottom: -130px;
        left: -80px;
        width: 340px;
        height: 340px;
        border-radius: 50%;
        background: rgba(255, 193, 7, 0.10);
        pointer-events: none;
    }

    .interested-page-hero > * {
        position: relative;
        z-index: 2;
    }

    .interested-mini-title {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.95rem;
        border-radius: 999px;
        background: rgba(255, 193, 7, 0.14);
        border: 1px solid rgba(255, 193, 7, 0.28);
        color: #ffd36b;
        font-size: 0.82rem;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.065em;
        margin-bottom: 1rem;
        backdrop-filter: blur(10px);
    }

    .interested-mini-title::before {
        content: "";
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #ffffff;
        box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.12);
    }

    .interested-page-hero h2 {
        color: #ffffff;
        font-weight: 950;
        letter-spacing: -0.045em;
        line-height: 1.07;
        font-size: clamp(2.15rem, 4vw, 3.35rem);
        margin-bottom: 0.75rem;
    }

    .interested-page-hero p {
        max-width: 760px;
        color: rgba(255, 255, 255, 0.86) !important;
        line-height: 1.78;
        font-size: 1.04rem;
        margin-bottom: 0;
    }

    .interested-page-hero .btn {
        border-radius: 999px;
        font-weight: 850;
        padding: 0.82rem 1.35rem;
        transition: all 0.22s ease;
    }

    .interested-page-hero .btn-outline-secondary {
        background: rgba(255, 255, 255, 0.10);
        color: #ffffff;
        border: 1px solid rgba(255, 255, 255, 0.42);
        backdrop-filter: blur(10px);
    }

    .interested-page-hero .btn-outline-secondary:hover {
        background: #ffffff;
        color: var(--lis-deep);
        border-color: #ffffff;
        transform: translateY(-2px);
    }

    .interested-profile-card {
        position: relative;
        overflow: hidden;
        height: 100%;
        border: 1px solid rgba(15, 42, 64, 0.08);
        border-radius: 30px;
        background:
            radial-gradient(circle at 92% 10%, rgba(255, 193, 7, 0.10), transparent 32%),
            linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
        box-shadow: var(--lis-shadow);
        transition: all 0.24s ease;
    }

    .interested-profile-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 4px;
        background: linear-gradient(90deg, var(--lis-gold), var(--lis-teal), var(--lis-blue));
        opacity: 0;
        transition: opacity 0.24s ease;
        z-index: 3;
    }

    .interested-profile-card:hover {
        transform: translateY(-6px);
        border-color: rgba(15, 118, 110, 0.18);
        box-shadow: var(--lis-shadow-strong);
    }

    .interested-profile-card:hover::before {
        opacity: 1;
    }

    .interested-image-wrap {
        position: relative;
        overflow: hidden;
        background: #07131c;
    }

    .interested-profile-image {
        width: 100%;
        height: 320px;
        object-fit: cover;
        transition: transform 0.35s ease, filter 0.35s ease;
    }

    .interested-profile-card:hover .interested-profile-image {
        transform: scale(1.04);
        filter: saturate(1.05) contrast(1.03);
    }

    .interested-image-wrap::after {
        content: "";
        position: absolute;
        inset: 0;
        background:
            linear-gradient(180deg, transparent 48%, rgba(7, 19, 28, 0.78) 100%),
            radial-gradient(circle at top right, rgba(255, 193, 7, 0.16), transparent 34%);
        pointer-events: none;
    }

    .interest-status-badge {
        position: absolute;
        top: 16px;
        right: 16px;
        z-index: 2;
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.42rem 0.78rem;
        border-radius: 999px;
        background: linear-gradient(135deg, var(--lis-gold-light), var(--lis-gold));
        color: #231707;
        font-size: 0.78rem;
        font-weight: 900;
        border: none;
        box-shadow: 0 14px 28px rgba(255, 193, 7, 0.24);
    }

    .interest-status-badge::before {
        content: "\F415";
        font-family: "bootstrap-icons";
        font-size: 0.85rem;
    }

    .interested-card-body {
        padding: 1.45rem;
        display: flex;
        flex-direction: column;
        height: calc(100% - 320px);
    }

    .interested-card-title {
        color: var(--lis-text);
        font-weight: 950;
        letter-spacing: -0.02em;
        line-height: 1.25;
        margin-bottom: 0.95rem;
    }

    .interested-meta-list {
        color: var(--lis-muted);
        font-size: 0.92rem;
        line-height: 1.55;
        margin-bottom: 1.2rem;
    }

    .interested-meta-list div {
        display: flex;
        align-items: flex-start;
        gap: 0.45rem;
        margin-bottom: 0.45rem;
    }

    .interested-meta-list i {
        color: var(--lis-teal);
        margin-top: 0.05rem;
        min-width: 18px;
    }

    .btn-view-interest-details {
        border-radius: 999px;
        padding: 0.82rem 1.2rem;
        font-weight: 850;
        letter-spacing: 0.01em;
        background: linear-gradient(135deg, var(--lis-deep), var(--lis-blue));
        border: none;
        color: #ffffff;
        box-shadow: 0 16px 32px rgba(13, 110, 253, 0.20);
        transition: all 0.22s ease;
    }

    .btn-view-interest-details:hover {
        background: linear-gradient(135deg, var(--lis-deep), var(--lis-teal));
        color: #ffffff;
        transform: translateY(-2px);
        box-shadow: 0 20px 38px rgba(15, 118, 110, 0.24);
    }

    .interested-empty-card {
        position: relative;
        overflow: hidden;
        border: 1px solid rgba(15, 42, 64, 0.08);
        border-radius: 34px;
        background:
            radial-gradient(circle at 92% 8%, rgba(255, 193, 7, 0.14), transparent 32%),
            linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
        box-shadow: var(--lis-shadow-strong);
    }

    .interested-empty-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 6px;
        background: linear-gradient(90deg, var(--lis-gold), var(--lis-teal), var(--lis-blue));
        z-index: 2;
    }

    .interested-empty-card .card-body {
        position: relative;
        z-index: 3;
        padding: 3.2rem 1.8rem;
    }

    .interested-empty-icon {
        width: 92px;
        height: 92px;
        margin: 0 auto 1.2rem;
        border-radius: 30px;
        background:
            radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.75), transparent 28%),
            linear-gradient(135deg, var(--lis-gold-light), var(--lis-gold));
        color: var(--lis-deep);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 2.65rem;
        box-shadow:
            0 18px 38px rgba(255, 193, 7, 0.28),
            0 0 0 10px rgba(255, 193, 7, 0.10);
    }

    .interested-empty-card h4 {
        color: var(--lis-text);
        font-weight: 950;
        letter-spacing: -0.025em;
    }

    .interested-empty-card p {
        color: var(--lis-muted) !important;
        line-height: 1.75;
        max-width: 620px;
        margin-left: auto;
        margin-right: auto;
    }

    .interested-empty-card .btn-primary {
        border-radius: 999px;
        padding: 0.82rem 1.45rem;
        font-weight: 850;
        background: linear-gradient(135deg, var(--lis-deep), var(--lis-blue));
        border: none;
        color: #ffffff;
        box-shadow: 0 16px 32px rgba(13, 110, 253, 0.20);
    }

    .interested-empty-card .btn-primary:hover {
        background: linear-gradient(135deg, var(--lis-deep), var(--lis-teal));
        color: #ffffff;
        transform: translateY(-2px);
    }

    @media (max-width: 767.98px) {
        .interested-dating-section {
            padding: 60px 0;
            min-height: auto;
        }

        .interested-page-hero {
            border-radius: 30px;
            padding: 2.1rem 1.35rem;
        }

        .interested-page-hero h2 {
            font-size: 2.1rem;
        }

        .interested-profile-card {
            border-radius: 26px;
        }

        .interested-profile-image {
            height: 300px;
        }

        .interested-card-body {
            height: auto;
        }
    }

    @media (max-width: 420px) {
        .interested-page-hero {
            border-radius: 26px;
        }

        .interested-profile-image {
            height: 280px;
        }

        .interested-empty-card {
            border-radius: 28px;
        }
    }
</style>

<section class="interested-dating-section">
    <div class="container interested-dating-wrap">

        <div class="interested-page-hero">
            <div class="d-flex flex-wrap justify-content-between align-items-center gap-3">
                <div>
                    <span class="interested-mini-title">Guest Dashboard</span>
                    <h2>My Interested Dating Profiles</h2>
                    <p>
                        View the local dating partner profiles you have marked as interested and continue exploring details securely.
                    </p>
                </div>

                <div>
                    <a href="{% url 'expat_life:foreigner_dashboard' %}" class="btn btn-outline-secondary">
                        <i class="bi bi-arrow-left-circle me-2"></i>
                        Back to Dashboard
                    </a>
                </div>
            </div>
        </div>

        {% if interests %}
            <div class="row g-4">
                {% for interest in interests %}
                    <div class="col-md-6 col-lg-4">
                        <div class="interested-profile-card">

                            <div class="interested-image-wrap">
                                {% if interest.partner.profile_photo %}
                                    <img src="{{ interest.partner.profile_photo.url }}"
                                         class="interested-profile-image"
                                         alt="{{ interest.partner.display_name|default:interest.partner.full_name }}">
                                {% else %}
                                    <img src="{% static 'images/default-profile.jpg' %}"
                                         class="interested-profile-image"
                                         alt="Default Profile">
                                {% endif %}

                                <span class="interest-status-badge">
                                    {{ interest.get_status_display }}
                                </span>
                            </div>

                            <div class="interested-card-body">
                                <h5 class="interested-card-title">
                                    {{ interest.partner.display_name|default:interest.partner.full_name }}
                                </h5>

                                <div class="interested-meta-list">
                                    <div>
                                        <i class="bi bi-gender-ambiguous"></i>
                                        <span>{{ interest.partner.get_gender_display }}</span>
                                    </div>

                                    {% if interest.partner_age %}
                                        <div>
                                            <i class="bi bi-calendar-heart"></i>
                                            <span>Age {{ interest.partner_age }}</span>
                                        </div>
                                    {% endif %}

                                    <div>
                                        <i class="bi bi-geo-alt"></i>
                                        <span>
                                            {% if interest.partner.city %}{{ interest.partner.city }}{% endif %}
                                            {% if interest.partner.district %}, {{ interest.partner.district }}{% endif %}
                                            {% if interest.partner.country %}, {{ interest.partner.country }}{% endif %}
                                        </span>
                                    </div>

                                    <div>
                                        <i class="bi bi-clock-history"></i>
                                        <span>Interested on {{ interest.created_at|date:"M d, Y" }}</span>
                                    </div>
                                </div>

                                <div class="mt-auto">
                                    <a href="{% url 'expat_life:public_partner_detail' interest.partner.pk %}"
                                       class="btn btn-view-interest-details w-100">
                                        <i class="bi bi-eye me-2"></i>
                                        View Details
                                    </a>
                                </div>
                            </div>

                        </div>
                    </div>
                {% endfor %}
            </div>
        {% else %}
            <div class="interested-empty-card">
                <div class="card-body text-center">
                    <div class="interested-empty-icon">
                        <i class="bi bi-heart"></i>
                    </div>

                    <h4>No Interested Dating Profiles Yet</h4>

                    <p class="mb-4">
                        You have not marked any dating partner profiles as interested yet.
                        Browse available profiles and save the ones you would like to review later.
                    </p>

                    <a href="{% url 'dating_app:public_partner_list' %}" class="btn btn-primary">
                        <i class="bi bi-search-heart me-2"></i>
                        Browse Dating Profiles
                    </a>
                </div>
            </div>
        {% endif %}

    </div>
</section>

{% endblock %}