{% extends "superadmin/base_superadmin.html" %}

{% block title %}Bulk Actions - Superadmin{% endblock %}

{% block content %}
<div class="space-y-6">
    <!-- Page Header -->
    <div class="border-b border-gray-200 pb-4">
        <h1 class="text-2xl font-bold text-gray-900">Bulk Actions</h1>
        <p class="text-gray-600 mt-1">Perform bulk operations on system data</p>
    </div>

    <!-- Warning Notice -->
    <div class="bg-red-50 border border-red-200 rounded-lg p-4">
        <div class="flex items-center">
            <i class="fas fa-exclamation-triangle text-red-600 mr-3"></i>
            <div>
                <h4 class="text-sm font-medium text-red-900">Warning</h4>
                <p class="text-sm text-red-700 mt-1">
                    Bulk actions affect multiple records simultaneously and cannot be undone. 
                    Please review carefully before proceeding.
                </p>
            </div>
        </div>
    </div>

    <!-- Bulk Actions Grid -->
    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
        <!-- Member Management -->
        <div class="bg-white shadow rounded-lg">
            <div class="px-6 py-4 border-b border-gray-200">
                <h3 class="text-lg font-medium text-gray-900">
                    <i class="fas fa-users text-blue-600 mr-2"></i>Member Management
                </h3>
            </div>
            <div class="p-6">
                <div class="space-y-4">
                    <form method="POST" class="space-y-4">
                        <div class="bg-blue-50 border border-blue-200 rounded-lg p-4">
                            <div class="flex items-center">
                                <i class="fas fa-key text-blue-600 mr-3"></i>
                                <div>
                                    <h4 class="text-sm font-medium text-blue-900">Reset Member Passwords</h4>
                                    <p class="text-sm text-blue-700 mt-1">Reset all member passwords to default (1234)</p>
                                </div>
                            </div>
                        </div>
                        
                        <button type="submit" name="action" value="reset_passwords" 
                                class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-3 px-4 rounded-lg transition-colors"
                                onclick="return confirm('Are you sure you want to reset ALL member passwords? This action cannot be undone.')">
                            <i class="fas fa-unlock-alt mr-2"></i>Reset All Member Passwords
                        </button>
                    </form>
                    
                    <form method="POST">
                        <div class="bg-yellow-50 border border-yellow-200 rounded-lg p-4">
                            <div class="flex items-center">
                                <i class="fas fa-user-slash text-yellow-600 mr-3"></i>
                                <div>
                                    <h4 class="text-sm font-medium text-yellow-900">Deactivate Inactive Members</h4>
                                    <p class="text-sm text-yellow-700 mt-1">Deactivate members with no activity for 90+ days</p>
                                </div>
                            </div>
                        </div>
                        
                        <button type="submit" name="action" value="deactivate_inactive_members" 
                                class="w-full bg-yellow-600 hover:bg-yellow-700 text-white font-medium py-3 px-4 rounded-lg transition-colors mt-4"
                                onclick="return confirm('Are you sure you want to deactivate inactive members? This will disable their accounts.')">
                            <i class="fas fa-user-times mr-2"></i>Deactivate Inactive Members
                        </button>
                    </form>
                </div>
            </div>
        </div>

        <!-- Group Management -->
        <div class="bg-white shadow rounded-lg">
            <div class="px-6 py-4 border-b border-gray-200">
                <h3 class="text-lg font-medium text-gray-900">
                    <i class="fas fa-building text-green-600 mr-2"></i>Group Management
                </h3>
            </div>
            <div class="p-6">
                <div class="space-y-4">
                    <form method="POST">
                        <div class="bg-green-50 border border-green-200 rounded-lg p-4">
                            <div class="flex items-center">
                                <i class="fas fa-check-circle text-green-600 mr-3"></i>
                                <div>
                                    <h4 class="text-sm font-medium text-green-900">Activate All Groups</h4>
                                    <p class="text-sm text-green-700 mt-1">Activate all currently inactive groups</p>
                                </div>
                            </div>
                        </div>
                        
                        <button type="submit" name="action" value="activate_all_groups" 
                                class="w-full bg-green-600 hover:bg-green-700 text-white font-medium py-3 px-4 rounded-lg transition-colors mt-4"
                                onclick="return confirm('Are you sure you want to activate all groups?')">
                            <i class="fas fa-play-circle mr-2"></i>Activate All Groups
                        </button>
                    </form>
                    
                    <div class="bg-gray-50 border border-gray-200 rounded-lg p-4">
                        <div class="flex items-center">
                            <i class="fas fa-database text-gray-600 mr-3"></i>
                            <div>
                                <h4 class="text-sm font-medium text-gray-900">Export All Groups</h4>
                                <p class="text-sm text-gray-700 mt-1">Export complete group data with members</p>
                            </div>
                        </div>
                    </div>
                    
                    <button class="w-full bg-gray-600 hover:bg-gray-700 text-white font-medium py-3 px-4 rounded-lg transition-colors">
                        <i class="fas fa-download mr-2"></i>Export Group Data
                    </button>
                </div>
            </div>
        </div>
    </div>

    <!-- Data Management -->
    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
        <!-- Contribution Management -->
        <div class="bg-white shadow rounded-lg">
            <div class="px-6 py-4 border-b border-gray-200">
                <h3 class="text-lg font-medium text-gray-900">
                    <i class="fas fa-coins text-purple-600 mr-2"></i>Contribution Management
                </h3>
            </div>
            <div class="p-6">
                <div class="space-y-4">
                    <div class="bg-purple-50 border border-purple-200 rounded-lg p-4">
                        <div class="flex items-center">
                            <i class="fas fa-file-export text-purple-600 mr-3"></i>
                            <div>
                                <h4 class="text-sm font-medium text-purple-900">Export All Contributions</h4>
                                <p class="text-sm text-purple-700 mt-1">Export complete contribution history</p>
                            </div>
                        </div>
                    </div>
                    
                    <button class="w-full bg-purple-600 hover:bg-purple-700 text-white font-medium py-3 px-4 rounded-lg transition-colors">
                        <i class="fas fa-download mr-2"></i>Export Contributions
                    </button>
                    
                    <div class="bg-orange-50 border border-orange-200 rounded-lg p-4">
                        <div class="flex items-center">
                            <i class="fas fa-chart-bar text-orange-600 mr-3"></i>
                            <div>
                                <h4 class="text-sm font-medium text-orange-900">Recalculate Balances</h4>
                                <p class="text-sm text-orange-700 mt-1">Recalculate all member balances</p>
                            </div>
                        </div>
                    </div>
                    
                    <button class="w-full bg-orange-600 hover:bg-orange-700 text-white font-medium py-3 px-4 rounded-lg transition-colors">
                        <i class="fas fa-calculator mr-2"></i>Recalculate Balances
                    </button>
                </div>
            </div>
        </div>

        <!-- System Maintenance -->
        <div class="bg-white shadow rounded-lg">
            <div class="px-6 py-4 border-b border-gray-200">
                <h3 class="text-lg font-medium text-gray-900">
                    <i class="fas fa-tools text-red-600 mr-2"></i>System Maintenance
                </h3>
            </div>
            <div class="p-6">
                <div class="space-y-4">
                    <div class="bg-red-50 border border-red-200 rounded-lg p-4">
                        <div class="flex items-center">
                            <i class="fas fa-trash-alt text-red-600 mr-3"></i>
                            <div>
                                <h4 class="text-sm font-medium text-red-900">Clear System Logs</h4>
                                <p class="text-sm text-red-700 mt-1">Clear all system logs and temporary data</p>
                            </div>
                        </div>
                    </div>
                    
                    <button class="w-full bg-red-600 hover:bg-red-700 text-white font-medium py-3 px-4 rounded-lg transition-colors"
                            onclick="return confirm('Are you sure you want to clear all system logs? This action cannot be undone.')">
                        <i class="fas fa-broom mr-2"></i>Clear System Logs
                    </button>
                    
                    <div class="bg-indigo-50 border border-indigo-200 rounded-lg p-4">
                        <div class="flex items-center">
                            <i class="fas fa-sync-alt text-indigo-600 mr-3"></i>
                            <div>
                                <h4 class="text-sm font-medium text-indigo-900">Refresh Database</h4>
                                <p class="text-sm text-indigo-700 mt-1">Refresh database connections and cache</p>
                            </div>
                        </div>
                    </div>
                    
                    <button class="w-full bg-indigo-600 hover:bg-indigo-700 text-white font-medium py-3 px-4 rounded-lg transition-colors">
                        <i class="fas fa-sync mr-2"></i>Refresh Database
                    </button>
                </div>
            </div>
        </div>
    </div>

    <!-- Action History -->
    <div class="bg-white shadow rounded-lg">
        <div class="px-6 py-4 border-b border-gray-200">
            <h3 class="text-lg font-medium text-gray-900">
                <i class="fas fa-history text-gray-600 mr-2"></i>Recent Bulk Actions
            </h3>
        </div>
        <div class="p-6">
            <div class="text-center py-8">
                <i class="fas fa-clipboard-list text-6xl text-gray-400 mb-4"></i>
                <h3 class="text-lg font-medium text-gray-900">No Recent Actions</h3>
                <p class="text-sm text-gray-500 mt-2">Bulk actions performed will be logged here</p>
            </div>
        </div>
    </div>
</div>
{% endblock %}