<!DOCTYPE html>
<html lang="en" class="scroll-smooth">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@yield('title', 'Angaza Mediation Centre | Professional Mediation Training')</title>
    <meta name="description" content="@yield('meta_description', 'Angaza Mediation Centre - Accredited professional mediation training in Kenya. TVET accredited, MAC recognized, internationally affiliated.')">
    <meta name="keywords" content="mediation, mediation training, dispute resolution, ADR, Kenya, TVET, MAC accredited">
    <meta name="author" content="Angaza Mediation Centre">

    <!-- Open Graph -->
    <meta property="og:title" content="@yield('og_title', 'Angaza Mediation Centre')">
    <meta property="og:description" content="@yield('og_description', 'Professional Mediation Training - Accredited by TVET & MAC')">
    <meta property="og:type" content="website">

    <!-- Favicon -->
    <link rel="icon" type="image/svg+xml" href="{{ asset('images/favicon.svg') }}">

    <!-- Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:wght@400;500;600;700;800&display=swap" rel="stylesheet">

    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">

    @vite(['resources/css/app.css', 'resources/js/app.js'])

    <style>
        /* Custom Tailwind theme colors */
        @theme {
            --color-primary-50: #eff6ff;
            --color-primary-100: #dbeafe;
            --color-primary-200: #bfdbfe;
            --color-primary-300: #93c5fd;
            --color-primary-400: #60a5fa;
            --color-primary-500: #2563eb;
            --color-primary-600: #1d4ed8;
            --color-primary-700: #1e3a5f;
            --color-primary-800: #153153;
            --color-primary-900: #0f2240;
            --color-accent-50: #fef2f2;
            --color-accent-100: #fee2e2;
            --color-accent-200: #fecaca;
            --color-accent-300: #fca5a5;
            --color-accent-400: #f87171;
            --color-accent-500: #dc2626;
            --color-accent-600: #b91c1c;
            --color-accent-700: #991b1b;
            --color-accent-800: #7f1d1d;
            --color-accent-900: #450a0a;
        }

        body {
            font-family: 'Inter', sans-serif;
        }

        .font-display {
            font-family: 'Playfair Display', serif;
        }

        /* Smooth scroll offset for fixed header */
        section[id] {
            scroll-margin-top: 80px;
        }

        /* Custom scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
        }
        ::-webkit-scrollbar-track {
            background: #f1f5f9;
        }
        ::-webkit-scrollbar-thumb {
            background: #2563eb;
            border-radius: 4px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: #1d4ed8;
        }

        /* Animations */
        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(30px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes fadeInLeft {
            from { opacity: 0; transform: translateX(-30px); }
            to { opacity: 1; transform: translateX(0); }
        }
        @keyframes fadeInRight {
            from { opacity: 0; transform: translateX(30px); }
            to { opacity: 1; transform: translateX(0); }
        }
        @keyframes scaleIn {
            from { opacity: 0; transform: scale(0.9); }
            to { opacity: 1; transform: scale(1); }
        }
        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
        }
        @keyframes pulse-glow {
            0%, 100% { box-shadow: 0 0 5px rgba(37, 99, 235, 0.3); }
            50% { box-shadow: 0 0 20px rgba(37, 99, 235, 0.6); }
        }
        @keyframes shimmer {
            0% { background-position: -200% 0; }
            100% { background-position: 200% 0; }
        }
        @keyframes heroCardSlide {
            0% { opacity: 0; transform: translateX(-60px) scale(0.95); }
            100% { opacity: 1; transform: translateX(0) scale(1); }
        }

        .animate-fade-in-up { animation: fadeInUp 0.8s ease-out forwards; }
        .animate-fade-in-left { animation: fadeInLeft 0.8s ease-out forwards; }
        .animate-fade-in-right { animation: fadeInRight 0.8s ease-out forwards; }
        .animate-scale-in { animation: scaleIn 0.6s ease-out forwards; }
        .animate-slide-down { animation: slideDown 0.5s ease-out forwards; }
        .animate-float { animation: float 3s ease-in-out infinite; }
        .animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

        /* Intersection observer animation classes */
        .reveal {
            opacity: 0;
            transform: translateY(30px);
            transition: all 0.8s ease-out;
        }
        .reveal.active {
            opacity: 1;
            transform: translateY(0);
        }
        .reveal-left {
            opacity: 0;
            transform: translateX(-40px);
            transition: all 0.8s ease-out;
        }
        .reveal-left.active {
            opacity: 1;
            transform: translateX(0);
        }
        .reveal-right {
            opacity: 0;
            transform: translateX(40px);
            transition: all 0.8s ease-out;
        }
        .reveal-right.active {
            opacity: 1;
            transform: translateX(0);
        }
        .reveal-scale {
            opacity: 0;
            transform: scale(0.9);
            transition: all 0.6s ease-out;
        }
        .reveal-scale.active {
            opacity: 1;
            transform: scale(1);
        }

        /* Hero card animation */
        .hero-card {
            animation: heroCardSlide 0.6s ease-out forwards;
        }
        .hero-card:nth-child(1) { animation-delay: 0.2s; opacity: 0; }
        .hero-card:nth-child(2) { animation-delay: 0.5s; opacity: 0; }
        .hero-card:nth-child(3) { animation-delay: 0.8s; opacity: 0; }

        /* Slider transitions */
        .slider-slide {
            transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* Gallery hover effects */
        .gallery-item {
            overflow: hidden;
        }
        .gallery-item img {
            transition: transform 0.5s ease, filter 0.5s ease;
        }
        .gallery-item:hover img {
            transform: scale(1.1);
            filter: brightness(0.7);
        }
        .gallery-item .overlay {
            transition: all 0.4s ease;
        }
        .gallery-item:hover .overlay {
            opacity: 1;
        }

        /* Gradient text */
        .gradient-text {
            background: linear-gradient(135deg, #2563eb 0%, #dc2626 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        /* Section divider */
        .section-divider {
            background: linear-gradient(90deg, transparent 0%, #2563eb 50%, transparent 100%);
            height: 2px;
        }

        /* Button shine effect */
        .btn-shine {
            position: relative;
            overflow: hidden;
        }
        .btn-shine::after {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(
                to right,
                transparent 0%,
                rgba(255, 255, 255, 0.15) 50%,
                transparent 100%
            );
            transform: rotate(45deg);
            animation: shimmer 3s infinite;
        }

        /* Expert card hover */
        .expert-card {
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .expert-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 20px 60px rgba(37, 99, 235, 0.15);
        }

        /* Topic chip */
        .topic-chip {
            transition: all 0.3s ease;
        }
        .topic-chip:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(37, 99, 235, 0.2);
        }

        /* Header glass effect */
        .header-glass {
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
        }

        /* Diagonal section */
        .diagonal-section {
            clip-path: polygon(0 3%, 100% 0%, 100% 97%, 0% 100%);
        }
    </style>

    @stack('styles')
</head>
<body class="antialiased bg-white text-gray-800">

    @include('landing.partials.header')

    <main>
        @yield('content')
    </main>

    @include('landing.partials.footer')

    @stack('scripts')

    <script>
        // Intersection Observer for reveal animations
        document.addEventListener('DOMContentLoaded', function() {
            const observerOptions = {
                threshold: 0.1,
                rootMargin: '0px 0px -50px 0px'
            };

            const observer = new IntersectionObserver((entries) => {
                entries.forEach(entry => {
                    if (entry.isIntersecting) {
                        entry.target.classList.add('active');
                        // Add staggered delay for children
                        const children = entry.target.querySelectorAll('[data-delay]');
                        children.forEach((child, index) => {
                            child.style.transitionDelay = `${index * 0.1}s`;
                            child.classList.add('active');
                        });
                    }
                });
            }, observerOptions);

            document.querySelectorAll('.reveal, .reveal-left, .reveal-right, .reveal-scale').forEach(el => {
                observer.observe(el);
            });

            // Smooth scroll for anchor links
            document.querySelectorAll('a[href^="#"]').forEach(anchor => {
                anchor.addEventListener('click', function (e) {
                    e.preventDefault();
                    const target = document.querySelector(this.getAttribute('href'));
                    if (target) {
                        target.scrollIntoView({
                            behavior: 'smooth',
                            block: 'start'
                        });
                    }
                });
            });

            // Counter animation
            const counters = document.querySelectorAll('[data-counter]');
            const counterObserver = new IntersectionObserver((entries) => {
                entries.forEach(entry => {
                    if (entry.isIntersecting) {
                        const target = parseInt(entry.target.dataset.counter);
                        const duration = 2000;
                        const start = 0;
                        const startTime = performance.now();

                        function updateCounter(currentTime) {
                            const elapsed = currentTime - startTime;
                            const progress = Math.min(elapsed / duration, 1);
                            const easeOut = 1 - Math.pow(1 - progress, 3);
                            const current = Math.floor(start + (target - start) * easeOut);
                            entry.target.textContent = current;

                            if (progress < 1) {
                                requestAnimationFrame(updateCounter);
                            } else {
                                entry.target.textContent = target;
                            }
                        }
                        requestAnimationFrame(updateCounter);
                        counterObserver.unobserve(entry.target);
                    }
                });
            }, { threshold: 0.5 });

            counters.forEach(counter => counterObserver.observe(counter));
        });
    </script>
</body>
</html>
