<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <!-- Custom SimplyIN tab in admin sidebar -->
        <tab id="simplyin_tab" class="simplyin_config" translate="label" sortOrder="150">
            <label></label>
        </tab>

        <!-- SimplyIN section under the custom tab -->
        <section id="simplyin_config" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
            <class>separator-top</class>
            <label>General</label>
            <tab>simplyin_tab</tab>
            <resource>Simplyin_Payment::config</resource>

            <group id="simplyin_payment" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Simply.IN Fast checkout add-on</label>
                <field id="api_key" translate="label comment" type="text" sortOrder="16" showInDefault="1" showInWebsite="1" showInStore="0">
                    <label>API Key</label>
                    <comment>Your Simply.IN API authentication key</comment>
                    <frontend_model>Simplyin\Payment\Block\Adminhtml\System\Config\Field\ApiKeyMasked</frontend_model>
                    <backend_model>Simplyin\Payment\Model\Config\Backend\ApiKeyEncrypted</backend_model>
                    <validate>required-entry</validate>
                    <config_path>payment/simplyin_payment/api_key</config_path>
                </field>

                <!-- Shipping Methods Settings Group (nested for visual grouping) -->
                <group id="shipping_methods" translate="label" type="text" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Ustawienia metod dostawy</label>
                    <field id="dpd_pickup" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>DPD Pickup - automat lub punkt</label>
                        <source_model>Simplyin\Payment\Model\Config\Source\ShippingMethods</source_model>
                        <comment>Map DPD Pickup shipping method</comment>
                        <config_path>payment/shipping_methods/dpd_pickup</config_path>
                    </field>
                    <field id="dhl_box_pop" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>DHL BOX i POP</label>
                        <source_model>Simplyin\Payment\Model\Config\Source\ShippingMethods</source_model>
                        <comment>Map DHL BOX and POP shipping method</comment>
                        <config_path>payment/shipping_methods/dhl_box_pop</config_path>
                    </field>
                    <field id="inpost_paczkomat" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>InPost Paczkomat</label>
                        <source_model>Simplyin\Payment\Model\Config\Source\ShippingMethods</source_model>
                        <comment>Map InPost Paczkomat shipping method</comment>
                        <config_path>payment/shipping_methods/inpost_paczkomat</config_path>
                    </field>
                    <field id="orlen_punkty" translate="label comment" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>ORLEN Punkty Odbioru</label>
                        <source_model>Simplyin\Payment\Model\Config\Source\ShippingMethods</source_model>
                        <comment>Map ORLEN pickup points shipping method</comment>
                        <config_path>payment/shipping_methods/orlen_punkty</config_path>
                    </field>
                    <field id="ups_pickup" translate="label comment" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>UPS odbiór w punkcie</label>
                        <source_model>Simplyin\Payment\Model\Config\Source\ShippingMethods</source_model>
                        <comment>Map UPS pickup point shipping method</comment>
                        <config_path>payment/shipping_methods/ups_pickup</config_path>
                    </field>
                    <field id="default_courier" translate="label comment" type="select" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Domyślna metoda dostawy dla przesyłek kurierskich</label>
                        <source_model>Simplyin\Payment\Model\Config\Source\ShippingMethods</source_model>
                        <comment>Default shipping method for courier deliveries</comment>
                        <config_path>payment/shipping_methods/default_courier</config_path>
                    </field>

                    <group id="payment_settings" translate="label" type="text" sortOrder="250" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>payment settings:</label>
                        <field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0">
                            <label>Enabled</label>
                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                            <config_path>payment/simplyin_payment/active</config_path>
                        </field>
                        <field id="allowspecific" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="0">
                            <label>Payment from Applicable Countries</label>
                            <source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model>
                            <config_path>payment/simplyin_payment/allowspecific</config_path>
                        </field>
                        <field id="specificcountry" translate="label" type="multiselect" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
                            <label>Payment from Specific Countries</label>
                            <source_model>Magento\Directory\Model\Config\Source\Country</source_model>
                            <config_path>payment/simplyin_payment/specificcountry</config_path>
                        </field>
                        <field id="sort_order" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0">
                            <label>Sort Order</label>
                            <config_path>payment/simplyin_payment/sort_order</config_path>
                        </field>
                        <field id="debug" translate="label comment" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
                            <label>Debug Logging</label>
                            <comment>Enable verbose debug logging to var/log/simplyin_payment.log</comment>
                            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                            <config_path>payment/simplyin_payment/debug</config_path>
                        </field>
                        <field id="plugin_version" translate="label" type="label" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1">
                            <label>Plugin version</label>
                            <frontend_model>Simplyin\Payment\Block\Adminhtml\System\Config\PluginVersion</frontend_model>
                        </field>
                    </group>
                </group>

                <group id="additional_config" translate="label" type="text" sortOrder="300" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Additional Settings</label>
                    <field id="remember_details_unchecked" translate="label" type="checkbox" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>"Remember your details with Simply.IN" checkbox is not selected by default for users who do not have an account at Simply.IN</label>
                        <frontend_model>Simplyin\Payment\Block\Adminhtml\System\Config\Checkbox</frontend_model>
                        <config_path>payment/simplyin_payment/default_create_account_checked</config_path>
                    </field>

                    <field id="info" translate="label" type="note" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                        <frontend_model>Simplyin\Payment\Block\Adminhtml\System\Config\HelpText</frontend_model>
                    </field>
                </group>
            </group>
        </section>
    </system>
</config>