@extends('backEnd.layouts.master')
@section('title', 'Create Custom Offer')

@section('content')
<div class="container-fluid">
    <div class="row">
        <div class="col-12">
            <div class="page-title-box">
                <div class="page-title-right">
                    <ol class="breadcrumb m-0">
                        <li class="breadcrumb-item"><a href="{{ route('admin.dashboard') }}">Dashboard</a></li>
                        <li class="breadcrumb-item"><a href="{{ route('custom-offers.index') }}">Custom Offers</a></li>
                        <li class="breadcrumb-item active">Create</li>
                    </ol>
                </div>
                <h4 class="page-title">Create Custom Offer</h4>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-10 mx-auto">
            <div class="card">
                <div class="card-body">
                        <form action="{{ route('custom-offers.store') }}" method="POST" enctype="multipart/form-data">
                            @csrf

                            <div class="mb-3">
                                <label class="form-label">Offer Name *</label>
                                <input type="text" name="name" class="form-control" placeholder="e.g. Summer Deals, Weekend Offers" required>
                            </div>

                            <div class="mb-3">
                                <label class="form-label">Tagline (Title Above Products)</label>
                                <input type="text" name="tagline" class="form-control" placeholder="e.g. WEEKDAY DEALS!!!">
                            </div>

                            <div class="row">
                                <div class="col-md-6 mb-3">
                                    <label class="form-label">Start Date</label>
                                    <input type="date" name="start_date" class="form-control">
                                </div>
                                <div class="col-md-6 mb-3">
                                    <label class="form-label">End Date</label>
                                    <input type="date" name="end_date" class="form-control">
                                </div>
                            </div>

                            <div class="mb-3">
                                <div class="form-check form-switch">
                                    <input type="checkbox" name="show_timer" class="form-check-input" id="show_timer" value="1">
                                    <label class="form-check-label" for="show_timer">Show Countdown Timer</label>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-md-6 mb-3">
                                    <label class="form-label">Accent Icon Class (FontAwesome)</label>
                                    <input type="text" name="icon" class="form-control" placeholder="e.g. fire, bolt, tag">
                                </div>
                                <div class="col-md-3 mb-3">
                                    <label class="form-label">Accent Color</label>
                                    <input type="color" name="color" class="form-control" value="#E31019">
                                </div>
                                <div class="col-md-3 mb-3">
                                    <label class="form-label">Background Color</label>
                                    <input type="color" name="bg_color" class="form-control" value="#ffffff">
                                </div>
                                <div class="col-md-3 mb-3">
                                    <label class="form-label">Text Color</label>
                                    <input type="color" name="text_color" class="form-control" value="#222222">
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-md-6 mb-3">
                                    <label class="form-label">Icon Banner (Top Left)</label>
                                    <input type="file" name="banner" class="form-control" accept="image/*">
                                </div>
                                <div class="col-md-6 mb-3">
                                    <label class="form-label">Side Big Banner (Side Card)</label>
                                    <input type="file" name="side_banner" class="form-control" accept="image/*">
                                </div>
                            </div>

                             <div class="mb-3">
                                <label class="form-label">Background Image (Optional)</label>
                                <input type="file" name="bg_image" class="form-control" accept="image/*">
                                <small class="text-muted">Useful for subtle patterns or gradients.</small>
                            </div>


                            <div class="mb-3">
                                <label class="form-label">Banner Side</label>
                                <select name="banner_side" class="form-select">
                                    <option value="right" selected>Right Side</option>
                                    <option value="left">Left Side</option>
                                </select>
                            </div>

                            <div class="mb-3">
                                <label class="form-label">Sort Order</label>
                                <input type="number" name="sort_order" class="form-control" value="0">
                            </div>

                            <div class="mb-3">
                                <div class="form-check">
                                    <input type="checkbox" name="status" class="form-check-input" id="status" value="1" checked>
                                    <label class="form-check-label" for="status">Active</label>
                                </div>
                            </div>

                            <div class="d-flex gap-2">
                                <button type="submit" class="btn btn-primary">Create Offer</button>
                                <a href="{{ route('custom-offers.index') }}" class="btn btn-secondary">Cancel</a>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
