<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}Nature In Pots Community{% endblock %}</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }
        main {
            flex: 1;
        }
        footer {
            background-color: #f8f9fa;
            padding: 1rem 0;
            text-align: center;
        }
    </style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light mb-4">
    <div class="container">
        <a class="navbar-brand" href="{{ url_for('core_ui.home') }}">Nature In Pots</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 me-auto">
                <li class="nav-item"><a class="nav-link" href="{{ url_for('core_ui.home') }}">Home</a></li>
                <li class="nav-item"><a class="nav-link" href="{{ url_for('plant.index') }}">Plants</a></li>
                <li class="nav-item"><a class="nav-link" href="{{ url_for('importer.upload') }}">Import</a></li>
                  {% if current_user.is_authenticated and current_user.role == 'admin' %}
                    <li class="nav-item"><a class="nav-link text-danger" href="{{ url_for('admin.admin_dashboard') }}">Admin Dashboard</a></li>
                {% endif %}
                {% block plugin_links %}{% endblock %}
            </ul>
            <ul class="navbar-nav align-items-center">
                {% if current_user.is_authenticated %}
                    <li class="nav-item ms-3">
                        <a class="nav-link" href="{{ url_for('auth.logout') }}">Logout</a>
                    </li>
                {% else %}
                    <li class="nav-item ms-3"><a class="nav-link" href="{{ url_for('auth.login') }}">Login</a></li>
                    <li class="nav-item"><a class="nav-link" href="{{ url_for('auth.register') }}">Register</a></li>
                {% endif %}
            </ul>
        </div>
    </div>
</nav>
<main class="container">
    {% with messages = get_flashed_messages() %}
        {% if messages %}
            <div class="alert alert-warning">
                {% for message in messages %}
                    <div>{{ message }}</div>
                {% endfor %}
            </div>
        {% endif %}
    {% endwith %}
    {% block content %}{% endblock %}
</main>
<footer>
    &copy; {{ current_year | default(2025) }} Nature In Pots Community. All rights reserved.
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
