@extends('layout.admin')

@section('content')
<div class="container">
    <h2 class="mb-4">➕ নতুন অফার তৈরি করুন</h2>

    <form method="POST" action="{{ route('admin.offers.store') }}" enctype="multipart/form-data" class="card shadow p-4">
        @csrf

        <div class="row">
            <div class="col-md-6 mb-3">
                <label class="form-label">অফার টাইটেল</label>
                <input type="text" name="title" class="form-control" placeholder="উদাহরণ: 3GB + 50Min Combo" required>
            </div>
            <div class="col-md-6 mb-3">
                <label class="form-label">মেয়াদ</label>
                <input type="text" name="validity" class="form-control" placeholder="৭ দিন / ৩০ দিন" required>
            </div>
        </div>

        <div class="mb-3">
            <label class="form-label">বিস্তারিত</label>
            <textarea name="description" class="form-control" rows="3" placeholder="অফারের বিস্তারিত লিখুন..." required></textarea>
        </div>

        <div class="row">
            <div class="col-md-4 mb-3">
                <label class="form-label">মূল্য (৳)</label>
                <input type="number" name="price" class="form-control" step="0.01" required>
            </div>
            <div class="col-md-4 mb-3">
                <label class="form-label">ক্যাশব্যাক (৳)</label>
                <input type="number" name="cashback" class="form-control" step="0.01" required>
            </div>
            <div class="col-md-4 mb-3">
                <label class="form-label">লোগো (ছবি)</label>
                <input type="file" name="logo" class="form-control" required>
            </div>
        </div>

        <div class="row">
            <div class="col-md-6 mb-3">
                <label class="form-label">অপারেটর</label>
                <select name="operator_id" class="form-select" required>
                    @foreach($operators as $op)
                        <option value="{{ $op->id }}">{{ $op->name }}</option>
                    @endforeach
                </select>
            </div>
            <div class="col-md-6 mb-3">
                <label class="form-label">ক্যাটাগরি</label>
                <select name="category_id" class="form-select" required>
                    @foreach($categories as $cat)
                        <option value="{{ $cat->id }}">{{ $cat->name }}</option>
                    @endforeach
                </select>
            </div>
        </div>

        <button type="submit" class="btn btn-success">✅ অফার যুক্ত করুন</button>
    </form>
</div>
@endsection