/* Reset y utilidades base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* --- Fondo Geométrico Animado Intensificado --- */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    opacity: 1;
    /* Opacidad alta para prevalecer */
    animation: floatAnim 18s infinite alternate ease-in-out;
}

/* Tonos Oficiales NOESPLAY */
.shape-circle-1 {
    width: 480px;
    height: 480px;
    border-radius: 50%;
    /* Violeta azulado: #6666CC */
    background: radial-gradient(circle, rgba(102, 102, 204, 0.45) 0%, rgba(102, 102, 204, 0.1) 100%);
    top: -80px;
    left: -180px;
    filter: blur(60px);
}

.shape-circle-2 {
    width: 580px;
    height: 580px;
    border-radius: 50%;
    /* Verde lima: #79DF53 */
    background: radial-gradient(circle, rgba(121, 223, 83, 0.45) 0%, rgba(121, 223, 83, 0.1) 100%);
    bottom: -180px;
    right: -250px;
    animation-delay: -5s;
    animation-duration: 25s;
    filter: blur(70px);
}

.shape-circle-3 {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    /* Turquesa / cian: #4DC7CB */
    background: radial-gradient(circle, rgba(77, 199, 203, 0.4) 0%, transparent 100%);
    top: 35%;
    right: -120px;
    animation-delay: -10s;
    animation-duration: 18s;
    filter: blur(50px);
}

.shape-line {
    width: 1400px;
    height: 5px;
    /* Amarillo anaranjado: #FCB739 */
    background: linear-gradient(90deg, transparent, rgba(252, 183, 57, 0.6), transparent);
    top: 20%;
    left: -400px;
    transform: rotate(35deg);
    filter: blur(1px);
    animation: slideLine 20s infinite linear;
}

.shape-line-2 {
    width: 1000px;
    height: 3px;
    /* Rojo coral: #F74A46 */
    background: linear-gradient(90deg, transparent, rgba(247, 74, 70, 0.6), transparent);
    bottom: 15%;
    right: -300px;
    transform: rotate(-25deg);
    filter: blur(1px);
    animation: slideLineRev 18s infinite linear;
}

.shape-dots {
    width: 350px;
    height: 350px;
    /* Usando el violeta azulado para los puntos */
    background-image: radial-gradient(rgba(102, 102, 204, 0.7) 3.5px, transparent 3.5px);
    background-size: 30px 30px;
    top: 60%;
    left: 5%;
    filter: none;
    opacity: 0.9;
    animation: floatAnim 35s infinite alternate linear;
}

.shape-circle-center {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    /* Turquesa / cian: #4DC7CB */
    background: radial-gradient(circle, rgba(77, 199, 203, 0.25) 0%, transparent 100%);
    top: 50%;
    left: 45%;
    filter: blur(80px);
    animation-duration: 30s;
}

.shape-triangle-1 {
    width: 0;
    height: 0;
    border-left: 100px solid transparent;
    border-right: 100px solid transparent;
    /* Amarillo anaranjado: #FCB739 */
    border-bottom: 173px solid rgba(252, 183, 57, 0.15);
    top: 15%;
    left: 25%;
    filter: blur(10px);
    animation: rotateFloat 25s infinite linear;
}

.shape-triangle-2 {
    width: 0;
    height: 0;
    border-left: 80px solid transparent;
    border-right: 80px solid transparent;
    /* Rojo coral: #F74A46 */
    border-bottom: 138px solid rgba(247, 74, 70, 0.15);
    bottom: 30%;
    right: 30%;
    filter: blur(15px);
    animation: rotateFloat 20s infinite linear reverse;
}

.shape-square-1 {
    width: 150px;
    height: 150px;
    /* Verde lima: #79DF53 */
    border: 2px solid rgba(121, 223, 83, 0.2);
    top: 60%;
    right: 15%;
    border-radius: 20px;
    filter: blur(2px);
    animation: rotateFloat 35s infinite linear;
}

.shape-square-2 {
    width: 100px;
    height: 100px;
    /* Violeta azulado: #6666CC */
    background: rgba(102, 102, 204, 0.1);
    top: 10%;
    right: 40%;
    border-radius: 15px;
    filter: blur(5px);
    animation: rotateFloat 28s infinite linear reverse;
}

@keyframes floatAnim {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    100% {
        transform: translate(120px, 80px) scale(1.15) rotate(15deg);
    }
}

@keyframes rotateFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(50px, 50px) rotate(180deg);
    }

    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

@keyframes slideLine {
    0% {
        transform: rotate(35deg) translateX(-100%);
    }

    100% {
        transform: rotate(35deg) translateX(200%);
    }
}

@keyframes slideLineRev {
    0% {
        transform: rotate(-25deg) translateX(100%);
    }

    100% {
        transform: rotate(-25deg) translateX(-200%);
    }
}

/* -------------------------------- */

a {
    text-decoration: none;
    color: inherit;
}

button,
input {
    font-family: inherit;
}

/* Layout Header Minimalista Glassmorphism 3D */
.v2-header {
    position: sticky;
    top: 15px;
    z-index: 1000;
    margin: 0 auto;
    width: 95%;
    max-width: 1400px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    /* Efecto 3D: Sombra profunda y borde de luz interno */
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.v2-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.v2-logo img {
    height: 38px;
    filter: var(--logo-filter);
    transition: transform 0.2s;
}

.v2-logo img:hover {
    transform: scale(1.05);
}

.v2-search-wrapper {
    flex: 1;
    max-width: 500px;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
}

.search-input-group input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-input-group input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Layout Main y Tarjetas */
.v2-main-content {
    flex: 1;
    max-width: 1400px;
    /* Mas amplio */
    margin: 0 auto;
    width: 95%;
    padding: 30px 20px 60px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
}

/* Barra de Categorías Deslizable */
.categories-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 10px 5px 20px 5px;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.categories-scroll-wrapper::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.categories-container-v2 {
    display: flex;
    gap: 12px;
    width: max-content;
    padding: 2px;
}

.cat-pill {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 10px 22px;
    border-radius: 50px;
    color: #2d3748;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-pill:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.cat-pill.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* Grid de Apps */
.apps-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Móvil: 1 columna */
    gap: 25px;
}

@media (min-width: 768px) {
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Tablet: 2 columnas */
    }
}

@media (min-width: 1024px) {
    .apps-grid {
        grid-template-columns: repeat(3, 1fr);
        /* Desktop: 3 columnas estrictas */
    }
}

/* Tarjeta PWA Premium Efecto 3D Blur Blanco */
.pwa-card-v2 {
    /* El background será inyectado inline desde PHP (portada) */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    /* Borde blanco mas notorio para enmarcar como 3D glass */
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    /* Animación tipo rebote 3D divertido */
    position: relative;
    overflow: hidden;
    min-height: 180px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05), inset 0 2px 0 rgba(255, 255, 255, 0.4);
    /* Sombra externa volumétrica y borde de luz interno */
    transform-style: preserve-3d;
}

.pwa-card-v2:hover {
    transform: translateY(-8px) scale(1.03);
    /* Levitar y crecer */
    box-shadow: 0 25px 40px rgba(0, 0, 0, 0.15), 0 10px 15px rgba(0, 0, 0, 0.08), inset 0 2px 0 rgba(255, 255, 255, 0.8);
    /* Sombra se expande abajo dando sensación 3D */
    border-color: rgba(255, 255, 255, 0.9);
}

/* Overlay Difuminado */
.pwa-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.55);
    /* Capa SEMITRANSPARENTE BLANCA (+0.2 opacidad) */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1;
}

/* Contenido Principal sobre el Blur */
.pwa-card-content,
.pwa-meta {
    position: relative;
    z-index: 2;
    /* Por encima del overlay */
}

.pwa-card-content {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 20px 20px 5px 20px;
}

.pwa-icon-container {
    width: 100px;
    height: 100px;
    margin-right: 18px;
    border-radius: 24px;
    /* Bordes redondeados en el icono */
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background: transparent;
}

.pwa-icon-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pwa-info-wrapper {
    flex: 1;
    overflow: hidden;
}

.pwa-title {
    font-size: 1.35rem;
    /* Texto más grande e impactante */
    font-weight: 800;
    color: #1a202c !important;
    /* Texto negro/oscuro contrastante */
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Un ligero halo blanco por si hay zonas oscuras detrás, o sombra oscura suave */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.pwa-dev {
    font-size: 1rem;
    /* Más grande y legible */
    color: #4a5568;
    /* Gris oscuro para contrastar blanco */
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.pwa-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 5px 20px 20px 20px;
    font-size: 0.9rem;
    color: #2d3748;
}

.rating-stars {
    color: #ffd700;
    /* Oro brillante / Amarillo claro */
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    /* Badge gris oscuro tipo blur solicitado */
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 5px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.rating-stars span {
    font-size: 1.1rem;
}

.downloads-count {
    color: #4a5568;
    /* Gris oscuro */
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Hero Banners */
.hero-banner {
    border-radius: 20px;
    padding: 40px 30px;
    margin-bottom: 40px;
    background: var(--hero-bg-gradient);
    color: #fff;
    box-shadow: var(--hero-shadow);
    position: relative;
    overflow: hidden;
}

.hero-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('https://www.transparenttextures.com/patterns/cubes.png');
    opacity: 0.1;
    pointer-events: none;
}

.hero-content h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.hero-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 500px;
}

/* Footer layout */
.v2-footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    padding: 40px 20px;
    margin-top: auto;
}

.v2-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    height: 40px;
    filter: var(--logo-filter);
}

.footer-links a,
.developer-info p,
.contact-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover,
.contact-links a:hover {
    color: var(--accent-color);
}

.contact-links {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .v2-header-container {
        flex-wrap: wrap;
    }

    .v2-search-wrapper {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
    }

    .hero-banner {
        padding: 30px 20px;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .v2-footer-content {
        flex-direction: column;
        text-align: center;
    }

    .contact-links {
        justify-content: center;
    }
}