{% if page_obj.has_previous or page_obj.has_next %}
    <nav aria-label="Page navigation" class="mt-4">
        <ul class="pagination justify-content-center">

            {# Helper to build the query string while excluding the 'page' parameter #}
            {% load url_extras %}

            {# Build a string of all current filters (e.g., &department=IT&type=FULL_TIME) #}
            {% add_get_params request.GET as filter_params %}
            {% with filter_params=filter_params %}

                {% if page_obj.has_previous %}

                    {# First Page Link #}
                    <li class="page-item">
                        <a class="page-link text-primary-theme"
                           href="?page=1{{ filter_params }}">
                           First
                        </a>
                    </li>

                    {# Previous Page Link #}
                    <li class="page-item">
                        <a class="page-link text-primary-theme"
                           href="?page={{ page_obj.previous_page_number }}{{ filter_params }}">
                           Previous
                        </a>
                    </li>
                {% endif %}

                {# Current Page Status - Use your teal/custom background class here #}
                <li class="page-item active" aria-current="page">
                    <span class="page-link bg-kaauh-teal text-white">
                        {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
                    </span>
                </li>

                {% if page_obj.has_next %}

                    {# Next Page Link #}
                    <li class="page-item">
                        <a class="page-link text-primary-theme"
                           href="?page={{ page_obj.next_page_number }}{{ filter_params }}">
                           Next
                        </a>
                    </li>

                    {# Last Page Link #}
                    <li class="page-item">
                        <a class="page-link text-primary-theme"
                           href="?page={{ page_obj.paginator.num_pages }}{{ filter_params }}">
                           Last
                        </a>
                    </li>
                {% endif %}

            {% endwith %}

        </ul>
    </nav>
{% endif %}