<?php
session_start();

if(!isset($_SESSION['alogin'])){
    die("Login required");
}

if(!isset($_GET['amount'])){
    header("Location: recharge.php");
    exit();
}
$amount = htmlspecialchars($_GET['amount']);
?>

<!DOCTYPE html>
<html lang="bn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nagad Payment</title>

<style>
/* ================== RESET ================== */
* {
    margin:0;
    padding:0;
    box-sizing:border-box;
}

/* ================== BODY ================== */
body{
    font-family: Arial, sans-serif;
    background:#f5f5f5;
    line-height:1.4;
}

/* ================== TOPBAR ================== */
.topbar{
    background:#ff5500;
    color:#fff;
    padding:12px;
    text-align:center;
    font-weight:bold;
    font-size:18px;
}

/* ================== CONTAINER ================== */
.container{
    max-width:400px;
    margin:30px auto;
    background:#fff;
    border-radius:10px;
    box-shadow:0 4px 15px rgba(0,0,0,0.1);
    overflow:hidden;
}

/* ================== LOGO ================== */
.logo{
    text-align:center;
    padding:15px;
}
.logo img{
    width:120px;
    max-width:80%;
}

/* ================== AMOUNT ================== */
.amount{
    text-align:center;
    font-size:28px;
    color:#ff5500;
    font-weight:bold;
    padding:10px 0;
}

/* ================== INFO BOX ================== */
.info{
    padding:15px;
    background:#fafafa;
    border-top:1px solid #eee;
    border-bottom:1px solid #eee;
    font-size:14px;
    text-align:center;
}

/* ================== FORM ================== */
.form{
    padding:15px;
}
.form input{
    width:100%;
    padding:12px;
    margin-top:10px;
    border:1px solid #ddd;
    border-radius:6px;
    font-size:14px;
}

/* ================== BUTTON ================== */
.btn{
    width:100%;
    margin-top:15px;
    padding:12px;
    background:#ff5500;
    color:#fff;
    border:none;
    border-radius:6px;
    font-size:16px;
    font-weight:bold;
    cursor:pointer;
    transition:0.3s;
}
.btn:hover{
    background:#cc4400;
}

/* ================== FOOTER ================== */
.footer{
    text-align:center;
    font-size:12px;
    color:#888;
    padding:10px;
}

/* ================== RESPONSIVE ================== */
@media(max-width:480px){
    .container{
        margin:20px;
    }
    .amount{
        font-size:24px;
    }
    .btn{
        font-size:14px;
        padding:10px;
    }
    .info{
        font-size:13px;
    }
}
</style>

</head>

<body>

<div class="topbar">
    Nagad Payment
</div>

<div class="container">

    <div class="logo">
        <img src="https://upload.wikimedia.org/wikipedia/commons/3/33/Nagad_Logo.png" alt="Nagad Logo">
    </div>

    <div class="amount">
        ৳ <?php echo $amount; ?>
    </div>

    <div class="info">
        Send the above amount to <b>01XXXXXXXXX</b><br><br>
        Enter the <b>Transaction ID</b> below after sending money
    </div>

    <div class="form">
        <form action="submit_payment.php" method="POST">

            <input type="hidden" name="method" value="nagad">
            <input type="hidden" name="amount" value="<?php echo $amount; ?>">

            <input type="text" name="sender" placeholder="Nagad number )" required>

            <input type="text" name="trxid" placeholder="Transaction ID" required>

            <button class="btn" type="submit">
                Confirm Payment
            </button>

        </form>
    </div>

    <div class="footer">
        Secure Payment System
    </div>

</div>

</body>
</html>