

<?php $__env->startSection('content'); ?>
<div class="max-w-7xl mx-auto">

    <!-- HEADER -->
    <div class="mb-8">
        <h2 class="text-3xl font-bold tracking-wide">
            ✏️ Edit Consumer
        </h2>
        <p class="text-gray-400 text-sm">Update consumer details</p>
    </div>

    <!-- FORM CARD -->
    <div class="bg-white/10 backdrop-blur-2xl border border-white/20 rounded-2xl shadow-2xl p-8">

        <form method="POST" action="<?php echo e(url('/consumers/'.$data->id)); ?>" class="grid grid-cols-1 md:grid-cols-2 gap-6">
        <?php echo csrf_field(); ?>
        <?php echo method_field('PUT'); ?>

        <!-- BASIC -->
        <div class="col-span-2 section-title">Basic Info</div>

        <div class="input-group">
            <input name="account_zone" value="<?php echo e($data->account_zone); ?>" required>
            <label>Account Zone</label>
        </div>

        <div class="input-group">
            <input name="customer_id" value="<?php echo e($data->customer_id); ?>" required>
            <label>Customer ID</label>
        </div>

        <div class="input-group">
            <input name="distributor_customer_id" value="<?php echo e($data->distributor_customer_id); ?>">
            <label>Distributor Customer ID</label>
        </div>

        <div class="input-group">
            <input name="installation_number" value="<?php echo e($data->installation_number); ?>">
            <label>Installation Number</label>
        </div>

        <div class="input-group">
            <input name="business_partner_number" value="<?php echo e($data->business_partner_number); ?>">
            <label>Business Partner Number</label>
        </div>

        <div class="input-group">
            <input name="consumer_type" value="<?php echo e($data->consumer_type); ?>">
            <label>Consumer Type</label>
        </div>

        <!-- DISCOM -->
        <div class="col-span-2 section-title">DISCOM Details</div>

        <div class="input-group">
            <input name="discom" value="<?php echo e($data->discom); ?>">
            <label>DISCOM</label>
        </div>

        <div class="input-group">
            <input name="discom_consumer_id" value="<?php echo e($data->discom_consumer_id); ?>">
            <label>DISCOM Consumer ID</label>
        </div>

        <!-- DEVICE -->
        <div class="col-span-2 section-title">Meter / Device</div>

        <div class="input-group"><input name="meter_serial_number" value="<?php echo e($data->meter_serial_number); ?>"><label>Meter Serial Number</label></div>
        <div class="input-group"><input name="modem_profile" value="<?php echo e($data->modem_profile); ?>"><label>Modem Profile</label></div>
        <div class="input-group"><input name="imei" value="<?php echo e($data->imei); ?>"><label>IMEI</label></div>
        <div class="input-group"><input name="modem_serial_no" value="<?php echo e($data->modem_serial_no); ?>"><label>Modem Serial No</label></div>
        <div class="input-group"><input name="panel_serial_no" value="<?php echo e($data->panel_serial_no); ?>"><label>Panel Serial No</label></div>
        <div class="input-group"><input name="meter_profile" value="<?php echo e($data->meter_profile); ?>"><label>Meter Profile</label></div>
        <div class="input-group"><input type="number" name="multiplication_factor" value="<?php echo e($data->multiplication_factor); ?>"><label>Multiplication Factor</label></div>

        <!-- COMPANY -->
        <div class="col-span-2 section-title">Company Info</div>

        <div class="input-group"><input name="company_name" value="<?php echo e($data->company_name); ?>"><label>Company Name</label></div>
        <div class="input-group"><input name="contact_person" value="<?php echo e($data->contact_person); ?>"><label>Contact Person</label></div>

        <!-- ADDRESS -->
        <div class="col-span-2 section-title">Address</div>

        <div class="input-group"><input name="flat" value="<?php echo e($data->flat); ?>"><label>Flat / Building</label></div>
        <div class="input-group"><input name="area" value="<?php echo e($data->area); ?>"><label>Area</label></div>
        <div class="input-group"><input name="landmark" value="<?php echo e($data->landmark); ?>"><label>Landmark</label></div>
        <div class="input-group"><input name="pincode" value="<?php echo e($data->pincode); ?>"><label>Pincode</label></div>
        <div class="input-group"><input name="country" value="<?php echo e($data->country); ?>"><label>Country</label></div>
        <div class="input-group"><input name="state" value="<?php echo e($data->state); ?>"><label>State</label></div>
        <div class="input-group"><input name="city" value="<?php echo e($data->city); ?>"><label>City</label></div>

        <!-- LOCATION -->
        <div class="col-span-2 section-title">Location</div>

        <div class="input-group"><input name="latitude" id="lat" value="<?php echo e($data->latitude); ?>"><label>Latitude</label></div>
        <div class="input-group"><input name="longitude" id="lng" value="<?php echo e($data->longitude); ?>"><label>Longitude</label></div>

        <!-- AUTO LOCATION -->
        <div class="col-span-2">
            <button type="button" onclick="getLocation()" class="detect-btn">
                📡 Update Location
            </button>
        </div>

        <!-- SUBMIT -->
        <div class="col-span-2 mt-6">
            <button class="w-full premium-btn">
                💾 Update Consumer
            </button>
        </div>

        </form>
    </div>
</div>

<!-- SAME STYLES (reuse your existing CSS) -->
<style>
.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #e5e7eb;
    margin-top: 10px;
    border-left: 4px solid #6366f1;
    padding-left: 10px;
}

.input-group { position: relative; }

.input-group input {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.input-group label {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #9ca3af;
    transition: 0.3s;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: -8px;
    font-size: 11px;
    background: #111827;
    padding: 0 6px;
    border-radius: 6px;
}

.premium-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    padding: 14px;
    border-radius: 12px;
}

.detect-btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    background: #0ea5e9;
}
</style>

<script>
function getLocation() {
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(function(pos) {
            document.getElementById("lat").value = pos.coords.latitude;
            document.getElementById("lng").value = pos.coords.longitude;
        });
    }
}
</script>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home2/jitrealx/public_html/amccms/resources/views/consumers/edit.blade.php ENDPATH**/ ?>