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

{% block title %}AI Task Manager - Kanban Board{% endblock %}

{% block content %}
<div class="hero-section text-center py-5">
    <h1 class="display-4">Kanban Board</h1>
    <p class="lead">Visualize your tasks and track progress.</p>
</div>

<div class="kanban-board-container">
    <div class="kanban-board">
        {% for status_value, status_display in status_choices %}
        <div class="kanban-column">
            <h2 class="h5 p-3 bg-light border-bottom">{{ status_display }}</h2>
            <div class="kanban-cards p-3">
                {% for item in tasks_by_status|get_item:status_value %}
                <div class="card kanban-card mb-3 shadow-sm">
                    <div class="card-body">
                        <h5 class="card-title h6">{{ item.title }}</h5>
                        <p class="card-text small">{{ item.description|default:""|truncatewords:15 }}</p>
                        {% if item.tags %}
                            <div class="tags">
                                {% for tag in item.tags.split|slice:":3" %}
                                    <span class="badge bg-secondary">{{ tag }}</span>
                                {% endfor %}
                            </div>
                        {% endif %}
                    </div>
                </div>
                {% empty %}
                <div class="text-center text-muted p-3">No tasks in this stage.</div>
                {% endfor %}
            </div>
        </div>
        {% endfor %}
    </div>
</div>
{% endblock %}
