<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Preview: {{ $tutorial->title }}</title>
    <script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-100">
    <div class="min-h-screen py-8">
        <div class="max-w-6xl mx-auto px-4">
            {{-- Header --}}
            <div class="bg-white rounded-lg shadow-md p-6 mb-6">
                <div class="mb-4">
                    <a href="{{ route('products.show', $tutorial->tutorialVersion->product) }}"
                       class="text-blue-600 hover:text-blue-800 text-sm">
                        ← Volver al producto: {{ $tutorial->tutorialVersion->product->name }}
                    </a>
                </div>
                <h1 class="text-2xl font-bold mb-2">{{ $tutorial->title }}</h1>
                @if($tutorial->desc)
                    <p class="text-gray-600 mb-4">{{ $tutorial->desc }}</p>
                @endif
                <div class="flex items-center gap-4 text-sm text-gray-500">
                    <span>Plataforma: <span class="font-semibold uppercase">{{ $tutorial->platform }}</span></span>
                    <span>•</span>
                    <span>Versión: <span class="font-mono">{{ $tutorial->tutorialVersion->version }}</span></span>
                    <span>•</span>
                    <a href="{{ $videoUrl }}" target="_blank" class="text-blue-600 hover:text-blue-800">
                        Ver en {{ $tutorial->platform === 'youtube' ? 'YouTube' : 'Vimeo' }} →
                    </a>
                </div>
            </div>

            {{-- Video Embed --}}
            <div class="bg-white rounded-lg shadow-md p-6">
                <div class="aspect-video w-full">
                    <iframe
                        src="{{ $embedUrl }}"
                        frameborder="0"
                        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
                        allowfullscreen
                        class="w-full h-full rounded-lg"
                    ></iframe>
                </div>
            </div>
        </div>
    </div>
</body>
</html>








