<?php
require_once('logica/header.php');
include 'logica/session_config.php';
require 'logica/db.php';

$imagen_predeterminada = 'https://img.lulali20.com/Mi%20web/assets/logic/steve.webp';
$discord_imagen = $imagen_predeterminada;

if (!empty($_SESSION['user_id'])) {
    $user_id = $_SESSION['user_id'];

    $stmt = $pdo->prepare("SELECT * FROM usuarios WHERE discord_id = ?");
    $stmt->execute([$user_id]);
    $usuario = $stmt->fetch(PDO::FETCH_ASSOC);

    if ($usuario && !empty($usuario['discord_imagen'])) {
        $discord_imagen = $usuario['discord_imagen'];
    } else {
        $usuario = NULL;
    }
}
?>

<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="preload" fetchpriority="high" as="image" href="https://img.lulali20.com/Mi%20web/assets/background.webp" type="image/webp">
    
    <!-- SEO y Título -->
    <title>LuLaLi20 | Inicio</title>
    <meta name="description" content="Bienvenido al sitio oficial de LuLaLi20. Descubre mis últimos vídeos, gameplays, tutoriales y mucho más. ¡Únete a la comunidad!">

    <!-- Open Graph -->
    <meta property="og:title" content="LuLaLi20 | Inicio" />
    <meta property="og:description" content="Mi página oficial." />
    <meta property="og:site_name" content="LuLaLi20">
    <meta property="og:url" content="https://lulali20.com/" />
    <meta property="og:type" content="website" />
    <meta property="og:image" content="https://img.lulali20.com/Mi%20web/assets/logic/creeper.webp" />
    <meta property="og:image:alt" content="Logo LuLaLi20 Creeper" />
    <meta property="og:locale" content="es_ES" />

    <!-- Twitter Cards -->
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:site" content="@LuLaLi20Mc">
    <meta name="twitter:creator" content="@LuLaLi20Mc">
    <meta name="twitter:title" content="LuLaLi20">
    <meta name="twitter:description" content="Mi página oficial.">
    <meta name="twitter:image" content="https://img.lulali20.com/Mi%20web/assets/logic/creeper.webp">

    <!-- Color del tema y Favicon -->
    <meta name="theme-color" id="themeColorMeta" content="#1e1e1e">
    <link rel="apple-touch-icon" sizes="180x180" href="https://img.lulali20.com/Mi%20web/assets/logic/creeper.ico">
    <link rel="icon" type="image/png" sizes="32x32" href="https://img.lulali20.com/Mi%20web/assets/logic/creeper.ico">
    <link rel="icon" type="image/png" sizes="16x16" href="https://img.lulali20.com/Mi%20web/assets/logic/creeper.ico">
    <link rel="icon" href="https://img.lulali20.com/Mi%20web/assets/logic/creeper.ico" type="image/x-icon">
    <link rel="stylesheet" href="/assets/css/style.css">
    <link rel="stylesheet" href="/assets/css/index.css">
    <link rel="stylesheet" href="/assets/css/iconos.all.min.css">

    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=Open+Sans:wght@400;600&display=swap" rel="stylesheet">
    
    <!-- Verificación de Google -->
    <meta name="google-site-verification" content="fHYbmYJij9LRgqewrUc-k_ntvrKEcmDhLvN5UOkl_y8" />

    <link rel="stylesheet" href="/assets/css/skills.css">
</head>
<body>

<header>
    <nav>
        <a href="/index" class="logo-container">
            <img src="https://img.lulali20.com/Mi%20web/assets/logic/creeper.webp" alt="Logo LuLaLi20" class="logo-img">
            <span class="logo-text">LuLaLi20</span>
        </a>

        <ul class="nav-links" id="navLinks">
            <li><a href="/" class="active">Inicio</a></li>
            <li><a href="/downloads">Descargas</a></li>
            <li><a href="/eventos">Eventos</a></li>
            <li><a href="/community">Comunidad</a></li>
            <li><a href="#about">Sobre Mí</a></li>
            <li><a href="/l20smp">L20SMP</a></li>
        </ul>
        
        <div class="nav-actions">

            <button class="theme-toggle-button" id="themeToggle" aria-label="Cambiar tema">
                <!-- Icono cargado con JS -->
            </button>
            
            <div id="auth-container">
                <?php if(!isset($_SESSION['user_id'])): ?>
                    <button id="auth-button" aria-label="Opciones de usuario">
                        <img id="auth-image" src="<?= htmlspecialchars($discord_imagen) ?>" alt="Iniciar sesión" class="discord-user">
                    </button>
                    <div id="user-menu" class="user-menu-dropdown">
                        <a href="/login"><i class="fab fa-discord"></i> Iniciar Sesión</a>
                    </div>
                <?php else: ?>
                    <button id="auth-button" aria-label="Opciones de usuario">
                        <img id="auth-image" src="<?= htmlspecialchars($discord_imagen) ?>" alt="Iniciar sesión" class="discord-user">
                    </button>
                    <div id="user-menu" class="user-menu-dropdown">
                        <p id="user-name"><?= isset($usuario) && !empty($usuario['usuario']) ? htmlspecialchars($usuario['usuario']) : htmlspecialchars($usuario['discord_usuario'] ?? '') ?></p>
                        <a href="/profile">Ver perfil</a>
                        <hr>
                        <a href="/logout">Cerrar sesión</a>
                    </div>
                <?php endif; ?>
            </div>

            <button class="mobile-menu-button" id="mobileMenuBtn" aria-label="Abrir menú">
                ☰
            </button>
        </div>
    </nav>
</header>

    <main>
        <section id="hero" class="hero">
        <!-- 1. Imagen de fondo cargada desde el HTML -->
        <img src="https://img.lulali20.com/Mi%20web/assets/background.webp" alt="Fondo del canal de YouTube de LuLaLi20" class="hero-background-image">

        <!-- 2. Contenedor para el contenido que irá por encima de la imagen y el sombreado -->
        <div class="hero-content-container">
            <div class="container">
                <h1>Bienvenido a mi página oficial</h1>
                <p></p>
                <a href="https://www.youtube.com/@LuLaLi20?sub_confirmation=1" target="_blank" rel="noopener noreferrer" class="cta-button">Suscríbete en YouTube</a>
            </div>
        </div>
    </section>

        <section id="videos">
            <div class="container">
                <h2>Mis vídeos destacados</h2>
                <div class="videos-grid">
                    <article class="video-card">
                        <div class="video-embed-container">
                            <iframe loading="lazy" src="https://www.youtube.com/embed/hrDgWoYgi1Q?si=XuW4PcHAR1t7IzqX" title="Mundo Corrupto | Tráiler oficial" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
                        </div>
                        <div class="video-info">
                            <h3>Mundo Corrupto | Tráiler oficial</h3>
                            <p>¡Tráiler de mi nueva serie de Minecraft Bedrock!</p>
                        </div>
                    </article>
                    <article class="video-card">
                        <div class="video-embed-container">
                            <iframe loading="lazy" src="https://www.youtube.com/embed/GstUrgQed6s?si=NliCrQpmNhXlXfRE" title="¿¡Chrome Dino como MINECRAFT!?" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
                        </div>
                        <div class="video-info">
                            <h3>¿¡Chrome Dino como MINECRAFT!?</h3>
                            <p>Aprende a cambiar las texturas del dino de chrome.</p>
                        </div>
                    </article>
                    <article class="video-card">
                        <div class="video-embed-container">
                            <iframe loading="lazy" src="https://www.youtube.com/embed/w-Lj9oDU7lQ?si=gViFIWbJJ2Ec2Y4j" title="¿Una serie hardcore?" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
                        </div>
                        <div class="video-info">
                            <h3>¿Una serie hardcore?</h3>
                            <p>Mi serie hardcore.</p>
                        </div>
                    </article>
                </div>
                <div class="view-more-videos">
                    <a href="https://www.youtube.com/@LuLaLi20?sub_confirmation=1" target="_blank" rel="noopener noreferrer" class="cta-button">Ver Más Vídeos</a>
                </div>
            </div>
        </section>

        <section id="about">
            <div class="container">
                <img src="https://img.lulali20.com/Mi%20web/assets/logic/creeper.webp" alt="LuLaLi20" class="profile-pic">
                <div class="about-text">
                    <h2>Sobre mi</h2>
                    <p>¡Hola! Soy LuLaLi20, un creador de contenido de minecraft y desarrollador principiante</p>
                    <p>En mi canal de YouTube encontrarás vídeos de calidad (Cuando suba). Dentro de nada se vienen cosillas para el canal.</p>
                    <p>Hago streams casi todos los días/semanas en verano y durante el año hago directo cuando puedo.
                    <p>Sígueme para enterarte de las novedades y únete al <a class="primary-link" href="https://discord.lulali20.com">Servidor de Discord</a></p>
                </div>
            </div>
            </section>

            <section id="skills">
                <div class="container">
                    <div class="skills-header">
                        <h2>Habilidades</h2>
                        <p><center>Herramientas y software que uso para crear contenido y diseño.</center></p>
                    </div>
                    <div class="skills-grid">
                        <div class="card">
                            <img class="logo" src="https://img.lulali20.com/Adobe-logos/Premiere-pro.png" alt="Premiere Pro Logo">
                            <div class="text-container">
                                <h2>Premiere Pro</h2>
                                <p>Edición de Video</p>
                                <span class="level">Avanzado</span>
                            </div>
                            <img class="cat-image" src="https://mc-api.io/render/bust/LuLaLi20/java?size=2560" alt="Minecraft Avatar">
                        </div>

                        <div class="card">
                            <img class="logo" src="https://img.lulali20.com/Adobe-logos/Aftereffects.png" alt="After Effects Logo">
                            <div class="text-container">
                                <h2>After Effects</h2>
                                <p>Motion Graphics</p>
                                <span class="level">Intermedio - Principiante</span>
                            </div>
                            <img class="cat-image" src="https://mc-api.io/render/bust/LuLaLi20/java?size=2560" alt="Minecraft Avatar">
                        </div>

                        <div class="card">
                            <img class="logo" src="https://img.lulali20.com/Adobe-logos/Photoshop.png" alt="Photoshop Logo">
                            <div class="text-container">
                                <h2>Photoshop</h2>
                                <p>Edición de Imagen</p>
                                <span class="level">Intermedio</span>
                            </div>
                            <img class="cat-image" src="https://mc-api.io/render/bust/LuLaLi20/java?size=2560" alt="Minecraft Avatar">
                        </div>

                        <div class="card">
                            <img class="logo" src="https://img.lulali20.com/Adobe-logos/Illustrator.png" alt="Illustrator Logo">
                            <div class="text-container">
                                <h2>Illustrator</h2>
                                <p>Diseño Vectorial</p>
                                <span class="level">Principiante</span>
                            </div>
                            <img class="cat-image" src="https://mc-api.io/render/bust/LuLaLi20/java?size=2560" alt="Minecraft Avatar">
                        </div>
                    </div>
                </div>
            </section>

        <section id="community">
            <div class="container">
                <h2>Únete a la Comunidad</h2>
                <p>Redes sociales</p>
                <div class="social-links">
                    <a href="https://youtube.lulali20.com" target="_blank" rel="noopener noreferrer" title="YouTube"><svg viewBox="0 0 24 24"><path d="M21.58,6.18C21.35,5.32 20.68,4.65 19.82,4.42C18.27,4 12,4 12,4S5.73,4 4.18,4.42C3.32,4.65 2.65,5.32 2.42,6.18C2,7.73 2,12 2,12S2,16.27 2.42,17.82C2.65,18.68 3.32,19.35 4.18,19.58C5.73,20 12,20 12,20S18.27,20 19.82,19.58C20.68,19.35 21.35,18.68 21.58,17.82C22,16.27 22,12 22,12S22,7.73 21.58,6.18M10,15.46V8.54L16,12L10,15.46Z"/></svg></a>
                    <a href="https://www.youtube.com/@IpodCraft" target="_blank" rel="noopener noreferrer" title="YouTube (IpodCraft)"><svg viewBox="0 0 24 24"><path d="M21.58,6.18C21.35,5.32 20.68,4.65 19.82,4.42C18.27,4 12,4 12,4S5.73,4 4.18,4.42C3.32,4.65 2.65,5.32 2.42,6.18C2,7.73 2,12 2,12S2,16.27 2.42,17.82C2.65,18.68 3.32,19.35 4.18,19.58C5.73,20 12,20 12,20S18.27,20 19.82,19.58C20.68,19.35 21.35,18.68 21.58,17.82C22,16.27 22,12 22,12S22,7.73 21.58,6.18M10,15.46V8.54L16,12L10,15.46Z"/></svg></a>
                    <a href="https://twitter.com/LuLaLi20Mc" target="_blank" rel="noopener noreferrer" title="Twitter"><svg viewBox="0 0 24 24"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg></a>
                    <a href="https://instagram.com/LuLaLi20Mc" target="_blank" rel="noopener noreferrer" title="Instagram"><svg viewBox="0 0 24 24"><path d="M7.8,2H16.2C19.4,2 22,4.6 22,7.8V16.2A5.2,5.2 0 0,1 16.2,21.4H7.8C4.6,21.4 2,18.8 2,15.6V7.8A5.2,5.2 0 0,1 7.8,2M7.6,4A3.6,3.6 0 0,0 4,7.6V16.4C4,18.39 5.61,20 7.6,20H16.4A3.6,3.6 0 0,0 20,16.4V7.6C20,5.61 18.39,4 16.4,4H7.6M17.25,5.5A1.25,1.25 0 0,1 18.5,6.75A1.25,1.25 0 0,1 17.25,8A1.25,1.25 0 0,1 16,6.75A1.25,1.25 0 0,1 17.25,5.5M12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9Z"/></svg></a>
                    <a href="https://twitch.tv/LuLali20" target="_blank" rel="noopener noreferrer" title="Twitch"><svg viewBox="0 0 24 24"><path d="M4,2V16H8V20L12,16H16L20,12V2H4M18,11L16,13H13L11,15V13H8V4H18V11M15,6H13V10H15V6M11,6H9V10H11V6Z"/></svg></a>
                    <a href="https://discord.lulali20.com" target="_blank" rel="noopener noreferrer" title="Discord"><svg viewBox="0 0 24 24"><path d="M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"></path></svg></a>
                    <a href="https://whatsapp.com/channel/0029VaRyKNNJENy3pMTz4i3K" target="_blank" rel="noopener noreferrer" title="WhatsApp"><svg viewBox="0 0 308 308"><path fill="currentColor" d="M227.904,176.981c-0.6-0.288-23.054-11.345-27.044-12.781c-1.629-0.585-3.374-1.156-5.23-1.156 c-3.032,0-5.579,1.511-7.563,4.479c-2.243,3.334-9.033,11.271-11.131,13.642c-0.274,0.313-0.648,0.687-0.872,0.687 c-0.201,0-3.676-1.431-4.728-1.888c-24.087-10.463-42.37-35.624-44.877-39.867c-0.358-0.61-0.373-0.887-0.376-0.887 c0.088-0.323,0.898-1.135,1.316-1.554c1.223-1.21,2.548-2.805,3.83-4.348c0.607-0.731,1.215-1.463,1.812-2.153 c1.86-2.164,2.688-3.844,3.648-5.79l0.503-1.011c2.344-4.657,0.342-8.587-0.305-9.856c-0.531-1.062-10.012-23.944-11.02-26.348 c-2.424-5.801-5.627-8.502-10.078-8.502c-0.413,0,0,0-1.732,0.073c-2.109,0.089-13.594,1.601-18.672,4.802 c-5.385,3.395-14.495,14.217-14.495,33.249c0,17.129,10.87,33.302,15.537,39.453c0.116,0.155,0.329,0.47,0.638,0.922 c17.873,26.102,40.154,45.446,62.741,54.469c21.745,8.686,32.042,9.69,37.896,9.69c0.001,0,0.001,0,0.001,0 c2.46,0,4.429-0.193,6.166-0.364l1.102-0.105c7.512-0.666,24.02-9.22,27.775-19.655c2.958-8.219,3.738-17.199,1.77-20.458 C233.168,179.508,230.845,178.393,227.904,176.981z"></path><path fill="currentColor" d="M156.734,0C73.318,0,5.454,67.354,5.454,150.143c0,26.777,7.166,52.988,20.741,75.928L0.212,302.716 c-0.484,1.429-0.124,3.009,0.933,4.085C1.908,307.58,2.943,308,4,308c0.405,0,0.813-0.061,1.211-0.188l79.92-25.396 c21.87,11.685,46.588,17.853,71.604,17.853C240.143,300.27,308,232.923,308,150.143C308,67.354,240.143,0,156.734,0z M156.734,268.994c-23.539,0-46.338-6.797-65.936-19.657c-0.659-0.433-1.424-0.655-2.194-0.655c-0.407,0-0.815,0.062-1.212,0.188 l-40.035,12.726l12.924-38.129c0.418-1.234,0.209-2.595-0.561-3.647c-14.924-20.392-22.813-44.485-22.813-69.677 c0-65.543,53.754-118.867,119.826-118.867c66.064,0,119.812,53.324,119.812,118.867 C276.546,215.678,222.799,268.994,156.734,268.994z"></path></svg></a>
                </div>

            </div>
        </section>
    </main>

    <footer>
        <div class="container">
            <p>© 2024 - <span id="year"></span> <span class="text-primary"><a href="https://lulali20.com">LuLaLi20</a></span>, todos los derechos reservados.</p>
            <p>Diseñado por <span class="text-primary"><a href="https://lulali20.com">LuLaLi20</a></span>.</p>
        </div>
    </footer>

    <!-- ======================= -->
    <!-- SCRIPT JS INTEGRADO     -->
    <!-- ======================= -->
    <script src="/assets/js/theme.js"></script>
    <script src="/assets/js/functions.js"></script>
</body>
</html>




