@extends('layouts.app')

@section('content')
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
    <div class="bg-white overflow-hidden shadow sm:rounded-lg">
        <div class="px-4 py-5 sm:px-6">
            <h3 class="text-lg leading-6 font-medium text-gray-900">
                Submit Patents Details
            </h3>
            <p class="mt-1 max-w-2xl text-sm text-gray-500">
                Fill in the details of your Patents.
            </p>
        </div>
        @if ($errors->any())
        <div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4">
            <ul>
                @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
                @endforeach
            </ul>
        </div>
        @endif
        <div class="border-t border-gray-200">
            <form method="POST" action="{{ route('faculty.PatentsFormResponse') }}" enctype="multipart/form-data">
                @csrf
                <div class="px-4 py-5 sm:px-6">
                    <div class="space-y-6">

                        <!-- Author Information -->
                        <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
                            <div>
                                <label for="title" class="block text-sm font-medium text-gray-700">Title</label>
                                <input type="text" name="title" id="title" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
                            </div>
                            <div>
                                <label for="investigator" class="block text-sm font-medium text-gray-700">Investigator</label>
                                <input type="text" name="investigator" id="investigator" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" >
                            </div>
                        </div>

                        <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
                            <div>
                                <label for="application_no" class="block text-sm font-medium text-gray-700">Application No</label>
                                <input type="text" name="application_no" id="application_no" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
                            </div>
                            <div>
                                <label for="type" class="block text-sm font-medium text-gray-700">Type</label>
                                <input type="text" name="type" id="type" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" >
                            </div>
                        </div>

                        <!-- Department and Faculty Name -->
                        <div class="grid grid-cols-2 sm:grid-cols-2 gap-4">
                            <div>
                                <label for="department" class="block text-sm font-medium text-gray-700">Department</label>
                                <input type="text" name="department" id="department" value="{{ auth()->user()->department->name }}" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm bg-gray-100" disabled>
                                <input type="hidden" name="department_id" value="{{ auth()->user()->department->id }}">
                            </div>
                            <div>
                                <label for="faculty_name" class="block text-sm font-medium text-gray-700">Faculty Name</label>
                                <input type="text" name="faculty_name" id="faculty_name" value="{{ auth()->user()->name }}" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm bg-gray-100" disabled>
                                <input type="hidden" name="faculty_id" value="{{ auth()->user()->id }}">
                            </div>
                        </div>

                        <!-- Date Information -->
                        <div class="grid grid-cols-2 gap-4">
                            <div>
                                <label for="date_of_submission" class="block text-sm font-medium text-gray-700">Date Of Submission</label>
                                <input type="date" name="date_of_submission" id="date_of_submission" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
                            </div>
                            <div>
                                <label for="date_of_filling" class="block text-sm font-medium text-gray-700">Date Of Filling</label>
                                <input type="date" name="date_of_filling" id="date_of_filling" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" required>
                            </div>
                            <div>
                                <label for="status" class="block text-sm font-medium text-gray-700">Status</label>
                                <input type="text" name="status" id="status" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm " >
                            </div>
                        </div>

                        <!-- proof -->
                        <div>
                            <label for="proof" class="block text-sm font-medium text-gray-700">Upload Proof</label>
                            <input type="file" name="proof" id="proof" class="block w-full mt-1 border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" accept=".jpg,.jpeg,.png,.pdf,.doc,.docx,.zip" required>
                            <p class="mt-1 text-xs text-gray-500">Accepted formats: JPG, JPEG, PNG, PDF, DOC, DOCX, ZIP</p>
                        </div>
                    </div>
                </div>

                <!-- Submit Button -->
                <div class="px-4 py-3 sm:px-6 text-center mt-4">
                    <button type="submit" class="inline-flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-black">
                        Submit
                    </button>
                </div>

            </form>
        </div>
    </div>
</div>

@endsection