@extends('layouts.app')
@section('title', 'Wellness Plans')

@section('css')
@include('vetClinic::partials._mobile_responsive')
@endsection

@section('content')
<section class="content-header">
    <h1><i class="fa fa-heart"></i> Wellness Plans <small>Recurring health-plan subscriptions</small></h1>
</section>
<section class="content">

    <div class="alert alert-info" style="font-size:13px;">
        Subscribing a pet creates a recurring transaction on the core engine.
        The existing <code>pos:generateSubscriptionInvoices</code> cron issues monthly/annual invoices automatically.
    </div>

    @if($plans->isEmpty())
        <div class="callout callout-warning"><h4>No plans yet</h4>
            <p>Create one via <code>POST /vet-clinic/wellness/plans</code>.</p>
        </div>
    @else
    <div class="row">
        @foreach($plans as $p)
            <div class="col-md-4">
                <div class="box box-solid">
                    <div class="box-header with-border"><h3 class="box-title">{{ $p->name }}</h3></div>
                    <div class="box-body">
                        @if($p->description)<p>{{ $p->description }}</p>@endif
                        <p>
                            @if($p->price_monthly)<strong>{{ number_format($p->price_monthly, 2) }}</strong>/mo<br>@endif
                            @if($p->price_annual)<strong>{{ number_format($p->price_annual, 2) }}</strong>/yr@endif
                        </p>
                        <hr style="margin:8px 0;">
                        <strong style="font-size:11px;">Benefits</strong>
                        <ul style="padding-left:18px;font-size:12px;">
                            @foreach($p->benefits as $b)
                                <li>
                                    <strong>{{ $b->label }}</strong>
                                    <span class="text-muted">— {{ $b->kind }}
                                        @if($b->quantity_per_year) · {{ $b->quantity_per_year }}/yr @endif
                                        @if($b->value) · {{ $b->value }} @endif
                                    </span>
                                </li>
                            @endforeach
                        </ul>
                    </div>
                </div>
            </div>
        @endforeach
    </div>
    @endif

</section>
@endsection
