{% extends 'base.html' %}

{% block content %}
<div class="container mt-5">
    <div class="row justify-content-center">
        <div class="col-lg-8">
            <div class="mb-4">
                <a href="{% url 'course_edit' module.course.pk %}" class="text-dark text-decoration-none text-uppercase fw-bold">
                    <i class="bi bi-arrow-left"></i> Back to Course
                </a>
            </div>
            
            <h1 class="display-5 fw-bold text-uppercase mb-4">Lesson Management</h1>
            <p class="text-muted mb-4">Module: <strong>{{ module.title }}</strong></p>
            
            <div class="card border-2 rounded-0 shadow-sm">
                <div class="card-body p-4">
                    <form method="POST">
                        {% csrf_token %}
                        {% for field in form %}
                        <div class="mb-4">
                            <label class="form-label fw-bold text-uppercase small">{{ field.label }}</label>
                            {{ field }}
                            {% if field.errors %}
                            <div class="text-danger small mt-1">{{ field.errors }}</div>
                            {% endif %}
                        </div>
                        {% endfor %}
                        <button type="submit" class="btn btn-dark btn-lg w-100 rounded-0 border-2">Save Lesson</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
