<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
  <title>Withdraw </title>
  
  <!-- External Resources -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"/>
  <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/layui@2.8.17/dist/css/layui.css">

  <style>
    * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

    body {
      font-family: 'Poppins', sans-serif;
      /* আপনার থিমের এনিমেটেড ব্যাকগ্রাউন্ড */
      background: linear-gradient(-45deg, #0f2027, #203a43, #2c5364, #ff8c00);
      background-size: 400% 400%;
      animation: gradientBG 15s ease infinite;
      color: #fff;
      min-height: 100vh;
      display: flex;
      justify-content: center;
      padding-top: 20px;
    }

    @keyframes gradientBG {
      0% { background-position: 0% 50%; }
      50% { background-position: 100% 50%; }
      100% { background-position: 0% 50%; }
    }

    .app-container {
      width: 92%;
      max-width: 380px;
    }

    /* টপ ন্যাভিগেশন */
    .header-nav {
      display: flex;
      align-items: center;
      gap: 15px;
      margin-bottom: 20px;
    }
    .header-nav a { color: #fff; text-decoration: none; font-size: 18px; }
    .header-nav h2 { font-size: 18px; font-weight: 600; }

    /* ব্যালেন্স কার্ড - স্লিম ও উজ্জ্বল */
    .balance-card {
      background: linear-gradient(135deg, #FFD700 0%, #FF8C00 100%);
      padding: 15px 20px;
      border-radius: 15px;
      color: #222;
      box-shadow: 0 8px 20px rgba(0,0,0,0.2);
      margin-bottom: 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .balance-card span { font-size: 12px; font-weight: 600; opacity: 0.8; }
    .balance-card h3 { font-size: 20px; font-weight: 800; }

    /* উইথড্র সেকশন - গ্লাস ইফেক্ট */
    .withdraw-section {
      background: rgba(255, 255, 255, 0.12);
      backdrop-filter: blur(15px);
      padding: 20px;
      border-radius: 20px;
      border: 1px solid rgba(255, 255, 255, 0.2);
    }

    /* একাউন্ট ইনফো লিস্ট */
    .account-info {
      list-style: none;
      margin-bottom: 20px;
      padding: 10px;
      background: rgba(0,0,0,0.2);
      border-radius: 12px;
    }
    .account-info li {
      display: flex;
      justify-content: space-between;
      padding: 8px 0;
      border-bottom: 1px solid rgba(255,255,255,0.1);
      font-size: 12px;
    }
    .account-info li:last-child { border-bottom: none; }
    .account-info li label { color: #FFD700; opacity: 0.9; }
    .account-info li span { font-weight: 500; color: #fff; }

    /* ইনপুট বক্স */
    .input-label { display: block; font-size: 12px; color: #FFD700; margin-bottom: 8px; font-weight: 500; }
    
    .input-box {
      position: relative;
      margin-bottom: 20px;
    }
    .input-box i {
      position: absolute;
      left: 15px;
      top: 50%;
      transform: translateY(-50%);
      color: #FFD700;
    }
    .input-box input {
      width: 100%;
      padding: 12px 15px 12px 45px;
      background: rgba(0, 0, 0, 0.2);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 10px;
      color: #fff;
      font-size: 16px; /* জুম আটকানোর জন্য ১৬পিএক্স */
      outline: none;
    }

    /* বাটন */
    .withdraw-btn {
      width: 100%;
      padding: 14px;
      background: linear-gradient(90deg, #FF8C00, #FF4500);
      border: none;
      border-radius: 10px;
      color: #fff;
      font-size: 14px;
      font-weight: 700;
      text-transform: uppercase;
      cursor: pointer;
      box-shadow: 0 5px 15px rgba(255, 69, 0, 0.4);
    }
    .withdraw-btn:active { transform: scale(0.97); }

    /* রুলস বক্স */
    .rules-card {
      margin-top: 20px;
      padding: 15px;
      background: rgba(0, 0, 0, 0.15);
      border-radius: 15px;
      border-left: 4px solid #FFD700;
    }
    .rules-card h4 { font-size: 13px; color: #FFD700; margin-bottom: 8px; }
    .rules-card p { font-size: 11px; line-height: 1.8; color: #eee; }

    /* পপআপ ডিজাইন */
    .overlay {
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.85);
      display: none; justify-content: center; align-items: center;
      z-index: 1000; padding: 20px;
    }
    .popup {
      background: #fff;
      width: 100%; max-width: 300px;
      border-radius: 20px;
      padding: 25px;
      text-align: center;
      color: #333;
      position: relative;
    }
    .popup h3 { color: #ff5e00; font-size: 18px; margin-bottom: 12px; }
    .popup p { font-size: 13px; margin-bottom: 20px; color: #666; }
    .confirm-btn {
      width: 100%; padding: 12px; background: #ff5e00; border: none;
      border-radius: 10px; color: #fff; font-weight: 600;
    }
    .close-icon { position: absolute; top: 12px; right: 12px; color: #ccc; cursor: pointer; font-size: 18px; }

  </style>
</head>
<body>

<div class="app-container">
  
  <!-- Header -->
  <div class="header-nav">
    <a href="javascript:history.back();"><i class="fa-solid fa-arrow-left"></i></a>
    <h2>Withdraw</h2>
  </div>

  <!-- Balance Bar -->
  <div class="balance-card">
    <span>AVAILABLE BALANCE</span>
    <h3><?php echo e(price(auth()->user()->balance)); ?></h3>
  </div>

  <!-- Main Withdraw Section -->
  <div class="withdraw-section">
    
    <!-- Account Summary -->
    <ul class="account-info">
      <li><label>Name:</label><span><?php echo e(auth()->user()->realname); ?></span></li>
      <li><label>Method:</label><span><?php echo e(auth()->user()->bank_name); ?></span></li>
      <li><label>Account:</label><span><?php echo e(auth()->user()->gateway_address); ?></span></li>
    </ul>

    <!-- Input -->
    <label class="input-label">Withdrawal Amount</label>
    <div class="input-box">
      <i class="fa-solid fa-money-bill-transfer"></i>
      <input type="number" id="withdrawAmount" placeholder="Min. 400 BDT" autocomplete="off">
    </div>

    <button type="button" class="withdraw-btn" id="withdrawBtn">Request Withdrawal</button>
  </div>

  <!-- Rules -->
  <div class="rules-card">
    <h4><i class="fa-solid fa-circle-info"></i> Withdrawal Rules</h4>
    <p>
      • Service available 24/7.<br>
      • Minimum withdraw: 400 BDT | Max: 25,000 BDT.<br>
      • Service Fee: 5% of withdrawal amount.<br>
      • Processing time: 01 to 05 minutes.<br>
      • Ensure your bank info is correct to avoid delays.
    </p>
  </div>

</div>

<!-- Confirmation Popup -->
<div class="overlay" id="withdrawOverlay">
  <div class="popup">
    <i class="fa-solid fa-circle-xmark close-icon" id="closePopup"></i>
    <h3>Confirm Request</h3>
    <p>Are you sure you want to withdraw <b><span id="confirmAmt">0</span> BDT</b> to your account?</p>
    
    <form action="<?php echo e(route('user.withdraw-confirm-submit')); ?>" method="POST">
      <?php echo csrf_field(); ?>
      <input type="hidden" name="amount" id="finalAmount">
      <button class="confirm-btn" type="submit">Proceed Withdrawal</button>
    </form>
  </div>
</div>

<?php echo $__env->make('alert-message', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?> 

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/layui@2.8.17/dist/layui.js"></script>

<script>
layui.use(['layer'], function(){
  const layer = layui.layer;
  const balance = parseFloat("<?php echo e(auth()->user()->balance); ?>");

  $('#withdrawBtn').on('click', function(){
    const amount = parseFloat($('#withdrawAmount').val());

    if(!amount || amount < 400){
      layer.msg("Minimum withdrawal is 400 BDT", {icon: 5, anim: 6});
      return;
    }

    if(amount > balance){
      layer.msg("Insufficient balance!", {icon: 2});
      return;
    }

    $('#confirmAmt').text(amount);
    $('#finalAmount').val(amount);
    $('#withdrawOverlay').css('display', 'flex');
  });

  $('#closePopup').on('click', function(){
    $('#withdrawOverlay').hide();
  });
});
</script>

</body>
</html><?php /**PATH /home/goldenyi/public_html/resources/views/app/main/withdraw/index.blade.php ENDPATH**/ ?>