<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="A+ Academy - Premium tutoring for Grade 10-12 Science and CAT subjects. Grade 12 rewrite and upgrade programs available.">
    <title>{% block title %}A+ Academy{% endblock %}</title>

    <link rel="icon" href={{ url_for('static', filename='img/favicon.png') }} type="image/icon">

    <!-- Open Graph Meta Tags -->
    <meta property="og:title" content="A+ Academy - Premium Tutoring for Grade 10-12 Science and CAT Subjects">
    <meta property="og:description" content="A+ Academy offers expert tutoring for Grade 10-12 Science and CAT subjects, including rewrite and upgrade programs.">
    <meta property="og:image" content="{{ url_for('static', filename='img/favicon.png') }}">
    <meta property="og:url" content="{{ request.url }}">
    <meta property="og:type" content="website">

    <!-- Twitter Card Meta Tags -->
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:title" content="A+ Academy - Premium Tutoring for Grade 10-12 Science and CAT Subjects">
    <meta name="twitter:description" content="A+ Academy offers expert tutoring for Grade 10-12 Science and CAT subjects, including rewrite and upgrade programs.">
    <meta name="twitter:image" content="{{ url_for('static', filename='img/favicon.png') }}">


    <!-- SEO Meta Tags -->
    <meta name="keywords" content="A+ Academy, tutoring, Grade 10, Grade 11, Grade 12, Science tutoring, CAT tutoring, rewrite programs, upgrade programs, Johannesburg tutoring">

    <!--WhtatsApp Open Graph-->
    <meta property="og:title" content="A+ Academy - Premium Tutoring for Grade 10-12 Science and CAT Subjects">
    <meta property="og:description" content="A+ Academy offers expert tutoring for Grade 10-12 Science and CAT subjects, including rewrite and upgrade programs.">
    <meta property="og:image" content="{{ url_for('static', filename='img/favicon.png') }}">
    <meta property="og:url" content="https://debian-refresh-him-examines.trycloudflare.com">
    <meta property="og:type" content="website">
    

    <!-- Canonical URL -->
    <link rel="canonical" href="{{ request.url }}">

    <!-- Preconnect for Google Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    

    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Bootstrap Icons -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" rel="stylesheet">
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">

    <style>
        :root {
            --primary-blue: #2563eb;
            --primary-dark: #1e40af;
            --primary-light: #3b82f6;
            --platinum: #f8fafc;
            --platinum-dark: #e2e8f0;
            --text-dark: #1e293b;
            --text-muted: #64748b;
            --soft-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
            --soft-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
            --soft-shadow-xl: 0 25px 50px -12px rgba(37, 99, 235, 0.15);
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: 'Plus Jakarta Sans', sans-serif;
            background-color: var(--platinum);
            color: var(--text-dark);
            line-height: 1.6;
            overflow-x: hidden;
        }

        .soft-card {
            background: white;
            border-radius: 20px;
            box-shadow: var(--soft-shadow);
            border: 1px solid rgba(226, 232, 240, 0.6);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .soft-card:hover {
            transform: translateY(-4px);
            box-shadow: var(--soft-shadow-lg);
        }

        .soft-btn {
            background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
            color: white;
            border: none;
            padding: 12px 28px;
            border-radius: 12px;
            font-weight: 600;
            font-size: 0.95rem;
            box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .soft-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(37, 99, 235, 0.23);
            color: white;
        }

        .soft-btn-outline {
            background: transparent;
            color: var(--primary-blue);
            border: 2px solid var(--primary-blue);
            box-shadow: none;
        }

        .soft-btn-outline:hover {
            background: var(--primary-blue);
            color: white;
        }

        .navbar {
            background: rgba(248, 250, 252, 0.95);
            backdrop-filter: blur(20px);
            border-bottom: 1px solid rgba(226, 232, 240, 0.6);
            padding: 1rem 0;
            transition: all 0.3s ease;
        }

        .navbar.scrolled {
            box-shadow: var(--soft-shadow);
        }

        .navbar-brand {
            font-weight: 800;
            font-size: 1.5rem;
            color: var(--primary-blue) !important;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .nav-link {
            font-weight: 500;
            color: var(--text-dark) !important;
            padding: 0.5rem 1rem !important;
            margin: 0 0.2rem;
            border-radius: 8px;
            transition: all 0.3s ease;
        }

        .nav-link:hover {
            color: var(--primary-blue) !important;
            background: rgba(37, 99, 235, 0.05);
        }

        .nav-link.active {
            color: var(--primary-blue) !important;
            background: rgba(37, 99, 235, 0.1);
        }

        .hero-section {
            background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
            padding: 120px 0 80px;
            position: relative;
            overflow: hidden;
        }

        .hero-title {
            font-size: 3.5rem;
            font-weight: 800;
            line-height: 1.1;
            margin-bottom: 1.5rem;
            background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary-blue) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .hero-subtitle {
            font-size: 1.25rem;
            color: var(--text-muted);
            margin-bottom: 2rem;
            font-weight: 400;
        }

        .section-header {
            text-align: center;
            margin-bottom: 4rem;
        }

        .section-label {
            display: inline-block;
            background: rgba(37, 99, 235, 0.1);
            color: var(--primary-blue);
            padding: 6px 16px;
            border-radius: 20px;
            font-size: 0.875rem;
            font-weight: 600;
            margin-bottom: 1rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .section-title {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--text-dark);
            margin-bottom: 1rem;
        }

        .subject-card {
            background: white;
            border-radius: 20px;
            padding: 2rem;
            height: 100%;
            border: 1px solid rgba(226, 232, 240, 0.6);
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
        }

        .subject-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 4px;
            background: linear-gradient(90deg, var(--primary-blue), var(--primary-light));
            transform: scaleX(0);
            transition: transform 0.4s ease;
        }

        .subject-card:hover::before {
            transform: scaleX(1);
        }

        .subject-card:hover {
            transform: translateY(-8px);
            box-shadow: var(--soft-shadow-xl);
        }

        .subject-icon {
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            color: var(--primary-blue);
            margin-bottom: 1.5rem;
            transition: all 0.3s ease;
        }

        .subject-card:hover .subject-icon {
            background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-light) 100%);
            color: white;
            transform: scale(1.1);
        }

        .form-control, .form-select {
            border: 2px solid var(--platinum-dark);
            border-radius: 12px;
            padding: 12px 16px;
            font-size: 0.95rem;
            transition: all 0.3s ease;
            background: white;
        }

        .form-control:focus, .form-select:focus {
            border-color: var(--primary-blue);
            box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
        }

        .footer {
            background: linear-gradient(135deg, var(--text-dark) 0%, #0f172a 100%);
            color: white;
            padding: 60px 0 30px;
            margin-top: 80px;
        }

        .footer-brand {
            font-size: 1.5rem;
            font-weight: 800;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .footer-links {
            list-style: none;
            padding: 0;
        }

        .footer-links li {
            margin-bottom: 0.75rem;
        }

        .footer-links a {
            color: rgba(255, 255, 255, 0.7);
            text-decoration: none;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .footer-links a:hover {
            color: white;
            transform: translateX(4px);
        }

        .alert {
            border: none;
            border-radius: 12px;
            padding: 1rem 1.5rem;
            box-shadow: var(--soft-shadow);
        }

        @media (max-width: 768px) {
            .hero-title { font-size: 2.5rem; }
            .hero-section { padding: 100px 0 60px; }
            .section-title { font-size: 2rem; }
        }

        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(30px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .animate-fade-in {
            animation: fadeInUp 0.6s ease-out;
        }
    </style>
    {% block extra_css %}{% endblock %}
</head>
<body>
    <nav class="navbar navbar-expand-lg fixed-top">
        <div class="container">
            <a class="navbar-brand" href="{{ url_for('main.index') }}">
                <img src={{ url_for('static', filename='img/logo.png') }} alt="A+ Academy Logo" style="width: 60px; height: 50px;">
                Academy
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav ms-auto">
                    <li class="nav-item">
                        <a class="nav-link {% if request.endpoint == 'main.index' %}active{% endif %}" href="{{ url_for('main.index') }}">Home</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {% if request.endpoint == 'main.subjects' %}active{% endif %}" href="{{ url_for('main.subjects') }}">Subjects</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {% if request.endpoint == 'main.about' %}active{% endif %}" href="{{ url_for('main.about') }}">About Us</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {% if request.endpoint == 'main.contact' %}active{% endif %}" href="{{ url_for('main.contact') }}">Contact</a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    {% block content %}{% endblock %}

    <footer class="footer">
        <div class="container text-center">
            <div class="footer-brand d-flex gap-2">
                <img src={{ url_for('static', filename='img/logo.png') }} alt="A+ Academy Logo" style="width: 50px; height: 50px;">
                A+ Academy
            </div>
            <p class="mb-4">Premium Tutoring for Grade 10-12 Science and CAT Subjects</p>
            <ul class="footer-links d-flex justify-content-center gap-4 flex-wrap">
                <li><a href="{{ url_for('main.index') }}"><i class="bi bi-house-door-fill"></i> Home</a></li>
                <li><a href="{{ url_for('main.subjects') }}"><i class="bi bi-book-fill"></i> Subjects</a></li>
                <li><a href="{{ url_for('main.about') }}"><i class="bi bi-info-circle-fill"></i> About Us</a></li>
                <li><a href="{{ url_for('main.contact') }}"><i class="bi bi-envelope-fill"></i> Contact</a></li>
            </ul>
            <p class="mt-4 mb-0">&copy; {{ current_year }} A+ Academy. All rights reserved.</p>
            <p class="mt-2 mb-0">Developed by <a href="https://nateksoftwares.co.za" class="text-decoration-none">NAT<span style="display: inline-block; transform: scaleX(-1);">E</span>K Softwares</a></p>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    {% block extra_js %}
        <script>
            document.addEventListener('DOMContentLoaded', function() {
                const toggler = document.querySelector('.navbar-toggler');
                const navbarCollapse = document.getElementById('navbarNav');
                
                if (!toggler || !navbarCollapse) return;

                // Toggle menu on button click
                toggler.addEventListener('click', function(e) {
                    e.stopPropagation();
                    const isExpanded = toggler.getAttribute('aria-expanded') === 'true';
                    
                    if (isExpanded) {
                        closeMenu();
                    } else {
                        openMenu();
                    }
                });

                // Close menu when clicking outside
                document.addEventListener('click', function(e) {
                    if (!navbarCollapse.contains(e.target) && !toggler.contains(e.target)) {
                        closeMenu();
                    }
                });

                // Close menu when clicking on a nav link (mobile)
                navbarCollapse.querySelectorAll('.nav-link').forEach(link => {
                    link.addEventListener('click', function() {
                        if (window.innerWidth < 992) { // Bootstrap lg breakpoint
                            closeMenu();
                        }
                    });
                });

                // Close menu on escape key
                document.addEventListener('keydown', function(e) {
                    if (e.key === 'Escape') {
                        closeMenu();
                    }
                });

                function openMenu() {
                    navbarCollapse.classList.add('show');
                    toggler.setAttribute('aria-expanded', 'true');
                }

                function closeMenu() {
                    navbarCollapse.classList.remove('show');
                    toggler.setAttribute('aria-expanded', 'false');
                }
            });

        // ==============Modal Js - incase of Bootstrap Js not being used. Vanilla Js ======
        // Replace data-bs-toggle/data-bs-target with data-modal-target="modalId" if using the vanilla JS version.

        document.addEventListener('DOMContentLoaded', function() {
            // Card click handlers
            document.querySelectorAll('.soft-card').forEach(card => {
                card.addEventListener('click', function() {
                    const target = this.getAttribute('data-modal-target');
                    document.getElementById(target).style.display = 'block';
                    setTimeout(() => document.getElementById(target).classList.add('show'), 10);
                });
            });

            // Close handlers
            document.querySelectorAll('.modal .btn-close, .modal .btn-secondary').forEach(btn => {
                btn.addEventListener('click', function() {
                    const modal = this.closest('.modal');
                    modal.classList.remove('show');
                    setTimeout(() => modal.style.display = 'none', 300);
                });
            });

            // Click outside to close
            window.addEventListener('click', function(e) {
                if (e.target.classList.contains('modal')) {
                    e.target.classList.remove('show');
                    setTimeout(() => e.target.style.display = 'none', 300);
                }
            });
        });
                
        //==================================================================================
        </script>

        

    {% endblock %}

</body>
