<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\ContactController;

// Home Page
Route::get('/', function () {
    return view('pages.home');
})->name('home');

// About Page
Route::get('/about', function () {
    return view('pages.about');
})->name('about');

// Contact Pages
Route::get('/contact', function () {
    return view('pages.contact');
})->name('contact');

// Contact Form Submission
Route::post('/contact', [ContactController::class, 'submit'])->name('contact.submit');

// Main Services Page
Route::get('/services', function () {
    return view('pages.services');
})->name('services');

// Individual Service Pages
Route::get('/services/web', function () {
    return view('pages.services-web');
})->name('services.web');

Route::get('/services/app', function () {
    return view('pages.services-app');
})->name('services.app');

Route::get('/services/logo', function () {
    return view('pages.services-logo');
})->name('services.logo');

Route::get('/services/ecom', function () {
    return view('pages.services-ecom');
})->name('services.ecom');

Route::get('/services/brand', function () {
    return view('pages.services-brand');
})->name('services.brand');

Route::get('/services/smm', function () {
    return view('pages.services-smm');
})->name('services.smm');

Route::get('/services/seo', function () {
    return view('pages.services-seo');
})->name('services.seo');

// Packages Page
Route::get('/packages', function () {
    return view('pages.packages');
})->name('packages');

// Portfolio Page
Route::get('/portfolio', function () {
    return view('pages.portfolio');
})->name('portfolio');

// Social Info Page
Route::get('/social_info', function () {
    return view('pages.social-info');
})->name('social.info');

// Terms & Conditions Page
Route::get('/terms_and_conditions', function () {
    return view('pages.terms-conditions');
})->name('terms.conditions');

// Privacy Policy Page
Route::get('/privacy_policy', function () {
    return view('pages.privacy-policy');
})->name('privacy.policy');


// For old PHP file names that might be linked (optional redirects)
// Add these to maintain SEO and avoid broken links
Route::redirect('/index.php', '/', 301);
Route::redirect('/about.php', '/about', 301);
Route::redirect('/contact.php', '/contact', 301);
Route::redirect('/packages.php', '/packages', 301);
Route::redirect('/portfolio.php', '/portfolio', 301);

// Redirect old service file names
Route::redirect('/services.php', '/services', 301);
Route::redirect('/services app.php', '/services/app', 301);
Route::redirect('/services logo.php', '/services/logo', 301);
Route::redirect('/services ecom.php', '/services/ecom', 301);
Route::redirect('/services brand.php', '/services/brand', 301);
Route::redirect('/services smm.php', '/services/smm', 301);
Route::redirect('/services seo.php', '/services/seo', 301);

// Redirect old policy pages
Route::redirect('/terms_and_conditions.php', '/terms_and_conditions', 301);
Route::redirect('/privacy_policy.php', '/privacy_policy', 301);
Route::redirect('/social_info.php', '/social_info', 301);
