/* ============================================
   MEGA360 - Landing Page Styles
   Dark Mode | Tecnológico | Profesional
   ============================================ */

/* CSS Variables */
:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --accent-primary: #00e5ff;
    --accent-secondary: #7c3aed;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glow-primary: 0 0 40px rgba(0, 229, 255, 0.3);
    --glow-secondary: 0 0 40px rgba(124, 58, 237, 0.3);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Glitch effect en hover */
.text-glitch {
    position: relative;
}

.text-glitch:hover {
    animation: glitch 0.3s ease;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(2px, 2px); }
    100% { transform: translate(0); }
}

.text-accent {
    color: var(--accent-primary) !important;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 0;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(11, 15, 25, 0.95);
}

.navbar-brand {
    font-size: 1.5rem;
    color: var(--text-primary) !important;
    transition: var(--transition);
}

.navbar-brand:hover {
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.6));
}

.brand-accent {
    color: var(--accent-primary);
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--accent-primary) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.navbar-toggler {
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.3);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--accent-primary), #00b8d4);
    border: none;
    color: var(--bg-primary) !important;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.3);
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 30px rgba(0, 229, 255, 0.5),
        0 0 40px rgba(0, 229, 255, 0.2);
    color: var(--bg-primary) !important;
}


.btn-outline-custom {
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary) !important;
    background: transparent;
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-custom:hover {
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent-primary) !important;
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    position: relative;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

/* Grid Overlay - Doble capa tecnológica */
.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 229, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 70%);
    animation: gridPulse 4s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Hexagon Grid - Patrón tecnológico */
.hexagon-grid {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 56 98'%3E%3Cpath fill='none' stroke='rgba(0,229,255,0.04)' stroke-width='0.5' d='M28 0l28 14v28l-28 14-28-14V14z'/%3E%3C/svg%3E");
    background-size: 56px 98px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 10%, transparent 60%);
    opacity: 0.8;
}

/* Scan Line - Efecto radar/terminal */
.scan-line {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 229, 255, 0.03) 50%,
        transparent 100%
    );
    background-size: 100% 200px;
    animation: scanMove 3s linear infinite;
    pointer-events: none;
}

@keyframes scanMove {
    0% { background-position: 0 -200px; }
    100% { background-position: 0 100vh; }
}

/* Noise Overlay - Textura digital */
.noise-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* Floating Lines - Líneas futuristas */
.floating-lines {
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(90deg, transparent 49%, rgba(0, 229, 255, 0.1) 50%, transparent 51%);
    background-size: 100% 2px;
    animation: lineFloat 20s linear infinite;
    mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 30%, transparent 70%);
    opacity: 0.5;
}

@keyframes lineFloat {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Glow Orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 8s ease-in-out infinite;
}

.glow-orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-primary);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.glow-orb-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-secondary);
    bottom: -50px;
    left: -50px;
    animation-delay: -4s;
}

.glow-orb-3 {
    width: 200px;
    height: 200px;
    background: var(--accent-primary);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.15;
    animation: orbPulse 4s ease-in-out infinite;
}

@keyframes orbPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.15; }
    50% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.25; }
}

/* Mouse Glow - Sigue el cursor */
.mouse-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
}

/* Data Stream - Código cayendo */
.data-stream {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

/* Hero Content */
.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-down {
    display: inline-flex;
    color: var(--text-secondary);
    font-size: 1.5rem;
    animation: bounce 2s ease-in-out infinite;
    transition: color var(--transition);
}

.scroll-down:hover {
    color: var(--accent-primary);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* Animations */
.animate-fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   SECTIONS
   ============================================ */
.section-padding {
    padding: 6rem 0;
}

.section-alt {
    background-color: var(--bg-secondary);
}

/* Section Tech Background - Grid sutil en secciones */
.section-tech-bg {
    position: relative;
    overflow: hidden;
}

.section-tech-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 229, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.02) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
}

.section-header {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.section-header .section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
    opacity: 0.8;
}

#que-hacemos .section-title::after {
    left: 0;
    transform: none;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ============================================
   SERVICE CARDS
   ============================================ */
.service-card {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 2rem;
    height: 100%;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.service-card:hover {
    border-color: rgba(0, 229, 255, 0.3);
    transform: translateY(-8px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(0, 229, 255, 0.15);
}

.service-card:hover::before {
    transform: scaleX(1);
}

/* Borde inferior con gradiente en hover */
.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), var(--accent-secondary), transparent);
    transform: scaleX(0);
    transform-origin: center;
    transition: var(--transition);
}

.service-card:hover::after {
    transform: scaleX(1);
}

.service-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 229, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
    color: var(--accent-primary);
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: rgba(0, 229, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

.service-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.service-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* ============================================
   ECOSYSTEM / QUÉ HACEMOS
   ============================================ */
.ecosystem-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ecosystem-list li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.05rem;
}

.ecosystem-list li i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Ecosystem Visual */
.ecosystem-visual {
    position: relative;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ecosystem-connections {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.ecosystem-node {
    position: absolute;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.ecosystem-node i {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.ecosystem-node:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
    transform: scale(1.05);
}

.node-center {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(124, 58, 237, 0.15));
    border-color: var(--accent-primary);
    color: var(--text-primary);
    font-weight: 600;
    z-index: 2;
}

.node-center i {
    font-size: 2rem;
}

.node-1 { top: 10%; left: 10%; }
.node-2 { top: 10%; right: 10%; }
.node-3 { bottom: 20%; left: 5%; }
.node-4 { bottom: 20%; right: 5%; }
.node-5 { bottom: 5%; left: 50%; transform: translateX(-50%); }

/* ============================================
   TECH BADGES
   ============================================ */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.tech-badge {
    padding: 1rem 1.5rem;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.tech-badge {
    position: relative;
}

.tech-badge:hover {
    border-color: rgba(0, 229, 255, 0.4);
    color: var(--accent-primary);
    box-shadow: 
        0 0 25px rgba(0, 229, 255, 0.2),
        inset 0 0 20px rgba(0, 229, 255, 0.05);
    transform: scale(1.05);
}

/* ============================================
   PROCESS CARDS
   ============================================ */
.process-card {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 2rem;
    height: 100%;
    transition: var(--transition);
    position: relative;
}

.process-card:hover {
    border-color: rgba(124, 58, 237, 0.4);
    transform: translateY(-8px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(124, 58, 237, 0.2);
}

.process-number {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    opacity: 0.8;
    animation: numberPulse 2s ease-in-out infinite;
}

@keyframes numberPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.5)); }
}

.process-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.process-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* ============================================
   ADVANTAGE CARDS
   ============================================ */
.advantage-card {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 2rem;
    height: 100%;
    transition: var(--transition);
    text-align: center;
}

.advantage-card:hover {
    border-color: rgba(0, 229, 255, 0.3);
    transform: translateY(-8px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(0, 229, 255, 0.15);
}

.advantage-icon {
    font-size: 2.5rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    display: block;
    transition: var(--transition);
}

.advantage-card:hover .advantage-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.5));
}

.advantage-title {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.advantage-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.05), rgba(124, 58, 237, 0.05));
    pointer-events: none;
}

.cta-block {
    position: relative;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(11, 15, 25, 0.95));
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 24px;
    padding: 4rem 2rem;
    box-shadow: 
        0 0 60px rgba(0, 229, 255, 0.15),
        inset 0 0 60px rgba(0, 229, 255, 0.02);
    overflow: hidden;
}

.cta-block > * {
    position: relative;
    z-index: 1;
}

.cta-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
}

.cta-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-brand {
    font-size: 1.5rem;
    color: var(--text-primary) !important;
    text-decoration: none;
}

.footer-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2rem;
    justify-content: flex-end;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ============================================
   PARTICLES (JS-generated)
   ============================================ */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0.5;
    animation: particleFloat 15s linear infinite;
}

.particle-line {
    position: absolute;
    width: 1px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, var(--accent-primary), transparent);
    opacity: 0.3;
    animation: particleFloat 12s linear infinite;
}

.data-char {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-primary);
    opacity: 0.15;
    animation: dataFall 8s linear infinite;
    pointer-events: none;
}

@keyframes dataFall {
    0% { transform: translateY(-100px); opacity: 0; }
    5% { opacity: 0.15; }
    95% { opacity: 0.15; }
    100% { transform: translateY(100vh); opacity: 0; }
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .section-padding {
        padding: 4rem 0;
    }
    
    .footer-links {
        justify-content: flex-start;
    }
    
    .ecosystem-visual {
        height: 280px;
    }
    
    .ecosystem-node {
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
    }
    
    .ecosystem-node i {
        font-size: 1.25rem;
    }
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem;
    }
    
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ecosystem-visual {
        height: 250px;
    }
}

@media (max-width: 575.98px) {
    .navbar-collapse {
        background: rgba(17, 24, 39, 0.98);
        padding: 1rem;
        margin-top: 1rem;
        border-radius: 12px;
    }
}
