<?php
require_once __DIR__ . '/includes/functions.php';
$currentPage = 'home';
$s = get_settings();
$sliders = db()->query("SELECT * FROM sliders WHERE status = 'active' ORDER BY sort_order")->fetchAll();
$features = db()->query("SELECT * FROM features WHERE status = 'active' ORDER BY sort_order")->fetchAll();
$services = db()->query("SELECT * FROM services WHERE status = 'active' ORDER BY sort_order")->fetchAll();
$countries = db()->query("SELECT * FROM countries WHERE status = 'active' ORDER BY sort_order LIMIT 8")->fetchAll();
$programs = db()->query("SELECT * FROM test_preparations WHERE status = 'active' ORDER BY sort_order LIMIT 6")->fetchAll();
$testimonials = db()->query("SELECT * FROM testimonials WHERE status = 'active' ORDER BY sort_order")->fetchAll();
$galleryPreview = db()->query("SELECT * FROM gallery_items WHERE status = 'active' ORDER BY sort_order LIMIT 4")->fetchAll();
$partners = db()->query("SELECT * FROM partners WHERE status = 'active' ORDER BY sort_order")->fetchAll();
$about = db()->query('SELECT * FROM about_content WHERE id = 1')->fetch() ?: [];
$leadSent = $_GET['lead'] ?? '';
$pageSeoTitle = '';
$pageSeoDescription = $s['meta_description'] ?? '';
require __DIR__ . '/partials/header.php';
?>
<?php if ($leadSent === '1'): ?>
<div class="max-w-4xl mx-auto px-6 mt-4">
<div class="bg-brand-green/10 border border-brand-green text-brand-green text-sm font-medium rounded-xl px-5 py-3">
<i class="fa-solid fa-circle-check mr-2"></i>Thank you! Your enquiry has been received — our counsellors will contact you shortly.
</div>
</div>
<?php endif; ?>
<!-- ===================== HERO SLIDER ===================== -->
<section class="relative overflow-hidden">
<div class="swiper hero-swiper h-[560px] md:h-[640px]">
<div class="swiper-wrapper">
<?php foreach ($sliders as $slide): ?>
<div class="swiper-slide relative">
<div class="absolute inset-0 bg-gradient-to-br from-brand-black via-brand-black/80 to-brand-green/70"></div>
<img src="<?= e(resolve_image($slide['image'])) ?>" class="absolute inset-0 w-full h-full object-cover mix-blend-overlay opacity-60" alt="<?= e($slide['title']) ?>">
<div class="relative z-10 max-w-7xl mx-auto px-6 h-full flex items-center">
<div class="max-w-2xl" data-aos="fade-up">
<?php if ($slide['badge_text']): ?>
<span class="inline-block px-4 py-1.5 rounded-full bg-brand-gold/20 border border-brand-gold text-brand-gold text-xs font-semibold mb-5"><?= e($slide['badge_text']) ?></span>
<?php endif; ?>
<h1 class="text-white font-heading font-extrabold text-4xl md:text-6xl leading-tight mb-5"><?= e($slide['title']) ?></h1>
<p class="text-gray-200 text-lg mb-8"><?= e($slide['subtitle']) ?></p>
<?php if ($slide['button_text']): ?>
<a href="<?= e($slide['button_link'] ?: '#') ?>" class="gradient-btn text-white font-semibold px-7 py-3.5 rounded-full inline-flex items-center"><?= e($slide['button_text']) ?> <i class="fa-solid fa-arrow-right ml-2"></i></a>
<?php endif; ?>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="swiper-pagination"></div>
<div class="swiper-button-next !text-white"></div>
<div class="swiper-button-prev !text-white"></div>
</div>
</section>
<!-- ===================== CHAIRMAN'S MESSAGE PREVIEW (link to About) ===================== -->
<!-- ===================== WHY CHOOSE US ===================== -->
<section id="about" class="py-20 bg-gray-50 dark:bg-gray-900/40">
<div class="max-w-7xl mx-auto px-6">
<div class="text-center max-w-2xl mx-auto mb-14" data-aos="fade-up">
<span class="text-brand-red font-semibold text-sm tracking-widest uppercase">Why Choose Us</span>
<h2 class="font-heading font-extrabold text-3xl md:text-4xl mt-3">The <span class="gradient-text">Excellent</span> Difference</h2>
<p class="text-gray-500 dark:text-gray-400 mt-4">Pride in Excellence isn't just our tagline — it's how we guide every student toward their global education goals.</p>
</div>
<div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-6">
<?php foreach ($features as $i => $f): ?>
<div class="card-hover bg-white dark:bg-gray-800 rounded-2xl p-7 shadow-sm border-t-4 border-brand-<?= e($f['color']) ?>" data-aos="fade-up" data-aos-delay="<?= $i * 100 ?>">
<div class="w-14 h-14 rounded-xl bg-brand-<?= e($f['color']) ?>/10 flex items-center justify-center text-brand-<?= e($f['color']) ?> text-2xl mb-5"><i class="<?= e($f['icon']) ?>"></i></div>
<h3 class="font-heading font-bold text-lg mb-2"><?= e($f['title']) ?></h3>
<p class="text-gray-500 dark:text-gray-400 text-sm"><?= e($f['description']) ?></p>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
<!-- ===================== SERVICES ===================== -->
<section class="py-20" id="services">
<div class="max-w-7xl mx-auto px-6">
<div class="text-center max-w-2xl mx-auto mb-14" data-aos="fade-up">
<span class="text-brand-green font-semibold text-sm tracking-widest uppercase">What We Offer</span>
<h2 class="font-heading font-extrabold text-3xl md:text-4xl mt-3">Our Core <span class="gradient-text">Services</span></h2>
</div>
<div class="grid sm:grid-cols-2 lg:grid-cols-3 gap-6">
<?php $palette = ['bg-brand-black text-white', 'bg-brand-green text-white', 'bg-brand-red text-white', 'bg-white dark:bg-gray-800 border-2 border-brand-green', 'bg-white dark:bg-gray-800 border-2 border-brand-red', 'bg-white dark:bg-gray-800 border-2 border-brand-gold'];
foreach ($services as $i => $svc): ?>
<div class="card-hover relative overflow-hidden rounded-2xl <?= $palette[$i % count($palette)] ?> p-8" data-aos="zoom-in" data-aos-delay="<?= $i * 100 ?>">
<i class="<?= e($svc['icon']) ?> text-3xl mb-5 <?= $i < 3 ? 'text-brand-gold' : 'text-brand-green' ?>"></i>
<h3 class="font-heading font-bold text-xl mb-2"><?= e($svc['title']) ?></h3>
<p class="text-sm <?= $i < 3 ? 'text-gray-200' : 'text-gray-500 dark:text-gray-400' ?>"><?= e($svc['description']) ?></p>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
<!-- ===================== STUDY DESTINATIONS ===================== -->
<section class="py-20 bg-gray-50 dark:bg-gray-900/40">
<div class="max-w-7xl mx-auto px-6">
<div class="text-center max-w-2xl mx-auto mb-14" data-aos="fade-up">
<span class="text-brand-red font-semibold text-sm tracking-widest uppercase">Study Abroad</span>
<h2 class="font-heading font-extrabold text-3xl md:text-4xl mt-3">Popular <span class="gradient-text">Destinations</span></h2>
</div>
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-5">
<?php foreach ($countries as $i => $c): ?>
<a href="study-abroad-<?= e($c['slug']) ?>.php" class="card-hover group relative rounded-2xl overflow-hidden h-40" data-aos="fade-up" data-aos-delay="<?= $i * 80 ?>">
<img src="<?= e(resolve_image($c['hero_image'])) ?>" class="w-full h-full object-cover" alt="<?= e($c['name']) ?>">
<div class="absolute inset-0 bg-gradient-to-t from-brand-black/85 to-transparent flex items-end p-4"><p class="text-white font-heading font-bold"><?= e($c['name']) ?></p></div>
</a>
<?php endforeach; ?>
<a href="study-abroad.php" class="card-hover group relative rounded-2xl overflow-hidden h-40 flex items-center justify-center bg-gradient-to-br from-brand-red to-brand-green" data-aos="fade-up">
<p class="text-white font-heading font-bold">View All <i class="fa-solid fa-arrow-right ml-1"></i></p>
</a>
</div>
</div>
</section>
<!-- ===================== TEST PREPARATION ===================== -->
<section class="py-20">
<div class="max-w-7xl mx-auto px-6">
<div class="text-center max-w-2xl mx-auto mb-14" data-aos="fade-up">
<span class="text-brand-green font-semibold text-sm tracking-widest uppercase">Test Preparation</span>
<h2 class="font-heading font-extrabold text-3xl md:text-4xl mt-3">Programs That <span class="gradient-text">Get Results</span></h2>
</div>
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-5">
<?php $colors = ['red','green','gold']; foreach ($programs as $i => $p): $c = $colors[$i % 3]; ?>
<a href="test-preparation-<?= e($p['slug']) ?>.php" class="card-hover text-center bg-white dark:bg-gray-800 rounded-2xl p-6 shadow-sm" data-aos="fade-up" data-aos-delay="<?= $i * 80 ?>">
<div class="w-16 h-16 mx-auto rounded-full bg-brand-<?= $c ?>/10 flex items-center justify-center text-brand-<?= $c ?> font-heading font-extrabold text-lg mb-3"><?= e($p['name']) ?></div>
<p class="text-sm text-gray-500 dark:text-gray-400"><?= e(mb_strimwidth($p['full_name'] ?? '', 0, 24, '…')) ?></p>
</a>
<?php endforeach; ?>
</div>
</div>
</section>
<!-- ===================== SUCCESS STORIES / TESTIMONIALS ===================== -->
<?php if ($testimonials): ?>
<section class="py-20 bg-brand-black text-white relative overflow-hidden">
<div class="max-w-7xl mx-auto px-6 relative z-10">
<div class="text-center max-w-2xl mx-auto mb-14" data-aos="fade-up">
<span class="text-brand-gold font-semibold text-sm tracking-widest uppercase">Success Stories</span>
<h2 class="font-heading font-extrabold text-3xl md:text-4xl mt-3">What Our <span class="text-brand-gold">Students Say</span></h2>
</div>
<div class="swiper testimonial-swiper">
<div class="swiper-wrapper pb-12">
<?php foreach ($testimonials as $t): ?>
<div class="swiper-slide">
<div class="glass rounded-2xl p-8 h-full">
<div class="flex text-brand-gold mb-4"><?= str_repeat('<i class="fa-solid fa-star"></i>', max(1, (int) $t['rating'])) ?></div>
<p class="text-gray-200 mb-6">"<?= e($t['message']) ?>"</p>
<div class="flex items-center gap-3">
<div class="w-11 h-11 rounded-full bg-brand-red flex items-center justify-center font-bold"><?= e(strtoupper(substr($t['name'], 0, 2))) ?></div>
<div><p class="font-semibold"><?= e($t['name']) ?></p><p class="text-xs text-gray-400"><?= e($t['location']) ?></p></div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="swiper-pagination"></div>
</div>
</div>
</section>
<?php endif; ?>
<!-- ===================== GALLERY PREVIEW ===================== -->
<section class="py-20">
<div class="max-w-7xl mx-auto px-6">
<div class="flex flex-wrap items-end justify-between gap-4 mb-14" data-aos="fade-up">
<div>
<span class="text-brand-red font-semibold text-sm tracking-widest uppercase">Gallery</span>
<h2 class="font-heading font-extrabold text-3xl md:text-4xl mt-3">Moments Worth <span class="gradient-text">Sharing</span></h2>
</div>
<a href="gallery.php" class="text-brand-red font-semibold text-sm hover:underline">View Full Gallery <i class="fa-solid fa-arrow-right ml-1"></i></a>
</div>
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
<?php foreach ($galleryPreview as $i => $g): ?>
<img src="<?= e(resolve_image($g['image'])) ?>" class="card-hover rounded-2xl h-48 w-full object-cover" data-aos="zoom-in" data-aos-delay="<?= $i * 80 ?>">
<?php endforeach; ?>
</div>
</div>
</section>
<!-- ===================== UNIVERSITY PARTNERS ===================== -->
<?php if ($partners): ?>
<section class="py-16 border-y border-gray-100 dark:border-gray-800">
<div class="max-w-7xl mx-auto px-6">
<p class="text-center text-gray-500 dark:text-gray-400 text-sm font-semibold tracking-widest uppercase mb-8" data-aos="fade-up">Trusted by Leading Universities</p>
<div class="overflow-hidden">
<div class="flex gap-16 marquee-track w-max items-center opacity-70">
<?php $doubled = array_merge($partners, $partners); foreach ($doubled as $p): ?>
<span class="font-heading font-extrabold text-2xl text-gray-400"><?= e($p['name']) ?></span>
<?php endforeach; ?>
</div>
</div>
</div>
</section>
<?php endif; ?>
<!-- ===================== LEAD FORM ===================== -->
<section id="contact" class="py-20 relative overflow-hidden">
<div class="absolute inset-0 bg-gradient-to-br from-brand-green/5 via-transparent to-brand-red/5"></div>
<div class="max-w-5xl mx-auto px-6 relative z-10">
<div class="glass-light dark:glass rounded-3xl shadow-2xl p-8 md:p-12 border-t-4 border-brand-gold" data-aos="zoom-in">
<div class="text-center mb-10">
<span class="text-brand-red font-semibold text-sm tracking-widest uppercase">Get Started</span>
<h2 class="font-heading font-extrabold text-3xl md:text-4xl mt-3">Book Your <span class="gradient-text">Free Counselling</span></h2>
</div>
<form method="post" action="lead_submit.php" class="grid md:grid-cols-2 gap-5">
<?= csrf_field() ?>
<input type="hidden" name="source_page" value="home">
<input type="text" name="hp_field" class="hidden" tabindex="-1" autocomplete="off">
<input type="text" name="name" placeholder="Name" required class="rounded-xl border border-gray-300 dark:border-gray-600 bg-white/70 dark:bg-gray-800/60 px-5 py-3.5 focus:outline-none focus:ring-2 focus:ring-brand-green">
<input type="tel" name="phone" placeholder="Phone" required class="rounded-xl border border-gray-300 dark:border-gray-600 bg-white/70 dark:bg-gray-800/60 px-5 py-3.5 focus:outline-none focus:ring-2 focus:ring-brand-green">
<input type="email" name="email" placeholder="Email Address" class="rounded-xl border border-gray-300 dark:border-gray-600 bg-white/70 dark:bg-gray-800/60 px-5 py-3.5 focus:outline-none focus:ring-2 focus:ring-brand-green">
<select name="interested_country" class="rounded-xl border border-gray-300 dark:border-gray-600 bg-white/70 dark:bg-gray-800/60 px-5 py-3.5 focus:outline-none focus:ring-2 focus:ring-brand-green">
<option value="">Interested Country</option>
<?php foreach ($countries as $c): ?><option value="<?= e($c['name']) ?>"><?= e($c['name']) ?></option><?php endforeach; ?>
</select>
<select name="interested_course" class="rounded-xl border border-gray-300 dark:border-gray-600 bg-white/70 dark:bg-gray-800/60 px-5 py-3.5 focus:outline-none focus:ring-2 focus:ring-brand-green md:col-span-2">
<option value="">Interested Course</option>
<?php foreach ($programs as $p): ?><option value="<?= e($p['name']) ?>"><?= e($p['name']) ?></option><?php endforeach; ?>
</select>
<textarea name="message" placeholder="Message" rows="4" class="rounded-xl border border-gray-300 dark:border-gray-600 bg-white/70 dark:bg-gray-800/60 px-5 py-3.5 focus:outline-none focus:ring-2 focus:ring-brand-green md:col-span-2"></textarea>
<button type="submit" class="gradient-btn text-white font-semibold py-4 rounded-xl md:col-span-2">Submit Enquiry <i class="fa-solid fa-paper-plane ml-2"></i></button>
</form>
</div>
</div>
</section>
<!-- ===================== CTA BANNER ===================== -->
<section class="py-16 bg-gradient-to-r from-brand-red via-brand-black to-brand-green relative overflow-hidden">
<div class="max-w-5xl mx-auto px-6 text-center relative z-10" data-aos="fade-up">
<h2 class="font-heading font-extrabold text-2xl md:text-4xl text-white mb-5">Ready to Begin Your Study Abroad Journey?</h2>
<p class="text-gray-200 mb-8 max-w-xl mx-auto">Talk to our expert counsellors today — your first consultation is completely free.</p>
<a href="contact.php" class="inline-flex items-center gap-2 bg-brand-gold text-brand-black font-bold px-8 py-4 rounded-full hover:brightness-110 transition">
Book Free Consultation <i class="fa-solid fa-arrow-right"></i>
</a>
</div>
</section>
<script>
document.addEventListener('DOMContentLoaded', () => {
setTimeout(() => {
new Swiper('.hero-swiper', {
loop: true, autoplay: { delay: 5000, disableOnInteraction: false },
pagination: { el: '.hero-swiper .swiper-pagination', clickable: true },
navigation: { nextEl: '.hero-swiper .swiper-button-next', prevEl: '.hero-swiper .swiper-button-prev' },
effect: 'fade', fadeEffect: { crossFade: true }
});
new Swiper('.testimonial-swiper', {
loop: true, slidesPerView: 1, spaceBetween: 24, autoplay: { delay: 4000 },
pagination: { el: '.testimonial-swiper .swiper-pagination', clickable: true },
breakpoints: { 768: { slidesPerView: 2 }, 1024: { slidesPerView: 3 } }
});
}, 50);
});
</script>
<?php require __DIR__ . '/partials/footer.php'; ?>