@extends('super-admin.layout')

@section('title', 'Plans & features')

@section('content')
<div class="pg-head">
    <div>
        <h1>Plans &amp; features</h1>
        <p>Configure commercial plans, limits, and which features each plan includes.</p>
    </div>
</div>

<div class="card">
    <div class="tbl-wrap">
        <table class="data-tbl">
            <thead>
                <tr>
                    <th>Plan</th>
                    <th>Price</th>
                    <th>Limits</th>
                    <th>Features</th>
                    <th>Events</th>
                    <th>Status</th>
                    <th style="text-align:right">Actions</th>
                </tr>
            </thead>
            <tbody>
                @foreach($plans as $plan)
                    <tr>
                        <td>
                            <div class="cell-name">{{ $plan->name }}</div>
                            <div class="cell-sub mono">{{ $plan->code }}</div>
                        </td>
                        <td>{{ $plan->formattedPrice() }}</td>
                        <td class="cell-sub">
                            @if($plan->participant_limit)
                                {{ number_format($plan->participant_limit) }} pax ·
                                {{ $plan->session_limit }} sessions ·
                                {{ $plan->booth_limit }} booths
                            @else
                                Custom / unlimited
                            @endif
                        </td>
                        <td>{{ $plan->plan_features_count }} configured</td>
                        <td>{{ $plan->event_licenses_count }}</td>
                        <td>
                            <span class="status-pill {{ $plan->is_active ? 'success' : 'muted' }}">
                                {{ $plan->is_active ? 'Active' : 'Inactive' }}
                            </span>
                        </td>
                        <td>
                            <div class="action-group">
                                <a href="{{ route('mexco.super.plans.edit', $plan) }}" class="btn-outline btn-sm">Configure</a>
                            </div>
                        </td>
                    </tr>
                @endforeach
            </tbody>
        </table>
    </div>
</div>
@endsection
