* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    scroll-behavior: smooth;
    overflow-x: hidden;
    background-color: black;
}

/* Navigation Styles */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    border-bottom: 1px solid rgba(124, 58, 237, 0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.5rem 0;
}

nav.nav-scrolled {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(124, 58, 237, 0.2);
    padding: 1rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Floating Cubes Animation */
.floating-cube {
    position: absolute;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(0, 188, 212, 0.1) 100%);
    border: 1px solid rgba(124, 58, 237, 0.2);
    animation: float 20s infinite ease-in-out;
    backdrop-filter: blur(10px);
}

.cube-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.cube-2 {
    top: 50%;
    right: 15%;
    animation-delay: 7s;
    width: 150px;
    height: 150px;
}

.cube-3 {
    bottom: 20%;
    left: 20%;
    animation-delay: 14s;
    width: 80px;
    height: 80px;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.3;
    }

    25% {
        transform: translate(30px, -30px) rotate(90deg);
        opacity: 0.5;
    }

    50% {
        transform: translate(-20px, 20px) rotate(180deg);
        opacity: 0.3;
    }

    75% {
        transform: translate(20px, 30px) rotate(270deg);
        opacity: 0.5;
    }
}

/* 3D Cube Animation */
.cube-3d-container {
    perspective: 1000px;
    width: 400px;
    height: 400px;
    margin: 0 auto;
}

.cube-3d {
    width: 200px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateCube 20s infinite linear;
    margin: 100px auto;
}

.cube-face {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 2px solid rgba(124, 58, 237, 0.5);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(0, 188, 212, 0.1) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.cube-front {
    transform: translateZ(100px);
}

.cube-back {
    transform: rotateY(180deg) translateZ(100px);
}

.cube-right {
    transform: rotateY(90deg) translateZ(100px);
}

.cube-left {
    transform: rotateY(-90deg) translateZ(100px);
}

.cube-top {
    transform: rotateX(90deg) translateZ(100px);
}

.cube-bottom {
    transform: rotateX(-90deg) translateZ(100px);
}

@keyframes rotateCube {
    0% {
        transform: rotateX(0deg) rotateY(0deg);
    }

    100% {
        transform: rotateX(360deg) rotateY(360deg);
    }
}

/* About Section */
.about-image-container {
    position: relative;
    padding: 20px;
}

.about-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
    z-index: 0;
    filter: blur(60px);
}

.about-stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 1.25rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.about-stat-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(124, 58, 237, 0.3);
    transform: translateY(-5px);
}

.about-stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #7C3AED, #00BCD4);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.about-stat-card:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Service Cards */
.service-card {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.5) 0%, rgba(17, 24, 39, 0.5) 100%);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(0, 188, 212, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: rgba(124, 58, 237, 0.5);
    box-shadow: 0 20px 40px rgba(124, 58, 237, 0.2);
}

.service-card-inner {
    position: relative;
    z-index: 1;
}


/* Portfolio Slider Styles */
.portfolio-slider-container {
    cursor: grab;
    width: 100%;
}

.portfolio-slider-container:active {
    cursor: grabbing;
}

.portfolio-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    height: 100%;
    /* Ensure all cards in the flex track match height */
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
}

.portfolio-card .aspect-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    /* Backdrop for any potential gap */
}

.portfolio-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    /* Better for mobile-style screenshots */
    image-rendering: -webkit-optimize-contrast;
    /* Enhance perceived quality */
}

.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(124, 58, 237, 0.2);
    border-color: rgba(124, 58, 237, 0.5);
    z-index: 10;
}

/* Scrollbar Hide */
.portfolio-slider-container::-webkit-scrollbar {
    display: none;
}

.portfolio-slider-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Process Steps */
.process-step {
    position: relative;
    padding-left: 1rem;
}

.process-step::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 3rem;
    bottom: -3rem;
    width: 2px;
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.5) 0%, transparent 100%);
}

.process-step:last-child::before {
    display: none;
}

/* Tech Grid Styles */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tech-icon-box {
    width: 80px;
    height: 80px;
    background: rgba(31, 41, 55, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 1.2rem;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tech-icon-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.4s ease;
}

.tech-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #9CA3AF;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.tech-item:hover .tech-icon-box {
    transform: translateY(-8px) scale(1.05);
    border-color: rgba(0, 188, 212, 0.5);
    box-shadow: 0 10px 25px rgba(0, 188, 212, 0.15);
    background: rgba(31, 41, 55, 0.8);
}

.tech-item:hover .tech-label {
    color: #00BCD4;
}

.filter-white {
    filter: brightness(0) invert(1);
}

/* Testimonial Cards */
.testimonial-card {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.5) 0%, rgba(17, 24, 39, 0.5) 100%);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124, 58, 237, 0.5);
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.15);
}

/* Contact Form */
.contact-form {
    backdrop-filter: blur(10px);
}

/* Smooth Scroll & Global Offset (Transparent Nav) */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

section {
    scroll-margin-top: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7c3aed 0%, #00bcd4 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7c3aed 0%, #00bcd4 100%);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Gradient Text Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.text-gradient-animated {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding-top: 120px;
    }

    .cube-3d-container {
        display: none;
    }

    .floating-cube {
        width: 60px;
        height: 60px;
    }

    .cube-2 {
        width: 80px;
        height: 80px;
    }

    .cube-3 {
        width: 50px;
        height: 50px;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    animation: shimmer 2s infinite;
    background: linear-gradient(to right, transparent 0%, rgba(124, 58, 237, 0.2) 50%, transparent 100%);
    background-size: 1000px 100%;
}

/* Glow Effect */
.glow {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.5), 0 0 40px rgba(0, 188, 212, 0.3);
}

.glow-hover:hover {
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.7), 0 0 60px rgba(0, 188, 212, 0.5);
    transition: box-shadow 0.3s ease;
}

/* Particle Background */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Menu Mobile */
@media (max-width: 768px) {
    nav {
        padding: 1rem;
    }

    nav .hidden.md\\:flex {
        display: none;
    }
}

/* Hover Effects */
button,
a {
    position: relative;
    overflow: hidden;
}

button::before,
a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before,
a:hover::before {
    width: 300px;
    height: 300px;
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Neon Border Animation */
@keyframes neon-border {

    0%,
    100% {
        border-color: rgba(124, 58, 237, 0.5);
        box-shadow: 0 0 10px rgba(124, 58, 237, 0.3);
    }

    50% {
        border-color: rgba(0, 188, 212, 0.5);
        box-shadow: 0 0 20px rgba(0, 188, 212, 0.5);
    }
}

.neon-border {
    animation: neon-border 2s ease-in-out infinite;
}

@keyframes animate-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: animate-float 5s ease-in-out infinite;
}

/* Transitions */
.transition-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-bounce {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Footer Glassmorphism */
footer {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(17, 24, 39, 0.9));
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(124, 58, 237, 0.2);
    position: relative;
    z-index: 10;
}


/* Return to Top Button */
.return-to-top {
    position: fixed;
    bottom: 24px;
    left: 24px;
    /* Opuesto al chatbot */
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.8) 0%, rgba(17, 24, 39, 0.8) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: white;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.return-to-top.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.8);
}

.return-to-top:not(.hidden) {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: slideInLeft 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.return-to-top:hover {
    transform: scale(1.1);
    border-color: #00bcd4;
    box-shadow: 0 12px 32px rgba(0, 188, 212, 0.3);
    background: linear-gradient(135deg, #7c3aed 0%, #00bcd4 100%);
}

.return-to-top svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.return-to-top:hover svg {
    transform: translateY(-4px);
}

@media (max-width: 480px) {
    .return-to-top {
        width: 56px;
        height: 56px;
        bottom: 16px;
        left: 16px;
    }
}

/* Mobile Menu Styles */
#mobile-menu {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu.open {
    transform: translateX(0);
}

.menu-open-icon,
.menu-close-icon {
    transition: all 0.3s ease;
}

body.menu-open {
    overflow: hidden;
}

.n8n-chat-widget-input:focus-within {
    border-color: #7C3AED !important;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.3) !important;
}

/* Chatbot Responsiveness */
@media (max-width: 500px) {
    #cubot-chat-window {
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
        margin-bottom: 0 !important;
        position: fixed !important;
        z-index: 10002 !important;
    }

    #cubot-widget-container {
        bottom: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100% !important;
        padding: 0 !important;
    }

    #cubot-launcher {
        position: fixed;
        bottom: 1.5rem;
        right: 1.5rem;
        z-index: 10001;
    }

    .return-to-top {
        display: none !important;
    }
}