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

{% block title %}Home - Packs Site{% endblock %}

{% block content %}
<div class="home-hero">
    <div class="home-hero-inner">
        <h1>Packs Site</h1>
        <p>Hosted datapacks for Needs Of Nature &amp; Animation Director.</p>
        <p class="home-hero-sub">Browse and download packs shared by the community. Upload your own once you have a creator account.</p>
        <div class="home-hero-actions">
            <a href="{% url 'library:browse' %}" class="btn btn-primary"><i class="fas fa-search"></i> Browse packs</a>
            <a href="{% url 'library:project_create' %}" class="btn btn-secondary"><i class="fas fa-upload"></i> Upload a pack</a>
        </div>
    </div>
</div>

<div class="home-stats">
    <div class="stat-card">
        <i class="fas fa-users"></i>
        <span class="stat-value">{{ stats.creators }}</span>
        <span class="stat-label">Creators</span>
    </div>
    <div class="stat-card">
        <i class="fas fa-box-open"></i>
        <span class="stat-value">{{ stats.packs }}</span>
        <span class="stat-label">Packs</span>
    </div>
    <div class="stat-card">
        <i class="fas fa-download"></i>
        <span class="stat-value">{{ stats.downloads }}</span>
        <span class="stat-label">Downloads</span>
    </div>
    <div class="stat-card">
        <i class="fas fa-tag"></i>
        <span class="stat-value">{{ stats.versions }}</span>
        <span class="stat-label">Versions</span>
    </div>
</div>

<div class="home-section">
    <div class="home-section-header">
        <h2>Latest packs</h2>
        <a href="{% url 'library:browse' %}" class="home-section-link">View all <i class="fas fa-arrow-right"></i></a>
    </div>

    <div class="pack-grid">
        {% for project in latest_projects %}
            {% include 'library/_project_card.html' %}
        {% empty %}
            <div class="pack-card pack-card-empty">
                <div class="pack-card-thumb">
                    <i class="fas fa-box-open"></i>
                </div>
                <div class="pack-card-body">
                    <h3>No packs yet</h3>
                    <p class="pack-card-desc">Be the first to share a pack.</p>
                </div>
            </div>
        {% endfor %}
    </div>
</div>
{% endblock %}
