<html>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport"
        content="width=device-width,initial-scale=1.0,user-scalable=no,maximum-scale=1.0,minimum-scale=1.0">
    <title>Complete Solar</title>

    <head>
        <link rel="stylesheet" href="{{asset ('cs/td/web/css/common.css?v=1748431151565')}}" />
        <link rel="stylesheet" href="{{asset ('cs/td/web/css/teamList.css?v=1748431151565')}}" />
        <script src="{{asset ('cs/td/web/js/jquery-3.7.1.min.js')}}"></script>
        <script src="{{asset ('cs/td/web/js/app.js?v=1748431151565')}}"></script>

        <script>
            var i18n = {
                "PhoneEmpty": "Phone number is empty",
                "PasswordEmpty": "Password is empty",
                "InviteEmpty": "Invite code is empty",
                "Invalidphonenumber": "Invalid phone number",
                "surelogout": "Are you sure you want to log out",
                "Replicating.Success": "Replicating Success",
                "amount.incorrect": "The amount is incorrect",
                "Select.withdrawal.method": "Select withdrawal method",
                "Cardholder.name.empty": "Cardholder name is empty",
                "Card.number.empty": "Card number is empty",
                "Old.password.empty": "Old password is empty",
                "New.password.empty": "New password is empty",
                "Confirm.new.password.empty": "Confirm new password is empty",
                "Password.tip": "Password length must be between 6 and 16",
                "Confirm.password.empty": "Confirm password is empty",
            };
        </script>

        <script>
            $.ajaxSetup({
                complete: function (xhr, status) {
                    var sessionStatus = xhr.getResponseHeader('sessionstatus');
                    if (sessionStatus == 'timeout') {
                        var redirect = xhr.getResponseHeader('redirect');
                        var top = getTopWinow();
                        top.location.href = redirect;
                    } else if (sessionStatus == 'norights') {
                        alert("您没有权限!");
                    }
                }
            });

            function getTopWinow() {
                var p = window;
                while (p != p.parent) {
                    p = p.parent;
                }
                return p;
            }
        </script>

    </head>
</head>

<body>
    <div class="page flex-col">
        <div class="box_1 flex-row justify-between">
            <img onclick="goBack()" class="thumbnail_1" referrerpolicy="no-referrer"
                src="{{asset ('cs/td/web/images/back-btn.png')}}">
            <span class="text_1">Level user</span>
        </div>
        <div class="list_2 flex-col" id="list_content">
            @foreach($users as $element)
                <div class="list-items_1-0 flex-col">
                    <div class="section_1-0 flex-row justify-between">
                        <div class="image-text_2-0 flex-row justify-between">
                            <img class="label_1-0" referrerpolicy="no-referrer"
                                src="{{asset ('cs/td/web/images/vip.png')}}">
                            <div class="text-group_2-0 flex-col justify-between">
                                <span class="text_2-0">Account number</span>
                                <span class="text_3-0">
                                    {{ substr($element->ref_id, 0, 3) . str_repeat('*', max(0, strlen($element->ref_id) - 7)) . substr($element->ref_id, -4) }}
                                </span>
                            </div>
                        </div>
                        <span
                            class="text_4-0">{{(\App\Models\Deposit::where('status', 'approved')->where('user_id', $element->id)->sum('amount'))}}</span>
                    </div>
                    <div class="text-wrapper_2-0 flex-row justify-between">
                        <span class="text_5-0"></span>
                        <span class="text_6-0">Register Time&nbsp;&nbsp;&nbsp;&nbsp;{{$element->created_at}}</span>
                    </div>
                </div>
            @endforeach

            <div class="list_dropdown"></div>

        </div>
    </div>

</body>

</html>

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Team Details</title>
    <style>
        :root {
            --bg: #0b0b0e;
            --card: #16161b;
            --text: #e9e9ef;
            --muted: #a7a7b3;
            --gold: #ebca7c;
            --radius: 12px;
            --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: Inter, system-ui, Arial, sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
            padding-bottom: 80px;
        }

        .page {
            max-width: 420px;
            margin: 0 auto;
            padding: 16px;
            display: flex;
            flex-direction: column;
        }

        /* Back button header */
        .box_1 {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: flex-start;
            margin-bottom: 16px;
        }

        .thumbnail_1 {
            width: 36px;
            height: 36px;
            margin-right: 12px;
            cursor: pointer;
        }

        .text_1 {
            font-weight: 700;
            font-size: 18px;
            color: var(--gold);
        }

        /* User list */
        .list_2 {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .list-items_1-0 {
            background: #302816;
            border-radius: var(--radius);
            padding: 12px;
            display: flex;
            flex-direction: column;
            box-shadow: var(--shadow);
        }

        .section_1-0 {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }

        .image-text_2-0 {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 8px;
        }

        .label_1-0 {
            width: 36px;
            height: 36px;
            border-radius: 6px;
        }

        .text-group_2-0 {
            display: flex;
            flex-direction: column;
        }

        .text_2-0 {
            font-size: 12px;
            color: var(--muted);
        }

        .text_3-0 {
            font-size: 14px;
            font-weight: 700;
            color: var(--gold);
        }

        .text_4-0 {
            font-size: 14px;
            font-weight: 700;
            color: var(--gold);
        }

        .text-wrapper_2-0 {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: var(--muted);
        }

        /* Scroll for long lists */
        .list_2 {
            overflow-y: auto;
            max-height: calc(100vh - 100px);
        }

        /* Responsive */
        @media(max-width: 480px) {
            .text_1 {
                font-size: 16px;
            }

            .text_3-0,
            .text_4-0 {
                font-size: 13px;
            }
        }
    </style>
</head>

<body>
    <div class="page flex-col">
        <!-- Header with Back Button -->
        <div class="box_1 flex-row justify-between">
            <button onclick="goBack()"
                style="background:none; border:none; cursor:pointer; padding:0; margin-right:12px; display:flex; align-items:center;">
                <!-- Inline SVG Back Arrow -->
                <svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none"
                    stroke="#ebca7c" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <polyline points="15 18 9 12 15 6"></polyline>
                </svg>
            </button>
            <span class="text_1">Team Members</span>
        </div>

        <!-- Users List -->
        <div class="list_2 flex-col" id="list_content">
            @foreach($users as $element)
                <div class="list-items_1-0 flex-col">
                    <div class="section_1-0 flex-row justify-between">
                        <div class="image-text_2-0 flex-row justify-between">
                            <div class="text-group_2-0 flex-col justify-between">
                                <span class="text_2-0">Account Number</span>
                                <span class="text_3-0">
                                    {{ substr($element->phone, 0, 3) . str_repeat('*', max(0, strlen($element->phone) - 7)) . substr($element->phone, -4) }}
                                </span>
                            </div>
                        </div>
                        <span class="text_4-0">
                            {{\App\Models\Deposit::where('status', 'approved')->where('user_id', $element->id)->sum('amount')}}
                        </span>
                    </div>
                    <div class="text-wrapper_2-0 flex-row justify-between">
                        <span class="text_5-0"></span>
                        <span class="text_6-0">Register Time: {{$element->created_at}}</span>
                    </div>
                </div>
            @endforeach
        </div>
    </div>

    <script>
        function goBack() {
            window.history.back();
        }
    </script>
</body>

</html>