{% extends 'base.html' %}

{% block content %}
    <style>
        /* General Styles */
        body {
            margin: 0;
            font-family: Arial, sans-serif;
        }

        h1, h2 {
            text-align: center;
            color: #333;
        }

        .section {
            padding: 50px 20px;
            background-color: #fdf6e3; /* Beige background */
            margin: 20px auto;
            width: 80%;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            opacity: 0;
            transform: translateX(-100px);
            transition: all 0.8s ease-in-out;
        }

        .section.visible {
            opacity: 1;
            transform: translateX(0);
        }

        .service {
            display: flex;
            align-items: center;
            margin-top: 20px;
        }

        .service img {
            width: 100px;
            height: 100px;
            border-radius: 8px;
            margin-right: 20px;
        }

        .service p {
            font-size: 16px;
            line-height: 1.6;
        }

        .services-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-top: 40px;
        }

        .grid-item {
            background-color: #ffffff;
            padding: 20px;
            border-radius: 8px;
            text-align: center;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            opacity: 0;
            transform: translateY(100px);
            transition: all 0.8s ease-in-out;
        }

        .grid-item.visible {
            opacity: 1;
            transform: translateY(0);
        }

        .grid-item img {
            width: 80px;
            height: 80px;
            margin-bottom: 10px;
        }

        .grid-item h3 {
            margin: 10px 0;
            font-size: 18px;
        }

        .grid-item p {
            font-size: 14px;
            color: #555;
        }
    </style>
</head>
<body>
    <h1>Services</h1>

    <section class="section" id="service-1">
        <h2>Our Services</h2>
        <div class="service">
            <img src="https://via.placeholder.com/100" alt="Service Image">
            <p>I am a tech-savvy individual with a Bachelor's degree in Software Development, seeking employment as a mobile game developer. I am passionate about consistently advancing my knowledge and skills. I have attended multiple seminars and boot camps on coding and game development.</p>
        </div>
    </section>

    <section class="section" id="service-2">
        <h2>What We Offer</h2>
        <div class="service">
            <img src="https://via.placeholder.com/100" alt="Service Image">
            <p>I am a tech-savvy individual with a Bachelor's degree in Software Development, seeking employment as a mobile game developer. I am passionate about consistently advancing my knowledge and skills. I have attended multiple seminars and boot camps on coding and game development.</p>
        </div>
    </section>

    <section class="section" id="services-grid">
        <h2>Our Web App Provides</h2>
        <div class="services-grid">
            <div class="grid-item">
                <img src="https://via.placeholder.com/80" alt="Feature 1">
                <h3>Feature 1</h3>
                <p>Detail about the first feature of the web app.</p>
            </div>
            <div class="grid-item">
                <img src="https://via.placeholder.com/80" alt="Feature 2">
                <h3>Feature 2</h3>
                <p>Detail about the second feature of the web app.</p>
            </div>
            <div class="grid-item">
                <img src="https://via.placeholder.com/80" alt="Feature 3">
                <h3>Feature 3</h3>
                <p>Detail about the third feature of the web app.</p>
            </div>
            <div class="grid-item">
                <img src="https://via.placeholder.com/80" alt="Feature 4">
                <h3>Feature 4</h3>
                <p>Detail about the fourth feature of the web app.</p>
            </div>
        </div>
    </section>

    <script>
        // Function to check if element is in viewport
        function isInViewport(element) {
            const rect = element.getBoundingClientRect();
            return (
                rect.top >= 0 &&
                rect.left >= 0 &&
                rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
                rect.right <= (window.innerWidth || document.documentElement.clientWidth)
            );
        }

        // Function to add "visible" class to sections
        function handleScroll() {
            const sections = document.querySelectorAll('.section, .grid-item');
            sections.forEach(section => {
                if (isInViewport(section)) {
                    section.classList.add('visible');
                }
            });
        }

        // Listen for scroll event
        window.addEventListener('scroll', handleScroll);

        // Trigger scroll event on load to show elements already in view
        window.addEventListener('load', handleScroll);
    </script>
{% endblock %}