{% load static %}

<div class="container">
    <div class="navbar navbar-expand-lg bg-body-secondary">
        <div class="container">
            <a href="#" class="navbar-brand">
                <img src="{% static '/images/pyrss_logo.webp' %}" alt="Logo" width="50" class="d-inline-block">
            </a>
            <button type="button" class="navbar-toggler" data-bs-toggle="offcanvas" data-bs-target="#navCollapse" aria-controls="navCollapse" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div id="navCollapse" class="offcanvas offcanvas-end" tabindex="-1" aria-labelledby="navCollapseLabel">
                <div class="offcanvas-header">
                    <h5 id="navCollapseLabel" class="offcanvas-title">PYRSS</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
                </div>
                <div class="offcanvas-body">
                    <ul class="navbar-nav justify-content-end flex-grow-1 pe-3 align-items-center">
                        <li class="nav-item">
                            <a href="#" id="themeToggle" class="me-3 text-body">
                                <i class="bi bi-sun"></i>
                            </a>
                        </li>
                        <li class="nav-item">
                            <div class="dropdown">
                                <button type="button" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
                                    <img src="{{ request.user.avatar_url }}" alt="User Icon" width="30" class="rounded-circle me-2">
                                    <span>{{ request.user.global_name }}</span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li>
                                        {% comment %}<!-- Logout can only be post to -->{% endcomment %}
                                        <form action="/logout/" method="post" class="m-0">
                                            {% csrf_token %}
                                            <button type="submit" class="dropdown-item">Logout</button>
                                        </form>
                                    </li>
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>