<!DOCTYPE html>
<html lang="en">
<head> 
  <meta charset="UTF-8"> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"> 
  <title>{{env('APP_NAME')}} | Withdraw Information</title> 
  
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/layui@2.8.17/dist/css/layui.css">
  <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">

  <style>
    :root {
      --accent-black: #1a1a1a;
      --accent-gradient: linear-gradient(135deg, #1a1a1a 0%, #3a3a3a 100%);
      --bg-light: #f8fafc;
      --text-dark: #1e293b;
    }

    * {
      box-sizing: border-box;
    }

    body {
      font-family: 'Roboto', sans-serif;
      background-color: var(--bg-light);
      margin: 0; padding: 0;
      color: var(--text-dark);
      animation: fadeInBody 0.5s ease;
    }

    @keyframes fadeInBody {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    @keyframes fadeInUp {
      from { opacity: 0; transform: translateY(15px); }
      to { opacity: 1; transform: translateY(0); }
    }

    @keyframes popIn {
      from { opacity: 0; transform: scale(0.94); }
      to { opacity: 1; transform: scale(1); }
    }

    @keyframes slideDown {
      from { opacity: 0; transform: translateY(-12px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* 🔹 Header */
    .top-header {
      padding: 15px 20px;
      background: #fff;
      display: flex;
      align-items: center;
      border-bottom: 1px solid #e2e8f0;
      animation: slideDown 0.4s ease both;
    }
    .top-header h2 { flex: 1; text-align: center; font-size: 18px; font-weight: 700; margin: 0; }
    .back-btn {
      color: var(--text-dark); font-size: 20px; text-decoration: none; width: 40px;
      transition: transform 0.2s ease;
      display: inline-block;
    }
    .back-btn:hover { transform: translateX(-3px); }

    /* 🔹 Tab Navigation */
    .record-tab {
      display: flex;
      background: #fff;
      margin: 15px;
      padding: 5px;
      border-radius: 12px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.05);
      animation: fadeInUp 0.4s ease 0.05s both;
    }
    .record-tab a {
      flex: 1;
      text-align: center;
      padding: 12px;
      text-decoration: none;
      color: #64748b;
      font-weight: 600;
      font-size: 14px;
      border-radius: 10px;
      transition: 0.3s;
    }
    .record-tab a.active {
      background: var(--accent-gradient);
      color: #fff;
    }

    /* 🔹 Form Styling */
    .card-container {
      margin: 0 15px;
      background: #fff;
      padding: 20px;
      border-radius: 20px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.03);
      animation: fadeInUp 0.4s ease 0.1s both;
    }

    .input-item {
      margin-bottom: 18px;
      animation: fadeInUp 0.4s ease both;
    }

    .input-item:nth-of-type(1) { animation-delay: 0.15s; }
    .input-item:nth-of-type(2) { animation-delay: 0.2s; }
    .input-item:nth-of-type(3) { animation-delay: 0.25s; }
    .input-item:nth-of-type(4) { animation-delay: 0.3s; }

    .input-item label {
      display: block;
      font-size: 13px;
      font-weight: 600;
      color: #64748b;
      margin-bottom: 8px;
      margin-left: 5px;
    }
    .input-wrapper {
      position: relative;
      display: flex;
      align-items: center;
    }
    .input-wrapper i {
      position: absolute;
      left: 15px;
      color: #94a3b8;
      transition: color 0.25s ease;
    }
    .input-wrapper input, .input-wrapper select {
      width: 100%;
      padding: 14px 14px 14px 45px;
      border: 1px solid #e2e8f0;
      border-radius: 12px;
      font-size: 15px;
      outline: none;
      transition: 0.3s;
      background: #fcfdfe;
      -webkit-appearance: none;
    }
    .input-wrapper input:focus,
    .input-wrapper select:focus {
      border-color: var(--accent-black);
      background: #fff;
      box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
    }
    .input-wrapper input:focus + i,
    .input-wrapper:has(input:focus) i { color: var(--accent-black); }
    .input-wrapper input:disabled {
      background: #f1f5f9;
      color: #94a3b8;
    }

    /* 🔹 Confirm Button */
    .card-btn {
      width: 100%;
      padding: 16px;
      background: var(--accent-gradient);
      color: white;
      border: none;
      border-radius: 50px;
      font-size: 16px;
      font-weight: 700;
      margin-top: 10px;
      cursor: pointer;
      box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
      transition: transform 0.2s ease, box-shadow 0.25s ease;
      animation: fadeInUp 0.4s ease 0.35s both;
    }
    .card-btn:hover { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28); }
    .card-btn:active { transform: scale(0.97); }

    /* 🔹 Help Text */
    .tips-box {
      margin: 20px 15px;
      padding: 15px;
      background: #f5f5f5;
      border-radius: 12px;
      border: 1px dashed var(--accent-black);
      animation: fadeInUp 0.4s ease 0.4s both;
    }
    .tips-box p { font-size: 12px; color: #333333; line-height: 1.6; margin: 0; }
  </style>
</head> 

<body class="huiBg"> 
  <div class="top-header"> 
    <a href="/dashboard" class="back-btn"> 
      <i class="fa-solid fa-chevron-left"></i> 
    </a> 
    <h2>Withdraw Information</h2> 
  </div> 

  <div class="record-tab"> 
    <a href="javascript:void(0)" class="active" data-tab="bank">BANK SETUP</a> 
  </div> 

  @php $user = auth()->user(); @endphp

  <div class="card-container tab-content" id="tab-bank"> 
    <form action="{{ route('setup.gateway.submit') }}" method="post">
      @csrf
      <div class="input-item">
        <label>Account Phone</label>
        <div class="input-wrapper">
          <i class="fa-solid fa-phone"></i>
          <input disabled value="{{ $user->phone }}"> 
        </div>
      </div>

      <div class="input-item">
        <label>Holder Name</label>
        <div class="input-wrapper">
          <i class="fa-solid fa-user"></i>
          <input type="text" name="realname" placeholder="Enter holder name" value="{{$user->realname}}"> 
        </div>
      </div>

      <div class="input-item">
        <label>Bank Name</label>
        <div class="input-wrapper">
          <i class="fa-solid fa-building-columns"></i>
          <select name="gateway_method">
            <option value="">Select your bank</option>
            @foreach(\App\Models\BankList::where('status', '1')->get() as $elemenet)
              <option value="{{$elemenet->bank_code}}" @if($user->gateway_method == $elemenet->bank_code) selected @endif>{{$elemenet->name}}</option>
            @endforeach
          </select>
        </div>
      </div>

      <div class="input-item">
        <label>Account Number</label>
        <div class="input-wrapper">
          <i class="fa-solid fa-credit-card"></i>
          <input type="text" name="gateway_address" placeholder="Enter account number" value="{{$user->gateway_address}}"> 
        </div>
      </div>

      <button type="submit" class="card-btn">Save Information</button> 
    </form>
  </div> 

 
  <div class="tips-box">
    <p><strong>Note:</strong> Please ensure your bank information is correct. Withdrawals will be processed to this account only.</p>
  </div>

  @include('alert-message')

  <script>
    // Tab switching logic
    document.querySelectorAll('.record-tab a').forEach(tab => {
      tab.addEventListener('click', function(){
        document.querySelectorAll('.record-tab a').forEach(t => t.classList.remove('active'));
        this.classList.add('active');
        const selected = this.getAttribute('data-tab');
        document.querySelectorAll('.tab-content').forEach(c => c.style.display = 'none');
        document.getElementById('tab-' + selected).style.display = 'block';
      });
    });
  </script>
</body>
</html>
