<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ page.title }} | {{ site.config.title }}</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body {
            height: 100%;
            overflow: hidden;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
            color: #f1f1f1;
        }

        .slideshow {
            height: 100vh;
            width: 100vw;
            position: relative;
        }

        .slide {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 4rem;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.5s ease, visibility 0.5s ease;
        }

        .slide.active {
            opacity: 1;
            visibility: visible;
        }

        .slide h1 {
            font-size: 4rem;
            font-weight: 700;
            margin-bottom: 1rem;
            background: linear-gradient(135deg, #fff 0%, #60a5fa 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .slide h2 {
            font-size: 2.5rem;
            font-weight: 600;
            margin-bottom: 2rem;
            color: #60a5fa;
        }

        .slide .subtitle {
            font-size: 1.5rem;
            color: #9ca3af;
        }

        .slide ul {
            list-style: none;
            text-align: left;
            font-size: 1.5rem;
        }

        .slide li {
            margin-bottom: 1rem;
            padding-left: 2rem;
            position: relative;
        }

        .slide li::before {
            content: "→";
            position: absolute;
            left: 0;
            color: #60a5fa;
        }

        .slide pre {
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid #374151;
            border-radius: 0.75rem;
            padding: 1.5rem 2rem;
            font-size: 1.1rem;
            text-align: left;
            max-width: 90%;
        }

        .slide code {
            font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
            color: #e5e7eb;
        }

        .controls {
            position: fixed;
            bottom: 2rem;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 1rem;
            z-index: 100;
        }

        .controls button {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            padding: 0.75rem 1.5rem;
            border-radius: 0.5rem;
            cursor: pointer;
            font-size: 1rem;
            transition: background 0.2s ease;
        }

        .controls button:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .progress {
            position: fixed;
            bottom: 0;
            left: 0;
            height: 4px;
            background: #3b82f6;
            transition: width 0.3s ease;
        }

        .slide-counter {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            color: #6b7280;
            font-size: 0.875rem;
        }
    </style>
</head>
<body>
    <div class="slideshow">
        {{ page.content | safe }}
    </div>

    <div class="controls">
        <button onclick="prevSlide()">← Previous</button>
        <button onclick="nextSlide()">Next →</button>
    </div>

    <div class="progress" id="progress"></div>
    <div class="slide-counter" id="counter"></div>

    <script>
        const slides = document.querySelectorAll('.slide');
        let currentSlide = 0;

        function showSlide(index) {
            slides.forEach((slide, i) => {
                slide.classList.toggle('active', i === index);
            });
            currentSlide = index;
            updateProgress();
            updateCounter();
        }

        function nextSlide() {
            if (currentSlide < slides.length - 1) {
                showSlide(currentSlide + 1);
            }
        }

        function prevSlide() {
            if (currentSlide > 0) {
                showSlide(currentSlide - 1);
            }
        }

        function updateProgress() {
            const progress = ((currentSlide + 1) / slides.length) * 100;
            document.getElementById('progress').style.width = progress + '%';
        }

        function updateCounter() {
            document.getElementById('counter').textContent =
                (currentSlide + 1) + ' / ' + slides.length;
        }

        document.addEventListener('keydown', (e) => {
            if (e.key === 'ArrowRight' || e.key === ' ') {
                e.preventDefault();
                nextSlide();
            } else if (e.key === 'ArrowLeft') {
                e.preventDefault();
                prevSlide();
            }
        });

        showSlide(0);
    </script>
</body>
</html>
