<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}FlowBot | Facebook Automation{% endblock %}</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    {% load static %}
    <link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
    {% block head %}{% endblock %}
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark sticky-top">
        <div class="container">
            <a class="navbar-brand fw-bold" href="{% url 'home' %}">
                <span class="text-coral">Flow</span>Bot
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav ms-auto">
                    {% if user.is_authenticated %}
                        <li class="nav-item"><a class="nav-link" href="{% url 'dashboard' %}">Dashboard</a></li>
                        <li class="nav-item"><a class="nav-link" href="{% url 'fanpage_list' %}">Fanpages</a></li>
                        <li class="nav-item"><a class="nav-link" href="{% url 'flow_list' %}">Flows</a></li>
                        <li class="nav-item"><a class="nav-link text-coral" href="/admin/">Admin</a></li>
                        <li class="nav-item">
                            <form action="{% url 'admin:logout' %}" method="post" class="d-inline">
                                {% csrf_token %}
                                <button type="submit" class="nav-link btn btn-link py-0">Logout</button>
                            </form>
                        </li>
                    {% else %}
                        <li class="nav-item"><a class="nav-link" href="/admin/login/">Login</a></li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>

    {% block content %}{% endblock %}

    <footer class="py-4 mt-5 bg-indigo text-white-50">
        <div class="container text-center">
            <p class="mb-0">&copy; 2026 FlowBot Automation. Built with Django & Love.</p>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    {% block scripts %}{% endblock %}
</body>
</html>