/* ===================================== */
/* 0. ROOT VARIABLES & BASE STYLES       */
/* ===================================== */
:root {
    /* Colors - Futurista Oscuro con Degradados */
    --color-primary: #8A2BE2; /* Un púrpura vibrante, punto de partida */
    --color-primary-hover: #9932CC; /* Un poco más oscuro para el hover */
    --color-primary-active: #6A0DAD; /* Aún más oscuro para el active */
    --color-accent: #00ffff; /* Cian eléctrico para acentos */
    --color-accent-hover: #00cccc;
    --color-accent-active: #009999;

    /* Fondo principal: gradiente oscuro */
    --color-bg: #0A0A10; /* Casi negro, muy oscuro */
    /* Superficie para tarjetas y elementos destacados: gradiente o color oscuro */
    --color-surface: #1A1A2E; /* Azul marino muy oscuro / gris azulado */

    --color-muted: #7F8C8D; /* Gris suave para texto secundario */
    --color-text: #E0E0E0; /* Blanco roto para texto principal en fondos oscuros */
    --color-white: #ffffff; /* Blanco puro, para elementos muy específicos */
    --color-light-bg: #fdfdfd; /* Mantengo este por si se usa en algún componente específico que deba ser claro, pero se usará menos */
    --color-success: #28A745; /* Verde estándar para éxito, se puede futurizar si se desea */

    /* Typography */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-size-base: 1rem; /* 16px */
    --line-height-base: 1.6;

    /* Spacing Scale */
    --spacing-xs: 0.25rem; /* 4px */
    --spacing-sm: 0.5rem;  /* 8px */
    --spacing-md: 1rem;    /* 16px */
    --spacing-lg: 1.5rem;  /* 24px */
    --spacing-xl: 2rem;    /* 32px */
    --spacing-xxl: 3rem;   /* 48px */
    --spacing-xxxl: 4rem;  /* 64px */

    /* Border Radius */
    --border-radius-base: 12px;

    /* Shadows - Más sutiles en fondos oscuros */
    --shadow-default: 0 5px 15px rgba(0,0,0,0.4);
}

body {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text); /* Texto principal ahora blanco roto */
    /* Usamos un gradiente para el fondo del body */
    background: linear-gradient(180deg, var(--color-bg) 0%, #000000 100%);
    background-attachment: fixed; /* Para que el gradiente se mantenga fijo al scroll */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-accent); /* Los títulos resaltan con el cian eléctrico */
    line-height: 1.2;
}
h1, h2 {
    font-weight: 800; /* Extra-bold for headings */
}
h3 {
    font-weight: 700;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: var(--color-accent); /* Al hacer hover, cambian al color acento */
}

/* Bootstrap Overrides / Custom Utilities */
.btn-primary {
    /* Gradiente para los botones primarios */
    background: linear-gradient(45deg, var(--color-primary), var(--color-accent));
    border: none; /* Quitamos el borde para un look más limpio con gradiente */
    border-radius: var(--border-radius-base);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-weight: 600;
    transition: all 0.2s ease;
    color: var(--color-white); /* Aseguramos texto blanco en gradiente */
}
.btn-primary:hover {
    background: linear-gradient(45deg, var(--color-primary-hover), var(--color-accent-hover)); /* Gradiente de hover */
    transform: scale(1.04); /* Micro-interaction */
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5); /* Sombra futurista al hover */
}
.btn-primary:active {
    background: linear-gradient(45deg, var(--color-primary-active), var(--color-accent-active)) !important;
    transform: scale(0.98);
}
.btn-outline-light {
    border-color: var(--color-accent); /* Borde cian */
    color: var(--color-accent);
    border-radius: var(--border-radius-base);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-outline-light:hover {
    background-color: var(--color-accent);
    color: var(--color-bg); /* Texto oscuro en fondo acento */
    transform: scale(1.04);
}
.btn-outline-primary {
    border-color: var(--color-primary);
    color: var(--color-primary);
    border-radius: var(--border-radius-base);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-outline-primary:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
    transform: scale(1.04);
}

/* Fondos ajustados al nuevo esquema */
.bg-bg {
    background-color: var(--color-bg);
}
.bg-light-bg {
    background-color: var(--color-surface); /* light-bg se convierte en surface oscura */
}
.bg-surface {
    background-color: var(--color-surface);
}
.text-primary { color: var(--color-primary) !important; }
.text-accent { color: var(--color-accent) !important; }
.text-muted { color: var(--color-muted) !important; }
.text-white-50 { color: rgba(255, 255, 255, 0.7) !important; }

/* Spacing Helpers (SCSS-like, but in CSS) */
/* Example: .py-8 for padding-top/bottom 64px, .mb-7 for margin-bottom 48px */
.py-lg-8 { padding-top: var(--spacing-xxxl) !important; padding-bottom: var(--spacing-xxxl) !important; }
.mb-lg-7 { margin-bottom: var(--spacing-xxl) !important; }

/* Form Controls */
.form-control {
    border-radius: var(--border-radius-base);
    border: 1px solid rgba(255, 255, 255, 0.15); /* Borde claro en fondo oscuro */
    background-color: var(--color-surface); /* Fondo del input oscuro */
    color: var(--color-text); /* Texto del input claro */
    padding: var(--spacing-sm) var(--spacing-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control::placeholder { /* Color del placeholder */
    color: var(--color-muted);
}
.form-control:focus {
    border-color: var(--color-accent); /* Borde acento al enfocar */
    box-shadow: 0 0 0 0.25rem rgba(0, 255, 255, 0.25); /* Sombra acento al enfocar */
    background-color: var(--color-surface); /* Mantener fondo oscuro */
    color: var(--color-text); /* Mantener texto claro */
}


/* ===================================== */
/* 1. HEADER & NAVBAR                  */
/* ===================================== */
#main-header {
    background-color: transparent;
    transition: all 0.3s ease-in-out;
    z-index: 1030;
}
#main-header.scrolled {
    background-color: rgba(10, 10, 16, 0.9); /* Fondo oscuro semitransparente al scroll */
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-default);
    padding-top: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
}
#main-header .navbar-brand img {
    height: 40px;
    transition: height 0.3s ease;
    /* Considera añadir un filtro para que el logo se vea bien en fondos oscuros si no es ya blanco */
    /* filter: brightness(0) invert(1) drop-shadow(0 0 5px rgba(0,255,255,0.5)); */
}
#main-header.scrolled .navbar-brand img {
    height: 32px;
}

#main-header .navbar-nav .nav-link {
    color: var(--color-text); /* Texto claro por defecto */
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    position: relative;
    transition: color 0.3s ease;
}
#main-header.scrolled .navbar-nav .nav-link {
    color: var(--color-text); /* Sigue siendo claro al scroll */
}
#main-header .navbar-nav .nav-link:hover {
    color: var(--color-accent);
}
#main-header .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--color-accent);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}
#main-header .navbar-nav .nav-link:hover::after,
#main-header .navbar-nav .nav-link.active::after {
    width: 70%;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28224, 224, 224, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); /* Icono blanco/claro */
}
#main-header.scrolled .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28224, 224, 224, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); /* Mismo icono claro */
}

/* Mobile Nav Overlay (example, GSAP handles animation) */
.navbar-collapse {
    transition: all 0.3s ease;
}
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--color-bg); /* Fondo oscuro para el menú móvil */
        box-shadow: -5px 0 15px rgba(0,0,0,0.4);
    }
    .navbar-collapse .nav-link {
        color: var(--color-white);
    }
    .navbar-backdrop {
        background-color: rgba(0, 0, 0, 0.7); /* Fondo más oscuro para el backdrop */
    }
}


/* ===================================== */
/* 2. HERO SECTION                     */
/* ===================================== */
.hero-section {
    min-height: 100vh;
    padding-top: 120px;
    padding-bottom: 80px;
    /* Gradiente futurista para el hero */
    background: linear-gradient(135deg, var(--color-primary) 0%, #00FFFF 50%, #8A2BE2 100%);
    overflow: hidden;
    color: var(--color-white);
    position: relative; /* Asegura que el before y el after se posicionen correctamente */
}
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Patrón sutil en el fondo */
    background-image: url('data:image/svg+xml;utf8,<svg width="100%" height="100%" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 L 0 0 L 0 10" fill="none" stroke="rgba(255,255,255,0.08)" stroke-width="0.5"/></pattern><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.6; /* Un poco más visible */
    z-index: 0;
}
/* Añadimos un pseudo-elemento para un efecto de brillo sutil en el hero */
.hero-section::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(0,255,255,0.1) 0%, transparent 70%);
    opacity: 0.5;
    z-index: 0;
    animation: pulse-glow 10s infinite alternate; /* Animación de brillo */
}
@keyframes pulse-glow {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.1); opacity: 0.7; }
}

.hero-section .container {
    position: relative;
    z-index: 1;
}
.hero-mockup img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.6)); /* Sombra más pronunciada en oscuro */
    will-change: transform, opacity;
}


/* ===================================== */
/* 3. SOLUTIONS SECTION                */
/* ===================================== */
#solutions {
    color: var(--color-text);
    background-color: var(--color-bg); /* Fondo oscuro para esta sección */
}
.solution-card {
    background: linear-gradient(145deg, var(--color-surface) 0%, #2A2A4E 100%); /* Gradiente en tarjetas */
    border-radius: var(--border-radius-base);
    box-shadow: var(--shadow-default);
    transition: all 0.3s ease;
    border: none;
    will-change: transform, box-shadow;
    color: var(--color-text); /* Texto claro en la tarjeta */
}
.solution-card:hover {
    transform: translateY(-5px) rotateZ(-1deg);
    box-shadow: 0 12px 30px rgba(0, 255, 255, 0.2); /* Sombra de acento al hover */
}
.solution-card .card-icon {
    font-size: 3rem;
    color: var(--color-accent); /* Iconos en color acento */
    line-height: 1;
}
.solution-card .card-icon img {
    filter: drop-shadow(0 4px 8px rgba(0, 255, 255, 0.4)); /* Sombra acento en iconos */
}


/* ===================================== */
/* 4. MODULAR SYSTEM SECTION           */
/* ===================================== */
#modules {
    color: var(--color-text); /* Texto principal claro */
    background: linear-gradient(180deg, var(--color-bg) 0%, #000000 100%); /* Mismo gradiente que el body */
    padding: var(--spacing-xxxl) 0; /* Aseguramos espacio */
}
#modules h2, #modules h3 {
    color: var(--color-accent); /* Títulos en color acento */
}
.module-item {
    padding: var(--spacing-xxl) 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.module-item:last-child {
    border-bottom: none;
}
.module-number {
    display: block;
    font-size: clamp(2.5rem, 5vw, 4rem);
    opacity: 0.8; /* Más opaco */
    margin-bottom: var(--spacing-sm);
    color: var(--color-primary); /* Número en color primario */
    will-change: transform, opacity;
}
.module-item img {
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.6));
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--border-radius-base); /* Bordes redondeados para imágenes */
}


/* ===================================== */
/* 5. APPS SECTION                     */
/* ===================================== */
#apps {
    background-color: var(--color-surface); /* Fondo oscuro */
    padding: var(--spacing-xxxl) 0;
}
#apps h2 {
    color: var(--color-accent);
}
#appCarousel .carousel-item {
    padding: var(--spacing-xxl) 0;
}
#appCarousel .carousel-item img {
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.5s ease-in-out;
    border-radius: var(--border-radius-base); /* Bordes redondeados para imágenes */
}
#appCarousel .carousel-control-prev,
#appCarousel .carousel-control-next {
    width: 5%;
    color: var(--color-accent);
    opacity: 0.9;
}
#appCarousel .carousel-control-prev-icon,
#appCarousel .carousel-control-next-icon {
    background-image: none;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.5); /* Sombra brillante */
}
#appCarousel .carousel-control-prev-icon::before { content: "\f053"; font-family: "Font Awesome 6 Free"; font-weight: 900; color: var(--color-white); }
#appCarousel .carousel-control-next-icon::before { content: "\f054"; font-family: "Font Awesome 6 Free"; font-weight: 900; color: var(--color-white); }

#appCarousel .carousel-indicators button {
    background-color: var(--color-accent); /* Indicadores acento */
    border-radius: 50%;
    width: 10px;
    height: 10px;
    margin: 0 5px;
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#appCarousel .carousel-indicators button.active {
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 0 8px var(--color-accent); /* Brillo al activo */
}


/* ===================================== */
/* 6. IMPACT / NUMBERS SECTION         */
/* ===================================== */
.impact-card {
    background: linear-gradient(145deg, var(--color-surface), #2A2A4E); /* Gradiente */
    border-radius: var(--border-radius-base);
    box-shadow: var(--shadow-default);
    color: var(--color-text);
}
.impact-card h3 {
    color: var(--color-accent); /* Títulos en acento */
}
.counter-value {
    color: var(--color-primary); /* Números en primario */
    will-change: contents;
}


/* ===================================== */
/* 7. TESTIMONIALS SECTION             */
/* ===================================== */
.testimonial-section {
    background: var(--color-bg); /* Fondo oscuro */
    color: var(--color-text);
    padding: var(--spacing-xxxl) 0;
}
.testimonial-card {
    background: linear-gradient(145deg, var(--color-surface), #2A2A4E); /* Gradiente */
    border-radius: var(--border-radius-base);
    box-shadow: var(--shadow-default);
    will-change: transform, opacity;
    color: var(--color-text);
}
.testimonial-card img {
    border: 3px solid var(--color-accent); /* Borde acento */
}
#testimonialCarousel .carousel-control-prev-icon,
#testimonialCarousel .carousel-control-next-icon {
    background-color: var(--color-primary-hover); /* Controles en tono primario */
}
#testimonialCarousel .carousel-indicators button {
    background-color: var(--color-primary);
}


/* ===================================== */
/* 8. BLOG / RESOURCES SECTION         */
/* ===================================== */
#blog {
    background: linear-gradient(180deg, var(--color-bg) 0%, #000000 100%); /* Fondo gradiente */
    padding: var(--spacing-xxxl) 0;
}
#blog h2 {
    color: var(--color-accent);
}
.blog-card {
    background: linear-gradient(145deg, var(--color-surface) 0%, #2A2A4E 100%); /* Gradiente en tarjetas */
    color: var(--color-text);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform, box-shadow;
    border-radius: var(--border-radius-base);
    overflow: hidden; /* Para que la imagen respete el border-radius */
}
.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 255, 255, 0.2); /* Sombra acento al hover */
}
.blog-card .card-img-top {
    border-top-left-radius: var(--border-radius-base);
    border-top-right-radius: var(--border-radius-base);
    height: 250px;
    object-fit: cover;
    filter: brightness(0.8) contrast(1.2); /* Oscurecer y contrastar imágenes */
}
.blog-card .card-title {
    color: var(--color-accent); /* Títulos en acento */
}
.blog-card .card-text {
    color: var(--color-muted) !important;
}
.blog-card a {
    color: var(--color-primary);
}
.blog-card a:hover {
    color: var(--color-accent);
}


/* ===================================== */
/* 9. CONTACT SECTION                  */
/* ===================================== */
#contact {
    background-color: var(--color-bg); /* Fondo oscuro */
    padding: var(--spacing-xxxl) 0;
}
#contact h2 {
    color: var(--color-accent);
}
#contactForm {
    background: linear-gradient(145deg, var(--color-surface) 0%, #2A2A4E 100%); /* Gradiente en formulario */
    border-radius: var(--border-radius-base);
    box-shadow: var(--shadow-default);
    color: var(--color-text);
    padding: var(--spacing-xxl);
}
#form-feedback.success {
    color: var(--color-success);
}
#form-feedback.error {
    color: #dc3545; /* Bootstrap danger color */
}

/* WhatsApp Floating Button */
.whatsapp-btn {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    background-color: #25d366; /* WhatsApp green */
    color: var(--color-white);
    width: var(--spacing-xxl);
    height: var(--spacing-xxl);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 1000;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: whatsapp-pulse 2s infinite;
}
.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.6);
}

@keyframes whatsapp-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}


/* ===================================== */
/* 10. FOOTER                          */
/* ===================================== */
.footer {
    background: linear-gradient(180deg, #000000 0%, var(--color-bg) 100%); /* Gradiente inverso */
    color: var(--color-text);
    padding: var(--spacing-xxl) 0;
}
.footer .list-unstyled a {
    color: var(--color-muted);
}
.footer .list-unstyled a:hover {
    color: var(--color-accent); /* Hover en acento */
}
.footer .social-icons a {
    color: var(--color-white);
    font-size: 1.4rem;
    transition: color 0.3s ease;
}
.footer .social-icons a:hover {
    color: var(--color-accent);
}
.footer .fab.fa-google-play {
    color: var(--color-white);
    transition: color 0.3s ease;
}
.footer .fab.fa-google-play:hover {
    color: var(--color-accent);
}
.footer .text-muted {
    color: rgba(224,224,224,0.6) !important; /* Texto más claro */
}

/* Cookie Banner */
.cookie-banner {
    background-color: rgba(10, 10, 16, 0.95); /* Fondo muy oscuro */
    color: var(--color-white);
    box-shadow: 0 -5px 15px rgba(0,0,0,0.4);
}

/* Utility for will-change property on animated elements */
.will-change-transform { will-change: transform; }
.will-change-opacity { will-change: opacity; }
.will-change-contents { will-change: contents; } /* For counters */

/* Responsive Adjustments */
@media (max-width: 767.98px) {
    .hero-section {
        text-align: center;
        padding-top: 90px;
        padding-bottom: 60px;
    }
    .hero-ctas {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .hero-ctas .btn {
        width: 80%;
        margin-bottom: var(--spacing-md);
    }
    .py-lg-8 { padding-top: var(--spacing-xxl) !important; padding-bottom: var(--spacing-xxl) !important; }
    .mb-lg-7 { margin-bottom: var(--spacing-xl) !important; }

    .solution-card {
        margin-bottom: var(--spacing-md);
    }
    .module-item img {
        margin-bottom: var(--spacing-md);
    }
    .impact-card {
        margin-bottom: var(--spacing-md);
    }
    .blog-card {
        margin-bottom: var(--spacing-md);
    }
}