@extends('admin.layouts.app')

@section('title', 'BD Integrations')
@section('page_title', 'BD Integrations')

@section('content')
@php
    $settings = $settings ?? [];
@endphp

<div class="page-shell">
    <div class="page-head">
        <div>
            <h1 class="page-title">BD Integrations</h1>
            <div class="page-subtitle">Manage Bangladesh payment, SMS, and courier integration settings.</div>
        </div>
    </div>

    <form method="POST" action="{{ route('admin.settings.integrations') }}">
        @csrf

        <div class="grid-3">
            <div class="card">
                <h3 style="margin-top:0;">Payment Gateways</h3>

                <label for="bkash_enabled">bKash</label>
                <select id="bkash_enabled" name="bkash_enabled">
                    <option value="0">Disabled</option>
                    <option value="1">Enabled</option>
                </select>

                <label for="nagad_enabled">Nagad</label>
                <select id="nagad_enabled" name="nagad_enabled">
                    <option value="0">Disabled</option>
                    <option value="1">Enabled</option>
                </select>

                <label for="rocket_enabled">Rocket</label>
                <select id="rocket_enabled" name="rocket_enabled">
                    <option value="0">Disabled</option>
                    <option value="1">Enabled</option>
                </select>
            </div>

            <div class="card">
                <h3 style="margin-top:0;">SMS</h3>

                <label for="sms_provider">SMS Provider</label>
                <input type="text" id="sms_provider" name="sms_provider" value="{{ old('sms_provider', $settings['sms_provider'] ?? '') }}">

                <label for="sms_api_key">API Key</label>
                <input type="text" id="sms_api_key" name="sms_api_key" value="{{ old('sms_api_key', $settings['sms_api_key'] ?? '') }}">
            </div>

            <div class="card">
                <h3 style="margin-top:0;">Courier</h3>

                <label for="courier_provider">Courier Provider</label>
                <input type="text" id="courier_provider" name="courier_provider" value="{{ old('courier_provider', $settings['courier_provider'] ?? '') }}">

                <label for="delivery_charge_inside">Inside Dhaka</label>
                <input type="number" step="0.01" id="delivery_charge_inside" name="delivery_charge_inside" value="{{ old('delivery_charge_inside', $settings['delivery_charge_inside'] ?? 0) }}">

                <label for="delivery_charge_outside">Outside Dhaka</label>
                <input type="number" step="0.01" id="delivery_charge_outside" name="delivery_charge_outside" value="{{ old('delivery_charge_outside', $settings['delivery_charge_outside'] ?? 0) }}">
            </div>
        </div>

        <div class="form-actions">
            <button type="submit" class="btn primary">Save Integrations</button>
        </div>
    </form>
</div>
@endsection