@extends('dashboard.user.layouts.app')
@section('content')
    <div class="page-container">

        <div class="page-title-head d-flex align-items-sm-center flex-sm-row flex-column gap-2">
            <div class="flex-grow-1">
                <h4 class="fs-18 fw-semibold mb-0">{{ $title }}</h4>
            </div>

            <div class="text-end">
                <x-dashboard.breadcrumbs :breadcrumbs="$breadcrumbs" />
            </div>
        </div>

        <div class="row mt-4">

            <div class="col-12">

                <div class="card shadow-sm mb-4">
                    <div class="card-body">
                        <div class="row align-items-center">

                            {{-- Text Content --}}
                            <div class="col-lg-8">
                                <h3 class="fw-bold mb-3">AI Bot Trading</h3>
                                <hr>
                                <p class="text-muted fs-6">
                                    Welcome to our cutting-edge trading bot feature, designed to revolutionize your online
                                    trading experience!
                                    Harness advanced algorithms and machine learning to automate your strategies and
                                    capitalize on market opportunities 24/7.
                                </p>
                                <p class="text-muted fs-6">
                                    Forget constantly monitoring charts or executing trades manually. Our AI bot executes
                                    trades at optimal times, helping you maximize efficiency and profits—even while you
                                    sleep.
                                </p>

                                <button class="btn btn-primary mt-3" type="button" data-bs-toggle="offcanvas"
                                    data-bs-target="#offcanvasConnectBot" aria-controls="offcanvasConnectBot">
                                    <i class="ti ti-robot me-1"></i> Get Started
                                </button>
                            </div>

                            {{-- Image --}}
                            <div class="col-lg-4 text-center">
                                <img src="{{ asset('assets/images/bot.png') }}" alt="Trading Bot" class=" w-25 img-fluid">
                            </div>
                        </div>
                    </div>
                </div>

                {{-- Offcanvas: Connect Bot --}}
                <div class="offcanvas offcanvas-end" tabindex="-1" id="offcanvasConnectBot"
                    aria-labelledby="offcanvasConnectBotLabel">
                    <div class="offcanvas-header border-bottom">
                        <h5 id="offcanvasConnectBotLabel" class="fw-bold"><i class="ti ti-robot me-2"></i>Connect Bot</h5>
                        <button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas"
                            aria-label="Close"></button>
                    </div>

                    <div class="offcanvas-body">
                        <div class="mb-4">
                            <div class="alert alert-info">
                                <p class="mb-0">
                                    Obtain your <strong>API key</strong> and <strong>Secret key</strong> from your profile
                                    page before connecting.
                                </p>
                            </div>

                            <form action="{{ route('user.trade.bot.connect') }}" method="POST">
                                @csrf

                                {{-- API Key --}}
                                <div class="mb-3">
                                    <label for="api_key" class="form-label">API Key</label>
                                    <input type="text" id="api_key" name="api_key" class="form-control"
                                        placeholder="Enter your api key">
                                    @error('api_key')
                                        <small class="text-danger">{{ $message }}</small>
                                    @enderror
                                </div>

                                {{-- Secret Key --}}
                                <div class="mb-3">
                                    <label for="secret_key" class="form-label">Secret Key</label>
                                    <input type="text" id="secret_key" name="secret_key" class="form-control"
                                        placeholder="Enter your secret key">
                                    @error('secret_key')
                                        <small class="text-danger">{{ $message }}</small>
                                    @enderror
                                </div>

                                {{-- Submit --}}
                                <div class="d-grid mt-3">
                                    <button type="submit" class="btn btn-success btn-lg">
                                        <i class="ti ti-robot me-1"></i> Connect Bot
                                    </button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>

            </div>

        </div>

    </div>
@endsection
