<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use Illuminate\View\View;

class UserInterfaceController extends Controller
{
    public function sections(): View
    {
        $homeSectionUrl = fn (string $section) => route('admin.home.edit', ['section' => $section]);

        $pages = [
            ['label' => 'Home Page CMS', 'url' => route('admin.home.edit')],
            ['label' => 'Sections', 'url' => route('admin.sections.index')],
            ['label' => 'Pages', 'url' => route('admin.pages.index')],
            ['label' => 'Countries Page CMS', 'url' => route('admin.countries.page.edit')],
            ['label' => 'Country Sections CMS', 'url' => route('admin.country-sections.edit')],
            ['label' => 'Services Page CMS', 'url' => route('admin.services.edit')],
            ['label' => 'Success Stories CMS', 'url' => route('admin.success-stories.edit')],
            ['label' => 'Partner Institutions', 'url' => route('admin.partner-institutions.index')],
            ['label' => 'Countries Data', 'url' => route('admin.countries.index')],
            ['label' => 'Events', 'url' => route('admin.events.index')],
            ['label' => 'Student Reviews', 'url' => route('admin.student-reviews.index')],
            ['label' => 'FAQs', 'url' => route('admin.faqs.index')],
        ];

        $sections = [
            ['name' => 'Home - Hero / Why / Accreditation', 'page' => 'Home (/)', 'manage_url' => $homeSectionUrl('hero'), 'manage_label' => 'Edit Home CMS', 'sample_image' => 'https://images.unsplash.com/photo-1523240795612-9a054b0db644?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Opens Home CMS focused on the Hero section.'],
            ['name' => 'Home - Destinations / Events / Institutions', 'page' => 'Home (/)', 'manage_url' => $homeSectionUrl('destinations'), 'manage_label' => 'Edit Home CMS', 'sample_image' => 'https://images.unsplash.com/photo-1507608616759-54f48f0af0ee?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Opens Home CMS focused on destinations, events, and institutions.'],
            ['name' => 'Home - Student Videos / Visa Stories / Partners / FAQ', 'page' => 'Home (/)', 'manage_url' => $homeSectionUrl('videos'), 'manage_label' => 'Edit Home CMS', 'sample_image' => 'https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Opens Home CMS focused on videos, partners, FAQ, and final CTA fields.'],

            ['name' => 'Countries Listing - Hero', 'page' => 'Countries (/countries)', 'manage_url' => route('admin.countries.page.edit'), 'manage_label' => 'Edit Countries Page CMS', 'sample_image' => 'https://images.unsplash.com/photo-1469474968028-56623f02e42e?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Listing hero title, text, button, image.'],
            ['name' => 'Countries Listing - Destination Grid', 'page' => 'Countries (/countries)', 'manage_url' => route('admin.countries.index'), 'manage_label' => 'Manage Countries', 'sample_image' => 'https://images.unsplash.com/photo-1486299267070-83823f5448dd?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Country cards come from Countries data (name, hero image, flag).'],
            ['name' => 'Countries Listing - Red CTA Band', 'page' => 'Countries (/countries)', 'manage_url' => route('admin.countries.page.edit'), 'manage_label' => 'Edit Countries Page CMS', 'sample_image' => 'https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Bottom CTA title/text/button/image.'],

            ['name' => 'Country Details - Hero / Why / Quick Facts', 'page' => 'Country Details (/countries/{slug})', 'manage_url' => route('admin.countries.index'), 'manage_label' => 'Manage Countries', 'sample_image' => 'https://images.unsplash.com/photo-1539635278303-d4002c07eae3?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Hero and rich content from Country edit page + built-in section fields.'],
            ['name' => 'Country Details - Entry Requirements (Animated)', 'page' => 'Country Details (/countries/{slug})', 'manage_url' => route('admin.country-sections.edit'), 'manage_label' => 'Edit Country Sections CMS', 'sample_image' => 'https://images.unsplash.com/photo-1523050854058-8df90110c9f1?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Global pool + country-wise item mapping with auto-rotate timing.'],
            ['name' => 'Country Details - Major Admission Intakes', 'page' => 'Country Details (/countries/{slug})', 'manage_url' => route('admin.country-sections.edit'), 'manage_label' => 'Edit Country Sections CMS', 'sample_image' => 'https://images.unsplash.com/photo-1450101499163-c8848c66ca85?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Global intake items and country-wise mapping.'],
            ['name' => 'Country Details - Popular Subjects', 'page' => 'Country Details (/countries/{slug})', 'manage_url' => route('admin.country-sections.edit'), 'manage_label' => 'Edit Country Sections CMS', 'sample_image' => 'https://images.unsplash.com/photo-1518770660439-4636190af475?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Global subject cards and country-wise mapping.'],
            ['name' => 'Country Details - Admission & Visa Process', 'page' => 'Country Details (/countries/{slug})', 'manage_url' => route('admin.country-sections.edit'), 'manage_label' => 'Edit Country Sections CMS', 'sample_image' => 'https://images.unsplash.com/photo-1542744173-8e7e53415bb0?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Global process steps and country-wise mapping.'],
            ['name' => 'Country Details - Partner Institutions', 'page' => 'Country Details (/countries/{slug})', 'manage_url' => route('admin.partner-institutions.index'), 'manage_label' => 'Manage Partner Institutions', 'sample_image' => 'https://images.unsplash.com/photo-1523050854058-8df90110c9f1?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Shared institution library with name and logo, reused across multiple public pages.'],
            ['name' => 'Country Details - Student Videos', 'page' => 'Country Details (/countries/{slug})', 'manage_url' => route('admin.student-reviews.index'), 'manage_label' => 'Manage Student Reviews', 'sample_image' => 'https://images.unsplash.com/photo-1521737604893-d14cc237f11d?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Reuses global student review videos.'],
            ['name' => 'Country Details - Visa Success Stories', 'page' => 'Country Details (/countries/{slug})', 'manage_url' => route('admin.success-stories.edit'), 'manage_label' => 'Edit Success Stories CMS', 'sample_image' => 'https://images.unsplash.com/photo-1542909168-82c3e7fdca5c?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Reuses global featured visa success stories.'],

            ['name' => 'Services Timeline Page', 'page' => 'Services (/services)', 'manage_url' => route('admin.services.edit'), 'manage_label' => 'Edit Services CMS', 'sample_image' => 'https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Services hero and timeline content.'],
            ['name' => 'Events Cards', 'page' => 'Home + Events', 'manage_url' => route('admin.events.index'), 'manage_label' => 'Manage Events', 'sample_image' => 'https://images.unsplash.com/photo-1511578314322-379afb476865?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Event list and details cards.'],
            ['name' => 'FAQ Section', 'page' => 'Home (/)', 'manage_url' => route('admin.faqs.index'), 'manage_label' => 'Manage FAQs', 'sample_image' => 'https://images.unsplash.com/photo-1434030216411-0b793f4b4173?auto=format&fit=crop&w=1200&q=80', 'help_text' => 'Home FAQ accordion.'],
        ];

        return view('admin.ui.sections', compact('sections', 'pages'));
    }
}
