@extends('layouts.app')
@section('title', 'إنشاء اشتراك جديد')
@section('content')
<div class="min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 py-8 px-4 md:px-8">
    <div class="max-w-4xl mx-auto">
        <h1 class="text-3xl font-bold text-gray-900 mb-2">إنشاء اشتراك جديد</h1>
        <div class="bg-white rounded-xl shadow-lg p-8 mt-6">
            <form action="{{ route('subscriptions.store') }}" method="POST">
                @csrf
                <div class="mb-6">
                    <label for="company_id" class="block text-sm font-semibold text-gray-700 mb-2">الشركة</label>
                    <select id="company_id" name="company_id" required class="w-full px-4 py-2 border border-gray-300 rounded-lg">
                        <option value="">اختر شركة</option>
                        @foreach($companies as $company)
                        <option value="{{ $company->id }}">{{ $company->name }}</option>
                        @endforeach
                    </select>
                </div>
                <div class="mb-6">
                    <label for="subscription_plan_id" class="block text-sm font-semibold text-gray-700 mb-2">خطة الاشتراك</label>
                    <select id="subscription_plan_id" name="subscription_plan_id" required class="w-full px-4 py-2 border border-gray-300 rounded-lg">
                        <option value="">اختر خطة</option>
                        @foreach($plans as $plan)
                        <option value="{{ $plan->id }}">{{ $plan->name }}</option>
                        @endforeach
                    </select>
                </div>
                <div class="mb-6">
                    <label class="block text-sm font-semibold text-gray-700 mb-2">دورة الفواتير</label>
                    <div class="flex gap-4">
                        <label><input type="radio" name="billing_cycle" value="monthly" checked> شهري</label>
                        <label><input type="radio" name="billing_cycle" value="yearly"> سنوي</label>
                    </div>
                </div>
                <div class="flex gap-3 justify-end">
                    <a href="{{ route('subscriptions.index') }}" class="px-6 py-3 bg-gray-100 rounded-lg">إلغاء</a>
                    <button type="submit" class="px-6 py-3 bg-blue-600 text-white rounded-lg">إنشاء</button>
                </div>
            </form>
        </div>
    </div>
</div>
@endsection
