{% macro header(title, description="", button_text="", button_url="", icon="fa-folder", button_class="", button_icon="fa-plus", button_style="", buttons=None) %}
<header class="py-4">
    <div class="container-fluid">
        <div class="d-flex justify-content-between align-items-center">
            <div>
                <h3 class="mb-0">
                    <i class="fas {{ icon }} me-2" style="color: var(--primary-color);"></i>
                    {{ title }}
                </h3>
                {% if description %}
                    <p class="text-muted mb-0 mt-2 small">{{ description }}</p>
                {% endif %}
            </div>
            <div class="d-flex gap-2">
                {% if buttons %}
                    {% for button in buttons %}
                        {% if button.url == "#" %}
                            <button id="{{ button.id if button.id else '' }}"
                                    class="btn {{ button.class if button.class else '' }}" 
                                    style="{{ 'background-color: var(--primary-color); color: white;' if not button.class else '' }}{{ '; ' + button.style if button.style else '' }}"
                                    onclick="{{ button.onclick if button.onclick else '' }}">
                                {% if button.icon %}
                                    <i class="fas {{ button.icon }} me-1"></i>
                                {% endif %}
                                {{ button.text }}
                            </button>
                        {% else %}
                            <button onclick="window.location.href='{{ button.url }}'" 
                                    class="btn {{ button.class if button.class else '' }}" 
                                    style="{{ 'background-color: var(--primary-color); color: white;' if not button.class else '' }}{{ '; ' + button.style if button.style else '' }}">
                                {% if button.icon %}
                                    <i class="fas {{ button.icon }} me-1"></i>
                                {% endif %}
                                {{ button.text }}
                            </button>
                        {% endif %}
                    {% endfor %}
                {% elif button_text and button_url %}
                    {% if button_url == "#" %}
                        <button id="emptyTrashBtn"
                                class="btn {{ button_class if button_class else '' }}" 
                                style="{{ 'background-color: var(--primary-color); color: white;' if not button_class else '' }}{{ '; ' + button_style if button_style else '' }}"
                                onclick="showEmptyTrashModal()">
                            {% if button_icon %}
                                <i class="fas {{ button_icon }} me-1"></i>
                            {% endif %}
                            {{ button_text }}
                        </button>
                    {% else %}
                        <button onclick="window.location.href='{{ button_url }}'" 
                                class="btn {{ button_class if button_class else '' }}" 
                                style="{{ 'background-color: var(--primary-color); color: white;' if not button_class else '' }}{{ '; ' + button_style if button_style else '' }}">
                            {% if button_icon %}
                                <i class="fas {{ button_icon }} me-1"></i>
                            {% endif %}
                            {{ button_text }}
                        </button>
                    {% endif %}
                {% endif %}
            </div>
        </div>
    </div>
</header>
{% endmacro %} 