{% extends 'base/base.html' %}
{% block title %}Request Deposit - CryptoSignals Pro{% endblock %}

{% block content %}
<div class="container-fluid">
    <h1 class="page-title">Request Deposit</h1>
    
    <div class="row">
        <div class="col-md-8">
            <div class="card">
                <div class="card-body">
                    {% if messages %}
                        {% for message in messages %}
                        <div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
                            {{ message }}
                            <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                        </div>
                        {% endfor %}
                    {% endif %}
                    
                    <form method="post" enctype="multipart/form-data">
                        {% csrf_token %}
                        
                        <div class="mb-3">
                            <label class="form-label">Amount (USD)</label>
                            {{ form.amount }}
                            {% if form.amount.errors %}
                            <div class="text-danger small mt-2">{{ form.amount.errors|join:", " }}</div>
                            {% endif %}
                            <small class="custom-text-muted d-block mt-2">Deposit range: ${{ minimum_deposit|floatformat:2 }} to ${{ maximum_deposit|floatformat:2 }}</small>
                        </div>
                        
                        <div class="mb-3">
                            <label class="form-label">Payment Method</label>
                            {{ form.payment_method }}
                            {% if form.payment_method.errors %}
                            <div class="text-danger small mt-2">{{ form.payment_method.errors|join:", " }}</div>
                            {% endif %}
                        </div>
                        
                        <div class="mb-3">
                            <label class="form-label">Transaction ID / Hash</label>
                            {{ form.transaction_id }}
                            {% if form.transaction_id.errors %}
                            <div class="text-danger small mt-2">{{ form.transaction_id.errors|join:", " }}</div>
                            {% endif %}
                        </div>
                        
                        <div class="mb-3">
                            <label class="form-label">Your Wallet Address</label>
                            {{ form.wallet_address }}
                            {% if form.wallet_address.errors %}
                            <div class="text-danger small mt-2">{{ form.wallet_address.errors|join:", " }}</div>
                            {% endif %}
                        </div>
                        
                        <div class="mb-3">
                            <label class="form-label">Screenshot (Optional)</label>
                            {{ form.screenshot }}
                            {% if form.screenshot.errors %}
                            <div class="text-danger small mt-2">{{ form.screenshot.errors|join:", " }}</div>
                            {% endif %}
                        </div>
                        
                        <div class="mb-3">
                            <label class="form-label">Notes (Optional)</label>
                            {{ form.notes }}
                            {% if form.notes.errors %}
                            <div class="text-danger small mt-2">{{ form.notes.errors|join:", " }}</div>
                            {% endif %}
                        </div>
                        
                        <button type="submit" class="btn btn-primary">Submit Deposit Request</button>
                    </form>
                </div>
            </div>
        </div>
        
        <div class="col-md-4">
            <div class="card">
                <div class="card-header">
                    <h5 class="mb-0 custom-text-white">Payment Methods</h5>
                </div>
                <div class="card-body">
                    {% if payment_info %}
                        {% for info in payment_info %}
                        <div class="mb-3 pb-3 border-bottom" style="border-color: var(--border-color) !important;">
                            <h6 class="custom-text-white">{{ info.get_payment_method_display }}</h6>
                            <small class="custom-text-muted d-block">Deposit range: ${{ minimum_deposit|floatformat:2 }} - ${{ maximum_deposit|floatformat:2 }}</small>
                            <code class="d-block mt-2 custom-text-warning" style="font-size: 0.75rem;">{{ info.wallet_address }}</code>
                        </div>
                        {% endfor %}
                    {% else %}
                    <p class="custom-text-muted">No payment methods available.</p>
                    {% endif %}
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
