@extends('layouts.front')

@section('content')

<div class="container mt-5">
<div class="card shadow p-4">

<h3 class="mb-4 text-center text-primary">Journalist Application Form</h3>
<div class="reporting">
    @if(session('success'))
<div class="alert alert-success">
    {{ session('success') }}
</div>
@endif

@if(session('error'))
<div class="alert alert-danger">
    {{ session('error') }}
</div>
@endif
</div>


<div>
    @if(session('success'))
    <script>
        alert("{{ session('success') }}"); // Show alert
        window.location.href = "{{ url()->current() }}"; // Redirect to current page
        // Or redirect to another page: window.location.href = "{{ route('home') }}";
    </script>
@endif
</div>



<form method="POST" action="{{ route('application.store') }}" enctype="multipart/form-data">
@csrf

<div class="row">

{{-- ================= Personal Info ================= --}}

<div class="col-md-6 mb-3">
<label class="form-label">Full Name</label>
<input type="text" name="full_name" class="form-control" required>
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Father Name</label>
<input type="text" name="father_name" class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Mother Name</label>
<input type="text" name="mother_name" class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Date of Birth</label>
<input type="date" name="dob" class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Gender</label>
<select name="gender" class="form-select">
<option value="">Select</option>
<option>Male</option>
<option>Female</option>
<option>Other</option>
</select>
</div>

<div class="col-md-6 mb-3">
<label class="form-label">NID</label>
<input type="text" name="nid" class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Mobile</label>
<input type="text" name="mobile" class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Email</label>
<input type="email" name="email" class="form-control">
</div>

{{-- ================= Address ================= --}}

<div class="col-md-6 mb-3">
<label class="form-label">Present Address</label>
<textarea name="present_address" class="form-control"></textarea>
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Permanent Address</label>
<textarea name="permanent_address" class="form-control"></textarea>
</div>

<div class="col-md-6 mb-3">
<label class="form-label">District</label>
<input type="text" name="district" class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Division</label>
<input type="text" name="division" class="form-control">
</div>

{{-- ================= Professional ================= --}}

<div class="col-md-6 mb-3">
<label class="form-label">Education</label>
<input type="text" name="education" class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">University</label>
<input type="text" name="university" class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Graduation Year</label>
<input type="text" name="graduation_year" class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Experience</label>
<textarea name="experience" class="form-control"></textarea>
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Current Profession</label>
<input type="text" name="current_profession" class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Previous Media</label>
<input type="text" name="previous_media" class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Reporting Category</label>
<input type="text" name="reporting_category" class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Working Area</label>
<input type="text" name="working_area" class="form-control">
</div>

{{-- ================= Online Presence ================= --}}

<div class="col-md-6 mb-3">
<label class="form-label">Portfolio Link</label>
<input type="url" name="portfolio_link" class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">Facebook Link</label>
<input type="url" name="facebook_link" class="form-control">
</div>

<div class="col-md-6 mb-3">
<label class="form-label">YouTube Link</label>
<input type="url" name="youtube_link" class="form-control">
</div>
</div>
{{-- ================= Files ================= --}}
<div class="row">

<div class="col-md-4 mb-3">
<label class="form-label">Upload CV (PDF)</label>
<input type="file" name="cv_file" class="form-control">
</div>

<div class="col-md-4 mb-3">
<label class="form-label">Upload Photo</label>
<input type="file" name="photo" class="form-control">
</div>

<div class="col-md-4 mb-3">
<label class="form-label">Upload NID Copy</label>
<input type="file" name="nid_copy" class="form-control">
</div>
</div>
{{-- ================= Submit ================= --}}

<div class="col-12 mt-3">
<button type="submit" class="btn btn-dark px-4">
Submit Application
</button>
</div>


</form>

</div>
</div>

@endsection