/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    --primary: #0a192f; /* Navy Blue oscuro */
    --secondary: #112240; /* Navy más claro */
    --accent: #64ffda; /* Cyan/Teal para toque futurista */
    --text-light: #ccd6f6;
    --text-dim: #8892b0;
    --white: #ffffff;
    --font-main: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    background-color: var(--white);
    color: var(--primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header & Nav */
header {
    /* Color base */
    background-color: var(--primary);
    
    /* --- FONDO COMBINADO (Capas) --- */
    background-image: 
        /* CAPA 1 (Arriba): Tu malla tecnológica SVG */
        url('../img/header-pattern.svg'),
        
        /* CAPA 2 (Abajo): El brillo digital degradado */
        radial-gradient(
            circle at top right, 
            rgba(100, 255, 218, 0.15) 0%, 
            transparent 60%
        );
    /* ------------------------------ */

    /* Posición: Centrada para la malla, Arriba-Derecha para el brillo */
    background-position: center center, top right;
    
    /* Tamaño: 'cover' fuerza al SVG a llenar todo el ancho del header */
    background-size: cover, auto;
    
    background-repeat: no-repeat;
    
    /* Resto de tu configuración */
    padding: 0.30rem 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Estilos para el LOGO como imagen */
.logo {
    text-decoration: none;
    display: flex; /* Ayuda a alinear la imagen */
    align-items: center;
}

.logo-img {
    height: 80px; /* Tamaño controlado del logo */
    width: auto;
    object-fit: contain;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

/* Efecto NEON */
.nav-links a {
    /* ... tus estilos actuales ... */
    transition: all 0.3s ease; /* Suaviza la animación */
}

/* Efecto LÁSER UNDERLINE */
.nav-links a {
    position: relative; /* Necesario para ubicar la línea */
    padding-bottom: 5px; /* Espacio para la línea */
}

/* Creamos la línea invisible */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0; /* Empieza invisible (ancho 0) */
    height: 2px; /* Grosor de la línea */
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s ease-out; /* Animación de crecimiento */
    box-shadow: 0 0 8px var(--accent); /* La línea también brilla */
}

/* Al pasar el mouse, la línea crece al 100% */
.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--accent); /* El texto también cambia de color */
}

/* Mobile Menu Toggle */
.menu-toggle { display: none; color: white; font-size: 1.5rem; cursor: pointer; }

/* --- HERO CON VIDEO --- */
.hero {
    position: relative;
    padding: 8rem 5%;
    color: var(--white);
    text-align: center;
    overflow: hidden; /* Corta el video si sobra */
    /* Ya no usamos background-image aquí, porque el video lo cubre */
}
/* Estilo para el Logo Central del Hero */
.hero-logo {
    display: block;           /* Comportamiento de bloque para poder centrarlo */
    margin: 0 auto 0.0rem auto; /* Centrado horizontal y margen inferior de 1.5rem */
    max-width: 440px;         /* Tamaño máximo (ajusta este número si lo quieres más grande/chico) */
    height: 220px;             /* Mantiene la proporción */
     /* Sombra suave para que se separe del video de fondo */
     filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));   

    
    /* Animación de entrada suave (Opcional) */
    animation: fadeInDown 5s ease-out;
}

/* Animación de entrada (hace que el logo baje suavemente al cargar) */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 10;
        transform: translateY(0);
    }
}
/* Estilo del Video de Fondo */
.video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Clave: hace que el video llene todo sin deformarse */
    z-index: -2; /* Se va al fondo de todo */
}
/* Aseguramos que el texto esté encima de todo */
.hero-content {
    position: relative;
    z-index: 1;
}

.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--primary);
}

.btn-primary:hover { background-color: #4cdbc2; transform: translateY(-2px); }

.btn-outline {
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover { background-color: rgba(100,255,218,0.1); }

/* Sections */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    color: var(--primary);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* Tarjetas (Cards) */
.card {
    background: #f8f9fa;
    padding: 2.5rem 2rem; /* Un poco más de padding vertical */
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    transition: transform 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-align: center; /* Centramos el contenido para que coincida con el icono */
}

.card:hover { transform: translateY(-5px); }

/* Estilos NUEVOS para los Iconos dentro de las tarjetas */
.card-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    display: block;
    margin: 0 auto 1.5rem auto; /* Margen automático a los lados para centrar */
}

.card h3 { margin-bottom: 1rem; color: var(--secondary); }
.card p { color: #555; font-size: 0.95rem; }

/* Apps Specific */
.apps-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* Home Page Specific */
.home-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* Force 3 columns even on smaller screens if requested "permanently", 
   but usually one would stack on mobile. User asked for "permanently". */
@media (max-width: 768px) {
    .apps-grid, .home-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
}

.app-card {
    background: white;
    border: 1px solid #eee;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.badge {
    background: var(--secondary);
    color: white;
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background-color: var(--primary);
    color: var(--text-dim);
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

footer a { color: var(--accent); text-decoration: none; }

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        background: var(--primary);
        position: absolute;
        top: 60px; /* Ajustar si el logo cambia la altura del header */
        left: 0;
        width: 100%;
        padding: 1rem;
        text-align: center;
    }
    .nav-links.active { display: flex; }
    .menu-toggle { display: block; }
    .hero h1 { font-size: 2rem; }
}
/* --- PRELOADER / PANTALLA DE CARGA --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary); /* Tu azul marino de fondo */
    z-index: 9999; /* Por encima de TODO (incluso del menú) */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease; /* Transición suave al desaparecer */
}

.loader-content {
    text-align: center;
    color: var(--accent); /* Color Cyan */
}

/* El círculo giratorio (Spinner) */
.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(100, 255, 218, 0.3); /* Cyan transparente */
    border-radius: 50%;
    border-top-color: var(--accent); /* Cyan sólido arriba */
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1rem auto; /* Centrado y espacio abajo */
}

.loader-content p {
    font-family: 'Courier New', monospace; /* Fuente tipo "código" */
    font-size: 0.9rem;
    letter-spacing: 2px;
    animation: pulse 1.5s infinite;
}

/* Animación de giro */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animación de parpadeo del texto */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Clase para ocultar el loader (se activa con JS) */
.loader-hidden {
    opacity: 0;
    visibility: hidden;
}