{% extends 'base.html' %}

{% block content %}
<div class="container py-5">
    <h2>Search Results for "{{ query }}"</h2>
    {% if results %}
        <div class="row g-4">
            {% for result in results %}
                <div class="col-md-4">
                    <div class="card">
                        <div class="card-body">
                            <h5 class="card-title">{{ result.title }}</h5>
                            <p class="card-text">{{ result.description|truncatewords:30 }}</p>
                            <a href="#" class="btn btn-primary">View Details</a>
                        </div>
                    </div>
                </div>
            {% endfor %}
        </div>
    {% else %}
        <p>No results found for your search.</p>
    {% endif %}
</div>
{% endblock %}