<div class="container">
    <style>
        .css-ujjr14 {
            display: flex;
            width: 100%;
            height: 100%;
            -webkit-box-pack: center;
            justify-content: center;
            -webkit-box-align: end;
            align-items: end;
            padding: 0rem 0px 0px;
            background: rgba(0, 0, 0, 0.15);
            z-index: var(--chakra-zIndices-dialog);
        }
        .css-1nw4mfe {
            display: flex;            ;
            position: relative;
            flex-direction: column;
            width: 100%;
            max-height: 100%;
            overflow: hidden;
            border-radius: 1.6rem 1.6rem 0px 0px;
            background: var(--chakra-colors-white);
        }
        .css-7r74hk {
            display: flex;            ;
            gap: 0.8rem;
            padding-top: 1rem;
            padding-bottom: 1.2rem;
            padding-inline: 1.6rem;
            border-bottom-width: 1px;
            border-bottom-style: solid;
            border-color: var(--chakra-colors-gray-200);
        }
        .css-k4t1hf {
            appearance: none;
            -webkit-box-align: center;
            align-items: center;
            -webkit-box-pack: center;
            justify-content: center;
            user-select: none;
            position: relative;
            white-space: nowrap;
            vertical-align: middle;
            outline: transparent solid 2px;
            outline-offset: 2px;
            line-height: 1.2;
            border-radius: 0px;
            font-weight: var(--chakra-fontWeights-semibold);
            transition: none;
            height: var(--chakra-sizes-8);
            min-width: var(--chakra-sizes-8);
            font-size: var(--chakra-fontSizes-sm);
            padding-inline-start: var(--chakra-space-0);
            padding-inline-end: var(--chakra-space-0);
            color: var(--chakra-colors-blue-500);
            background: var(--chakra-colors-transparent);
            border-bottom: 1px solid transparent;
            padding: var(--chakra-space-0);
            margin-top: 0.6rem;
        }
        .css-g7y5ub {
            width: 1.6rem;
            height: 1.6rem;
            display: inline-block;
            line-height: 1em;
            -webkit-flex-shrink: 0;
            -ms-flex-negative: 0;
            flex-shrink: 0;
            color: var(--chakra-colors-blue-500);
            vertical-align: middle;
            fill: var(--chakra-colors-transparent);
            stroke: var(--chakra-colors-transparent);
        }
        .css-1a3ob45 {
            font-family: EuclidCircularB, sans-serif;
            font-weight: 700;
            color: var(--chakra-colors-gray-800);
            font-style: normal;
            margin: var(--chakra-space-0);
            font-size: var(--chakra-fontSizes-500);
            line-height: 3rem;
            letter-spacing: -0.05rem;
            padding: 0.8rem 3.2rem 0px 0px;
            flex: 1 1 0%;
        }
        .css-1rcner2 {
            padding: 1.6rem;
            overflow: auto;
        }
        .css-1jmaa3 {
            z-index: 3;
            width: 100%;
            position: relative;
        }
        .css-qvw3sj {
            width: 100%;
            background: var(--chakra-colors-white);
            border-radius: 8px;
            box-shadow: rgba(72, 88, 133, 0.12) 0px 24px 32px;
            position: relative;
        }
        .css-i7jdrw {
            display: flex;            ;
            width: 100%;
            flex-direction: column;
            gap: 2.4rem;
            padding: 2.4rem;
        }
        .css-cv8rvs {
            display: flex;            ;
            flex-direction: column;
            gap: 2.2rem;
        }
        .css-omhou1 {
            display: flex;            ;
            background: var(--chakra-colors-gray-200);
            border-radius: var(--chakra-radii-md);
            cursor: pointer;
            padding: 0.2rem;
            width: fit-content;
            gap: 0.2rem;
            min-width: 100%;
        }
        @media screen and (min-width: 0em) and (max-width: 639.98px) {
            .css-l8wdn[aria-checked="true"], .css-l8wdn[data-checked] {
                box-shadow: var(--chakra-shadows-accent-bottom-sm);
            }
        }
        .css-l8wdn[aria-checked="true"], .css-l8wdn[data-checked] {
            color: var(--chakra-colors-white);
            background-image: linear-gradient(to right, var(--chakra-colors-blue-500), var(--chakra-colors-blue-700));
        }
        @media screen and (min-width: 0em) and (max-width: 639.98px) {
            .css-l8wdn {
                padding-inline: 1.2rem;
                height: 3.2rem;
            }
        }
        .css-l8wdn {
            display: flex;            ;
            -webkit-box-align: center;
            align-items: center;
            -webkit-box-pack: center;
            justify-content: center;
            flex: 1 0 0px;
            gap: 0.8rem;
            border-radius: var(--chakra-radii-base);
            transition: 0.2s;
            user-select: none;
            color: var(--chakra-colors-gray-800);
        }
        fieldset {
            margin: 0;
            padding: 0;
        }
        @media screen and (min-width: 0em) and (max-width: 639.98px) {
            .css-1ltvw3b {
                line-height: 2rem;
                font-size: var(--chakra-fontSizes-50);
            }
        }
        .css-1ltvw3b {
            font-family: EuclidCircularB, sans-serif;
            font-style: normal;
            white-space: nowrap;
            color: inherit;
            font-weight: 600;
        }
        .css-du0yet {
            text-transform: uppercase;
            display: flex;            ;
            -webkit-box-align: center;
            align-items: center;
            border-radius: var(--chakra-radii-base);
            max-width: -webkit-max-content;
            white-space: nowrap;
            color: var(--chakra-colors-white);
            font-weight: 600;
            letter-spacing: 0.05rem;
            padding: 0.2rem 0.4rem;
            font-size: var(--chakra-fontSizes-50);
            line-height: 1.4rem;
            background-color: var(--chakra-colors-orange-500);
        }
        .css-l8wdn {
            display: flex;            ;
            -webkit-box-align: center;
            align-items: center;
            -webkit-box-pack: center;
            justify-content: center;
            flex: 1 0 0px;
            gap: 0.8rem;
            border-radius: var(--chakra-radii-base);
            transition: 0.2s;
            user-select: none;
            color: var(--chakra-colors-gray-800);
        }
        .css-1ltvw3b {
            font-family: EuclidCircularB, sans-serif;
            font-style: normal;
            white-space: nowrap;
            color: inherit;
            font-weight: 600;
        }
        .css-hboir5 {
            display: flex;            ;
            width: 100%;
        }
        .css-1eecgpw {
            display: flex;            ;
            flex-direction: column;
            width: 100%;
            gap: 0.4rem;
        }
        .css-1ofqig9 {
            display: flex;            ;
            flex-direction: column;
            width: 100%;
        }
        .css-593min {
            display: flex;            ;
            -webkit-box-pack: justify;
            justify-content: space-between;
            -webkit-box-align: center;
            align-items: center;
            margin-bottom: 2rem;
            gap: 0.8rem;
        }
        .css-1fag19g {
            display: flex;            ;
            flex-direction: row;
            -webkit-box-align: center;
            align-items: center;
            gap: 0.4rem;
        }
        .css-2d055x {
            font-family: EuclidCircularB, sans-serif;
            font-style: normal;
            color: var(--chakra-colors-gray-700);
            font-size: 1.4rem;
            font-weight: 500;
            line-height: 2.4rem;
        }
        .css-1ifssz3 {
            font-family: EuclidCircularB, sans-serif;
            font-style: normal;
            color: var(--chakra-colors-gray-800);
            font-weight: 700;
            font-size: 1.4rem;
            line-height: 2.4rem;
            text-align: right;
            white-space: nowrap;
            min-width: 7rem;
        }
        .css-fwjkw2 {
            padding: 0.4rem 0px 2.4rem;
        }
        .css-yllokj {
            display: block;
            position: relative;
            cursor: pointer;
            width: 100%;
            --slider-thumb-size: var(--chakra-sizes-3-5);
            --slider-track-size: var(--chakra-sizes-1);
        }
        .css-1ofqig9 {
            display: flex;            ;
            flex-direction: column;
            width: 100%;
        }
        .css-exvop4 {
            display: flex;            ;
            -webkit-box-pack: justify;
            justify-content: space-between;
            -webkit-box-align: center;
            align-items: center;
            margin-bottom: var(--chakra-space-0);
            gap: 0.8rem;
        }
        .css-1fag19g {
            display: flex;            ;
            flex-direction: row;
            -webkit-box-align: center;
            align-items: center;
            gap: 0.4rem;
        }
        .css-2d055x {
            font-family: EuclidCircularB, sans-serif;
            font-style: normal;
            color: var(--chakra-colors-gray-700);
            font-size: 1.4rem;
            font-weight: 500;
            line-height: 2.4rem;
        }
        .css-2d055x {
            font-family: EuclidCircularB, sans-serif;
            font-style: normal;
            color: var(--chakra-colors-gray-700);
            font-size: 1.4rem;
            font-weight: 500;
            line-height: 2.4rem;
        }
        .css-2d055x {
            font-family: EuclidCircularB, sans-serif;
            font-style: normal;
            color: var(--chakra-colors-gray-700);
            font-size: 1.4rem;
            font-weight: 500;
            line-height: 2.4rem;
        }
        .css-k008qs {
            display: -webkit-box;
            display: -webkit-flex;
            display: -ms-flexbox;
            display: flex;
        }
        .css-1svevxc {
            width: 16px;
            height: 16px;
            transition: color 200ms;
            color: var(--chakra-colors-gray-300);
        }
    </style>
    <div class="row">
        <div style="border-radius: 2rem">
            <div class="p-2">
                <form wire:submit.prevent="confirmPayment">
                    <div class="css-ujjr14 bg-white">
                        <div class="css-1nw4mfe">
                            <div class="css-7r74hk">
                                <button type="button" class="chakra-button css-k4t1hf close" aria-label="Step back" data-testid="feature.modal.back_button" data-dismiss="modal">
                                    <svg viewBox="0 0 16 16" focusable="false" class="chakra-icon css-g7y5ub" aria-hidden="true">
                                        <path fill-rule="evenodd" clip-rule="evenodd" d="M6.70711 2.2929C6.31659 1.90237 5.68342 1.90237 5.2929 2.29289L0.292896 7.29287C0.105359 7.4804 1.45502e-06 7.73476 5.24534e-07 7.99997C5.4772e-07 8.26519 0.105356 8.51954 0.292892 8.70708L5.29289 13.7071C5.68341 14.0976 6.31658 14.0976 6.7071 13.7071C7.09763 13.3166 7.09763 12.6834 6.70711 12.2929L3.41421 8.99998L15 8.99998C15.5523 8.99998 16 8.55226 16 7.99998C16 7.44769 15.5523 6.99998 15 6.99998L3.41422 6.99998L6.7071 3.70711C7.09763 3.31659 7.09763 2.68342 6.70711 2.2929Z" fill="currentColor"></path>
                                    </svg>
                                </button>
                                <h3 class="chakra-heading css-1a3ob45" role="heading">Make Payment</h3>
                            </div>
                            <div class="css-1rcner2">
                                <div class="css-1jmaa3">
                                    <div class="css-qvw3sj">
                                        <div class="css-i7jdrw">
                                            <div class="css-cv8rvs">
                                                <div role="radiogroup" aria-labelledby="financing-type" class="css-omhou1">
                                                    <fieldset aria-checked="true" role="radio" class="css-l8wdn">
                                                        <p class="chakra-text css-1ltvw3b mt-2">Instant Payment</p>
                                                    </fieldset>
                                                </div>
                                                <div class="css-hboir5">
                                                    <small>After making this payment, head over to your profile section and fill in your sipping address where we will send the car to. Cars are delivered within 14 days.</small>
                                                </div>
                                            </div>

                                            <div class="col-12 d-block justify-content-center">
                                                <div class="">
                                                    <div class="nk-pps-title">
                                                        <h4 class="title fw-bold">Make Your Payment</h4>
                                                        <small class="caption">
                                                            Your payment with ID <strong class="text-success">{{ $payment_id }}</strong> has been placed successfully. To complete, please send the exact amount of <strong class="text-success">{{ $pay_amount }} USDT</strong>(trc20) to the address below.
                                                        </small>
                                                    </div>
                                                </div>
                                                <div class="py-1">
                                                    <img src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data={{ $pay_address }}" alt="qr code">
                                                </div>
                                                <div class="form-group">
                                                    <div class="form-label overline-title-alt fw-bold lg py-1">USDT Address</div>
                                                    <div class="form-control-wrap">
                                                        <div class="form-clip clipboard-init nk-tooltip"
                                                            data-clipboard-target="#wallet-address" title="Copy">
                                                            <em class="click-to-copy icon ni ni-copy"></em>
                                                        </div>
                                                        <div class="form-icon"><em class="icon ni ni-sign-btc-alt"></em></div>
                                                        <input readonly type="text" class="form-control form-control-lg"
                                                            id="wallet-address" value="{{ $pay_address }}">
                                                    </div>
                                                </div>
                                            </div>

                                            <a id="confirmPayment" href="#crypto-paid" class="btn btn-block btn-primary popup-open p-3">
                                                <span class="fw-bold">Paid USDT</span>
                                            </a>
                                        </div>

                                        <!-- popup like a modal when the #crypto-paid anchor link is clicked -->
                                        <div id="crypto-paid" class="d-none mt-3 bg-light p-2 border rounded p-3 mt-1">
                                            <h2 class="mb-2 py-1 fw-bold">Confirm Your Payment</h2>
                                            <small class="py-1">
                                                If you have just paid, please provide us with your payment ID above to speed up
                                                the confirmation process.
                                                <div class="text-danger fw-bold py-3">
                                                    Do not enter the payment ID if you haven't made the payment to avoid being banned
                                                </div>
                                            </small>

                                            <form class="form" wire:submit.prevent="confirmPayment"
                                                id="crypto-pay-reference">
                                                <div class="form-group mt-1">
                                                    <div class="form-label fw-bold">
                                                        Payment ID <span class="text-danger">*</span>
                                                    </div>
                                                    <div class="form-control-wrap">
                                                        <input type="text" class="form-control p-4"
                                                            wire:model.lazy="entered_payment_id"
                                                            placeholder="Enter your payment ID">
                                                    </div>
                                                    @error('entered_payment_id')
                                                        <small class="text-danger fw-bold">{{ $message }}</small>
                                                        @enderror
                                                </div>

                                                <div class="alert alert-{{ $responseCode == 1 ? 'success' : 'danger' }} mb-1">
                                                    <small class="fw-bold">{{ $paymentConfirmationResponse }}</small>
                                                </div>

                                                <button type="submit" id="confirm-payment" class="btn btn-primary p-3 fw-bold">Confirm Payment</button>
                                            </form>

                                            <div class="alert-note is-plain mt-4">
                                                <small>Account will be credited once the payment is confirmed on the blockchain</small>
                                            </div>
                                        </div>
                                        <!-- end here -->

                                        <div class="css-tiyt5v px-3">
                                            <div class="css-qtnf3s mb-2">
                                                <p class="css-er1uci epmtl4v0">Need some advice?</p>
                                                <button class="btn btn-white btn-lg text-primary fw-bold border border-2 border-primary">Chat Support  &nbsp;<i class="fa-solid fa-message"></i></button>
                                            </div>
                                            <div class="p-1 shadow-sm">
                                                <small class="chakra-text css-cs1cpz text-danger">
                                                    You can request for a refund if you choose to discontinue with your purchase.
                                                </small>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {

            let confirmPaymentBtn = document.getElementById('confirmPayment');

            let displayPaymentConfirmation = () => {
                document.getElementById('crypto-paid').classList.remove('d-none');
            }

            confirmPaymentBtn.addEventListener('click', displayPaymentConfirmation);

            window.addEventListener('reinitializePaymentConfirmation', function() {
                displayPaymentConfirmation();
            });
        });
    </script>
</div>
