:root {
    --tech-bg: #050505;
    --tech-card-bg: rgba(20, 20, 20, 0.6);
    --tech-text-primary: #FFFFFF;
    --tech-text-secondary: #A0A0A0;
    --tech-border: rgba(255, 255, 255, 0.08);
    --tech-accent: #4A90E2;
    --tech-accent-glow: rgba(74, 144, 226, 0.4);
    --gradient-text: linear-gradient(135deg, #4A90E2 0%, #00F2FF 100%);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--tech-bg);
    background-image:
        linear-gradient(rgba(74, 144, 226, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74, 144, 226, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    color: var(--tech-text-secondary);
    overflow-x: hidden;
}


/* --- GLOBAL SCROLLBAR & SELECTION --- */
::-webkit-scrollbar {
    width: 10px;
    background: #111;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
    border: 2px solid #111;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--tech-accent);
}

::selection {
    background: var(--tech-accent);
    color: #fff;
}

/* --- ACCESSIBILITY FOCUS & MOTION --- */
:focus-visible {
    outline: 2px solid var(--tech-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- PRELOADER --- */
#preloader {
    position: fixed;
    inset: 0;
    background-color: #000;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(74, 144, 226, 0.2);
    border-top-color: var(--tech-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loader-text {
    font-family: 'Inter', monospace;
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--tech-accent);
    animation: pulse 1.5s infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* --- ANIMACIÓN EXTRA PARA CONTADORES --- */
@keyframes numberPop {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.3);
        filter: brightness(2) drop-shadow(0 0 15px var(--tech-accent));
        color: #fff;
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
        color: inherit;
    }
}

.counter.landed {
    animation: numberPop 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* --- CURSOR --- */
@media (min-width: 1024px) {
    body {
        cursor: none;
    }

    a,
    button,
    input,
    textarea,
    summary,
    .card,
    .whatsapp-btn {
        cursor: none;
    }

    #custom-cursor {
        position: fixed;
        top: 0;
        left: 0;
        width: 20px;
        height: 20px;
        border: 2px solid var(--tech-accent);
        background-color: rgba(74, 144, 226, 0.1);
        border-radius: 50%;
        pointer-events: none;
        z-index: 9999;
        transform: translate(-50%, -50%);
        transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s;
        box-shadow: 0 0 10px var(--tech-accent-glow);
        mix-blend-mode: screen;
    }

    body:has(a:hover) #custom-cursor,
    body:has(button:hover) #custom-cursor,
    body:has(.card:hover) #custom-cursor,
    body:has(input:hover) #custom-cursor,
    body:has(.whatsapp-btn:hover) #custom-cursor {
        width: 50px;
        height: 50px;
        background-color: rgba(74, 144, 226, 0.3);
        border-color: #fff;
        box-shadow: 0 0 20px var(--tech-accent);
    }
}

/* --- WHATSAPP --- */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s;
    animation: pulse-green 2s infinite;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* --- VIDEO DE FONDO --- */
.video-background {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -99;
    overflow: hidden;
    background-color: #000;
}

#bg-video-file {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0.4;
    filter: contrast(1.1) grayscale(100%);
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(5, 5, 5, 0.3) 0%, rgba(0, 0, 0, 0.95) 100%);
    z-index: -98;
    pointer-events: none;
}

/* --- PARTICLES BACKGROUND --- */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    /* On top of background, below content */
    pointer-events: none;
}

/* --- AJUSTES MÓVIL (BARRA PEGAJOSA & BACK TO TOP) --- */
@media (max-width: 768px) {

    /* Ocultar video y mostrar imagen en móvil */
    #bg-video-file {
        display: none;
    }

    .video-background {
        background-image: url('fondo_poster.jpg');
        background-size: cover;
        background-position: center center;
    }

    /* Ajustes de posición para no chocar con la barra inferior fija de oferta */
    .whatsapp-btn {
        bottom: 100px !important;
    }

    #back-to-top {
        bottom: 170px !important;
        right: 20px !important;
        padding: 8px;
    }

    /* Padding extra para que el footer no quede tapado */
    body {
        padding-bottom: 100px;
    }
}

/* --- GENERAL STYLES --- */
.brand-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    filter: drop-shadow(0 0 10px var(--tech-accent-glow));
}

.main-title {
    color: var(--tech-text-primary);
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.section-title {
    color: var(--tech-text-primary);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--tech-accent);
    margin-top: 8px;
    border-radius: 2px;
}

.card {
    background-color: var(--tech-card-bg);
    backdrop-filter: blur(12px);
    border-radius: 1rem;
    border: 1px solid var(--tech-border);
    padding: 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.btn-primary {
    background: linear-gradient(90deg, #357ABD 0%, #4A90E2 100%);
    color: white;
    font-weight: 700;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 25px var(--tech-accent-glow);
    transform: scale(1.05);
}

.btn-secondary {
    background: transparent;
    color: var(--tech-accent);
    border: 1px solid var(--tech-accent);
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(74, 144, 226, 0.1);
    box-shadow: 0 0 20px var(--tech-accent-glow);
    border-color: #fff;
    color: #fff;
}

.timeline-line {
    position: absolute;
    left: -23px;
    top: 30px;
    bottom: -30px;
    width: 2px;
    background: linear-gradient(to bottom, var(--tech-accent), transparent);
    z-index: 1;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 24px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #000;
    border: 3px solid var(--tech-accent);
    z-index: 2;
    box-shadow: 0 0 10px var(--tech-accent);
}

.chart-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    height: 250px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 0.5rem;
    border: 1px solid var(--tech-border);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Slider */
.slider-container {
    position: relative;
    overflow: hidden;
    padding: 10px 0;
}

.slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.slider-item {
    flex: 0 0 100%;
    padding: 0 10px;
}

@media (min-width: 768px) {
    .slider-item {
        flex: 0 0 50%;
    }
}

@media (min-width: 1024px) {
    .slider-item {
        flex: 0 0 33.3333%;
    }
}

.slider-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--tech-accent);
    border: 1px solid var(--tech-border);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    font-size: 1.2rem;
}

.slider-button:hover {
    background-color: var(--tech-accent);
    color: #fff;
}

.slider-button.left-0 {
    left: 10px;
}

.slider-button.right-0 {
    right: 10px;
}

/* Animaciones */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-title-word {
    display: inline-block;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

/* LOGO NODES & GLOW ANIMATION */
@keyframes nodePulse {

    0%,
    100% {
        box-shadow: 0 0 8px var(--tech-accent);
        opacity: 1;
    }

    50% {
        box-shadow: 0 0 15px var(--tech-accent), 0 0 5px #fff;
        opacity: 0.8;
    }
}

.logo-node {
    width: 10px;
    height: 10px;
    border: 1px solid #333;
    background: transparent;
    transition: all 0.4s ease;
    border-radius: 2px;
}

.logo-node.active {
    background-color: var(--tech-accent);
    border-color: #fff;
    /* Se aplica la animación de glow */
    animation: nodePulse 3s infinite alternate;
}

.form-input {
    background-color: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--tech-border);
    color: var(--tech-text-primary);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--tech-accent);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
    background-color: #000;
}

.form-input.invalid {
    border-color: #E53E3E;
}

/* Modales */
.modal {
    z-index: 100;
    backdrop-filter: blur(8px);
    background-color: rgba(0, 0, 0, 0.7);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #111;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--tech-accent);
}

.dashboard-card {
    background-color: #16181D;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
}

.tab-button.active {
    background-color: var(--tech-accent);
    color: white;
    box-shadow: 0 0 15px var(--tech-accent-glow);
}
