<?php
/**
 * Create Fundraiser Form — type selection step.
 *
 * Shown when no type is pre-forced. The ambassador picks one of three actions:
 *  - Join: create a personal fundraiser under the current one.
 *  - Create a team: create a team (then optionally add yourself as an individual).
 *  - Start new Fundraiser: set up a sub-fundraiser others can then join.
 *
 * @var array{
 *     root_id: int,
 *     parent_id: int,
 *     skip_root_step: bool,
 *     nesting_enabled: bool,
 *     individual_allowed: bool,
 *     team_allowed: bool,
 *     sub_fundraiser_allowed: bool,
 * } $context
 *
 * @package AmbassadorHub\Fundraisers\Blocks\CreateFundraiserForm
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
?>

<h3 class="ambh-cff-step-title"><?php esc_html_e( 'What would you like to do?', 'ambassadorhub' ); ?></h3>

<ul class="ambh-cff-type-list" role="list">

	<?php if ( $context['individual_allowed'] || 0 === $context['root_id'] ) : ?>
	<li class="ambh-cff-type-item" data-type-item="individual">
		<button
			type="button"
			class="ambh-cff-type-option"
			data-type="individual">
			<span class="ambh-cff-type-option__icon" aria-hidden="true">👤</span>
			<span class="ambh-cff-type-option__body">
				<strong class="ambh-cff-type-option__label"><?php esc_html_e( 'Join', 'ambassadorhub' ); ?></strong>
				<span class="ambh-cff-type-option__description">
					<?php esc_html_e( 'Create your personal fundraising page and start collecting donations.', 'ambassadorhub' ); ?>
				</span>
			</span>
		</button>
	</li>
	<?php endif; ?>

	<li class="ambh-cff-type-item" data-type-item="team"<?php echo $context['nesting_enabled'] && $context['team_allowed'] ? '' : ' hidden'; ?>>
		<button
			type="button"
			class="ambh-cff-type-option"
			data-type="team">
			<span class="ambh-cff-type-option__icon" aria-hidden="true">👥</span>
			<span class="ambh-cff-type-option__body">
				<strong class="ambh-cff-type-option__label"><?php esc_html_e( 'Create a team', 'ambassadorhub' ); ?></strong>
				<span class="ambh-cff-type-option__description">
					<?php esc_html_e( 'Start a team and invite others to join. You can add your personal page afterwards.', 'ambassadorhub' ); ?>
				</span>
			</span>
		</button>
	</li>

	<?php if ( $context['sub_fundraiser_allowed'] || 0 === $context['root_id'] ) : ?>
	<li class="ambh-cff-type-item" data-type-item="fundraiser">
		<button
			type="button"
			class="ambh-cff-type-option"
			data-type="fundraiser">
			<span class="ambh-cff-type-option__icon" aria-hidden="true">🎯</span>
			<span class="ambh-cff-type-option__body">
				<strong class="ambh-cff-type-option__label"><?php esc_html_e( 'Start new Fundraiser', 'ambassadorhub' ); ?></strong>
				<span class="ambh-cff-type-option__description">
					<?php esc_html_e( 'Set up a new fundraiser for a cause — others can then join it or start a team.', 'ambassadorhub' ); ?>
				</span>
			</span>
		</button>
	</li>
	<?php endif; ?>

</ul>

<?php if ( ! $context['skip_root_step'] ) : ?>
	<button type="button" class="ambh-cff-back ambh-cff-back--type ambh-button ambh-button--secondary">
		<?php esc_html_e( '← Back', 'ambassadorhub' ); ?>
	</button>
<?php endif; ?>
