/* styles.css */

/* --- Importación de Fuentes de Google --- */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Capriola&display=swap');

/* --- Variables Globales de Estilo --- */
:root {
    --color-neon: #ab47bc;
    --color-neon-glow: #d81b60;
    --color-fondo: #0a0a0a;
    --color-texto: #ffffff;
    --color-verde: #28a745;
    --color-verde-hover: #218838;
    --font-titulo: 'Orbitron', sans-serif;
    --font-texto: 'Capriola', sans-serif;
}

* {
    box-sizing: border-box;
}

/* --- Estilos Base y de Fondo --- */
body {
    margin: 0;
    font-family: var(--font-texto);
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0d0d0d 100%);
    color: var(--color-texto);
    min-height: 100vh;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
}

input,
textarea {
    user-select: text;
    -webkit-user-select: text;
}


#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: brightness(1.2) saturate(1.3);
    pointer-events: none;
}

/* --- Header Responsivo --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 30px;
    /* Reduced padding */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid rgba(171, 71, 188, 0.3);
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    height: auto;
    min-height: 55px;
    /* Base height */
}

.header.scrolled {
    padding: 2px 30px;
    /* Minimal padding */
    background: rgba(10, 10, 10, 0.98);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    min-height: 40px;
    /* Very compact on scroll */
    height: auto;
}

.header.scrolled .logo {
    width: 90px;
    /* Resize via width instead of transform */
    transform: none;
}

.logo {
    width: 110px;
    /* Reduced initial width (was 120px) */
    height: auto;
    filter: drop-shadow(0 0 15px var(--color-neon));
    transition: width 0.3s ease;
    flex-shrink: 0;
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 25px var(--color-neon-glow));
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-links a,
.user-menu>a {
    font-family: var(--font-titulo);
    /* Títulos para los enlaces del menú */
    text-decoration: none;
    color: var(--color-texto);
    font-size: 1rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 30px;
    transition: all 0.3s ease;
    text-shadow: 0 0 8px var(--color-neon);
    display: flex;
    align-items: center;
    gap: 10px;
    /* Espacio entre icono y texto */
}

.nav-links a:hover,
.nav-links a.active,
.user-menu>a:hover,
.user-menu>a.active {
    background-color: var(--color-neon);
    color: white;
    box-shadow: 0 0 20px var(--color-neon-glow);
    text-shadow: 0 0 5px white;
}

.nav-icon {
    font-size: 20px;
    width: 22px;
    text-align: center;
}

.nav-text {
    display: block;
    /* Visible por defecto */
}

/* --- Botón Hamburguesa (Móvil) --- */
.hamburger-btn {
    display: none;
    background: transparent;
    border: 2px solid var(--color-neon);
    color: var(--color-neon);
    font-size: 1.5rem;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hamburger-btn:hover,
.hamburger-btn.active {
    background: var(--color-neon);
    color: white;
}

/* --- Nav Container (Desktop) --- */
.nav-container {
    display: flex;
    align-items: center;
    gap: 25px;
}

/* --- Contenido Principal --- */
.main-content {
    padding: 40px 20px;
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    margin-top: 80px;
    /* Increased offset for desktop to be safe */
}

.main-content h1 {
    font-family: var(--font-titulo);
    /* Títulos principales */
    font-size: 3rem;
    color: var(--color-neon);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px var(--color-neon), 0 0 40px var(--color-neon-glow);
    margin-bottom: 20px;
}

/* --- Grid de Códigos --- */
.codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.code-card {
    position: relative;
    /* Necesario para posicionar la corona */
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 2px solid rgba(171, 71, 188, 0.5);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(15px);
    transition: all 0.4s ease;
    box-shadow: 0 8px 32px rgba(171, 71, 188, 0.2);
    display: flex;
    flex-direction: column;
}

.code-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-neon);
    box-shadow: 0 15px 50px rgba(171, 71, 188, 0.4);
}

.code-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--color-neon);
}

.code-card p {
    font-family: var(--font-texto);
    font-size: 1.3rem;
    margin: 0 0 20px 0;
    color: #fff;
    font-weight: bold;
    flex-grow: 1;
    /* Empuja los botones hacia abajo */
}

/* --- ESTE ES EL CÓDIGO MODIFICADO --- */
.card-buttons {
    display: flex;
    justify-content: center;
    /* Centra los botones para mejor apariencia */
    flex-wrap: wrap;
    /* ¡Esta es la clave! Permite que los botones bajen a la siguiente línea */
    gap: 10px;
    /* Añade un espacio consistente entre los botones */
    padding: 0 10px;
}

/* --- Botones Generales --- */
.btn {
    cursor: pointer;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 50px;
    border: none;
    transition: all 0.3s ease;
    font-family: var(--font-texto);
    /* Todos los botones usan la fuente de texto */
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: inline-block;
}

.btn-download {
    background-color: var(--color-verde);
    color: white;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-download:hover {
    background-color: var(--color-verde-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.6);
}

.btn-view {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: var(--color-texto);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(171, 71, 188, 0.5);
}

.btn-view:hover {
    border-color: var(--color-neon);
    color: var(--color-neon);
    text-shadow: 0 0 10px var(--color-neon);
    transform: translateY(-2px);
}

/* --- Botón Premium en Card --- */
.btn-premium {
    background: linear-gradient(145deg, #fdd835, #fb8c00);
    color: #1a1a1a;
    font-weight: 700;
    border: 2px solid #fdd835;
    box-shadow: 0 5px 20px rgba(253, 216, 53, 0.4);
    position: relative;
    overflow: hidden;
    z-index: 1;
    font-family: var(--font-texto);
    font-size: 1rem;
    text-transform: uppercase;
    padding: 12px 24px;
    border-radius: 50px;
}

.btn-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(251, 140, 0, 0.6);
}

/* --- Insignia de Corona Premium --- */
.premium-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(145deg, #fdd835, #fb8c00);
    color: #1a1a1a;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(253, 216, 53, 0.5);
    border: 2px solid white;
    z-index: 5;
}

/* --- Ventana Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(145deg, #1e1e1e, #121212);
    padding: 30px 40px;
    border-radius: 20px;
    border: 2px solid var(--color-neon);
    box-shadow: 0 10px 40px rgba(171, 71, 188, 0.4);
    width: 90%;
    max-width: 450px;
    text-align: center;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: var(--color-neon-glow);
    transform: rotate(90deg);
}

.modal-content h2 {
    font-family: var(--font-titulo);
    /* Título del modal */
    color: var(--color-neon);
    font-size: 2rem;
    margin-bottom: 25px;
    text-shadow: 0 0 15px var(--color-neon);
}

.purchase-section {
    margin-bottom: 25px;
}

.purchase-section h3 {
    font-family: var(--font-texto);
    /* Subtítulos del modal */
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* --- ESTILOS MEJORADOS PARA BOTONES DE COMPRA EN MODAL --- */
.btn-purchase {
    display: flex;
    flex-direction: column;
    /* Organiza el contenido en columna */
    align-items: center;
    gap: 8px;
    /* Espacio entre la línea de texto y la de precio/logo */
    width: 100%;
    padding: 20px 10px;
    /* Hacemos los botones más altos */
    margin-bottom: 15px;
    border-radius: 12px;
    border: none;
    font-family: var(--font-texto);
    /* Fuente de texto para estos botones */
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
    box-sizing: border-box;
}

.btn-purchase:hover {
    transform: translateY(-3px) scale(1.02);
    filter: brightness(1.1);
}

.purchase-action {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    /* Centramos el texto superior */
}

.purchase-details {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Centramos el precio y el logo */
    width: 100%;
}

.purchase-price {
    font-size: 2.2rem;
    /* Precio más grande */
    font-weight: bold;
    margin-right: 15px;
}

.purchase-logo {
    height: 45px;
    /* Icono más grande */
    width: auto;
}

/* Colores específicos de los botones de compra */
.btn-purchase.yape {
    background-color: #9c27b0;
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.5);
}

.btn-purchase.paypal {
    background-color: #0088ff;
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.5);
}

.btn-purchase.store {
    background-color: #fdd835;
    color: #1a1a1a;
    box-shadow: 0 4px 15px rgba(253, 216, 53, 0.5);
}

.btn-purchase.store .purchase-action {
    color: rgba(0, 0, 0, 0.8);
}

/* Texto más oscuro para el botón amarillo */


/* --- Footer --- */
.footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
    border-top: 1px solid rgba(171, 71, 188, 0.3);
    background: rgba(10, 10, 10, 0.5);
}

.footer p {
    margin: 0 0 15px 0;
    font-family: var(--font-texto);
    color: rgba(255, 255, 255, 0.7);
}

.footer-icons {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
}

.footer-icons a {
    color: var(--color-texto);
    transition: all 0.3s ease;
    font-size: 32px;
}

.footer-icons a:hover {
    color: var(--color-neon);
    transform: scale(1.1);
}

/* --- Media Queries para Responsividad --- */





/* Media Query adicional para el modal en pantallas muy pequeñas */
@media (max-width: 480px) {
    .modal-content {
        padding: 25px 20px;
    }

    .modal-content h2 {
        font-size: 1.6rem;
    }

    .purchase-action {
        font-size: 0.9rem;
    }

    .purchase-price {
        font-size: 1.8rem;
    }

    .purchase-logo {
        height: 35px;
        /* Iconos un poco más pequeños para pantallas extra pequeñas */
    }

    .btn-purchase {
        padding: 15px 10px;
    }
}


/* --- Estilos para el Modal de Redirección de Navegador --- */
.modal-icon {
    font-size: 3rem;
    color: var(--color-neon);
    margin-bottom: 15px;
    display: block;
    /* Para que el margen funcione */
}

#browser-redirect-modal .modal-content p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.btn-abrir-navegador {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    color: white;
    font-family: var(--font-titulo);
    font-size: 1.1rem;
    background: linear-gradient(145deg, #28a745, #218838);
    /* Verde para indicar acción positiva */
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.5);
    transition: all 0.3s ease;
}

.btn-abrir-navegador:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(40, 167, 69, 0.7);
}

/* --- User Menu --- */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-menu .user-name {
    cursor: pointer;
}

.user-menu .dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #1a1a1a;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 100;
    border-radius: 5px;
    border: 1px solid var(--color-neon);
}

.user-menu .dropdown-content a {
    color: var(--color-texto);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.user-menu .dropdown-content a:hover {
    background-color: var(--color-neon);
    color: white;
}

/* Dropdown hover only on desktop */
@media (min-width: 769px) {
    .user-menu:hover .dropdown-content {
        display: block;
    }
}

/* --- Media Queries para Responsividad --- */
@media (max-width: 768px) {
    .header {
        padding: 5px 15px;
        /* Minimal padding */
        position: fixed;
        /* Ensure fixed */
        top: 0;
        left: 0;
        width: 100%;
        min-height: 50px;
        /* Reduced from 60px */
        justify-content: space-between;
        z-index: 1000;
        background: rgba(10, 10, 10, 0.9);
    }

    .main-content {
        margin-top: 110px;
        /* Increased from 90px to guaranteed clear header */
        padding-top: 20px;
    }

    .header.scrolled {
        padding: 2px 15px;
        min-height: 40px;
        /* Very compact */
    }

    .header.scrolled .logo {
        width: 80px;
    }



    .logo {
        width: 100px;
    }

    .hamburger-btn {
        display: block;
        order: 2;
    }

    .nav-container {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(26, 26, 26, 0.98);
        border-bottom: 2px solid var(--color-neon);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
        flex-direction: column;
        padding: 20px;
        z-index: 1000;
        align-items: center;
        backdrop-filter: blur(10px);
    }

    .nav-container.active {
        display: flex;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .nav-links a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 12px;
        margin: 0;
        gap: 10px;
    }

    .nav-text {
        display: inline-block;
        /* Mostrar texto en el menú móvil */
    }

    .nav-icon {
        margin: 0;
        width: auto;
    }

    .user-menu {
        width: 100%;
        margin-left: 0;
        margin-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 20px;
        flex-direction: column;
        align-items: center;
    }

    .user-menu .user-name {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .user-menu .dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        background: transparent;
        display: block;
        /* Siempre visible dentro del acordeón móvil si se desea, o manejado con JS */
        text-align: center;
    }

    .user-menu .dropdown-content a {
        text-align: center;
        background: rgba(255, 255, 255, 0.05);
        margin-bottom: 5px;
        border-radius: 5px;
    }

    .main-content h1 {
        font-size: 2.2rem;
    }

    .codes-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important;
        /* Force 2 columns */
        gap: 10px;
        /* Smaller gap */
    }

    .code-card {
        padding: 8px;
        /* Reduce padding to fit content */
        border-radius: 10px;
        width: 100%;
        /* Ensure card takes full grid cell width */
        min-width: 0;
        /* Prevent overflow */
    }

    .code-card img {
        height: 100px;
        /* Smaller images on mobile */
        margin-bottom: 8px;
    }

    .code-card p {
        font-size: 0.8rem;
        /* Smaller title */
        margin: 0 0 8px 0;
    }

    .btn,
    .btn-premium {
        padding: 5px 10px;
        font-size: 0.6rem;
        /* Much smaller button text */
        border-radius: 4px;
        /* Slightly less rounded for tiny size */
    }

    .card-buttons {
        gap: 4px;
        /* Tighter gap for small buttons */
    }
}

/* Media Query adicional para el modal en pantallas muy pequeñas */
@media (max-width: 480px) {
    .modal-content {
        padding: 25px 20px;
    }

    .modal-content h2 {
        font-size: 1.6rem;
    }

    .purchase-action {
        font-size: 0.9rem;
    }

    .purchase-price {
        font-size: 1.8rem;
    }

    .purchase-logo {
        height: 35px;
    }

    .btn-purchase {
        padding: 15px 10px;
    }
}