@extends('layouts.aura-main')

@section('main-content')
<div class="max-w-3xl mx-auto pb-20">
    <div class="mb-8">
        <h1 class="text-2xl font-black text-slate-900 tracking-tight">Financial Statement Generator</h1>
        <p class="text-[12px] font-medium text-slate-500 uppercase tracking-wider">Initialize a new IFRS-compliant reporting period</p>
    </div>

    <form action="{{ route('reports.statements.edit.redirect') }}" method="GET">
        <div class="bg-white border border-slate-300 rounded-sm shadow-sm p-10">
            <div class="flex items-center gap-2 mb-8 border-b border-slate-100 pb-4">
                <div class="w-1.5 h-4 bg-indigo-500 rounded-full"></div>
                <h2 class="text-[11px] font-black text-slate-700 uppercase tracking-widest">Reporting Parameters</h2>
            </div>

            <div class="space-y-8">
                <div>
                    <label class="block text-[10px] font-bold text-slate-500 uppercase mb-2 tracking-wider">Financial Year</label>
                    <select name="year" required class="w-full border border-slate-300 rounded px-4 py-3 text-sm font-bold text-slate-700 focus:border-indigo-500 outline-none bg-slate-50/50">
                        @php $currentYear = date('Y'); @endphp
                        @for($i = $currentYear; $i >= $currentYear - 5; $i--)
                            <option value="{{ $i }}">{{ $i }} Financial Year</option>
                        @endfor
                    </select>
                </div>

                <div class="grid grid-cols-2 gap-8">
                    <div>
                        <label class="block text-[10px] font-bold text-slate-500 uppercase mb-2 tracking-wider">Start Period</label>
                        <input type="date" name="start_date" required value="{{ date('Y') }}-01-01" 
                            class="w-full border border-slate-300 rounded px-4 py-3 text-sm focus:border-indigo-500 outline-none">
                    </div>
                    <div>
                        <label class="block text-[10px] font-bold text-slate-500 uppercase mb-2 tracking-wider">End Period</label>
                        <input type="date" name="end_date" required value="{{ date('Y') }}-12-31" 
                            class="w-full border border-slate-300 rounded px-4 py-3 text-sm focus:border-indigo-500 outline-none">
                    </div>
                </div>

                <div class="pt-6 border-t border-slate-100 flex items-center justify-between">
                    <p class="text-[11px] text-slate-400 italic max-w-xs">
                        * Data will be fetched from the ledger based on these dates to pre-fill your draft.
                    </p>
                    <button type="submit" class="bg-indigo-600 text-white px-10 py-3 rounded-sm text-[12px] font-bold shadow-lg hover:bg-indigo-700 transition uppercase tracking-tighter">
                        Generate Draft Statement
                    </button>
                </div>
            </div>
        </div>
    </form>
</div>
@endsection