/* --- VARIABLES Y RESET --- */
:root {
    --primary-color: #3b82f6; 
    --primary-hover: #2563eb;
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --text-light: #64748b;
    --card-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* Evita scroll horizontal indeseado */
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- NAVEGACIÓN --- */
header {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Botón Hamburguesa Oculto por defecto */
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    color: var(--text-color);
    cursor: pointer;
}

/* --- HERO SECTION --- */
#hero {
    padding: 120px 0 80px;
    /* Capa oscura superpuesta + la imagen de fondo */
    background: linear-gradient(rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.85)), 
                url('https://images.unsplash.com/photo-1618761714954-0b8cd0026356?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 90vh;
    display: flex;
    align-items: center;
    text-align: center;
}

#hero .container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-text {
    max-width: 800px;
    margin: 0 auto;
}

#hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: #ffffff;
    line-height: 1.1;
}

#hero p {
    font-size: 1.2rem;
    color: #cbd5e1;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s, transform 0.2s;
    font-size: 1.1rem;
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* --- SECCIÓN DE APPS --- */
#apps {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 50px;
}

.apps-grid {
    display: grid;
    /* Grid automático y responsivo base */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.app-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    text-align: center;
}

.app-card:hover {
    transform: translateY(-5px);
}

.app-icon {
    width: 100px;
    height: 100px;
    border-radius: 22px;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.app-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.app-card p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.store-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.store-btn {
    background-color: #000;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    width: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s;
}

.store-btn:hover {
    opacity: 0.8;
}

/* --- SOBRE MÍ Y CONTACTO --- */
#about, #contact {
    padding: 80px 0;
    text-align: center;
}

#about {
    background-color: var(--card-bg);
}

.content-wrapper {
    max-width: 700px;
    margin: 0 auto;
}

.skills {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.skill-tag {
    background-color: #e2e8f0;
    color: #475569;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* --- REDES SOCIALES --- */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 55px;
    height: 55px;
    background-color: var(--card-bg);
    color: var(--text-color);
    border-radius: 50%;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, color 0.3s, background 0.3s, box-shadow 0.3s;
}

.social-links a:hover {
    transform: translateY(-5px);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.social-links a[aria-label="Facebook"]:hover { background-color: #1877F2; }
.social-links a[aria-label="Youtube"]:hover { background-color: #FF0000; }
.social-links a[aria-label="Instagram"]:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* --- FOOTER --- */
footer {
    background-color: #0f172a;
    color: #94a3b8;
    text-align: center;
    padding: 30px 20px;
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-color);
}

/* =========================================
   RESPONSIVIDAD (MEDIA QUERIES)
   ========================================= */

/* Tablets y Pantallas Medianas (Hasta 900px) */
@media (max-width: 900px) {
    #hero h1 { font-size: 2.8rem; }
    #hero p { font-size: 1.1rem; }
    
    /* Reducimos el padding general para no ocupar tanta pantalla */
    #apps, #about, #contact { padding: 60px 0; }
    .section-title { font-size: 2rem; margin-bottom: 40px; }
}

/* Dispositivos Móviles (Hasta 768px) */
@media (max-width: 768px) {
    /* 1. Activar el Menú Hamburguesa */
    .menu-toggle { display: block; }

    /* 2. Ocultar enlaces y convertirlos en menú desplegable */
    .nav-links {
        position: absolute;
        top: 70px; /* Debajo del header */
        left: 0;
        width: 100%;
        background-color: var(--card-bg);
        flex-direction: column;
        align-items: center;
        gap: 0;
        box-shadow: 0 10px 10px rgba(0,0,0,0.05);
        
        /* Efecto de despliegue */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
    }

    /* Clase activa insertada por JavaScript */
    .nav-links.active {
        max-height: 300px;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 15px 0;
        border-bottom: 1px solid #f1f5f9;
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    /* 3. Ajustar textos e imágenes */
    #hero h1 { font-size: 2.2rem; }
    .section-title { font-size: 1.8rem; }
    
    /* 4. Forzar apps a 1 sola columna en móviles pequeños */
    .apps-grid {
        grid-template-columns: 1fr; 
        gap: 30px;
    }
}

/* Dispositivos Móviles Pequeños (Hasta 480px) */
@media (max-width: 480px) {
    #hero h1 { font-size: 1.8rem; }
    
    /* Botones ocupan el ancho completo de la pantalla para facilitar tocarlos */
    .btn, .store-btn { 
        width: 100%; 
        text-align: center;
    }
    
    .social-links a {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}