<?php

declare(strict_types=1);

use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Statistics;

/** @var Statistics $stats */
?>

<h4 class="border-bottom p-2 mb-4">
    <?= I18N::translate('Total individuals') ?>
    <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalIndividuals() ?></span>
</h4>

<div class="row mb-3 row-cols-1 row-cols-lg-2 g-3">
    <div class="col">
        <div class="d-grid gap-3">
            <div class="row row-cols-1 row-cols-md-2 row-cols-lg-1 g-3">
                <div class="col">
                    <div class="card">
                        <h5 class="card-header border-bottom-0">
                            <?= I18N::translate('Total males') ?>
                            <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalSexMales() ?></span>
                        </h5>
                    </div>
                </div>

                <div class="col">
                    <div class="card">
                        <h5 class="card-header border-bottom-0">
                            <?= I18N::translate('Total females') ?>
                            <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalSexFemales() ?></span>
                        </h5>
                    </div>
                </div>
            </div>
            <div class="card">
                <div class="card-body">
                    <?= $stats->chartSex() ?>
                </div>
            </div>
        </div>
    </div>

    <div class="col">
        <div class="d-grid gap-3">
            <div class="row row-cols-1 row-cols-md-2 row-cols-lg-1 g-3">
                <div class="col">
                    <div class="card">
                        <h5 class="card-header border-bottom-0">
                            <?= I18N::translate('Total living') ?>
                            <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalLiving() ?></span>
                        </h5>
                    </div>
                </div>
    
                <div class="col">
                    <div class="card">
                        <h5 class="card-header border-bottom-0">
                            <?= I18N::translate('Total dead') ?>
                            <span class="badge bg-secondary rounded-pill float-end"><?= $stats->totalDeceased() ?></span>
                        </h5>
                    </div>
                </div>
            </div>
            
            <div class="card">
                <div class="card-body">
                    <?= $stats->chartMortality() ?>
                </div>
            </div>
        </div>
    </div>
</div>
