<div class="tab-pane fade" id="consent" role="tabpanel">
    <x-admin.card>
        <div class="row g-3">
            <div class="col-12">
                <div class="form-check form-switch">
                    <input class="form-check-input" type="checkbox" id="consent_enabled"
                           name="consent_enabled" value="1"
                           {{ old('consent_enabled', setting('consent_enabled', false)) ? 'checked' : '' }}>
                    <label class="form-check-label" for="consent_enabled">{{ __('admin/settings.consent_enabled') }}</label>
                    <div class="form-text small">{{ __('admin/settings.consent_enabled_help') }}</div>
                </div>
            </div>

            <div class="col-md-6">
                <label class="form-label">{{ __('admin/settings.consent_cookie_lifetime_days') }}</label>
                <input type="number" class="form-control" name="consent_cookie_lifetime_days"
                       value="{{ old('consent_cookie_lifetime_days', setting('consent_cookie_lifetime_days', 365)) }}"
                       min="1" max="3650">
            </div>

            <div class="col-md-6">
                <label class="form-label">{{ __('admin/settings.consent_banner_position') }}</label>
                <select class="form-select" name="consent_banner_position">
                    @php $pos = old('consent_banner_position', setting('consent_banner_position', 'bottom')); @endphp
                    <option value="bottom" @selected($pos === 'bottom')>{{ __('admin/settings.consent_banner_position_bottom') }}</option>
                    <option value="top" @selected($pos === 'top')>{{ __('admin/settings.consent_banner_position_top') }}</option>
                </select>
            </div>

            <div class="col-12">
                <x-admin.content-link-picker
                    name="consent_policy_url"
                    :value="setting('consent_policy_url', '')"
                    :label="__('admin/settings.consent_policy_url')"
                    :help="__('admin/settings.consent_policy_url_help')" />
            </div>

            <div class="col-md-6">
                <label class="form-label">{{ __('admin/settings.consent_banner_text_tr') }}</label>
                <textarea class="form-control" name="consent_banner_text_tr" rows="3">{{ old('consent_banner_text_tr', setting('consent_banner_text_tr', '')) }}</textarea>
            </div>

            <div class="col-md-6">
                <label class="form-label">{{ __('admin/settings.consent_banner_text_en') }}</label>
                <textarea class="form-control" name="consent_banner_text_en" rows="3">{{ old('consent_banner_text_en', setting('consent_banner_text_en', '')) }}</textarea>
            </div>

            <div class="col-md-6">
                <label class="form-label">{{ __('admin/settings.consent_reject_implicit_expiry_days') }}</label>
                <input type="number" class="form-control" name="consent_reject_implicit_expiry_days"
                       value="{{ old('consent_reject_implicit_expiry_days', setting('consent_reject_implicit_expiry_days', 30)) }}"
                       min="0" max="3650">
            </div>
        </div>
    </x-admin.card>

    {{-- PRC-796 — İYS (İleti Yönetim Sistemi) entegrasyonu --}}
    <x-admin.card>
        <x-slot:header>
            <h6 class="mb-0"><i class="fas fa-shield-halved me-2"></i>{{ __('admin.iys_settings_title') }}</h6>
        </x-slot:header>
        <div class="row g-3">
            <div class="col-md-6">
                <div class="form-check form-switch">
                    <input class="form-check-input" type="checkbox" id="iys_enabled"
                           name="iys_enabled" value="1"
                           {{ old('iys_enabled', setting('iys_enabled', false)) ? 'checked' : '' }}>
                    <label class="form-check-label" for="iys_enabled">{{ __('admin.iys_enabled') }}</label>
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-check form-switch">
                    <input class="form-check-input" type="checkbox" id="iys_test_mode"
                           name="iys_test_mode" value="1"
                           {{ old('iys_test_mode', setting('iys_test_mode', true)) ? 'checked' : '' }}>
                    <label class="form-check-label" for="iys_test_mode">{{ __('admin.iys_test_mode') }}</label>
                </div>
            </div>
            <div class="col-md-4">
                <label class="form-label">{{ __('admin.iys_username') }}</label>
                <input type="text" class="form-control" name="iys_username"
                       value="{{ old('iys_username', setting('iys_username', '')) }}" autocomplete="off">
            </div>
            <div class="col-md-4">
                <label class="form-label">{{ __('admin.iys_password') }}</label>
                <input type="password" class="form-control" name="iys_password"
                       value="{{ old('iys_password', setting('iys_password', '')) }}" autocomplete="new-password">
            </div>
            <div class="col-md-4">
                <label class="form-label">{{ __('admin.iys_code') }}</label>
                <input type="text" class="form-control" name="iys_code"
                       value="{{ old('iys_code', setting('iys_code', '')) }}" autocomplete="off">
            </div>
            <div class="col-md-6">
                <label class="form-label">{{ __('admin.iys_brand_code') }}</label>
                <input type="text" class="form-control" name="iys_brand_code"
                       value="{{ old('iys_brand_code', setting('iys_brand_code', '')) }}" autocomplete="off">
            </div>
            <div class="col-md-6">
                <label class="form-label">{{ __('admin.iys_webhook_secret') }}</label>
                <input type="password" class="form-control" name="iys_webhook_secret"
                       value="{{ old('iys_webhook_secret', setting('iys_webhook_secret', '')) }}" autocomplete="new-password">
            </div>
        </div>
    </x-admin.card>
</div>
