@extends('layouts.master')
@section('content')
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
        integrity="sha384-k6RqeWeci5ZR/Lv4MR0sA0FfDOMQ6Tn2b4YZRt1ImZgHXtB4tmco7nh4/PkFALK9" crossorigin="anonymous">

    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f0f0f0;
        }

        .profile-container {
            padding: 20px;
        }

        .profile-card {
            background-color: #fff;
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .profile-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
        }

        .profile-card.bg-az-primary {
            background-color: #00beda;
            color: #fff;
            text-align: center;
        }

        .profile-card.bg-az-primary .card-body img {
            border: 4px solid #fff;
            border-radius: 50%;
            margin-top: -80px;
        }

        .profile-card h2 {
            font-size: 22px;
            color: #333;
            margin-bottom: 20px;
        }

        .profile-card h4.card-title {
            font-size: 26px;
            font-weight: bold;
            margin-bottom: 20px;
        }

        .profile-card .badge {
            font-size: 14px;
            padding: 5px 10px;
            border-radius: 20px;
            background-color: #00beda;
        }

        .profile-card #personal-info label {
            font-size: 16px;
            color: #6c757d;
        }

        .profile-card #personal-info span {
            font-size: 16px;
            color: #212529;
        }

        .profile-card .text-primary {
            color: #00beda;
            /* Applied theme color */
        }

        .profile-card i.fas {
            font-size: 18px;
            margin-right: 8px;
            color: #00beda;
            /* Applied theme color to icons */
        }

        .details-card {
            background-color: #fff;
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 20px;
        }

        .details-card h3 {
            font-size: 20px;
            color: #333;
            margin-top: 0;
            margin-bottom: 20px;
        }

        .detail-box {
            background-color: #f8f9fa;
            border: 1px solid #ced4da;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 15px;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .detail-box:hover {
            transform: translateY(-5px);
            box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
        }

        .detail-box h4 {
            font-size: 18px;
            color: #333;
            margin-top: 0;
            margin-bottom: 10px;
        }

        .detail-box p {
            font-size: 16px;
            color: #666;
            margin-bottom: 0;
        }

        .detail-box .text-primary {
            color: #00beda;
            /* Applied theme color */
        }

        .detail-box .badge {
            background-color: #00beda;
            color: #fff;
            font-size: 14   px;
            padding: 5px 10px;
            border-radius: 20px;
        }

        .text-primary {
            color: #00beda;
        }

        .fas {
            color: #00beda;
            /* Applied theme color to all icons */
        }
    </style>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
        }

        /* header {
                                            background-color: #333;
                                            color: #fff;
                                            text-align: center;
                                            padding: 20px 0;
                                            margin-bottom: 20px;
                                        } */

        h1 {
            margin: 0;
        }

        /* main {
                                            max-width: 800px;
                                            margin: 0 auto;
                                            padding: 20px;
                                            background-color: #fff;
                                            border-radius: 8px;
                                            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
                                        } */
        .bg-az-primary {
            background-color: #09bad5;
            /* Replace with your desired shade of blue */
        }

        section {
            margin-bottom: 20px;
        }

        h2 {
            color: #333;
            border-bottom: 2px solid #ccc;
            padding-bottom: 5px;
            margin-bottom: 10px;
        }

        label {
            font-weight: bold;
            display: inline-block;
            width: 120px;
            margin-right: 10px;
            padding: 7px
        }

        span {
            /* display: inline-block; */
            margin-bottom: 5px;
            padding: 7px
        }

        footer {
            background-color: #333;
            color: #fff;
            text-align: center;
            padding: 10px 0;
            position: fixed;
            bottom: 0;
            width: 100%;
        }

        .table-responsive {
            height: 400px;
            /* Set the height for scrollable area */
            overflow-y: auto;
            /* Enable vertical scroll bar */
        }

        #example1,
        #example2,
        #example3 {
            table-layout: auto;
            /* Ensure the table layout is fixed */
            width: 100%;
            /* Make sure the table takes up the full width of its container */
        }

        #example1 th,
        #example1 td,
        #example2 th,
        #example2 td,
        #example3 th,
        #example3 td {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        #example1 tfoot th,
        #example1 tfoot td,
        #example2 tfoot th,
        #example2 tfoot td,
        #example3 tfoot th,
        #example3 tfoot td {
            height: 50px;
            background-color: #f8f9fa;
            font-weight: bold;
            text-align: center;
        }

        #example1 tfoot th,
        #example1 tfoot td {
            background-color: #d1ecf1;
        }

        #example2 tfoot th,
        #example2 tfoot td {
            background-color: #d4edda;
        }

        #example3 tfoot th,
        #example3 tfoot td {
            background-color: #f8d7da;
        }

        .customer-details-card {
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            padding: 20px;
        }

        .card-title {
            color: #333;
            font-size: 1.2rem;
            margin-bottom: 1rem;
        }

        .section-title {
            color: #666;
            font-size: 1rem;
            margin-bottom: 1rem;
        }

        .info-item {
            margin-bottom: 1.5rem;
        }

        label {
            font-weight: bold;
            color: #444;
        }

        span {
            color: #666;
        }
    </style>

    {{-- <div class="breadcrumb rounded p-2" style="border-radius: 5px; background-color: #00beda">
    <span class="breadcrumb-item text-white" aria-current="page">Home</span>
    <span class="breadcrumb-item active text-white" aria-current="page">Customers</span>
</div> --}}

    <br>
    <h2 class="az-content-title" style="display: inline"> Customers Details <span>
            <a href="{{ url('customers') }}" class="btn btn-az-primary" style="float: right">Customers</a></span>
    </h2>
    <div class="row">
        <div class="col-md-12">
            @if (Session('alert'))
                <div class="alert alert-card alert-<?php echo Session('alert-class'); ?>" role="alert">
                    <?php echo Session('alert'); ?>
                    <button class="close" type="button" data-dismiss="alert" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                </div>
            @endif
        </div>
    </div>

    {{-- <div class="separator-breadcrumb border-top"></div> --}}
    <div class="row profile-container">
        <!-- Profile Information -->
        <div class="col-md-4">
            <!-- Customer Profile Card -->
            <div class="profile-card  text-white mb-4">
                <div class="card-body text-center">
                    <h4 class="card-title"><b>{{ $view->customer_name }}</b></h4>
                   
                        <span class="badge bg-dark rounded-pill"></span>
                    
                    <hr>
                    <img src="{{ asset('images/logo-icon.png') }}"
                         class="card-img-top img-fluid rounded-circle shadow-sm my-3"
                         style="max-width: 150px;"
                         alt="Customer Image">
                </div>
            </div>

            <!-- Personal Information Card -->
            <div class="profile-card bg-light shadow-sm rounded p-4">
                <section id="personal-info">
                    <h2 class="mb-4 text-center" style="color: #00beda;">Personal Information</h2>
                    <div class="mb-3 d-flex align-items-center">
                        <i class="fas fa-user me-3" style="color: #00beda;"></i>
                        <label for="Customer-name" class="fw-bold text-muted me-2">Name:</label>
                        <span id="Customer-name" class="text-dark">{{ $view->customer_name }}</span>
                    </div>
                    <div class="mb-3 d-flex align-items-center">
                        <i class="fas fa-envelope me-3" style="color: #00beda;"></i>
                        <label for="Customer-email" class="fw-bold text-muted me-2">Email:</label>
                        <span id="Customer-email" class="text-dark">{{ $view->customer_email }}</span>
                    </div>
                    <div class="mb-3 d-flex align-items-center">
                        <i class="fas fa-phone me-3" style="color: #00beda;"></i>
                        <label for="Customer-cell" class="fw-bold text-muted me-2">Cell:</label>
                        <span id="Customer-cell" class="text-dark">{{ $view->customer_cell }}</span>
                    </div>
                    <div class="mb-3 d-flex align-items-center">
                        <i class="fas fa-id-card me-3" style="color: #00beda;"></i>
                        <label for="Customer-type" class="fw-bold text-muted me-2">Type:</label>
                        <span id="Customer-type" class="text-dark">{{ $view->customer_type }}</span>
                    </div>
                    <div class="mb-3 d-flex align-items-center">
                        <i class="fas fa-map-marker-alt me-3" style="color: #00beda;"></i>
                        <label for="Customer-address" class="fw-bold text-muted me-2">Address:</label>
                        <span id="Customer-address" class="text-dark">{{ $view->customer_address }}</span>
                    </div>
                </section>
            </div>
        </div>

        <!-- Details Section -->
        <div class="col-md-8">
            <div class="details-card bg-white shadow-sm rounded p-4">
                <div class="row">
                    <h4>Payment History</h4><hr>
                    <table id="example2" class="table table-invoice">
                        <thead>
                            <tr>
                                <th class="wd-2">S.No</th>
                                <th class="wd-2">Sale Order</th>
                                <th class="wd-20p">Amount</th>
                                <th class="wd-15p">Received</th>
                                <th class="wd-15p">Ageing</th>
                                <th class="wd-15p">Status</th>
                                <th class="wd-15p ">Date</th>
                                <th class="none">Operations</th>
                            </tr>
                        </thead>
                        <tbody>
                        
                        </tbody>
                        <tfoot>
                            <tr>
                                <th class="wd-2">S.No</th>
                                <th class="wd-2">Sale Order</th>
                                <th class="wd-20p">Amount</th>
                                <th class="wd-15p">Received</th>
                                <th class="wd-15p">Ageing</th>
                                <th class="wd-15p">Status</th>
                                <th class="wd-15p ">Date</th>
                                <th class="none">Operations</th>
                            </tr>
                        </tfoot>
                    </table>
                    
                    
<!--                     First Column 
                    <div class="col-md-6">
                        <div class="detail-box mb-4 p-3 bg-light rounded shadow-sm">
                            <div class="d-flex justify-content-between align-items-center mb-2">
                                <h4 class="mb-0" style="color: #00beda;">
                                    <i class="fas fa-chart-line me-2" style="color: #00beda;"></i>Revenue
                                </h4>
                                <span class="badge bg-success rounded-pill px-2 py-1">+25%</span>
                            </div>
                            <h5 class="text-primary">0</h5>
                            <small class="text-muted">since last month</small>
                        </div>
                        <div class="detail-box mb-4 p-3 bg-light rounded shadow-sm">
                            <div class="d-flex justify-content-between align-items-center mb-2">
                                <h4 class="mb-0" style="color: #ffcc00;">
                                    <i class="fas fa-exclamation-circle me-2" style="color: #ffcc00;"></i>Pending Payment
                                </h4>
                                <span class="badge bg-warning rounded-pill px-2 py-1">2 overdue</span>
                            </div>
                            <h5 class="text-primary">0</h5>
                            <small class="text-muted">needs attention</small>
                        </div>
                        <div class="detail-box p-3 bg-light rounded shadow-sm">
                            <div class="d-flex justify-content-between align-items-center mb-2">
                                <h4 class="mb-0" style="color: #00beda;">
                                    <i class="fas fa-shopping-cart me-2" style="color: #00beda;"></i>Total Purchases
                                </h4>
                                <span class="badge bg-info rounded-pill px-2 py-1">Last: 2 days ago</span>
                            </div>
                            <h5 class="text-primary">0</h5>
                            <small class="text-muted">transactions completed</small>
                        </div>
                    </div>
                     Second Column 
                    <div class="col-md-6">
                        <div class="detail-box mb-4 p-3 bg-light rounded shadow-sm">
                            <div class="d-flex justify-content-between align-items-center mb-2">
                                <h4 class="mb-0" style="color: #6c757d;">
                                    <i class="fas fa-dollar-sign me-2" style="color: #6c757d;"></i>Total Payments
                                </h4>
                                <span class="badge bg-secondary rounded-pill px-2 py-1">Details</span>
                            </div>
                            <h5 class="text-primary">0</h5>
                            <small class="text-muted">in total</small>
                        </div>
                        
                    </div>-->
                </div>
            </div>
        </div>
    </div>

@endsection

@push('scripts')
    <script type="text/javascript">
        $(document).ready(function() {

            $('#example1 tfoot th').each(function() {
                var title = $(this).text();
                $(this).html('<input type="text" class="form-control" placeholder="' + title + '" />');
            });
            $('#example2 tfoot th').each(function() {
                var title = $(this).text();
                $(this).html('<input type="text" class="form-control" placeholder="' + title + '" />');
            });
            $('#example3 tfoot th').each(function() {
                var title = $(this).text();
                $(this).html('<input type="text" class="form-control" placeholder="' + title + '" />');
            });




            $('#example1').DataTable({
                "ordering": true,
                "dom": 'Blfrtip',
                "buttons": [
                    'excel', 'pdf', 'print'
                ],
                responsive: !0,
                columnDefs: [{
                    className: 'control'
                }],
                initComplete: function() {
                    // Apply the search
                    this.api()
                        .columns()
                        .every(function() {
                            var that = this;

                            $('input', this.footer()).on('keyup change clear', function() {
                                if (that.search() !== this.value) {
                                    that.search(this.value).draw();
                                }
                            });
                        });
                }
            });
            $('#example2').DataTable({
                "ordering": true,
                "searching": false,
                "dom": 'Blfrtip',
                "buttons": [
                    'excel', 'pdf', 'print'
                ],
                responsive: !0,
                columnDefs: [{
                    className: 'control'
                }],
                initComplete: function() {
                    // Apply the search
                    this.api()
                        .columns()
                        .every(function() {
                            var that = this;

                            $('input', this.footer()).on('keyup change clear', function() {
                                if (that.search() !== this.value) {
                                    that.search(this.value).draw();
                                }
                            });
                        });
                }
            });
            $('#example3').DataTable({
                "ordering": true,
                "dom": 'Blfrtip',
                "buttons": [
                    'excel', 'pdf', 'print'
                ],
                responsive: !0,
                columnDefs: [{
                    className: 'control'
                }],
                initComplete: function() {
                    // Apply the search
                    this.api()
                        .columns()
                        .every(function() {
                            var that = this;

                            $('input', this.footer()).on('keyup change clear', function() {
                                if (that.search() !== this.value) {
                                    that.search(this.value).draw();
                                }
                            });
                        });
                }
            });
        });
        $(document).on('click', '.delete', function() {
            if (confirm('Are you sure want to delete?')) {} else {
                return false;
            }
        });
    </script>
@endpush
