<?php require ROOT_PATH . '/admin/templates/header.php'; ?>

<div class="content-wrapper">
<section class="content pt-3">
<div class="container-fluid pb-5">

<div class="d-flex justify-content-between align-items-start gap-3 mb-4"><div><h3 class="mb-1 fw-bold"><i class="bi bi-google text-danger me-2"></i><?= __('integrations.ga4.page_title','Google Analytics 4') ?></h3></div></div>


<form method="post" action="<?= admin_url('ga4/save') ?>">
        <?= \Core\System\Csrf::field(); ?>
    <div class="card border-0 shadow-sm">
        <div class="card-header bg-white border-bottom py-3"><h6 class="mb-0 fw-semibold"><?= __('integrations.ga4.title','Google Analytics 4') ?></h6></div>

        <div class="card-body">
            <div class="form-group">
                <label><?= __('integrations.ga4.measurement_id','Measurement ID') ?></label>
                <input type="text"
                       name="measurement_id"
                       class="form-control"
                       value="<?= htmlspecialchars($ga4['measurement_id'] ?? '') ?>"
                       required>
            </div>

            <div class="form-group mt-3">
                <label>
                    <input type="checkbox"
                           name="is_active"
                           value="1"
                           <?= !empty($ga4['is_active']) ? 'checked' : '' ?>>
                    <?= __('integrations.ga4.enable','Enable Google Analytics 4') ?>
                </label>
            </div>
        </div>

        <div class="card-footer text-end">
            <button type="submit" class="btn btn-primary">
                <?= __('actions.save','Save') ?>
            </button>
        </div>
    </div>
</form>
<?php ?>
</div></section></div>
<?php require ROOT_PATH . '/admin/templates/footer.php'; ?>