{% extends 'hosting_app/base_hosting.html' %}
{% load static %}

{% block title %}Delete Gallery Image | Host in Sri Lanka{% endblock %}

{% block content %}

<style>
    /* =========================================================
       HOST VENUE GALLERY DELETE CONFIRM — PREMIUM
    ========================================================= */

    .hosting-delete-page {
        min-height: 100vh;
        padding: 4rem 0 5rem;
        background:
            radial-gradient(circle at top left, rgba(255, 193, 7, 0.12), transparent 28%),
            radial-gradient(circle at top right, rgba(220, 38, 38, 0.10), transparent 32%),
            linear-gradient(180deg, #fffaf5 0%, #fff4e8 42%, #ffffff 100%);
    }

    .hosting-delete-shell {
        max-width: 920px;
        margin: 0 auto;
    }

    .hosting-delete-hero {
        position: relative;
        overflow: hidden;
        border-radius: 38px;
        padding: 2.6rem 2.4rem;
        margin-bottom: 2rem;
        color: #ffffff;
        background:
            radial-gradient(circle at top right, rgba(255, 211, 107, 0.20), transparent 32%),
            linear-gradient(135deg, #2d1716 0%, #743129 56%, #991b1b 100%);
        box-shadow: 0 30px 68px rgba(58, 30, 24, 0.20);
    }

    .hosting-delete-hero::before {
        content: "";
        position: absolute;
        top: -110px;
        right: -85px;
        width: 300px;
        height: 300px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.07);
        pointer-events: none;
    }

    .hosting-delete-hero::after {
        content: "";
        position: absolute;
        bottom: -150px;
        left: -110px;
        width: 360px;
        height: 360px;
        border-radius: 50%;
        background: rgba(255, 193, 7, 0.10);
        pointer-events: none;
    }

    .hosting-delete-hero-inner {
        position: relative;
        z-index: 2;
    }

    .hosting-delete-kicker {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.52rem 1rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.14);
        border: 1px solid rgba(255, 255, 255, 0.22);
        color: #ffe7aa;
        font-size: 0.84rem;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 1rem;
    }

    .hosting-delete-hero h1 {
        font-size: clamp(2.1rem, 4vw, 3.35rem);
        font-weight: 950;
        line-height: 1.12;
        letter-spacing: -0.045em;
        margin-bottom: 0.75rem;
    }

    .hosting-delete-hero p {
        max-width: 780px;
        margin-bottom: 0;
        color: rgba(255, 255, 255, 0.88);
        font-size: 1.03rem;
        line-height: 1.8;
    }

    .hosting-delete-card {
        border-radius: 34px;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid rgba(239, 226, 211, 0.95);
        box-shadow: 0 24px 56px rgba(58, 30, 24, 0.10);
        overflow: hidden;
    }

    .hosting-delete-card-header {
        padding: 1.55rem 1.7rem 1.1rem;
        border-bottom: 1px solid #efe2d3;
        background:
            radial-gradient(circle at top right, rgba(220, 38, 38, 0.06), transparent 28%),
            linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
    }

    .hosting-delete-card-header h2 {
        color: #2d1716;
        font-weight: 950;
        margin-bottom: 0.35rem;
    }

    .hosting-delete-card-header p {
        color: #7a655d;
        margin-bottom: 0;
        line-height: 1.65;
    }

    .hosting-delete-card-body {
        padding: 1.7rem;
    }

    .hosting-delete-preview {
        display: grid;
        grid-template-columns: 320px 1fr;
        gap: 1.5rem;
        align-items: stretch;
    }

    .hosting-delete-image-wrap {
        border-radius: 28px;
        overflow: hidden;
        background: #fff4e4;
        border: 1px solid #efe2d3;
        min-height: 260px;
    }

    .hosting-delete-image-wrap img {
        width: 100%;
        height: 100%;
        min-height: 260px;
        object-fit: cover;
        display: block;
    }

    .hosting-delete-info {
        border-radius: 28px;
        background: #fffaf5;
        border: 1px solid #efe2d3;
        padding: 1.4rem;
    }

    .hosting-delete-info h3 {
        color: #2d1716;
        font-weight: 950;
        margin-bottom: 0.7rem;
    }

    .hosting-delete-info p {
        color: #6f5b53;
        line-height: 1.75;
        margin-bottom: 1rem;
    }

    .hosting-delete-meta {
        display: grid;
        gap: 0.75rem;
        margin-top: 1rem;
    }

    .hosting-delete-meta-item {
        border-radius: 18px;
        background: #ffffff;
        border: 1px solid #efe2d3;
        padding: 0.9rem 1rem;
    }

    .hosting-delete-meta-item span {
        display: block;
        color: #7a655d;
        font-size: 0.76rem;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 0.25rem;
    }

    .hosting-delete-meta-item strong {
        color: #2d1716;
        font-weight: 900;
    }

    .hosting-delete-warning {
        margin-top: 1.5rem;
        border-radius: 24px;
        padding: 1.1rem 1.2rem;
        background: #fef2f2;
        border: 1px solid #fecaca;
        color: #991b1b;
        line-height: 1.7;
        font-weight: 650;
    }

    .hosting-delete-warning strong {
        color: #7f1d1d;
    }

    .hosting-delete-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
        padding: 1.3rem 1.7rem;
        border-top: 1px solid #efe2d3;
        background: #fffaf5;
    }

    .hosting-delete-actions .btn {
        border-radius: 999px;
        font-weight: 850;
        min-height: 50px;
        padding: 0.82rem 1.4rem;
    }

    .hosting-delete-btn {
        background: linear-gradient(135deg, #7f1d1d, #dc2626);
        color: #ffffff;
        border: none;
        box-shadow: 0 14px 28px rgba(220, 38, 38, 0.20);
    }

    .hosting-delete-btn:hover {
        color: #ffffff;
        background: linear-gradient(135deg, #991b1b, #ef4444);
        transform: translateY(-2px);
    }

    .hosting-cancel-btn {
        background: #ffffff;
        color: #2d1716;
        border: 1px solid #d8bfa3;
    }

    .hosting-cancel-btn:hover {
        background: #fff4e4;
        color: #2d1716;
    }

    @media (max-width: 991.98px) {
        .hosting-delete-page {
            padding-top: 2.8rem;
        }

        .hosting-delete-hero {
            padding: 2rem 1.45rem;
            border-radius: 30px;
        }

        .hosting-delete-preview {
            grid-template-columns: 1fr;
        }

        .hosting-delete-image-wrap img,
        .hosting-delete-image-wrap {
            min-height: 320px;
        }
    }

    @media (max-width: 767.98px) {
        .hosting-delete-card-body,
        .hosting-delete-card-header,
        .hosting-delete-actions {
            padding-left: 1.15rem;
            padding-right: 1.15rem;
        }

        .hosting-delete-actions {
            flex-direction: column-reverse;
            align-items: stretch;
        }

        .hosting-delete-actions .btn {
            width: 100%;
        }

        .hosting-delete-image-wrap img,
        .hosting-delete-image-wrap {
            min-height: 240px;
        }
    }
</style>


<section class="hosting-delete-page">
    <div class="container">
        <div class="hosting-delete-shell">

            <!-- HERO -->
            <div class="hosting-delete-hero">
                <div class="hosting-delete-hero-inner">

                    <span class="hosting-delete-kicker">
                        <i class="bi bi-trash3-fill"></i>
                        Confirm Delete
                    </span>

                    <h1>Delete Gallery Image?</h1>

                    <p>
                        You are about to remove an image from the gallery of
                        <strong>{{ venue.venue_name }}</strong>. This action cannot be undone.
                    </p>

                </div>
            </div>


            <!-- CARD -->
            <div class="hosting-delete-card">

                <div class="hosting-delete-card-header">
                    <h2>Review Image Before Deleting</h2>
                    <p>
                        Please confirm that this is the image you want to remove from the venue gallery.
                    </p>
                </div>

                <div class="hosting-delete-card-body">

                    <div class="hosting-delete-preview">

                        <div class="hosting-delete-image-wrap">
                            {% if gallery_image.image %}
                                <img src="{{ gallery_image.image.url }}"
                                     alt="{{ gallery_image.caption|default:venue.venue_name }}">
                            {% endif %}
                        </div>

                        <div class="hosting-delete-info">
                            <h3>{{ venue.venue_name }}</h3>

                            <p>
                                {% if gallery_image.caption %}
                                    {{ gallery_image.caption }}
                                {% else %}
                                    This gallery image does not have a caption.
                                {% endif %}
                            </p>

                            <div class="hosting-delete-meta">

                                <div class="hosting-delete-meta-item">
                                    <span>Display Order</span>
                                    <strong>{{ gallery_image.display_order }}</strong>
                                </div>

                                <div class="hosting-delete-meta-item">
                                    <span>Uploaded Date</span>
                                    <strong>{{ gallery_image.created_at|date:"M d, Y" }}</strong>
                                </div>

                                <div class="hosting-delete-meta-item">
                                    <span>Venue Category</span>
                                    <strong>
                                        {% if venue.venue_category %}
                                            {{ venue.get_venue_category_display }}
                                        {% else %}
                                            Host Venue
                                        {% endif %}
                                    </strong>
                                </div>

                                <div class="hosting-delete-meta-item">
                                    <span>Location</span>
                                    <strong>
                                        {% if venue.city or venue.district %}
                                            {{ venue.city }}{% if venue.city and venue.district %}, {% endif %}{{ venue.district }}
                                        {% else %}
                                            Not provided
                                        {% endif %}
                                    </strong>
                                </div>

                            </div>
                        </div>

                    </div>

                    <div class="hosting-delete-warning">
                        <strong>Warning:</strong>
                        Once deleted, this image will be permanently removed from this venue gallery.
                        You will need to upload it again if you want to use it later.
                    </div>

                </div>

                <div class="hosting-delete-actions">

                    <a href="{% url 'hosting_app:host_venue_gallery_manage' venue.slug %}"
                       class="btn hosting-cancel-btn">
                        <i class="bi bi-arrow-left-circle me-2"></i>
                        Cancel & Go Back
                    </a>

                    <form method="post">
                        {% csrf_token %}
                        <button type="submit" class="btn hosting-delete-btn">
                            <i class="bi bi-trash3-fill me-2"></i>
                            Yes, Delete Image
                        </button>
                    </form>

                </div>

            </div>

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

{% endblock %}