<?php

use Illuminate\Support\Facades\Route;

Route::view('/', 'welcome')->name('home');

Route::view('dashboard', 'dashboard')
    ->middleware(['auth', 'verified'])
    ->name('dashboard');

Route::view('profile', 'profile')
    ->middleware(['auth'])
    ->name('profile');

// Parks routes
Route::get('/parks', [App\Http\Controllers\ParkController::class, 'index'])->name('parks.index');
Route::get('/parks/create', [App\Http\Controllers\ParkController::class, 'create'])->name('parks.create')->middleware('auth');
Route::get('/parks/{park:slug}', [App\Http\Controllers\ParkController::class, 'show'])->name('parks.show');
Route::get('/parks/{park:slug}/edit', [App\Http\Controllers\ParkController::class, 'edit'])->name('parks.edit')->middleware('auth');

Route::get('/rides', function () {
    return view('placeholder', ['title' => 'Rides', 'message' => 'Rides feature coming soon!']);
})->name('rides.index');

Route::get('/search', function () {
    return view('placeholder', ['title' => 'Search Results', 'message' => 'Search feature coming soon!']);
})->name('search');

// Admin placeholder route
Route::get('/admin', function () {
    return view('placeholder', ['title' => 'Admin Panel', 'message' => 'Admin panel coming soon!']);
})->middleware(['auth'])->name('admin.index');

// Footer routes
Route::get('/terms', function () {
    return view('placeholder', ['title' => 'Terms of Service', 'message' => 'Terms of Service page coming soon!']);
})->name('terms');

Route::get('/privacy', function () {
    return view('placeholder', ['title' => 'Privacy Policy', 'message' => 'Privacy Policy page coming soon!']);
})->name('privacy');

require __DIR__.'/auth.php';

// Categories CRUD routes
Route::resource('categories', App\Http\Controllers\CategoryController::class);
// Operators CRUD routes
Route::resource('operators', App\Http\Controllers\OperatorController::class);
// Rides CRUD routes
Route::resource('rides', App\Http\Controllers\RideController::class);
// Parks CRUD routes
Route::resource('parks', App\Http\Controllers\ParkController::class);