@extends('layouts.admin')

@section('content')
<div class="max-w-4xl mx-auto space-y-6">
    <div class="bg-white p-6 rounded-[2rem] shadow-sm border border-gray-100 flex items-center justify-between">
        <div class="flex items-center gap-4">
            <div class="w-12 h-12 bg-indigo-50 text-indigo-600 rounded-2xl flex items-center justify-center text-2xl">
                🏫
            </div>
            <div>
                <h3 class="font-black text-xl text-gray-800">প্রতিষ্ঠানের প্রোফাইল</h3>
                <p class="text-[10px] text-gray-400 font-bold uppercase tracking-widest">Update basic school information</p>
            </div>
        </div>
    </div>

    @if(session('success'))
        <div class="bg-emerald-50 text-emerald-600 p-4 rounded-2xl font-bold text-sm border border-emerald-100 animate-pulse">
            ✅ {{ session('success') }}
        </div>
    @endif

    <div class="bg-white p-8 rounded-[2.5rem] shadow-sm border border-gray-100">
        <form action="{{ route('admin.settings.company.update') }}" method="POST" enctype="multipart/form-data" class="space-y-6">
            @csrf
            {{-- হিডেন আইডি যাতে ঐ নির্দিষ্ট রো-টাই আপডেট হয় --}}
            <input type="hidden" name="id" value="{{ $company->id ?? '' }}">

            <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                <div class="space-y-2">
                    <label class="text-[11px] font-black text-gray-400 uppercase ml-2 tracking-wider">প্রতিষ্ঠানের নাম</label>
                    <input type="text" name="school_name" value="{{ $company->school_name ?? '' }}" placeholder="উদা: ক্যাডেট কিন্ডারগার্টেন" class="w-full p-4 bg-gray-50 border-2 border-transparent focus:border-indigo-100 focus:bg-white rounded-2xl outline-none transition-all font-bold text-gray-700">
                </div>

                <div class="space-y-2">
                    <label class="text-[11px] font-black text-gray-400 uppercase ml-2 tracking-wider">স্লোগান</label>
                    <input type="text" name="slogan" value="{{ $company->slogan ?? '' }}" placeholder="উদা: শিক্ষার আলো ঘরে ঘরে" class="w-full p-4 bg-gray-50 border-2 border-transparent focus:border-indigo-100 focus:bg-white rounded-2xl outline-none transition-all font-bold text-gray-700">
                </div>

                <div class="space-y-2">
                    <label class="text-[11px] font-black text-gray-400 uppercase ml-2 tracking-wider">ফোন নম্বর</label>
                    <input type="text" name="contact_number" value="{{ $company->contact_number ?? '' }}" class="w-full p-4 bg-gray-50 border-2 border-transparent focus:border-indigo-100 focus:bg-white rounded-2xl outline-none transition-all font-bold text-gray-700">
                </div>

                <div class="space-y-2">
                    <label class="text-[11px] font-black text-gray-400 uppercase ml-2 tracking-wider">ইমেইল ঠিকানা</label>
                    <input type="email" name="email" value="{{ $company->email ?? '' }}" class="w-full p-4 bg-gray-50 border-2 border-transparent focus:border-indigo-100 focus:bg-white rounded-2xl outline-none transition-all font-bold text-gray-700">
                </div>

                <div class="md:col-span-2 space-y-2">
                    <label class="text-[11px] font-black text-gray-400 uppercase ml-2 tracking-wider">প্রতিষ্ঠানের ঠিকানা</label>
                    <textarea name="address" rows="2" class="w-full p-4 bg-gray-50 border-2 border-transparent focus:border-indigo-100 focus:bg-white rounded-2xl outline-none transition-all font-bold text-gray-700">{{ $company->address ?? '' }}</textarea>
                </div>

                <div class="space-y-2">
                    <label class="text-[11px] font-black text-gray-400 uppercase ml-2 tracking-wider">লোগো (স্কয়ার হলে ভালো হয়)</label>
                    <div class="flex items-center gap-4 bg-gray-50 p-4 rounded-2xl border-2 border-dashed border-gray-200">
                        @if(!empty($company->logo))
                            <img src="{{ asset('storage/'.$company->logo) }}" class="w-14 h-14 rounded-xl object-cover border-2 border-white shadow-sm">
                        @else
                            <div class="w-14 h-14 bg-gray-200 rounded-xl flex items-center justify-center text-xs text-gray-400">No Logo</div>
                        @endif
                        <input type="file" name="logo" class="text-xs font-bold text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-xs file:font-black file:bg-indigo-50 file:text-indigo-600 hover:file:bg-indigo-100">
                    </div>
                </div>

                <div class="space-y-2">
                    <label class="text-[11px] font-black text-gray-400 uppercase ml-2 tracking-wider">কারেন্সি সিম্বল (যেমন: ৳)</label>
                    <input type="text" name="currency_symbol" value="{{ $company->currency_symbol ?? '৳' }}" class="w-full p-4 bg-gray-50 border-2 border-transparent focus:border-indigo-100 focus:bg-white rounded-2xl outline-none transition-all font-bold text-gray-700">
                </div>
            </div>

            <div class="pt-6 border-t border-gray-50 flex justify-end">
                <button type="submit" class="bg-indigo-600 text-white px-12 py-4 rounded-2xl font-black hover:bg-indigo-700 transition-all shadow-xl shadow-indigo-100 active:scale-95">
                    আপডেট করুন
                </button>
            </div>
        </form>
    </div>
</div>
@endsection