/* 1. Variables y Reset */
:root {
    --bg-color: #050a07;         /* Negro verdoso muy oscuro */
    --card-bg: rgba(20, 30, 25, 0.7); /* Vidrio oscuro */
    --primary: #00ff88;          /* Verde Neón vibrante */
    --secondary: #10b981;        /* Verde esmeralda */
    --text-main: #e0e0e0;        /* Blanco hueso */
    --text-muted: #a0a0a0;
    --font-mono: 'Courier New', Courier, monospace; /* Estilo código */
    --font-sans: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow-x: hidden;
}

/* 2. Fondo Canvas */
#canvas-network {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1; 
    opacity: 0.4;
}

/* 3. Navegación */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(5, 10, 7, 0.95); /* Más opaco para leer mejor */
    backdrop-filter: blur(10px);
    z-index: 2000; 
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
    max-width: 70%;
    line-height: 1.2;
}

.logo span { color: white; }

/* Enlaces del menú*/
.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover { color: var(--primary); }

.menu-toggle {
    display: none; /* Oculto en PC */
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

.btn-contact {
    border: 1px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.btn-contact:hover {
    background: var(--primary);
    color: var(--bg-color) !important;
}

/* 4. Hero Section */
.hero {
    min-height: 100vh; /* min-height es mejor para celular */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px 0; /* Padding top para que no choque con el navbar */
}

.hero h1 {
    font-size: 3.5rem; 
    margin: 1.5rem 0;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -1px;
    max-width: 900px;
}

.highlight {
    color: var(--primary);
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.terminal-text {
    font-family: var(--font-mono);
    color: var(--secondary);
    font-size: 0.9rem;
}

#typing-text {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 1.5rem;
    min-height: 1.5em; 
}

.hero-desc {
    max-width: 600px;
    margin: 1.5rem auto;
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Botones */
.btn {
    padding: 0.8rem 2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    margin: 0.5rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-color);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 0 25px rgba(0, 255, 136, 0.5); }

.btn-outline {
    border: 2px solid var(--text-main);
    color: var(--text-main);
}

.btn-outline:hover { background: var(--text-main); color: var(--bg-color); }

/* 5. Servicios (Grid) */
.section-padding { padding: 5rem 10%; }

.section-title {
    font-family: var(--font-mono);
    font-size: 2rem;
    margin-bottom: 3rem;
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
}

.grid-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Un poco más ancho */
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    transition: 0.3s;
    cursor: pointer;
}

.card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.card h3 { margin-bottom: 1rem; font-family: var(--font-mono); }
.card p { color: var(--text-muted); font-size: 0.9rem; }

/* Acordeón */
.toggle-icon {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.card-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    width: 100%; /* Asegurar ancho */
}

.card.active {
    border-color: var(--primary);
    background: rgba(20, 30, 25, 0.95);
}

.card.active .toggle-icon {
    transform: rotate(180deg);
    color: var(--primary);
}

.service-details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    list-style: none;
    transition: all 0.4s ease-out;
    margin-top: 0;
    border-top: 1px solid transparent;
}

.service-details li {
    font-size: 0.9rem;
    color: var(--text-main);
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-details li i { color: var(--primary); font-size: 0.8rem; }

.card.active .service-details {
    max-height: 500px;
    opacity: 1;
    margin-top: 1rem;
    padding-top: 1rem;
}

/* 6. Enfoque / Nosotros */
.about {
    background: linear-gradient(to right, var(--bg-color), #08100c);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h3 { font-size: 1.8rem; margin-bottom: 1.5rem; color: white; }
.about-text p { color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.7; }

.stats-grid {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.stat-number { font-family: var(--font-mono); color: var(--primary); font-size: 1.5rem; font-weight: bold; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

.code-block {
    background: #000;
    padding: 2rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.line { margin-bottom: 0.5rem; color: #abb2bf; }
.indent { margin-left: 1.5rem; }
.indent2 { margin-left: 3rem; }
.var { color: #c678dd; } .func { color: #61afef; } .str { color: #98c379; } .op { color: #56b6c2; }

/* 7. Contacto */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Por defecto 2 columnas */
    gap: 4rem;
}

.contact-info h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    font-size: 1.1rem;
}
.info-item i { color: var(--primary); }

.social-links { margin-top: 2rem; }
.social-links i {
    font-size: 3rem;
    color: var(--text-main);
    transition: all 0.3s;
    display: inline-block;
}
.social-links a:hover i {
    color: #0A66C2;
    transform: scale(1.15) translateY(-5px);
}

/* Mapa */
.map-column {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.map-title {
    font-family: var(--font-mono);
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.map-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

#map {
    width: 100%;
    height: 350px;
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 136, 0.3);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    z-index: 100; /* Menor que el navbar */
}

footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: -1.5rem;   
    margin-bottom: 3.5rem; 
    display: block;        
    opacity: 0.8;
}

/* Ajustar el título para que no quede pegado al subtítulo */
.section-title {
    margin-bottom: 2rem;   /* Espacio entre el título y el subtítulo */
}

/* =========================================
    MEDIA QUERIES
   ========================================= */

@media (max-width: 900px) {
    .section-padding { padding: 3rem 6%; }

    /* 1. Navegación Móvil */
    .menu-toggle { 
        display: block; 
        z-index: 2001;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: fixed; /* Cambiado a fixed para cubrir pantalla */
        top: -100%; /* Escondido arriba */
        left: 0;
        width: 100%;
        height: auto;
        background: rgba(5, 10, 7, 0.98);
        padding: 4rem 2rem 2rem 2rem;
        transition: 0.4s ease-in-out;
        border-bottom: 2px solid var(--primary);
        gap: 2rem;
        z-index: 1999;
    }

    .nav-links.active {
        top: 0; /* Desliza hacia abajo */
    }

    /* 2. Hero ajustado */
    .hero { padding-top: 120px; }
    .hero h1 { font-size: 2rem; }
    #typing-text { font-size: 1.1rem; }
    .cta-group { display: flex; flex-direction: column; align-items: center; }
    .btn { width: 80%; margin: 0.5rem 0; }

    /* 3. Reajuste de Grillas (Enfoque y Contacto) */
    .about-grid, 
    .contact-wrapper {
        grid-template-columns: 1fr !important; /* Forzamos una columna */
        gap: 2.5rem;
    }

    .about-visual { order: -1; } /* El visual va arriba en móvil */
    .code-block { 
        display: block; /* Lo reactivamos pero ajustado */
        font-size: 0.8rem;
        padding: 1rem;
        overflow-x: hidden;
    }

    /* 4. Mapa y Contacto */
    .contact-info { text-align: center; }
    .info-item { justify-content: center; }
    
    #map { 
        height: 300px; 
        width: 100%;
        margin-top: 1rem;
    }

    
}

.loading-bar::before {
  content: "░░░░░░░░";
  animation: loading 3s ease-in-out infinite;
}

@keyframes loading {
  0% { content: "░░░░░░░░"; }
  25% { content: "██░░░░░░"; }
  50% { content: "████░░░░"; }
  75% { content: "██████░░"; }
  100% { content: "████████"; }
}

/* Para el porcentaje necesitas usar counter o JavaScript */
.loading-percent::before {
  content: "0%";
  animation: percent 3s ease-in-out infinite;
}

@keyframes percent {
  0% { content: "0%"; }
  25% { content: "25%"; }
  50% { content: "50%"; }
  75% { content: "75%"; }
  100% { content: "100%"; }
}