@extends('admin.layouts.app')

@section('panel')
<div class="row">
    <div class="col-lg-8">
        <div class="card b-radius--10">
            <div class="card-body p-0">
                <div class="table-responsive--md table-responsive">
                    <div class="grid_div">
                        <div class="head_grid">
                            <div class="left_head_grid">
                                <span>Match OODS <i class="fa fa-angle-down" aria-hidden="true"></i></span>
                            </div>
                            <div class="right_head_grid">
                                <a href="#">Bet Lock</a>
                                <a href="#">User Book</a>
                            </div>
                            <div style="clear: both;"></div>
                        </div><!-- head_grid -->
                        <div class="grid_row_content">
                            <div class="grid_row_one">
                                <div class="col_one1 w-75">                        
                                    <span class="playr_count text-right"></span>
                                </div>
                                <div class="col_one2">
                                    <span class="single_number">0</span>
                                    <div class="btn01 blue">
                                        <span>Back</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span>Lay</span>
                                    </div>
                                </div>
                                <div style="clear:both;"></div>
                            </div>
                            <div class="grid_row_one">
                                <div class="col_one1">
                                    <span class="plyer_title">Ales Krejci</span>
                                    <span class="playr_count">0</span>
                                </div>
                                <div class="col_one2">
                                    <div class="btn01 red">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 red">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 blue">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 blue">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                </div>
                                <div style="clear:both;"></div>
                            </div>
                            <div class="grid_row_one">
                                <div class="col_one1">
                                    <span class="plyer_title">Stanislav Olejarcik</span>
                                    <span class="playr_count">0</span>
                                </div>
                                <div class="col_one2">
                                    <div class="btn01 blue">
                                        <span class="strong">2.42</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 blue">
                                        <span class="strong">2.64</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 blue">
                                        <span class="strong">2.64</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">2.64</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">2.64</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">2.64</span>
                                        <span>200L</span>
                                    </div>
                                </div>
                                <div style="clear:both;"></div>
                            </div>
                            <div class="grid_row_one">
                                <div class="col_one1">
                                    <span class="plyer_title">Oliver Twist</span>
                                    <span class="playr_count">0</span>
                                </div>
                                <div class="col_one2">
                                    <div class="btn01 green">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 green">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 blue">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 blue">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                </div>
                                <div style="clear:both;"></div>
                            </div>
                            <div class="grid_row_one">
                                <div class="col_one1">
                                    <span class="plyer_title">Oliver Twist</span>
                                    <span class="playr_count">0</span>
                                </div>
                                <div class="col_one2">
                                    <div class="btn01 green">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 green">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 blue">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 blue">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                </div>
                                <div style="clear:both;"></div>
                            </div>
                            <div class="grid_row_one">
                                <div class="col_one1">
                                    <span class="plyer_title">Oliver Twist</span>
                                    <span class="playr_count">0</span>
                                </div>
                                <div class="col_one2">
                                    <div class="btn01 green">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 green">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 blue">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 blue">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                </div>
                                <div style="clear:both;"></div>
                            </div>
                            <div class="grid_row_one">
                                <div class="col_one1">
                                    <span class="plyer_title">Oliver Twist</span>
                                    <span class="playr_count">0</span>
                                </div>
                                <div class="col_one2">
                                    <div class="btn01 blue">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 blue">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 blue">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                </div>
                                <div style="clear:both;"></div>
                            </div>
                            <div class="grid_row_one">
                                <div class="col_one1">
                                    <span class="plyer_title">Oliver Twist</span>
                                    <span class="playr_count">0</span>
                                </div>
                                <div class="col_one2">
                                    <div class="btn01 blue">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 blue">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 pink">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 blue">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                    <div class="btn01 blue">
                                        <span class="strong">1.62</span>
                                        <span>200L</span>
                                    </div>
                                </div>
                                <div style="clear:both;"></div>
                            </div>
                        </div><!-- grid_row_content -->
                    </div><!-- grid_div -->

    
                    </div>
                </div>

             
                    <div class="card-footer py-4">
                        
                    </div>
              
            </div>
        </div><!-- col-lg-8 -->

        <div class="col-lg-4">
        <div class="card b-radius--10">
            <div class="card-body p-0">
                <div class="table-responsive--md table-responsive">
                    <div class="grid_div">
                        <div class="head_grid">
                            <div class="left_head_grid">
                                <span>My Bets <i class="fa fa-angle-down" aria-hidden="true"></i></span>
                            </div>
                            <div class="right_head_grid">
                                <!-- <a href="#">Bet Lock</a> -->
                                <a href="#">View more</a>
                            </div>
                            <div style="clear: both;"></div>
                        </div><!-- head_grid -->
                        <div class="grid_row_content">
                            
                        <div class="tabs">
                            <div class="tab-buttons">
                              <button class="tab-btn active" data-tab="tab1">Matched Bets</button>
                              <!-- <button class="tab-btn" data-tab="tab2">Tab 2</button>
                              <button class="tab-btn" data-tab="tab3">Tab 3</button> -->
                            </div>
                            <div class="tab-content">
                              <div id="tab1" class="tab-panel active">
                                <div class="container">
                                  <div class="row">
                                        <div class="col-md-3">UserName</div>
                                        <div class="col-md-3">Nation</div>
                                        <div class="col-md-3">Rate</div>
                                        <div class="col-md-3">Amount</div>
                                  </div>
                                  <div class="row all_records_row">
                                        <div class="col-md-12">
                                            No records found
                                        </div>
                                  </div>
                              </div>
                              </div>
                              <!-- <div id="tab2" class="tab-panel">Content for Tab 2</div>
                              <div id="tab3" class="tab-panel">Content for Tab 3</div> -->
                            </div>
                        </div>      
                           
                        </div><!-- grid_row_content -->
                    </div><!-- grid_div -->    
                    </div>
                </div>

             
                   <!--  <div class="card-footer py-4">
                        
                    </div> -->
              
            </div>
        </div><!-- col-lg-8 -->
    </div>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script>
    $(document).ready(function () {
        $('.left_head_grid span').click(function () {
            // Toggle the visibility of the grid_row_content div
            $('.grid_row_content').slideToggle();

            // Toggle the icon class within the span
            $(this).find('i').toggleClass('fa-angle-down fa-angle-up');
        });
    });
    </script>

    <script>
        document.addEventListener('DOMContentLoaded', () => {
        const buttons = document.querySelectorAll('.tab-btn');
        const panels = document.querySelectorAll('.tab-panel');
            buttons.forEach(button => {
                button.addEventListener('click', () => {
                  // Remove active class from all buttons and panels
                  buttons.forEach(btn => btn.classList.remove('active'));
                  panels.forEach(panel => panel.classList.remove('active'));

                  // Add active class to the clicked button and corresponding panel
                  button.classList.add('active');
                  const tabId = button.getAttribute('data-tab');
                  document.getElementById(tabId).classList.add('active');
                });
            });
        });
  </script>

    <style>
        body {
            margin: 0;
            padding: 0;
        }
       /* .grid_div{
            width: 800px;
        }*/
        .head_grid{
            background: #333;
            color: #fff;
            padding:10px;
            border-radius: 2px;
        }
        .left_head_grid{
            float: left;
            cursor: pointer;
        }   
        .left_head_grid span{
            color:#fff;
        }   
        .right_head_grid{
            float:right;
        }
        .right_head_grid a{
            background: #f18521;
            color: #fff;
            display: inline-block;
            width: 100px;
            text-align: center;
            text-decoration: none;
            font-size: 14px;
            height: 30px;
            line-height: 30px;
            border-radius: 5px;
        }
        .grid_row_content .grid_row_one{
            padding:2px 0;
            border-bottom: 1px solid rgba(0, 0, 0, .07);
        }
        .grid_row_content .grid_row_one .col_one1{
            float:left;
            /*width: 85%;*/
        }
        .grid_row_content .grid_row_one .col_one1 span{
            display: block;
            padding-left: 10px;
        }
        .grid_row_content .grid_row_one .col_one1 span.playr_count.text-right{
            text-align: right;
        }
        .grid_row_content .grid_row_one .col_one2 {
            float:right;
        }
        .grid_row_content .grid_row_one .col_one2 .btn01{
            background: #72bbef;
            color: #333;
            width: 80px;
            /* height: 35px; */
            border-radius: 3px;
            text-align: center;
            padding: 3px 0;
            display: inline-block;
        }
        .grid_row_content .grid_row_one .col_one2 .btn01.blue{
            background: #72bbef;
        }

        .grid_row_content .grid_row_one .col_one2 .btn01.pink{
            background: #e16f9a;
        }

        .grid_row_content .grid_row_one .col_one2 .btn01.green{
            background: #34c38f;
        }
        .grid_row_content .grid_row_one .col_one2 .btn01.red{
            background: #f46a6a;
        }

        .grid_row_content .grid_row_one .col_one2 .btn01 span{
            display: block;
            line-height: 18px;
            font-size: 16px;
            color:#000;
        }

        .grid_row_content .grid_row_one .col_one2 .btn01 span.strong{
            font-weight: 600;
        }

        /*----tabs content----*/

        .grid_row_content .tabs{
            margin-top: 10px;
        }

        .grid_row_content .tab-btn {
            flex: 1;
            padding: 10px 15px;
            text-align: center;
            border: none;
            background: #f9f9f9;
            cursor: pointer;
            transition: background 0.3s;
            font-size: 12px;
        }

        .grid_row_content .tab-btn.active {
            background: #fff;
            color: #333;
            border-top: 1px solid #ccc;
            border-left: 1px solid #ccc;
            border-right: 1px solid #ccc;
            border-bottom: 1px solid #fff;

        }

        .grid_row_content .tab-btn:hover {
            background: #ddd;
        }

        /* Content Styles */
        .grid_row_content .tab-content {
            margin-top: 10px;
            border-top: 1px solid #ccc;
            margin-top: -1px;
        }

        .grid_row_content .tab-content .tab-panel .row .col-md-3{
            font-size: 12px;
            text-align: center;
            font-weight: 500;
            padding: 10px 0;
        }

        .grid_row_content .tab-panel {
            display: none;
        }

        .grid_row_content .tab-panel.active {
            display: block;
        }

        .grid_row_content .tab-panel .container .row{
            border-top: 1px solid #ccc;
        }

        .grid_row_content .tab-panel .container .row:first-child{
            border:none;
        }

        .grid_row_content .tabs .tab-buttons{
/*            border-bottom: 1px solid #ccc;*/
        }

        .all_records_row{
            font-size: 13px;
            padding:20px 0;
        }

    </style>
    <x-confirmation-modal />

    <div class="offcanvas offcanvas-end" id="offcanvasRight" aria-labelledby="offcanvasRightLabel" tabindex="-1">
        <div class="offcanvas-header">
            <h5 id="offcanvasRightLabel">@lang('Filter by')</h5>
            <button class="close bg--transparent" data-bs-dismiss="offcanvas" type="button" aria-label="Close">
                <i class="las la-times"></i>
            </button>
        </div>
        <div class="offcanvas-body">
            <form action="">
                <div class="form-group">
                    <label>@lang('Team One')</label>
                    <select class="form-control select2-basic" name="team_one_id">
                        <option value="">@lang('All')</option>
                       
                    </select>
                </div>
                <div class="form-group">
                    <label>@lang('Team Two')</label>
                    <select class="form-control select2-basic" name="team_two_id">
                        <option value="">@lang('All')</option>
                        
                    </select>
                </div>
                <div class="form-group">
                    <label>@lang('Leauge')</label>
                    <select class="form-control select2-basic" name="league_id">
                        <option value="">@lang('All')</option>
                       
                    </select>
                </div>
                <div class="form-group">
                    <label>@lang('Game Started From')</label>
                    <input name="start_time" type="search" class="datepicker-here form-control bg--white pe-2 date-range" placeholder="@lang('Start Date - End Date')" autocomplete="off" value="{{ request()->start_time }}">
                </div>
                <div class="form-group">
                    <label>@lang('Bet Started From')</label>
                    <input name="bet_start_time" type="search" class="datepicker-here form-control bg--white pe-2 date-range" placeholder="@lang('Start Date - End Date')" autocomplete="off" value="{{ request()->bet_start_time }}">
                </div>
                <div class="form-group">
                    <label>@lang('Bet Ended At')</label>
                    <input name="bet_end_time" type="search" class="datepicker-here form-control bg--white pe-2 date-range" placeholder="@lang('Start Date - End Date')" autocomplete="off" value="{{ request()->bet_end_time }}">
                </div>
                <div class="form-group">
                    <button class="btn btn--primary w-100 h-45"> @lang('Filter')</button>
                </div>
            </form>
        </div>
    </div>
@endsection

@push('style')
    <style>
        .thumb img {
            width: 30px;
            height: 30px;
        }
    </style>
@endpush

@push('breadcrumb-plugins')
    <button class="btn btn-sm btn-outline--info " data-bs-toggle="offcanvas" data-bs-target="#offcanvasRight" type="button" aria-controls="offcanvasRight"><i class="las la-filter"></i> @lang('Filter')</button>
    <a class="btn btn-sm btn-outline--primary " href="{{ route('admin.game.create') }}"><i class="las la-plus"></i>@lang('Add New')</a>
@endpush

@push('script-lib')
    <script src="{{ asset('assets/admin/js/moment.min.js') }}"></script>
    <script src="{{ asset('assets/global/js/daterangepicker.min.js') }}"></script>
@endpush

@push('style-lib')
    <link rel="stylesheet" type="text/css" href="{{ asset('assets/global/css/daterangepicker.css') }}">
@endpush
@push('script')
    <script>
        (function($) {
            "use strict"

            const datePicker = $('.date-range').daterangepicker({
                autoUpdateInput: false,
                locale: {
                    cancelLabel: 'Clear'
                },
                showDropdowns: true,
                ranges: {
                    'Today': [moment(), moment()],
                    'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
                    'Last 7 Days': [moment().subtract(6, 'days'), moment()],
                    'Last 15 Days': [moment().subtract(14, 'days'), moment()],
                    'Last 30 Days': [moment().subtract(30, 'days'), moment()],
                    'This Month': [moment().startOf('month'), moment().endOf('month')],
                    'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')],
                    'Last 6 Months': [moment().subtract(6, 'months').startOf('month'), moment().endOf('month')],
                    'This Year': [moment().startOf('year'), moment().endOf('year')],
                },
                maxDate: moment()
            });
            const changeDatePickerText = (event, startDate, endDate) => {
                $(event.target).val(startDate.format('MMMM DD, YYYY') + ' - ' + endDate.format('MMMM DD, YYYY'));
            }


            $('.date-range').on('apply.daterangepicker', (event, picker) => changeDatePickerText(event, picker.startDate, picker.endDate));


            if ($('.date-range').val()) {
                let dateRange = $('.date-range').val().split(' - ');
                $('.date-range').data('daterangepicker').setStartDate(new Date(dateRange[0]));
                $('.date-range').data('daterangepicker').setEndDate(new Date(dateRange[1]));
            }

        })(jQuery)
    </script>
@endpush
