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

{% block title %}Book {{ venue.venue_name }} | Hosting Experience{% endblock %}

{% block content %}

<style>
    /* =========================================================
       GUEST HOST BOOKING START — HOSTING THEME
    ========================================================= */

    .guest-host-booking-page {
        min-height: 100vh;
        background:
            radial-gradient(circle at top left, rgba(255, 193, 7, 0.10), transparent 30%),
            radial-gradient(circle at top right, rgba(116, 49, 41, 0.10), transparent 32%),
            linear-gradient(180deg, #fffaf5 0%, #ffffff 48%, #fff7ed 100%);
        color: #2c1b17;
    }

    .guest-host-booking-hero {
        position: relative;
        overflow: hidden;
        min-height: 520px;
        display: flex;
        align-items: center;
        color: #ffffff;
        background:
            linear-gradient(
                100deg,
                rgba(27, 16, 15, 0.96) 0%,
                rgba(54, 27, 24, 0.88) 44%,
                rgba(89, 44, 30, 0.58) 100%
            );
    }

    .guest-host-booking-hero-bg {
        position: absolute;
        inset: 0;
        z-index: 0;
    }

    .guest-host-booking-hero-bg img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .guest-host-booking-hero-bg::after {
        content: "";
        position: absolute;
        inset: 0;
        background:
            radial-gradient(circle at 82% 18%, rgba(255, 193, 7, 0.28), transparent 28%),
            radial-gradient(circle at 12% 78%, rgba(202, 95, 58, 0.22), transparent 32%),
            linear-gradient(
                100deg,
                rgba(27, 16, 15, 0.96) 0%,
                rgba(54, 27, 24, 0.88) 44%,
                rgba(89, 44, 30, 0.62) 100%
            );
    }

    .guest-host-booking-hero-placeholder {
        position: absolute;
        inset: 0;
        background:
            radial-gradient(circle at top right, rgba(255, 193, 7, 0.28), transparent 34%),
            linear-gradient(145deg, #2e1817 0%, #6d2e28 64%, #a3601b 100%);
    }

    .guest-host-booking-hero::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -1px;
        height: 110px;
        background: linear-gradient(180deg, transparent 0%, #fffaf5 100%);
        pointer-events: none;
        z-index: 1;
    }

    .guest-host-booking-hero-inner {
        position: relative;
        z-index: 2;
        padding: 6rem 0 7rem;
    }

    .guest-host-booking-kicker {
        display: inline-flex;
        align-items: center;
        gap: 0.55rem;
        padding: 0.55rem 1.05rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.13);
        border: 1px solid rgba(255, 255, 255, 0.20);
        color: #ffd36b;
        font-size: 0.84rem;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.055em;
        backdrop-filter: blur(10px);
        margin-bottom: 1.1rem;
    }

    .guest-host-booking-hero h1 {
        max-width: 980px;
        font-size: clamp(2.25rem, 5vw, 4.65rem);
        font-weight: 950;
        line-height: 1.02;
        letter-spacing: -0.06em;
        margin-bottom: 1rem;
    }

    .guest-host-booking-hero h1 span {
        color: #ffd36b;
    }

    .guest-host-booking-hero p {
        max-width: 820px;
        color: rgba(255, 255, 255, 0.87);
        font-size: 1.06rem;
        line-height: 1.82;
        margin-bottom: 1.4rem;
    }

    .guest-host-booking-hero-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.65rem;
        margin-bottom: 1.4rem;
    }

    .guest-host-booking-hero-chip {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.52rem 0.85rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.13);
        border: 1px solid rgba(255, 255, 255, 0.20);
        color: #ffffff;
        font-size: 0.82rem;
        font-weight: 850;
        backdrop-filter: blur(10px);
    }

    .guest-host-booking-hero-chip.gold {
        background: rgba(255, 200, 63, 0.92);
        border-color: rgba(255, 200, 63, 0.96);
        color: #26160d;
    }

    .guest-host-booking-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.9rem;
    }

    .guest-host-booking-actions .btn {
        min-height: 52px;
        border-radius: 18px;
        padding: 0.85rem 1.45rem;
        font-weight: 900;
    }

    .guest-host-btn-gold {
        background: linear-gradient(135deg, #ffc83f, #df9219);
        color: #26160d;
        border: none;
        font-weight: 950 !important;
        box-shadow: 0 18px 34px rgba(223, 146, 25, 0.30);
        transition: all 0.22s ease;
    }

    .guest-host-btn-gold:hover,
    .guest-host-btn-gold:focus {
        background: linear-gradient(135deg, #2e1817, #6d2e28);
        color: #ffffff !important;
        transform: translateY(-2px);
        box-shadow: 0 22px 42px rgba(54, 28, 23, 0.28);
    }

    .guest-host-btn-glass {
        background: rgba(255, 255, 255, 0.10);
        color: #ffffff;
        border: 1px solid rgba(255, 255, 255, 0.34);
        backdrop-filter: blur(10px);
    }

    .guest-host-btn-glass:hover {
        background: rgba(255, 255, 255, 0.17);
        color: #ffffff;
    }

    .guest-host-booking-section {
        padding: 5rem 0;
    }

    .guest-host-card {
        border-radius: 32px;
        background: linear-gradient(145deg, #fffaf4 0%, #ffffff 100%);
        border: 1px solid rgba(124, 74, 50, 0.10);
        box-shadow: 0 18px 42px rgba(55, 31, 22, 0.07);
        overflow: hidden;
        margin-bottom: 1.5rem;
    }

    .guest-host-card-header {
        padding: 1.5rem 1.6rem 1.05rem;
        border-bottom: 1px solid rgba(124, 74, 50, 0.10);
        background:
            radial-gradient(circle at top right, rgba(255, 193, 7, 0.08), transparent 30%),
            linear-gradient(145deg, #fffaf4 0%, #ffffff 100%);
    }

    .guest-host-card-header h2,
    .guest-host-card-header h3 {
        color: #38231d;
        font-weight: 950;
        margin-bottom: 0.35rem;
    }

    .guest-host-card-header p {
        color: #78625a;
        line-height: 1.7;
        margin-bottom: 0;
    }

    .guest-host-card-body {
        padding: 1.6rem;
    }

    .guest-form-group {
        margin-bottom: 1.25rem;
    }

    .guest-form-group label {
        display: block;
        color: #38231d;
        font-size: 0.84rem;
        font-weight: 950;
        text-transform: uppercase;
        letter-spacing: 0.045em;
        margin-bottom: 0.5rem;
    }

    .guest-form-group input,
    .guest-form-group select,
    .guest-form-group textarea {
        width: 100%;
        min-height: 50px;
        border-radius: 16px;
        border: 1px solid #eadbc9;
        background: #fffaf5;
        color: #38231d;
        font-weight: 650;
        padding: 0.8rem 0.95rem;
        transition: 0.2s ease;
    }

    .guest-form-group textarea {
        min-height: 120px;
    }

    .guest-form-group input:focus,
    .guest-form-group select:focus,
    .guest-form-group textarea:focus {
        border-color: #a75e17;
        box-shadow: 0 0 0 0.22rem rgba(167, 94, 23, 0.14);
        background: #ffffff;
        outline: none;
    }

    .guest-field-help {
        display: block;
        color: #8b6550;
        font-size: 0.84rem;
        line-height: 1.55;
        margin-top: 0.45rem;
    }

    .guest-field-error {
        color: #dc2626;
        font-size: 0.86rem;
        font-weight: 800;
        margin-top: 0.4rem;
    }

    .guest-non-field-errors {
        border-radius: 22px;
        padding: 1rem 1.1rem;
        background: #fef2f2;
        border: 1px solid #fecaca;
        color: #b91c1c;
        font-weight: 700;
        margin-bottom: 1.25rem;
    }

    .guest-selection-card-grid {
        display: grid;
        gap: 1rem;
    }

    .guest-option-card {
        border-radius: 24px;
        border: 1px solid #eadbc9;
        background: #ffffff;
        padding: 1rem;
    }

    .guest-option-card h4 {
        color: #38231d;
        font-weight: 950;
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }

    .guest-option-card p {
        color: #78625a;
        line-height: 1.6;
        font-size: 0.9rem;
        margin-bottom: 0.65rem;
    }

    .guest-option-price {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        border-radius: 999px;
        padding: 0.42rem 0.68rem;
        background: #fff7e8;
        border: 1px solid #efd8b7;
        color: #5a351f;
        font-size: 0.8rem;
        font-weight: 950;
    }

    .guest-addon-list ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: grid;
        gap: 0.75rem;
    }

    .guest-addon-list li {
        border-radius: 22px;
        border: 1px solid #eadbc9;
        background: #ffffff;
        padding: 0.9rem 1rem;
    }

    .guest-addon-list label {
        display: flex;
        align-items: flex-start;
        gap: 0.7rem;
        cursor: pointer;
        margin: 0;
        color: #38231d;
        font-weight: 850;
        text-transform: none;
        letter-spacing: 0;
        font-size: 0.95rem;
    }

    .guest-addon-list input[type="checkbox"] {
        width: 1.05rem;
        height: 1.05rem;
        min-height: auto;
        margin-top: 0.18rem;
        accent-color: #a75e17;
        flex-shrink: 0;
    }

    .guest-host-side-card {
        border-radius: 32px;
        background: linear-gradient(145deg, #fffaf4 0%, #ffffff 100%);
        border: 1px solid rgba(124, 74, 50, 0.10);
        box-shadow: 0 18px 42px rgba(55, 31, 22, 0.07);
        overflow: hidden;
        margin-bottom: 1.4rem;
        position: sticky;
        top: 1rem;
    }

    .guest-host-side-card.not-sticky {
        position: static;
    }

    .guest-host-side-header {
        padding: 1.45rem 1.5rem 1rem;
        border-bottom: 1px solid rgba(124, 74, 50, 0.10);
        background:
            radial-gradient(circle at top right, rgba(255, 193, 7, 0.08), transparent 30%),
            linear-gradient(145deg, #fffaf4 0%, #ffffff 100%);
    }

    .guest-host-side-header h3 {
        color: #38231d;
        font-weight: 950;
        margin-bottom: 0.25rem;
    }

    .guest-host-side-header p {
        color: #78625a;
        line-height: 1.65;
        margin-bottom: 0;
    }

    .guest-host-side-body {
        padding: 1.45rem;
    }

    .guest-summary-box {
        border-radius: 28px;
        padding: 1.4rem;
        background:
            radial-gradient(circle at top right, rgba(255, 193, 7, 0.18), transparent 34%),
            linear-gradient(145deg, #2e1817 0%, #6d2e28 64%, #a3601b 100%);
        color: #ffffff;
        margin-bottom: 1rem;
    }

    .guest-summary-box span {
        display: block;
        color: rgba(255, 255, 255, 0.72);
        font-size: 0.78rem;
        font-weight: 950;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 0.4rem;
    }

    .guest-summary-box strong {
        display: block;
        color: #ffffff;
        font-size: 1.5rem;
        font-weight: 950;
        line-height: 1.2;
        margin-bottom: 0.7rem;
    }

    .guest-summary-box p {
        color: rgba(255, 255, 255, 0.82);
        line-height: 1.65;
        margin-bottom: 0;
        font-size: 0.92rem;
    }

    .guest-info-item {
        border-radius: 22px;
        padding: 1rem;
        background: #fff7e8;
        border: 1px solid #efd8b7;
        margin-bottom: 0.8rem;
    }

    .guest-info-item span {
        display: block;
        color: #8b6550;
        font-size: 0.76rem;
        font-weight: 950;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 0.35rem;
    }

    .guest-info-item strong {
        color: #38231d;
        font-weight: 900;
        word-break: break-word;
    }

    .guest-process-list {
        display: grid;
        gap: 0.75rem;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .guest-process-list li {
        display: flex;
        align-items: flex-start;
        gap: 0.65rem;
        color: #78625a;
        line-height: 1.6;
    }

    .guest-process-list i {
        color: #a75e17;
        margin-top: 0.2rem;
        flex-shrink: 0;
    }

    .guest-submit-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.8rem;
        margin-top: 1.5rem;
    }

    .guest-submit-actions .btn {
        border-radius: 999px;
        min-height: 52px;
        font-weight: 950;
        padding: 0.85rem 1.35rem;
    }

    @media (max-width: 991.98px) {
        .guest-host-booking-hero {
            min-height: auto;
        }

        .guest-host-booking-hero-inner {
            padding: 5.5rem 0 6.5rem;
        }

        .guest-host-booking-section {
            padding: 4rem 0;
        }

        .guest-host-side-card {
            position: static;
        }
    }

    @media (max-width: 767.98px) {
        .guest-host-booking-actions,
        .guest-submit-actions {
            flex-direction: column;
            align-items: stretch;
        }

        .guest-host-booking-actions .btn,
        .guest-submit-actions .btn {
            width: 100%;
        }

        .guest-host-card-body,
        .guest-host-card-header,
        .guest-host-side-header,
        .guest-host-side-body {
            padding-left: 1.15rem;
            padding-right: 1.15rem;
        }
    }

    @media (max-width: 575.98px) {
        .guest-host-booking-hero > .container,
        .guest-host-booking-section > .container {
            padding-left: 1.25rem !important;
            padding-right: 1.25rem !important;
        }
    }

    .guest-addon-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .guest-addon-card {
        display: flex;
        align-items: flex-start;
        gap: 0.85rem;
        border-radius: 24px;
        border: 1px solid #eadbc9;
        background:
            radial-gradient(circle at top right, rgba(255, 193, 7, 0.06), transparent 34%),
            #ffffff;
        padding: 1rem;
        cursor: pointer;
        transition: all 0.22s ease;
        height: 100%;
        margin: 0;
    }

    .guest-addon-card:hover {
        border-color: #d59a43;
        transform: translateY(-2px);
        box-shadow: 0 16px 34px rgba(55, 31, 22, 0.08);
    }

    .guest-addon-check {
        flex: 0 0 auto;
        padding-top: 0.2rem;
    }

    .guest-addon-check input[type="checkbox"] {
        width: 1.1rem;
        height: 1.1rem;
        min-height: auto;
        accent-color: #a75e17;
        cursor: pointer;
    }

    .guest-addon-content {
        min-width: 0;
        flex: 1;
    }

    .guest-addon-title {
        color: #38231d;
        font-weight: 950;
        line-height: 1.35;
        margin-bottom: 0.35rem;
    }

    .guest-addon-desc {
        color: #78625a;
        font-size: 0.88rem;
        line-height: 1.6;
        margin-bottom: 0.65rem;
    }

    .guest-addon-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.45rem;
    }

    .guest-addon-meta span {
        display: inline-flex;
        align-items: center;
        gap: 0.32rem;
        border-radius: 999px;
        padding: 0.34rem 0.58rem;
        background: #fff7e8;
        border: 1px solid #efd8b7;
        color: #6f4f3f;
        font-size: 0.74rem;
        font-weight: 850;
    }

    .guest-addon-meta i {
        color: #a75e17;
    }

    @media (max-width: 767.98px) {
        .guest-addon-grid {
            grid-template-columns: 1fr;
        }
    }
</style>


<div class="guest-host-booking-page">

    <!-- =====================================================
         HERO
    ====================================================== -->
    <section class="guest-host-booking-hero">

        {% if venue.cover_image %}
            <div class="guest-host-booking-hero-bg">
                <img src="{{ venue.cover_image.url }}" alt="{{ venue.venue_name }}">
            </div>
        {% else %}
            <div class="guest-host-booking-hero-placeholder"></div>
        {% endif %}

        <div class="container guest-host-booking-hero-inner">

            <span class="guest-host-booking-kicker">
                <i class="bi bi-calendar-heart-fill"></i>
                Book Hosting Experience
            </span>

            <h1>
                Plan your experience at <span>{{ venue.venue_name }}</span>
            </h1>

            <p>
                Select your preferred event package, meal plan, add-on services, date,
                guest count, and special requests. We will prepare your booking order
                and add it to your Guest Payment Center.
            </p>

            <div class="guest-host-booking-hero-meta">
                {% if venue.is_featured %}
                    <span class="guest-host-booking-hero-chip gold">
                        <i class="bi bi-star-fill"></i>
                        Featured Venue
                    </span>
                {% endif %}

                {% if venue.venue_category %}
                    <span class="guest-host-booking-hero-chip">
                        <i class="bi bi-tag-fill"></i>
                        {{ venue.get_venue_category_display }}
                    </span>
                {% endif %}

                {% if venue.city or venue.district %}
                    <span class="guest-host-booking-hero-chip">
                        <i class="bi bi-geo-alt-fill"></i>
                        {% if venue.city %}{{ venue.city }}{% endif %}
                        {% if venue.city and venue.district %}, {% endif %}
                        {% if venue.district %}{{ venue.district }}{% endif %}
                    </span>
                {% endif %}

                {% if venue.max_guest_capacity %}
                    <span class="guest-host-booking-hero-chip">
                        <i class="bi bi-people-fill"></i>
                        Up to {{ venue.max_guest_capacity }} guests
                    </span>
                {% endif %}
            </div>

            <div class="guest-host-booking-actions">
                <a href="{% url 'expat_life:guest_host_venue_detail' venue.slug %}"
                   class="btn guest-host-btn-glass">
                    <i class="bi bi-arrow-left-circle me-2"></i>
                    Back to Venue Details
                </a>

                <a href="{% url 'expat_life:foreigner_payment_center' %}"
                   class="btn guest-host-btn-glass">
                    <i class="bi bi-wallet2 me-2"></i>
                    Payment Center
                </a>
            </div>

        </div>
    </section>


    <!-- =====================================================
         BOOKING FORM
    ====================================================== -->
    <section class="guest-host-booking-section">
        <div class="container">

            <div class="row g-4 align-items-start">

                <!-- MAIN FORM -->
                <div class="col-lg-8">

                    <form method="post">
                        {% csrf_token %}

                        {% if form.non_field_errors %}
                            <div class="guest-non-field-errors">
                                {% for error in form.non_field_errors %}
                                    <div>{{ error }}</div>
                                {% endfor %}
                            </div>
                        {% endif %}

                        <!-- Event details -->
                        <div class="guest-host-card">
                            <div class="guest-host-card-header">
                                <h2>Event Details</h2>
                                <p>
                                    Tell us when, why, and for how many guests you want to plan this experience.
                                </p>
                            </div>

                            <div class="guest-host-card-body">
                                <div class="row g-3">

                                    <div class="col-md-6">
                                        <div class="guest-form-group">
                                            <label for="{{ form.event_type.id_for_label }}">
                                                {{ form.event_type.label }}
                                            </label>
                                            {{ form.event_type }}
                                            {% for error in form.event_type.errors %}
                                                <div class="guest-field-error">{{ error }}</div>
                                            {% endfor %}
                                        </div>
                                    </div>

                                    <div class="col-md-6">
                                        <div class="guest-form-group">
                                            <label for="{{ form.number_of_guests.id_for_label }}">
                                                {{ form.number_of_guests.label }}
                                            </label>
                                            {{ form.number_of_guests }}
                                            {% for error in form.number_of_guests.errors %}
                                                <div class="guest-field-error">{{ error }}</div>
                                            {% endfor %}
                                        </div>
                                    </div>

                                    <div class="col-md-6">
                                        <div class="guest-form-group">
                                            <label for="{{ form.preferred_event_date.id_for_label }}">
                                                {{ form.preferred_event_date.label }}
                                            </label>
                                            {{ form.preferred_event_date }}
                                            {% for error in form.preferred_event_date.errors %}
                                                <div class="guest-field-error">{{ error }}</div>
                                            {% endfor %}
                                        </div>
                                    </div>

                                    <div class="col-md-6">
                                        <div class="guest-form-group">
                                            <label for="{{ form.preferred_start_time.id_for_label }}">
                                                {{ form.preferred_start_time.label }}
                                            </label>
                                            {{ form.preferred_start_time }}
                                            {% for error in form.preferred_start_time.errors %}
                                                <div class="guest-field-error">{{ error }}</div>
                                            {% endfor %}
                                        </div>
                                    </div>

                                    <div class="col-md-6">
                                        <div class="guest-form-group mb-md-0">
                                            <label for="{{ form.expected_duration_hours.id_for_label }}">
                                                {{ form.expected_duration_hours.label }}
                                            </label>
                                            {{ form.expected_duration_hours }}
                                            <span class="guest-field-help">
                                                Optional. Example: 2.5 hours, 4 hours, or leave blank if flexible.
                                            </span>
                                            {% for error in form.expected_duration_hours.errors %}
                                                <div class="guest-field-error">{{ error }}</div>
                                            {% endfor %}
                                        </div>
                                    </div>

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


                        <!-- Package and meal -->
                        <div class="guest-host-card">
                            <div class="guest-host-card-header">
                                <h3>Package & Meal Selection</h3>
                                <p>
                                    Choose the main event package and meal plan you prefer for this venue.
                                </p>
                            </div>

                            <div class="guest-host-card-body">
                                <div class="row g-3">

                                    <div class="col-md-6">
                                        <div class="guest-form-group">
                                            <label for="{{ form.selected_package.id_for_label }}">
                                                {{ form.selected_package.label }}
                                            </label>
                                            {{ form.selected_package }}
                                            {% for error in form.selected_package.errors %}
                                                <div class="guest-field-error">{{ error }}</div>
                                            {% endfor %}
                                        </div>

                                        {% if event_packages %}
                                            <div class="guest-selection-card-grid">
                                                {% for package in event_packages %}
                                                    <div class="guest-option-card">
                                                        <h4>{{ package.title }}</h4>
                                                        {% if package.description %}
                                                            <p>{{ package.description|truncatechars:125 }}</p>
                                                        {% endif %}
                                                        <span class="guest-option-price">
                                                            <i class="bi bi-cash-coin"></i>
                                                            USD {{ package.price_usd|floatformat:2 }}
                                                        </span>
                                                    </div>
                                                {% endfor %}
                                            </div>
                                        {% endif %}
                                    </div>

                                    <div class="col-md-6">
                                        <div class="guest-form-group">
                                            <label for="{{ form.selected_meal_plan.id_for_label }}">
                                                {{ form.selected_meal_plan.label }}
                                            </label>
                                            {{ form.selected_meal_plan }}
                                            {% for error in form.selected_meal_plan.errors %}
                                                <div class="guest-field-error">{{ error }}</div>
                                            {% endfor %}
                                        </div>

                                        {% if meal_plans %}
                                            <div class="guest-selection-card-grid">
                                                {% for meal_plan in meal_plans %}
                                                    <div class="guest-option-card">
                                                        <h4>{{ meal_plan.title }}</h4>
                                                        {% if meal_plan.description %}
                                                            <p>{{ meal_plan.description|truncatechars:125 }}</p>
                                                        {% endif %}
                                                        <span class="guest-option-price">
                                                            <i class="bi bi-cash-coin"></i>
                                                            USD {{ meal_plan.price_per_person_usd|floatformat:2 }} per person
                                                        </span>
                                                        {% if meal_plan.minimum_people %}
                                                            <span class="guest-field-help">
                                                                Minimum {{ meal_plan.minimum_people }} people
                                                            </span>
                                                        {% endif %}
                                                    </div>
                                                {% endfor %}
                                            </div>
                                        {% endif %}
                                    </div>

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


                        <!-- Add-ons -->
                        <div class="guest-host-card">
                            <div class="guest-host-card-header">
                                <h3>Add-on Services</h3>
                                <p>
                                    Select optional services such as décor, flowers, cake, photography, music, or other enhancements.
                                </p>
                            </div>

                            <div class="guest-host-card-body">
                                {% if add_on_services %}

                                    <div class="guest-addon-grid">
                                        {% for checkbox in form.selected_add_ons %}
                                            <label class="guest-addon-card" for="{{ checkbox.id_for_label }}">
                                                <div class="guest-addon-check">
                                                    {{ checkbox.tag }}
                                                </div>

                                                <div class="guest-addon-content">
                                                    <div class="guest-addon-title">
                                                        {{ checkbox.choice_label }}
                                                    </div>

                                                    {% for service in add_on_services %}
                                                        {% if service.pk|stringformat:"s" == checkbox.data.value|stringformat:"s" %}
                                                            {% if service.description %}
                                                                <p class="guest-addon-desc">
                                                                    {{ service.description|truncatechars:120 }}
                                                                </p>
                                                            {% endif %}

                                                            <div class="guest-addon-meta">
                                                                <span>
                                                                    <i class="bi bi-cash-coin"></i>
                                                                    USD {{ service.price_usd|floatformat:2 }}
                                                                </span>

                                                                {% if service.pricing_type %}
                                                                    <span>
                                                                        <i class="bi bi-tag-fill"></i>
                                                                        {{ service.get_pricing_type_display }}
                                                                    </span>
                                                                {% endif %}
                                                            </div>
                                                        {% endif %}
                                                    {% endfor %}
                                                </div>
                                            </label>
                                        {% endfor %}
                                    </div>

                                    {% for error in form.selected_add_ons.errors %}
                                        <div class="guest-field-error">{{ error }}</div>
                                    {% endfor %}

                                    <div class="mt-3">
                                        <span class="guest-field-help">
                                            Add-on pricing will be calculated into your booking order.
                                            Per-person add-ons are calculated using your guest count.
                                        </span>
                                    </div>

                                {% else %}
                                    <p class="text-muted mb-0">
                                        No add-on services are currently published for this venue.
                                    </p>
                                {% endif %}
                            </div>
                        </div>


                        <!-- Occasion notes -->
                        <div class="guest-host-card">
                            <div class="guest-host-card-header">
                                <h3>Occasion Notes & Special Requests</h3>
                                <p>
                                    Share details that help us understand the experience you want to create.
                                </p>
                            </div>

                            <div class="guest-host-card-body">
                                <div class="guest-form-group">
                                    <label for="{{ form.occasion_title.id_for_label }}">
                                        {{ form.occasion_title.label }}
                                    </label>
                                    {{ form.occasion_title }}
                                    {% for error in form.occasion_title.errors %}
                                        <div class="guest-field-error">{{ error }}</div>
                                    {% endfor %}
                                </div>

                                <div class="guest-form-group">
                                    <label for="{{ form.occasion_note.id_for_label }}">
                                        {{ form.occasion_note.label }}
                                    </label>
                                    {{ form.occasion_note }}
                                    {% for error in form.occasion_note.errors %}
                                        <div class="guest-field-error">{{ error }}</div>
                                    {% endfor %}
                                </div>

                                <div class="guest-form-group mb-0">
                                    <label for="{{ form.special_requests.id_for_label }}">
                                        {{ form.special_requests.label }}
                                    </label>
                                    {{ form.special_requests }}
                                    {% for error in form.special_requests.errors %}
                                        <div class="guest-field-error">{{ error }}</div>
                                    {% endfor %}
                                </div>
                            </div>
                        </div>


                        <div class="guest-submit-actions">
                            <button type="submit" class="btn guest-host-btn-gold">
                                <i class="bi bi-check-circle-fill me-2"></i>
                                Prepare Booking & Go to Payment Center
                            </button>

                            <a href="{% url 'expat_life:guest_host_venue_detail' venue.slug %}"
                               class="btn btn-outline-secondary">
                                <i class="bi bi-arrow-left-circle me-2"></i>
                                Cancel
                            </a>
                        </div>

                    </form>

                </div>


                <!-- SIDEBAR -->
                <div class="col-lg-4">

                    <div class="guest-host-side-card">
                        <div class="guest-host-side-header">
                            <h3>Booking Summary</h3>
                            <p>
                                This creates or updates your current unpaid host event booking.
                            </p>
                        </div>

                        <div class="guest-host-side-body">
                            <div class="guest-summary-box">
                                <span>Next Step</span>
                                <strong>Payment Center</strong>
                                <p>
                                    After submitting, your selected booking will appear as a due payable item
                                    in your Guest Payment Center.
                                </p>
                            </div>

                            <div class="guest-info-item">
                                <span>Venue</span>
                                <strong>{{ venue.venue_name }}</strong>
                            </div>

                            <div class="guest-info-item">
                                <span>Location</span>
                                <strong>
                                    {% if venue.city %}{{ venue.city }}{% endif %}
                                    {% if venue.city and venue.district %}, {% endif %}
                                    {% if venue.district %}{{ venue.district }}{% endif %}
                                </strong>
                            </div>

                            {% if venue.max_guest_capacity %}
                                <div class="guest-info-item">
                                    <span>Venue Capacity</span>
                                    <strong>Up to {{ venue.max_guest_capacity }} guests</strong>
                                </div>
                            {% endif %}

                            <div class="d-grid gap-2 mt-3">
                                <a href="{% url 'expat_life:guest_host_venue_detail' venue.slug %}"
                                   class="btn btn-outline-dark rounded-pill fw-bold">
                                    <i class="bi bi-building-heart me-2"></i>
                                    Venue Details
                                </a>

                                <a href="{% url 'expat_life:foreigner_payment_center' %}"
                                   class="btn btn-outline-secondary rounded-pill fw-bold">
                                    <i class="bi bi-wallet2 me-2"></i>
                                    Payment Center
                                </a>
                            </div>
                        </div>
                    </div>


                    <div class="guest-host-side-card not-sticky">
                        <div class="guest-host-side-header">
                            <h3>How This Works</h3>
                            <p>
                                A simple booking flow before payment.
                            </p>
                        </div>

                        <div class="guest-host-side-body">
                            <ul class="guest-process-list">
                                <li>
                                    <i class="bi bi-1-circle-fill"></i>
                                    <span>Select event type, date, time, package, meals, and add-ons.</span>
                                </li>
                                <li>
                                    <i class="bi bi-2-circle-fill"></i>
                                    <span>We create or update your unpaid booking order for this venue.</span>
                                </li>
                                <li>
                                    <i class="bi bi-3-circle-fill"></i>
                                    <span>The total becomes a due payable item in your Guest Payment Center.</span>
                                </li>
                                <li>
                                    <i class="bi bi-4-circle-fill"></i>
                                    <span>After payment, the booking becomes confirmed and visible for coordination.</span>
                                </li>
                            </ul>
                        </div>
                    </div>


                    {% if venue.important_notes %}
                        <div class="guest-host-side-card not-sticky">
                            <div class="guest-host-side-header">
                                <h3>Important Venue Notes</h3>
                                <p>
                                    Please review before confirming your booking.
                                </p>
                            </div>

                            <div class="guest-host-side-body">
                                <div class="guest-info-item mb-0">
                                    <span>Notes</span>
                                    <strong style="white-space: pre-line;">{{ venue.important_notes }}</strong>
                                </div>
                            </div>
                        </div>
                    {% endif %}

                </div>

            </div>

        </div>
    </section>

</div>

{% endblock %}