@extends('layouts.seller')

@section('title', 'Edit Banner')

@section('content')
<div class="page-header">
    <div>
        <h4 class="page-title">Edit Banner</h4>
        <p class="text-muted mb-0">Update your microsite banner</p>
    </div>
    <a href="{{ route('seller.banners.index') }}" class="btn btn-light border shadow-sm">
        <i class="bi bi-arrow-left me-1"></i> Back to List
    </a>
</div>

<div class="row justify-content-center">
    <div class="col-md-8">
        <div class="card border-0 shadow-sm">
            <div class="card-body p-4">
                <form action="{{ route('seller.banners.update', $banner->id) }}" method="POST" enctype="multipart/form-data">
                    @csrf
                    @method('PUT')
                    
                    <div class="mb-4">
                        <label class="form-label fw-bold">Current Image</label>
                        <div class="ratio ratio-21x9 bg-light border rounded mb-2">
                            <img src="{{ asset('storage/' . $banner->image_path) }}" class="object-fit-cover rounded">
                        </div>
                    </div>

                    <div class="mb-3">
                        <label class="form-label fw-bold">Change Image</label>
                        <input type="file" name="image" class="form-control" accept="image/*">
                        <div class="form-text">Leave empty to keep current image. Recommended size: 1200x400px.</div>
                    </div>

                    <div class="mb-4">
                        <label class="form-label fw-bold">Link URL (Optional)</label>
                        <input type="url" name="link" class="form-control" value="{{ $banner->link }}" placeholder="https://...">
                        <div class="form-text">Where should this banner link to?</div>
                    </div>

                    <div class="d-grid">
                        <button type="submit" class="btn btn-primary-gradient py-2">
                            <i class="bi bi-check-lg me-2"></i> Update Banner
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection
