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

{% block content %}
<div class="container mt-5">
    <h1 class="mb-4">Ad Generation Tool</h1>

    <div class="row">
        <div class="col-md-6">
            <div class="card">
                <div class="card-body">
                    <h5 class="card-title">Enter Product Details</h5>
                    <form method="post">
                        {% csrf_token %}
                        <div class="mb-3">
                            <label for="product_name" class="form-label">Product Name</label>
                            <input type="text" class="form-control" id="product_name" name="product_name" required>
                        </div>
                        <div class="mb-3">
                            <label for="product_description" class="form-label">Product Description</label>
                            <textarea class="form-control" id="product_description" name="product_description" rows="3" required></textarea>
                        </div>
                        <div class="mb-3">
                            <label for="target_audience" class="form-label">Target Audience</label>
                            <input type="text" class="form-control" id="target_audience" name="target_audience" required>
                        </div>
                        <button type="submit" class="btn btn-primary">Generate Ad</button>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-md-6">
            <div class="card">
                <div class="card-body">
                    <h5 class="card-title">Generated Ad Creative</h5>
                    {% if ad_copy and ad_image_url %}
                        <div class="card">
                            <img src="{{ ad_image_url }}" class="card-img-top" alt="Generated Ad Image">
                            <div class="card-body">
                                <h5 class="card-title">Ad Copy</h5>
                                <p class="card-text">{{ ad_copy }}</p>
                            </div>
                        </div>
                    {% else %}
                        <p>Your generated ad creative will appear here.</p>
                    {% endif %}
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
