<?php $__env->startSection('title', $title); ?>
<?php $__env->startSection('content'); ?>

<div class="min-h-screen bg-gray-50 dark:bg-gray-900 py-8" x-data="{ showCodeInfo: false, selectedMethod: '' }">
    <div class="container mx-auto px-6">
        <!-- Header -->
        <div class="flex flex-col lg:flex-row lg:items-center justify-between mb-8 gap-4">
            <div>
                <h1 class="text-3xl md:text-4xl font-bold text-gray-900 dark:text-white">Fund Withdrawals</h1>
                <p class="text-gray-600 dark:text-gray-400 mt-2">Securely withdraw your funds using various payment methods</p>
            </div>
            <a href="<?php echo e(route('dashboard')); ?>"
               class="inline-flex items-center gap-2 px-6 py-3 bg-white hover:bg-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-xl font-medium transition-all duration-200 shadow-lg hover:shadow-xl border border-gray-200 dark:border-gray-700">
                <i data-lucide="arrow-left" class="w-5 h-5"></i>
                Back to Dashboard
            </a>
        </div>

        <!-- Alert Messages -->
        <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.danger-alert','data' => []]); ?>
<?php $component->withName('danger-alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
        <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.success-alert','data' => []]); ?>
<?php $component->withName('success-alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>

        <!-- Breadcrumbs -->
        <nav class="flex mb-6" aria-label="Breadcrumb">
            <ol class="inline-flex items-center space-x-1 md:space-x-3">
                <li class="inline-flex items-center">
                    <a href="<?php echo e(route('dashboard')); ?>" class="inline-flex items-center text-sm text-gray-600 hover:text-blue-600 dark:text-gray-400 dark:hover:text-blue-400">
                        <i data-lucide="home" class="w-4 h-4 mr-2"></i>
                        Home
                    </a>
                </li>
                <li aria-current="page">
                    <div class="flex items-center">
                        <i data-lucide="chevron-right" class="w-4 h-4 text-gray-400 mx-1"></i>
                        <span class="text-sm text-gray-500 dark:text-gray-400">Withdrawals</span>
                    </div>
                </li>
            </ol>
        </nav>

        <?php if(Auth::user()->withdrawal_code === 'on'): ?>
            <!-- Withdrawal Code Required Section -->
            <div class="bg-white dark:bg-gray-800 rounded-2xl shadow-xl border border-gray-200 dark:border-gray-700 max-w-4xl mx-auto">
                <div class="p-8 border-b border-gray-200 dark:border-gray-700">
                    <div class="flex items-center gap-4">
                        <div class="p-4 bg-gradient-to-br from-amber-100 to-orange-100 dark:from-amber-900/30 dark:to-orange-900/30 rounded-xl">
                            <i data-lucide="shield-check" class="w-8 h-8 text-amber-600 dark:text-amber-400"></i>
                        </div>
                        <div>
                            <h2 class="text-2xl font-bold text-gray-900 dark:text-white">Security Verification Required</h2>
                            <p class="text-gray-600 dark:text-gray-400 mt-1">Additional verification needed to process your withdrawal</p>
                        </div>
                    </div>
                </div>

                <div class="p-8">
                    <!-- Enhanced Warning Message -->
                    <div class="bg-gradient-to-r from-amber-50 to-orange-50 dark:from-amber-900/20 dark:to-orange-900/20 border-l-4 border-amber-500 p-6 mb-8 rounded-lg">
                        <div class="flex">
                            <div class="flex-shrink-0">
                                <i data-lucide="info" class="h-6 w-6 text-amber-600" aria-hidden="true"></i>
                            </div>
                            <div class="ml-4">
                                <div class="text-base font-medium text-amber-800 dark:text-amber-300 mb-2">
                                    Withdrawal Code Required
                                </div>
                                <p class="text-sm text-amber-700 dark:text-amber-400 leading-relaxed">
                                    For your security, this withdrawal requires a verification code. Please contact our customer support team via live chat or email at
                                    <a href="mailto:<?php echo e($settings->contact_email); ?>" class="font-semibold underline hover:text-amber-600 transition-colors"><?php echo e($settings->contact_email); ?></a>
                                    to obtain your withdrawal verification code.
                                </p>
                                <button @click="showCodeInfo = !showCodeInfo" class="mt-3 flex items-center text-sm font-medium text-amber-700 dark:text-amber-400 hover:text-amber-600 transition-colors">
                                    <span x-text="showCodeInfo ? 'Hide security details' : 'Learn about withdrawal security'"></span>
                                    <i x-bind:data-lucide="showCodeInfo ? 'chevron-up' : 'chevron-down'" class="ml-1 w-4 h-4"></i>
                                </button>
                                <div x-show="showCodeInfo" x-transition:enter="transition ease-out duration-200" x-transition:enter-start="opacity-0 transform -translate-y-2" x-transition:enter-end="opacity-100 transform translate-y-0" class="mt-3 p-4 bg-amber-100/50 dark:bg-amber-900/30 rounded-lg text-sm text-amber-700 dark:text-amber-400" style="display: none;">
                                    <p class="font-medium mb-2">Why withdrawal codes are required:</p>
                                    <ul class="space-y-1 text-xs">
                                        <li>• Enhanced security to protect your account from unauthorized access</li>
                                        <li>• Verification that all withdrawal requests are legitimate and authorized</li>
                                        <li>• Additional layer of protection against fraudulent transactions</li>
                                        <li>• Compliance with financial security regulations and best practices</li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- Enhanced Withdrawal Code Form -->
                    <div class="bg-gray-50 dark:bg-gray-700/30 rounded-xl p-6">
                        <form action="<?php echo e(route('userwithdrawal')); ?>" method="post" class="space-y-6">
                            <?php echo csrf_field(); ?>
                            <div>
                                <label for="withdrawal_code" class="block text-sm font-semibold text-gray-700 dark:text-gray-300 mb-3">
                                    Enter Withdrawal Verification Code
                                </label>
                                <div class="relative">
                                    <div class="absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none">
                                        <i data-lucide="shield-check" class="h-5 w-5 text-gray-400"></i>
                                    </div>
                                    <input type="text"
                                           name="withdrawal_code"
                                           id="withdrawal_code"
                                           required
                                           placeholder="Enter your verification code here"
                                           class="pl-12 block w-full rounded-xl border-gray-300 dark:border-gray-600 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:text-white text-base py-4 transition-all duration-200"
                                    />
                                </div>
                                <p class="mt-2 text-xs text-gray-500 dark:text-gray-400">This code was provided by our customer support team</p>
                            </div>

                            <button type="submit" class="w-full inline-flex justify-center items-center gap-2 py-4 px-6 bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 text-white font-semibold rounded-xl transition-all duration-200 shadow-lg hover:shadow-xl transform hover:scale-[1.02]">
                                <i data-lucide="check-circle" class="h-5 w-5"></i>
                                <span>Verify & Continue</span>
                            </button>
                        </form>
                    </div>
                </div>
            </div>

<?php else: ?>
        <!-- Withdrawal Method Selection -->
        <div class="bg-white dark:bg-gray-800 rounded-2xl shadow-xl border border-gray-200 dark:border-gray-700 max-w-4xl mx-auto mb-8">
            <div class="p-8 border-b border-gray-200 dark:border-gray-700">
                <div class="flex items-center gap-4">
                    <div class="p-4 bg-gradient-to-br from-blue-100 to-indigo-100 dark:from-blue-900/30 dark:to-indigo-900/30 rounded-xl">
                        <i data-lucide="credit-card" class="w-8 h-8 text-blue-600 dark:text-blue-400"></i>
                    </div>
                    <div>
                        <h2 class="text-2xl font-bold text-gray-900 dark:text-white">Select Withdrawal Method</h2>
                        <p class="text-gray-600 dark:text-gray-400 mt-1">Choose your preferred payment method for receiving funds</p>
                    </div>
                </div>
            </div>

            <div class="p-8">
                <form method="POST" action="<?php echo e(route('withdrawamount')); ?>" class="space-y-8">
                    <?php echo csrf_field(); ?>

                    <!-- Enhanced Withdrawal Method Selector -->
                    <div>
                        <label for="method" class="block text-sm font-semibold text-gray-700 dark:text-gray-300 mb-4">
                            Payment Method
                        </label>
                        <div class="relative">
                            <select
                                name="method"
                                id="method"
                                required
                                x-model="selectedMethod"
                                class="appearance-none block w-full pl-4 pr-12 py-4 border border-gray-300 dark:border-gray-600 rounded-xl shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-800 dark:text-white text-base transition-all duration-200"
                            >
                                <option value="" disabled selected>Choose a withdrawal method</option>
                                <?php $__empty_1 = true; $__currentLoopData = $wmethods; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $method): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <option value="<?php echo e($method->name); ?>"><?php echo e($method->name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <option value="" disabled>No withdrawal methods available</option>
                                <?php endif; ?>
                            </select>
                            <div class="absolute inset-y-0 right-0 flex items-center px-3 pointer-events-none">
                                <i data-lucide="chevron-down" class="h-5 w-5 text-gray-400"></i>
                            </div>
                        </div>
                    </div>

                    <!-- Enhanced Method Details Card -->
                    <div x-show="selectedMethod" x-transition:enter="transition ease-out duration-300" x-transition:enter-start="opacity-0 transform scale-95" x-transition:enter-end="opacity-100 transform scale-100" class="bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 rounded-xl p-6 border border-blue-200 dark:border-blue-700" style="display: none;">
                        <div class="flex items-start gap-4">
                            <!-- Enhanced Dynamic icon based on method -->
                            <div class="p-3 rounded-xl shadow-sm" :class="{
                                'bg-orange-100 dark:bg-orange-900/30': selectedMethod === 'Bitcoin',
                                'bg-blue-100 dark:bg-blue-900/30': selectedMethod === 'Ethereum',
                                'bg-green-100 dark:bg-green-900/30': selectedMethod === 'Bank Transfer',
                                'bg-purple-100 dark:bg-purple-900/30': selectedMethod === 'USDT',
                                'bg-gray-100 dark:bg-gray-900/30': !['Bitcoin', 'Ethereum', 'Bank Transfer', 'USDT'].includes(selectedMethod)
                            }">
                                <i :data-lucide="selectedMethod === 'Bitcoin' ? 'bitcoin' : (selectedMethod === 'Ethereum' ? 'zap' : (selectedMethod === 'Bank Transfer' ? 'building-bank' : (selectedMethod === 'USDT' ? 'circle-dollar-sign' : 'credit-card')))" class="w-6 h-6" :class="{
                                    'text-orange-600 dark:text-orange-400': selectedMethod === 'Bitcoin',
                                    'text-blue-600 dark:text-blue-400': selectedMethod === 'Ethereum',
                                    'text-green-600 dark:text-green-400': selectedMethod === 'Bank Transfer',
                                    'text-purple-600 dark:text-purple-400': selectedMethod === 'USDT',
                                    'text-gray-600 dark:text-gray-400': !['Bitcoin', 'Ethereum', 'Bank Transfer', 'USDT'].includes(selectedMethod)
                                }"></i>
                            </div>
                            <div class="flex-1">
                                <h3 class="font-semibold text-gray-900 dark:text-white text-lg" x-text="selectedMethod + ' Withdrawal'"></h3>
                                <p class="text-sm text-gray-600 dark:text-gray-400 mt-1" x-text="'You have selected ' + selectedMethod + ' as your preferred withdrawal method.'"></p>
                                <div class="mt-3 flex items-center gap-2 text-xs text-blue-600 dark:text-blue-400">
                                    <i data-lucide="shield-check" class="w-4 h-4"></i>
                                    <span>Secure & encrypted transaction</span>
                                </div>
                            </div>
                        </div>
                    </div>

                    <button type="submit" class="w-full inline-flex justify-center items-center gap-3 py-4 px-6 bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 text-white font-semibold rounded-xl transition-all duration-200 shadow-lg hover:shadow-xl transform hover:scale-[1.02]">
                        <i data-lucide="arrow-right" class="h-5 w-5"></i>
                        <span>Proceed to Withdrawal</span>
                    </button>
                </form>
            </div>
        </div>

        <!-- Enhanced Withdrawal History -->
        <div class="bg-white dark:bg-gray-800 rounded-2xl shadow-xl border border-gray-200 dark:border-gray-700 max-w-6xl mx-auto">
            <div class="p-8 border-b border-gray-200 dark:border-gray-700">
                <div class="flex items-center gap-4">
                    <div class="p-4 bg-gradient-to-br from-indigo-100 to-purple-100 dark:from-indigo-900/30 dark:to-purple-900/30 rounded-xl">
                        <i data-lucide="history" class="w-8 h-8 text-indigo-600 dark:text-indigo-400"></i>
                    </div>
                    <div class="flex-1">
                        <h2 class="text-2xl font-bold text-gray-900 dark:text-white">Withdrawal History</h2>
                        <p class="text-gray-600 dark:text-gray-400 mt-1">Monitor the status and details of your withdrawal requests</p>
                    </div>
                </div>
            </div>

            <div class="p-8">
                <div class="overflow-hidden rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm">
                    <div class="overflow-x-auto">
                        <table class="w-full">
                            <thead>
                                <tr class="bg-gradient-to-r from-gray-50 to-gray-100 dark:from-gray-700 dark:to-gray-800">
                                    <th class="px-6 py-4 text-left text-xs font-bold text-gray-600 dark:text-gray-300 uppercase tracking-wider">Amount</th>
                                    <th class="px-6 py-4 text-left text-xs font-bold text-gray-600 dark:text-gray-300 uppercase tracking-wider">Date Requested</th>
                                    <th class="px-6 py-4 text-left text-xs font-bold text-gray-600 dark:text-gray-300 uppercase tracking-wider">Method</th>
                                    <th class="px-6 py-4 text-left text-xs font-bold text-gray-600 dark:text-gray-300 uppercase tracking-wider">Status</th>
                                </tr>
                            </thead>
                            <tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
                                <?php $__empty_1 = true; $__currentLoopData = $withdrawals; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $withdrawal): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <tr class="hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-all duration-200">
                                        <td class="px-6 py-5 whitespace-nowrap">
                                            <div class="flex items-center">
                                                <div class="p-2 bg-gray-100 dark:bg-gray-700 rounded-lg mr-3">
                                                    <i data-lucide="banknote" class="w-4 h-4 text-gray-600 dark:text-gray-400"></i>
                                                </div>
                                                <div>
                                                    <div class="text-base font-semibold text-gray-900 dark:text-white"><?php echo e(Auth::user()->currency); ?><?php echo e(number_format($withdrawal->amount, 2, '.', ',')); ?></div>
                                                    <div class="text-sm text-gray-500 dark:text-gray-400">Withdrawal Amount</div>
                                                </div>
                                            </div>
                                        </td>
                                        <td class="px-6 py-5 whitespace-nowrap">
                                            <div class="text-sm text-gray-900 dark:text-white font-medium"><?php echo e(\Carbon\Carbon::parse($withdrawal->created_at)->format('M d, Y')); ?></div>
                                            <div class="text-xs text-gray-500 dark:text-gray-400"><?php echo e(\Carbon\Carbon::parse($withdrawal->created_at)->format('H:i A')); ?></div>
                                        </td>
                                        <td class="px-6 py-5 whitespace-nowrap">
                                            <div class="inline-flex items-center px-3 py-2 rounded-lg text-sm font-medium bg-blue-50 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400 border border-blue-200 dark:border-blue-700">
                                                <i data-lucide="<?php echo e($withdrawal->payment_mode == 'Bitcoin' ? 'bitcoin' : ($withdrawal->payment_mode == 'Ethereum' ? 'zap' : ($withdrawal->payment_mode == 'USDT' ? 'circle-dollar-sign' : 'building-bank'))); ?>" class="w-4 h-4 mr-2"></i>
                                                <?php echo e($withdrawal->payment_mode); ?>

                                            </div>
                                        </td>
                                        <td class="px-6 py-5 whitespace-nowrap">
                                            <?php if($withdrawal->status=='Pending'): ?>
                                                <span class="inline-flex items-center px-3 py-2 rounded-lg text-sm font-medium bg-yellow-50 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400 border border-yellow-200 dark:border-yellow-700">
                                                    <i data-lucide="clock" class="w-4 h-4 mr-2"></i>
                                                    <?php echo e($withdrawal->status); ?>

                                                </span>
                                            <?php elseif($withdrawal->status=='Rejected'): ?>
                                                <span class="inline-flex items-center px-3 py-2 rounded-lg text-sm font-medium bg-red-50 text-red-800 dark:bg-red-900/30 dark:text-red-400 border border-red-200 dark:border-red-700">
                                                    <i data-lucide="x-circle" class="w-4 h-4 mr-2"></i>
                                                    <?php echo e($withdrawal->status); ?>

                                                </span>
                                            <?php else: ?>
                                                <span class="inline-flex items-center px-3 py-2 rounded-lg text-sm font-medium bg-green-50 text-green-800 dark:bg-green-900/30 dark:text-green-400 border border-green-200 dark:border-green-700">
                                                    <i data-lucide="check-circle" class="w-4 h-4 mr-2"></i>
                                                    <?php echo e($withdrawal->status); ?>

                                                </span>
                                            <?php endif; ?>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr>
                                        <td colspan="4" class="px-6 py-12 text-center">
                                            <div class="flex flex-col items-center">
                                                <div class="p-4 bg-gray-100 dark:bg-gray-700 rounded-full mb-4">
                                                    <i data-lucide="inbox" class="w-8 h-8 text-gray-400 dark:text-gray-500"></i>
                                                </div>
                                                <h3 class="text-lg font-medium text-gray-900 dark:text-white mb-1">No withdrawals yet</h3>
                                                <p class="text-gray-500 dark:text-gray-400">Your withdrawal history will appear here once you make your first request</p>
                                            </div>
                                        </td>
                                    </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php endif; ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    <?php echo \Illuminate\View\Factory::parentPlaceholder('scripts'); ?>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // Initialize Lucide icons
            if (typeof lucide !== 'undefined') {
                lucide.createIcons();
            }
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.dasht', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\bluetrade\resources\views/user/withdrawals.blade.php ENDPATH**/ ?>