<div class="card bg-base-100 shadow-xl border border-base-300 hover:shadow-lg folder-card" data-id="{{ folder.id }}">
    <div class="card-body" data-loading-states>
        <div class="flex justify-between items-start mb-2">
            <h3 class="text-xl font-bold truncate flex-grow">{{ folder.name }}</h3>
            <div class="flex space-x-2">
                <button class="btn btn-sm btn-outline"
                        hx-get="/api/folders/{{ folder.id }}/edit"
                        hx-target="#modal-holder"
                        hx-swap="innerHTML"
                        hx-trigger="click"
                        data-loading-disable
                        >
                    <i class="fas fa-edit" data-loading-class="!hidden"></i>
                    <span class="loading loading-spinner loading-xs hidden" data-loading-class-remove="hidden"></span>
                </button>
                <button class="btn btn-sm btn-outline btn-error fade-me-out delete-button"
                        hx-delete="/api/folders/{{ folder.id }}"
                        hx-swap="outerhtml settle:300ms"
                        hx-confirm="Are you sure you want to delete this folder?"
                        data-loading-disable
                        >
                    <i class="fas fa-trash" data-loading-class="!hidden"></i>
                    <span class="loading loading-spinner loading-xs hidden" data-loading-class-remove="hidden"></span>
                </button>
            </div>
        </div>
        
        <!-- Priority badge -->
        <div class="flex flex-wrap justify-between items-center mb-2 gap-1">
            <div class="flex flex-wrap gap-1">
                {% block badges %}{% endblock %}
            </div>
            {% if folder.priority == 1 %}
                <span class="badge badge-error">High Priority</span>
            {% elif folder.priority == -1 %}
                <span class="badge badge-info">Low Priority</span>
            {% else %}
                <span class="badge badge-primary">Normal Priority</span>
            {% endif %}
        </div>
 
        <div class="bg-base-200 rounded-box p-4 mb-4">
            <p class="text-base-content/80">{{ folder.rule_text }}</p>
        </div>
        
        <div class="flex justify-between items-center mt-2">
            <div class="flex items-center space-x-2">
                <span class="text-xs">Type:</span>
                <select
                    class="select select-bordered select-xs"
                    hx-put="/api/folders/{{ folder.id }}/type"
                    hx-swap="outerHTML settle:300ms"
                    hx-include="this"
                    name="folder_type"
                    data-loading-disable >
                    <option value="tidy" {% if folder.folder_type == 'tidy' %}selected{% endif %}>Tidy</option>
                    <option value="destination" {% if folder.folder_type == 'destination' %}selected{% endif %}>Destination</option>
                    <option value="ignore" {% if folder.folder_type == 'ignore' %}selected{% endif %}>Ignore</option>
                </select>
            </div>
        </div>
    </div>
</div>