<!DOCTYPE html>
<html lang="es">
<head>
    <base target="_self">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
    <title>Tizentube - YouTube Sin Anuncios | Genera tu Código de Prueba Gratis</title>
    <meta name="description" content="Disfruta YouTube sin anuncios con Tizentube. Genera tu código de prueba gratis y vive la experiencia premium sin interrupciones.">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.tailwindcss.com"></script>
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        "youtube-red": "#FF0000",
                        "youtube-dark": "#0F0F0F",
                        "youtube-darker": "#0A0A0A",
                        "youtube-gray": "#282828",
                        "youtube-light": "#AAAAAA"
                    }
                }
            }
        }
    </script>
    <style>
        @import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap");
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            user-select: none;
        }
        
        body {
            font-family: "Roboto", sans-serif;
            background: linear-gradient(135deg, #0A0A0A 0%, #1a1a1a 100%);
            color: #ffffff;
            min-height: 100vh;
        }
        
        .gradient-text {
            background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .premium-badge {
            background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
            color: #000;
            padding: 6px 16px;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
        }
        
        .hero-icon {
            font-size: 5rem;
            color: #FF0000;
            animation: float 3s ease-in-out infinite;
            filter: drop-shadow(0 0 20px rgba(255, 0, 0, 0.5));
        }
        
        @keyframes float {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-20px); }
        }
        
        .card-premium {
            background: linear-gradient(135deg, #1a1a1a 0%, #282828 100%);
            border: 1px solid rgba(255, 0, 0, 0.2);
            border-radius: 20px;
            padding: 3rem;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
            transition: all 0.3s ease;
        }
        
        .card-premium:hover {
            transform: translateY(-5px);
            box-shadow: 0 25px 70px rgba(255, 0, 0, 0.2);
        }
        
        .btn-generate {
            background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
            color: white;
            border: none;
            padding: 18px 50px;
            font-size: 1.2rem;
            font-weight: 700;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 10px 30px rgba(255, 0, 0, 0.3);
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        
        .btn-generate:hover:not(:disabled) {
            transform: translateY(-3px);
            box-shadow: 0 15px 40px rgba(255, 0, 0, 0.5);
        }
        
        .btn-generate:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }
        
        .code-display {
            background: linear-gradient(135deg, rgba(255, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.5) 100%);
            border: 2px solid #FF0000;
            border-radius: 20px;
            padding: 2.5rem;
            margin-top: 2rem;
            animation: slideIn 0.5s ease;
        }
        
        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .code-value {
            font-size: 3rem;
            font-weight: 900;
            letter-spacing: 6px;
            color: #FF0000;
            text-align: center;
            font-family: "Courier New", monospace;
            text-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
            padding: 1rem;
            word-break: break-all;
        }
        
        .btn-copy {
            background: rgba(255, 255, 255, 0.1);
            color: white;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 50px;
            padding: 12px 30px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        
        .btn-copy:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-2px);
        }
        
        .btn-copy.copied {
            background: rgba(0, 255, 0, 0.2);
            border-color: #00ff00;
            color: #00ff00;
        }
        
        .loading-spinner {
            display: inline-block;
            width: 24px;
            height: 24px;
            border: 3px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: white;
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .alert-error {
            background: rgba(220, 53, 69, 0.15);
            border: 1px solid rgba(220, 53, 69, 0.4);
            border-radius: 12px;
            padding: 1rem;
            margin-top: 1.5rem;
            color: #ff6b6b;
        }
        
        .info-card {
            background: linear-gradient(135deg, #1a1a1a 0%, #282828 100%);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 16px;
            padding: 2rem;
            transition: all 0.3s ease;
        }
        
        .info-card:hover {
            transform: translateY(-5px);
            border-color: rgba(255, 0, 0, 0.3);
        }
        
        .form-control {
            background: rgba(255, 255, 255, 0.05);
            border: 2px solid rgba(255, 255, 255, 0.1);
            color: white;
            border-radius: 12px;
            padding: 14px 18px;
            font-size: 1rem;
            transition: all 0.3s ease;
        }
        
        .form-control:focus {
            background: rgba(255, 255, 255, 0.08);
            border-color: #FF0000;
            outline: none;
            box-shadow: 0 0 0 4px rgba(255, 0, 0, 0.1);
        }
        
        .form-control::placeholder {
            color: rgba(255, 255, 255, 0.4);
        }
        
        .badge-no-ads {
            background: rgba(255, 0, 0, 0.2);
            border: 1px solid #ff4444;
            border-radius: 50px;
            padding: 4px 12px;
            font-size: 0.7rem;
            font-weight: 600;
        }
        
        .nav-buttons {
            display: flex;
            gap: 15px;
            align-items: center;
            flex-wrap: wrap;
        }
        
        .btn-nav {
            padding: 8px 20px;
            border-radius: 40px;
            font-weight: 600;
            font-size: 0.9rem;
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        
        .btn-nav:hover {
            transform: translateY(-2px);
        }
        
        .btn-clientes {
            background: linear-gradient(135deg, #25D366, #128C7E);
            color: white;
        }
        
        .btn-clientes:hover {
            background: linear-gradient(135deg, #128C7E, #075E54);
            box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
        }
        
        .btn-reseller {
            background: linear-gradient(135deg, #FF0000, #CC0000);
            color: white;
        }
        
        .btn-reseller:hover {
            background: linear-gradient(135deg, #CC0000, #AA0000);
            box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
        }
        
        .timer-countdown {
            font-size: 1.2rem;
            color: #ffaa00;
            margin-top: 10px;
            font-weight: bold;
        }
        
        @media (max-width: 768px) {
            .hero-icon { font-size: 3.5rem; }
            .code-value { font-size: 1.8rem; letter-spacing: 3px; }
            .card-premium { padding: 2rem; }
            .nav-buttons {
                justify-content: center;
                width: 100%;
            }
        }
        
        @keyframes neonPulse {
            0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
            100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
        }
    </style>
</head>
<body>
    <header class="sticky top-0 z-50 bg-youtube-darker border-b border-gray-800 shadow-lg">
        <div class="container mx-auto px-4 py-4">
            <div class="flex justify-between items-center flex-wrap gap-4">
                <div class="flex items-center gap-3">
                    <i class="fab fa-youtube text-youtube-red text-4xl"></i>
                    <div>
                        <h1 class="text-2xl font-bold">Tizentube</h1>
                        <span class="premium-badge">SIN ANUNCIOS</span>
                    </div>
                </div>
                <div class="nav-buttons">
                    <a href="index.php" class="btn-nav btn-clientes">
                        <i class="fas fa-tv"></i> Planes Clientes
                    </a>
                    <a href="planes_reseller.php" class="btn-nav btn-reseller">
                        <i class="fas fa-store"></i> Ser Reseller
                    </a>
                    <a href="#download" class="btn-nav" style="background: linear-gradient(135deg, #ff8800, #ff5500); color: white;">
                        <i class="fas fa-download"></i> Descargar App
                    </a>
                </div>
            </div>
        </div>
    </header>

    <main class="container mx-auto px-4 py-12 max-w-6xl">
        <section class="text-center mb-12">
            <div class="hero-icon mb-6">
                <i class="fas fa-ban"></i>
            </div>
            <h2 class="text-5xl md:text-6xl font-black mb-4">
                YouTube <span class="gradient-text">Sin Anuncios</span>
            </h2>
            <p class="text-xl text-youtube-light max-w-2xl mx-auto mb-6">
                Genera tu código de prueba y elimina todos los anuncios de YouTube. Experiencia premium sin interrupciones.
            </p>
            <div class="inline-flex items-center gap-3 bg-youtube-gray px-6 py-3 rounded-full border border-youtube-red">
                <i class="fas fa-gift text-youtube-red"></i>
                <span class="font-semibold" id="trial-duration">Prueba gratuita de 5 horas</span>
            </div>
        </section>

        <section class="card-premium max-w-3xl mx-auto mb-12">
            <h3 class="text-3xl font-bold text-center mb-2">🎁 Demo Gratis - 5 Horas</h3>
            <p class="text-center text-youtube-light mb-8">Completa tus datos para obtener acceso premium sin anuncios por 5 horas</p>

            <form id="trialForm" class="space-y-6">
                <div class="grid md:grid-cols-2 gap-6">
                    <div>
                        <label for="inpName" class="block text-sm font-semibold mb-2 text-youtube-light">
                            <i class="fas fa-user mr-2"></i>Nombre Completo
                        </label>
                        <input 
                            id="inpName" 
                            type="text" 
                            class="form-control w-full" 
                            placeholder="Ej: Juan Pérez"
                            minlength="2"
                            maxlength="60"
                            required
                        >
                    </div>
                    <div>
                        <label for="inpPhone" class="block text-sm font-semibold mb-2 text-youtube-light">
                            <i class="fas fa-phone mr-2"></i>WhatsApp
                        </label>
                        <input 
                            id="inpPhone" 
                            type="tel" 
                            class="form-control w-full" 
                            placeholder="593XXXXXXXXX"
                            minlength="10"
                            maxlength="20"
                            required
                        >
                        <p class="text-xs text-youtube-light mt-2">
                            <i class="fas fa-info-circle mr-1"></i>
                            Usado para enviarte el código y evitar duplicados
                        </p>
                    </div>
                </div>

                <div class="text-center">
                    <button id="btnGen" type="submit" class="btn-generate">
                        <i class="fas fa-magic mr-2"></i>
                        Generar Demo Gratis (5h)
                    </button>
                    <div id="loading" class="mt-4 hidden">
                        <div class="loading-spinner mx-auto"></div>
                        <p class="text-youtube-light mt-3">Generando tu código de prueba...</p>
                    </div>
                </div>
            </form>

            <div id="result" class="code-display hidden">
                <div class="text-center">
                    <p class="text-youtube-light mb-3 text-lg">
                        <i class="fas fa-check-circle text-green-500 mr-2"></i>
                        ¡Código de prueba generado con éxito!
                    </p>
                    <div id="code" class="code-value">------</div>
                    <div class="text-youtube-light mb-6">
                        <i class="fas fa-hourglass-half mr-2"></i>
                        Válido hasta: <strong id="exp" class="text-white">-</strong>
                        <div id="countdown" class="timer-countdown"></div>
                    </div>
                    <button id="btnCopy" type="button" class="btn-copy">
                        <i class="fas fa-copy mr-2"></i>
                        Copiar Código
                    </button>
                    <p class="text-sm text-youtube-light mt-4">
                        <i class="fas fa-lightbulb mr-1"></i>
                        Pega este código en la app Tizentube para activar YouTube sin anuncios
                    </p>
                </div>
            </div>

            <div id="err" class="alert-error hidden">
                <i class="fas fa-exclamation-triangle mr-2"></i>
                <span id="errMsg">Error desconocido</span>
            </div>
        </section>

        <section class="grid md:grid-cols-3 gap-6 mb-12">
            <div class="info-card">
                <div class="text-youtube-red text-3xl mb-4">
                    <i class="fas fa-list-check"></i>
                </div>
                <h4 class="text-xl font-bold mb-3">Cómo Usar la Demo</h4>
                <ul class="space-y-2 text-youtube-light">
                    <li class="flex items-start gap-2">
                        <i class="fas fa-check text-youtube-red mt-1"></i>
                        <span>Descarga e instala Tizentube</span>
                    </li>
                    <li class="flex items-start gap-2">
                        <i class="fas fa-check text-youtube-red mt-1"></i>
                        <span>Abre la app y ve a Activación</span>
                    </li>
                    <li class="flex items-start gap-2">
                        <i class="fas fa-check text-youtube-red mt-1"></i>
                        <span>Pega tu código de demo</span>
                    </li>
                    <li class="flex items-start gap-2">
                        <i class="fas fa-check text-youtube-red mt-1"></i>
                        <span>Disfruta YouTube sin anuncios por 5h</span>
                    </li>
                </ul>
            </div>

            <div class="info-card">
                <div class="text-youtube-red text-3xl mb-4">
                    <i class="fas fa-crown"></i>
                </div>
                <h4 class="text-xl font-bold mb-3">Beneficios Premium</h4>
                <ul class="space-y-2 text-youtube-light">
                    <li class="flex items-start gap-2">
                        <i class="fas fa-ban text-youtube-red mt-1"></i>
                        <span><strong>Cero anuncios</strong> en todos los videos</span>
                    </li>
                    <li class="flex items-start gap-2">
                        <i class="fas fa-tachometer-alt text-youtube-red mt-1"></i>
                        <span>Navegación más rápida sin carga de anuncios</span>
                    </li>
                    <li class="flex items-start gap-2">
                        <i class="fas fa-headphones text-youtube-red mt-1"></i>
                        <span>Audio sin cortes en listas de reproducción</span>
                    </li>
                    <li class="flex items-start gap-2">
                        <i class="fas fa-tv text-youtube-red mt-1"></i>
                        <span>Compatible con Android TV y Fire TV</span>
                    </li>
                </ul>
            </div>

            <div class="info-card">
                <div class="text-youtube-red text-3xl mb-4">
                    <i class="fas fa-rocket"></i>
                </div>
                <h4 class="text-xl font-bold mb-3">¿Por qué Tizentube?</h4>
                <ul class="space-y-2 text-youtube-light">
                    <li class="flex items-start gap-2">
                        <i class="fas fa-check-circle text-youtube-red mt-1"></i>
                        <span>100% libre de publicidad</span>
                    </li>
                    <li class="flex items-start gap-2">
                        <i class="fas fa-check-circle text-youtube-red mt-1"></i>
                        <span>Hasta 5 dispositivos simultáneos</span>
                    </li>
                    <li class="flex items-start gap-2">
                        <i class="fas fa-check-circle text-youtube-red mt-1"></i>
                        <span>Activación inmediata</span>
                    </li>
                    <li class="flex items-start gap-2">
                        <i class="fas fa-check-circle text-youtube-red mt-1"></i>
                        <span>Soporte 24/7</span>
                    </li>
                </ul>
            </div>
        </section>

        <section id="download" class="card-premium text-center">
            <div class="text-youtube-red text-5xl mb-6">
                <i class="fas fa-mobile-screen-button"></i>
            </div>
            <h3 class="text-3xl font-bold mb-4">Descarga Tizentube</h3>
            <p class="text-youtube-light mb-6 max-w-xl mx-auto">
                Compatible con Android TV, Fire TV y dispositivos con control remoto
            </p>
            
            <div class="bg-black/40 rounded-2xl p-6 mb-6 max-w-md mx-auto border border-red-500/30">
                <i class="fas fa-download text-2xl text-red-500 mb-2"></i>
                <p class="text-lg font-mono font-bold">Código Downloader:</p>
                <p class="text-3xl font-mono font-black text-red-500 tracking-wider my-2">2293102</p>
                <p class="text-sm text-youtube-light break-all">
                    <i class="fas fa-link"></i> <a href="http://aftv.news/2293102" id="downloadLink" class="text-red-400 hover:underline" target="_blank">http://aftv.news/2293102</a>
                </p>
                <button onclick="copyDownloaderCode()" class="mt-4 bg-transparent border border-white/30 hover:border-red-500 text-white px-6 py-2 rounded-full transition-all">
                    <i class="fas fa-copy"></i> Copiar código 2293102
                </button>
            </div>
            
            <div class="flex flex-wrap justify-center gap-4 mt-4">
                <div class="flex items-center gap-2 bg-white/10 px-4 py-2 rounded-full">
                    <i class="fas fa-tv text-red-500"></i>
                    <span>Android TV / Fire TV</span>
                </div>
                <div class="flex items-center gap-2 bg-white/10 px-4 py-2 rounded-full">
                    <i class="fas fa-gamepad text-red-500"></i>
                    <span>Control remoto compatible</span>
                </div>
                <div class="flex items-center gap-2 bg-white/10 px-4 py-2 rounded-full">
                    <i class="fas fa-mobile-alt text-yellow-500"></i>
                    <span>Compatibilidad limitada con móviles</span>
                </div>
            </div>
        </section>
    </main>

    <footer class="border-t border-gray-800 mt-16 py-8">
        <div class="container mx-auto px-4 text-center">
            <div class="flex items-center justify-center gap-2 mb-4">
                <i class="fab fa-youtube text-youtube-red text-2xl"></i>
                <span class="text-xl font-bold">Tizentube</span>
                <span class="badge-no-ads"><i class="fas fa-ban"></i> Sin Anuncios</span>
            </div>
            <p class="text-youtube-light mb-2">
                &copy; <span id="currentYear"></span> Tizentube. Todos los derechos reservados.
            </p>
            <p class="text-sm text-youtube-light">
                Disfruta YouTube sin anuncios con nuestra prueba gratuita de 5 horas. Contrata tu plan premium para acceso ilimitado.
            </p>
        </div>
    </footer>

    <script>
        const WHATSAPP_NUMBER = "593980649398";
        const API_URL = "./panel/api/generate_trial_code.php";
        
        let expirationInterval = null;
        
        // Función para formatear fecha local del cliente
        function formatLocalDate(date) {
            const day = String(date.getDate()).padStart(2, '0');
            const month = String(date.getMonth() + 1).padStart(2, '0');
            const hours = String(date.getHours()).padStart(2, '0');
            const minutes = String(date.getMinutes()).padStart(2, '0');
            return `${day}/${month} ${hours}:${minutes}`;
        }
        
        // Función para calcular y mostrar el tiempo restante
        function startCountdown(expirationDate) {
            if (expirationInterval) clearInterval(expirationInterval);
            
            const countdownElement = document.getElementById('countdown');
            if (!countdownElement) return;
            
            expirationInterval = setInterval(() => {
                const now = new Date();
                const diff = expirationDate - now;
                
                if (diff <= 0) {
                    countdownElement.innerHTML = '<span style="color: #ff6666;">⚠️ Código expirado ⚠️</span>';
                    clearInterval(expirationInterval);
                    return;
                }
                
                const hours = Math.floor(diff / (1000 * 60 * 60));
                const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
                const seconds = Math.floor((diff % (1000 * 60)) / 1000);
                
                countdownElement.innerHTML = `⏱️ Tiempo restante: ${hours}h ${minutes}m ${seconds}s`;
            }, 1000);
        }
        
        // Elementos del DOM
        const elements = {
            form: document.getElementById("trialForm"),
            nameInput: document.getElementById("inpName"),
            phoneInput: document.getElementById("inpPhone"),
            generateBtn: document.getElementById("btnGen"),
            loading: document.getElementById("loading"),
            result: document.getElementById("result"),
            codeDisplay: document.getElementById("code"),
            expiryDisplay: document.getElementById("exp"),
            errorBox: document.getElementById("err"),
            errorMsg: document.getElementById("errMsg"),
            copyBtn: document.getElementById("btnCopy"),
            trialDuration: document.getElementById("trial-duration"),
            currentYear: document.getElementById("currentYear")
        };
        
        if (elements.currentYear) {
            elements.currentYear.textContent = new Date().getFullYear();
        }
        
        function showError(message) {
            elements.errorMsg.textContent = message;
            elements.errorBox.classList.remove("hidden");
            elements.result.classList.add("hidden");
        }
        
        function hideError() {
            elements.errorBox.classList.add("hidden");
        }
        
        elements.form.addEventListener("submit", async function(e) {
            e.preventDefault();
            hideError();
            
            const name = elements.nameInput.value.trim();
            const phone = elements.phoneInput.value.trim();
            
            if (name.length < 2) {
                showError("El nombre debe tener al menos 2 caracteres.");
                return;
            }
            
            if (phone.length < 10) {
                showError("El teléfono debe tener al menos 10 dígitos.");
                return;
            }
            
            elements.generateBtn.disabled = true;
            elements.loading.classList.remove("hidden");
            elements.result.classList.add("hidden");
            
            try {
                const formData = new FormData();
                formData.append("name", name);
                formData.append("phone", phone);
                
                const response = await fetch(API_URL, { method: "POST", body: formData });
                const contentType = response.headers.get("content-type");
                
                if (!contentType || !contentType.includes("application/json")) {
                    throw new Error("Error en la respuesta del servidor");
                }
                
                const data = await response.json();
                
                if (data.success || data.ok || data.code) {
                    elements.codeDisplay.textContent = data.code;
                    
                    // Calcular fecha de expiración local (hora actual del cliente + 5 horas)
                    const localExpiration = new Date();
                    localExpiration.setHours(localExpiration.getHours() + 5);
                    
                    elements.expiryDisplay.textContent = formatLocalDate(localExpiration);
                    elements.result.classList.remove("hidden");
                    
                    // Iniciar cuenta regresiva
                    startCountdown(localExpiration);
                    
                    elements.form.reset();
                } else {
                    showError(data.message || data.error || "Error al generar el código. Intenta nuevamente.");
                }
            } catch (error) {
                console.error("Error:", error);
                showError("Error de conexión. Por favor, intenta nuevamente.");
            } finally {
                elements.generateBtn.disabled = false;
                elements.loading.classList.add("hidden");
            }
        });
        
        if (elements.copyBtn) {
            elements.copyBtn.addEventListener("click", function() {
                const code = elements.codeDisplay.textContent;
                navigator.clipboard.writeText(code).then(function() {
                    elements.copyBtn.classList.add("copied");
                    elements.copyBtn.innerHTML = "<i class=\"fas fa-check mr-2\"></i>¡Copiado!";
                    setTimeout(function() {
                        elements.copyBtn.classList.remove("copied");
                        elements.copyBtn.innerHTML = "<i class=\"fas fa-copy mr-2\"></i>Copiar Código";
                    }, 2000);
                }).catch(function() {
                    showError("No se pudo copiar el código. Cópialo manualmente.");
                });
            });
        }
        
        window.copyDownloaderCode = function() {
            navigator.clipboard.writeText("2293102").then(() => {
                const btn = document.querySelector('.bg-black\\/40 button:last-child');
                if (btn) {
                    const originalText = btn.innerHTML;
                    btn.innerHTML = '<i class="fas fa-check"></i> ¡Copiado!';
                    setTimeout(() => { btn.innerHTML = originalText; }, 2000);
                }
            }).catch(() => {
                alert("Copia manual: 2293102");
            });
        };
        
        // ========== PROTECCIÓN ==========
        function showNeonAlert(message) {
            const alertDiv = document.createElement('div');
            alertDiv.style.cssText = `
                position: fixed;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                background: rgba(0, 0, 0, 0.95);
                backdrop-filter: blur(12px);
                border: 2px solid #ff3333;
                border-radius: 24px;
                padding: 28px 40px;
                text-align: center;
                z-index: 10000;
                box-shadow: 0 0 50px rgba(255, 0, 0, 0.6);
                animation: neonPulse 0.3s ease;
                min-width: 300px;
            `;
            alertDiv.innerHTML = `
                <i class="fas fa-shield-alt" style="font-size: 48px; color: #ff3333; margin-bottom: 15px; display: block;"></i>
                <h3 style="color: #ff5555; font-size: 1.5rem; margin-bottom: 12px;">🔒 CÓDIGO PROTEGIDO</h3>
                <p style="color: white; margin-bottom: 20px;">${message}</p>
                <button onclick="this.parentElement.remove()" style="background: #ff3333; border: none; padding: 10px 28px; border-radius: 40px; color: white; font-weight: bold; cursor: pointer;">ACEPTAR</button>
            `;
            document.body.appendChild(alertDiv);
            setTimeout(() => { if (alertDiv && alertDiv.parentElement) alertDiv.remove(); }, 3000);
        }
        
        if (!document.querySelector('#neonKeyframes')) {
            const styleSheet = document.createElement('style');
            styleSheet.id = 'neonKeyframes';
            styleSheet.textContent = `@keyframes neonPulse { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }`;
            document.head.appendChild(styleSheet);
        }
        
        document.addEventListener('contextmenu', function(e) {
            e.preventDefault();
            showNeonAlert('No está permitido inspeccionar o copiar el contenido de esta página');
            return false;
        });
        
        document.addEventListener('keydown', function(e) {
            if (e.key === 'F12' || (e.ctrlKey && e.shiftKey && (e.key === 'I' || e.key === 'C' || e.key === 'J')) ||
                (e.ctrlKey && e.key === 'u') || (e.ctrlKey && e.key === 's')) {
                e.preventDefault();
                showNeonAlert('Esta acción no está permitida');
            }
        });
        
        const downloadLink = document.getElementById('downloadLink');
        if (downloadLink) downloadLink.setAttribute('rel', 'noopener noreferrer');
    </script>
</body>
</html>