@extends('layouts.site')

@section('title', 'Become a Partner - Join Our Network')
@section('meta-description', 'Apply to become an organizational partner and join our collaborative network for health advocacy and community development.')

@section('content')
<!-- Hero Section -->
<div class="bg-gradient-to-r from-green-600 to-green-700 shadow-lg">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
        <div class="text-center">
            <h1 class="text-4xl md:text-5xl font-serif font-bold text-white mb-4">
                <i class="fas fa-handshake mr-3"></i>
                Become a Partner
            </h1>
            <p class="text-xl text-green-100 max-w-3xl mx-auto">
                Join our network of organizations committed to advancing health advocacy, research, and community development.
            </p>
        </div>
    </div>
</div>

<!-- Breadcrumb -->
<div class="bg-gray-50 border-b">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-3">
        <nav class="flex items-center space-x-2 text-sm text-gray-600">
            <a href="{{ route('partners.public.index') }}" class="hover:text-green-600">
                <i class="fas fa-home mr-1"></i>
                Partners
            </a>
            <i class="fas fa-chevron-right text-gray-400 text-xs"></i>
            <span class="text-gray-900">Become a Partner</span>
        </nav>
    </div>
</div>

<!-- Main Content -->
<div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
    <!-- Benefits Section -->
    <div class="bg-green-50 rounded-xl p-6 mb-10">
        <h2 class="text-xl font-serif font-bold text-green-900 mb-4">
            <i class="fas fa-lightbulb text-green-600 mr-2"></i>
            Why Partner With Us?
        </h2>
        <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
            <div class="flex items-start">
                <i class="fas fa-check-circle text-green-600 mt-1 mr-3"></i>
                <div>
                    <h3 class="font-semibold text-green-900">Collaborative Network</h3>
                    <p class="text-sm text-green-700">Connect with like-minded organizations</p>
                </div>
            </div>
            <div class="flex items-start">
                <i class="fas fa-check-circle text-green-600 mt-1 mr-3"></i>
                <div>
                    <h3 class="font-semibold text-green-900">Resource Sharing</h3>
                    <p class="text-sm text-green-700">Access shared resources and expertise</p>
                </div>
            </div>
            <div class="flex items-start">
                <i class="fas fa-check-circle text-green-600 mt-1 mr-3"></i>
                <div>
                    <h3 class="font-semibold text-green-900">Visibility</h3>
                    <p class="text-sm text-green-700">Showcase your organization publicly</p>
                </div>
            </div>
            <div class="flex items-start">
                <i class="fas fa-check-circle text-green-600 mt-1 mr-3"></i>
                <div>
                    <h3 class="font-semibold text-green-900">Impact</h3>
                    <p class="text-sm text-green-700">Make a difference together</p>
                </div>
            </div>
        </div>
    </div>

    <!-- Application Form -->
    <div class="bg-white rounded-xl shadow-lg p-8">
        <h2 class="text-2xl font-serif font-bold text-gray-900 mb-6">
            Partnership Application
        </h2>

        @if(session('error'))
            <div class="mb-6 p-4 bg-red-100 border border-red-400 text-red-700 rounded-lg">
                <i class="fas fa-exclamation-circle mr-2"></i>
                {{ session('error') }}
            </div>
        @endif

        <form action="{{ route('partners.public.apply') }}" method="POST">
            @csrf

            <!-- Organization Information -->
            <div class="border-b pb-6 mb-6">
                <h3 class="text-lg font-semibold text-gray-900 mb-4">
                    <i class="fas fa-building text-blue-600 mr-2"></i>
                    Organization Information
                </h3>
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <!-- Organization Name -->
                    <div class="md:col-span-2">
                        <label for="organization_name" class="block text-sm font-medium text-gray-700 mb-1">
                            Organization Name <span class="text-red-500">*</span>
                        </label>
                        <input type="text" 
                               name="organization_name" 
                               id="organization_name"
                               value="{{ old('organization_name') }}"
                               required
                               class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent">
                        @error('organization_name')
                            <p class="mt-1 text-sm text-red-600">{{ $message }}</p>
                        @enderror
                    </div>

                    <!-- Organization Type -->
                    <div>
                        <label for="organization_type" class="block text-sm font-medium text-gray-700 mb-1">
                            Organization Type <span class="text-red-500">*</span>
                        </label>
                        <select name="organization_type" 
                                id="organization_type"
                                required
                                class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent">
                            <option value="">Select type...</option>
                            <option value="government" {{ old('organization_type') == 'government' ? 'selected' : '' }}>Government Agency</option>
                            <option value="ngo" {{ old('organization_type') == 'ngo' ? 'selected' : '' }}>Non-Governmental Organization</option>
                            <option value="private_sector" {{ old('organization_type') == 'private_sector' ? 'selected' : '' }}>Private Sector</option>
                            <option value="academic" {{ old('organization_type') == 'academic' ? 'selected' : '' }}>Academic Institution</option>
                            <option value="healthcare" {{ old('organization_type') == 'healthcare' ? 'selected' : '' }}>Healthcare Organization</option>
                            <option value="international" {{ old('organization_type') == 'international' ? 'selected' : '' }}>International Organization</option>
                            <option value="community_based" {{ old('organization_type') == 'community_based' ? 'selected' : '' }}>Community-Based Organization</option>
                            <option value="faith_based" {{ old('organization_type') == 'faith_based' ? 'selected' : '' }}>Faith-Based Organization</option>
                            <option value="other" {{ old('organization_type') == 'other' ? 'selected' : '' }}>Other</option>
                        </select>
                        @error('organization_type')
                            <p class="mt-1 text-sm text-red-600">{{ $message }}</p>
                        @enderror
                    </div>

                    <!-- Email -->
                    <div>
                        <label for="email" class="block text-sm font-medium text-gray-700 mb-1">
                            Organization Email <span class="text-red-500">*</span>
                        </label>
                        <input type="email" 
                               name="email" 
                               id="email"
                               value="{{ old('email') }}"
                               required
                               class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent">
                        @error('email')
                            <p class="mt-1 text-sm text-red-600">{{ $message }}</p>
                        @enderror
                    </div>

                    <!-- Phone -->
                    <div>
                        <label for="phone" class="block text-sm font-medium text-gray-700 mb-1">
                            Phone Number
                        </label>
                        <input type="tel" 
                               name="phone" 
                               id="phone"
                               value="{{ old('phone') }}"
                               class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent">
                        @error('phone')
                            <p class="mt-1 text-sm text-red-600">{{ $message }}</p>
                        @enderror
                    </div>

                    <!-- Website -->
                    <div>
                        <label for="website" class="block text-sm font-medium text-gray-700 mb-1">
                            Website URL
                        </label>
                        <input type="url" 
                               name="website" 
                               id="website"
                               value="{{ old('website') }}"
                               placeholder="https://"
                               class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent">
                        @error('website')
                            <p class="mt-1 text-sm text-red-600">{{ $message }}</p>
                        @enderror
                    </div>

                    <!-- Description -->
                    <div class="md:col-span-2">
                        <label for="description" class="block text-sm font-medium text-gray-700 mb-1">
                            Organization Description <span class="text-red-500">*</span>
                        </label>
                        <textarea name="description" 
                                  id="description"
                                  rows="4"
                                  required
                                  placeholder="Tell us about your organization, its mission, and activities..."
                                  class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent">{{ old('description') }}</textarea>
                        <p class="mt-1 text-sm text-gray-500">Maximum 2000 characters</p>
                        @error('description')
                            <p class="mt-1 text-sm text-red-600">{{ $message }}</p>
                        @enderror
                    </div>
                </div>
            </div>

            <!-- Contact Person -->
            <div class="border-b pb-6 mb-6">
                <h3 class="text-lg font-semibold text-gray-900 mb-4">
                    <i class="fas fa-user text-blue-600 mr-2"></i>
                    Primary Contact Person
                </h3>
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <!-- Contact Name -->
                    <div>
                        <label for="contact_name" class="block text-sm font-medium text-gray-700 mb-1">
                            Full Name <span class="text-red-500">*</span>
                        </label>
                        <input type="text" 
                               name="contact_name" 
                               id="contact_name"
                               value="{{ old('contact_name') }}"
                               required
                               class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent">
                        @error('contact_name')
                            <p class="mt-1 text-sm text-red-600">{{ $message }}</p>
                        @enderror
                    </div>

                    <!-- Contact Email -->
                    <div>
                        <label for="contact_email" class="block text-sm font-medium text-gray-700 mb-1">
                            Email <span class="text-red-500">*</span>
                        </label>
                        <input type="email" 
                               name="contact_email" 
                               id="contact_email"
                               value="{{ old('contact_email') }}"
                               required
                               class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent">
                        @error('contact_email')
                            <p class="mt-1 text-sm text-red-600">{{ $message }}</p>
                        @enderror
                    </div>

                    <!-- Contact Phone -->
                    <div>
                        <label for="contact_phone" class="block text-sm font-medium text-gray-700 mb-1">
                            Phone Number
                        </label>
                        <input type="tel" 
                               name="contact_phone" 
                               id="contact_phone"
                               value="{{ old('contact_phone') }}"
                               class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent">
                        @error('contact_phone')
                            <p class="mt-1 text-sm text-red-600">{{ $message }}</p>
                        @enderror
                    </div>
                </div>
            </div>

            <!-- Additional Information -->
            <div class="mb-8">
                <h3 class="text-lg font-semibold text-gray-900 mb-4">
                    <i class="fas fa-comment text-blue-600 mr-2"></i>
                    Additional Information
                </h3>
                <div>
                    <label for="message" class="block text-sm font-medium text-gray-700 mb-1">
                        Message (Optional)
                    </label>
                    <textarea name="message" 
                              id="message"
                              rows="4"
                              placeholder="Any additional information or questions about the partnership..."
                              class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent">{{ old('message') }}</textarea>
                    @error('message')
                        <p class="mt-1 text-sm text-red-600">{{ $message }}</p>
                    @enderror
                </div>
            </div>

            <!-- Submit -->
            <div class="flex items-center justify-between">
                <a href="{{ route('partners.public.index') }}" 
                   class="px-6 py-3 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition">
                    <i class="fas fa-arrow-left mr-2"></i>
                    Back to Directory
                </a>
                <button type="submit" 
                        class="px-8 py-3 bg-green-600 text-white rounded-lg font-semibold hover:bg-green-700 transition shadow-lg">
                    <i class="fas fa-paper-plane mr-2"></i>
                    Submit Application
                </button>
            </div>
        </form>
    </div>

    <!-- Info Box -->
    <div class="mt-8 bg-blue-50 rounded-lg p-6 text-center">
        <p class="text-blue-800">
            <i class="fas fa-info-circle mr-2"></i>
            Your application will be reviewed by our team. We will contact you within 5-7 business days.
        </p>
    </div>
</div>
@endsection
