<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Stream Anime Episode - AnimeFlix</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#3B82F6',
                        secondary: '#1E293B',
                        accent: '#F43F5E',
                        dark: '#0F172A',
                        light: '#F8FAFC',
                    },
                    fontFamily: {
                        sans: ['Inter', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
        body { font-family: 'Inter', sans-serif; background-color: #0F172A; color: #F8FAFC; }
        .video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
        .video-container video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
    </style>
</head>
<body class="min-h-screen">
    <!-- Navigation -->
    <nav class="bg-secondary/80 backdrop-blur-md sticky top-0 z-50 border-b border-gray-700">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex items-center justify-between h-16">
                <div class="flex items-center">
                    <div class="flex-shrink-0">
                        <a href="/" class="flex items-center">
                            <i class="fas fa-play-circle text-accent text-2xl mr-2"></i>
                            <span class="text-xl font-bold text-white">AnimeFlix</span>
                        </a>
                    </div>
                </div>
                <div class="hidden md:block">
                    <form method="get" action="/search" class="ml-4 flex items-center md:ml-6">
                        <div class="relative">
                            <input type="text" name="q" placeholder="Search anime..." class="bg-dark text-white px-4 py-2 rounded-full w-64 focus:outline-none focus:ring-2 focus:ring-primary">
                            <button class="absolute right-3 top-2 text-gray-400 hover:text-white">
                                <i class="fas fa-search"></i>
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </nav>
    <main class="max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
        <a href="javascript:history.back()" class="text-primary hover:underline flex items-center mb-6"><i class="fas fa-arrow-left mr-2"></i>Back</a>
        <h1 class="text-2xl font-bold mb-8">Stream Anime Episode</h1>
        {% if direct_link %}
            <div class="video-container rounded-xl overflow-hidden shadow-2xl mb-6">
                <video controls autoplay poster="" style="background:#181a1b;">
                    <source src="{{ direct_link }}" type="video/mp4">
                    Your browser does not support the video tag.
                </video>
            </div>
            <div class="text-center mt-4">
                <a href="{{ direct_link }}" class="download-btn inline-block bg-primary text-white px-4 py-2 rounded font-semibold transition hover:bg-blue-600" download>Download MP4</a>
            </div>
        {% else %}
            <p>Could not generate direct streaming link.</p>
        {% endif %}
    </main>
</body>
</html> 