@extends('super-admin.layout')

@section('title', 'Feature catalogue')

@section('content')
<div class="pg-head">
    <div>
        <h1>Feature catalogue</h1>
        <p>Platform features referenced by plans, add-ons, and event entitlements.</p>
    </div>
</div>

@foreach($features as $category => $items)
    <div class="card section-card mb-3">
        <h2 style="text-transform:capitalize">{{ str_replace('_', ' ', $category) }}</h2>
        <div class="tbl-wrap">
            <table class="data-tbl">
                <thead>
                    <tr>
                        <th>Feature</th>
                        <th>Code</th>
                        <th>Plans</th>
                        <th>Status</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach($items as $feature)
                        <tr>
                            <td class="cell-name">{{ $feature->name }}</td>
                            <td class="mono cell-sub">{{ $feature->code }}</td>
                            <td>{{ $feature->plan_features_count }}</td>
                            <td>
                                <span class="status-pill {{ $feature->is_active ? 'success' : 'muted' }}">
                                    {{ $feature->is_active ? 'Active' : 'Inactive' }}
                                </span>
                            </td>
                        </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
    </div>
@endforeach
@endsection
