/* Base Styles */
body {
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    cursor: none;
}

/* Hide default cursor */
.font-code {
    font-family: 'Fira Code', monospace;
}

.accent-green {
    color: #22c55e;
}

.bg-accent-green {
    background-color: #22c55e;
}

/* Custom Cursor Styles */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(34, 197, 94, 0.5);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Hover state for cursor */
body.hovering .cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(34, 197, 94, 0.1);
    border-color: transparent;
}

/* Hide cursor on touch devices */
@media (hover: none) and (pointer: coarse) {

    .cursor-dot,
    .cursor-outline {
        display: none;
    }

    body {
        cursor: auto;
    }
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 40;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.dark .noise-overlay {
    opacity: 0.05;
}

/* Page Load Curtain */
.page-curtain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #111827;
    z-index: 10000;
    transform-origin: top;
}

/* Cursor Effect for Typing */
.typed-cursor {
    opacity: 1;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* Background Animation Container */
#anime-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    overflow: hidden;
    display: grid;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

/* Service Cards */
.service-card {
    will-change: transform;
}

/* Timeline Styles */
.timeline-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 0%;
    /* Starts at 0 */
    background-color: #374151;
    z-index: 0;
}

.dark .timeline-line {
    background-color: #22c55e;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

/* Buttons */
.btn-animated-gradient {
    background-size: 200% auto;
    transition: background-position 0.5s;
}

.btn-animated-gradient:hover {
    background-position: right center;
}

/* Anime.js square styles */
#anime-container .square {
    position: relative;
    background-color: rgba(34, 197, 94, 0.1);
}

.dark #anime-container .square {
    background-color: rgba(34, 197, 94, 0.05);
}

/* Tech Icons */
.tech-item {
    will-change: transform;
}

/* Carousel Styles */
.carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.carousel-image.active {
    opacity: 1;
}

.client-logo-effect {
    filter: grayscale(1) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.client-logo-effect:hover {
    filter: grayscale(0) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
    transform: scale(1.1);
}

/* ScrollSpy Active State */
.nav-link.active {
    color: #22c55e !important;
    font-weight: 600;
}

/* Lenis Smooth Scroll Recommended CSS */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

/* --- N8N CHAT WIDGET OVERRIDES (PREMIUM GLASS & DARK MODE) --- */
/* Forzamos estilos sobre las clases detectadas en el DOM normal */

.n8n-chat * {
    font-family: 'Poppins', sans-serif !important;
}

/* 1. Main Window - Glassmorphism */
.n8n-chat .chat-window {
    border-radius: 24px !important;
    overflow: hidden !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
}

/* Dark Mode Window */
.dark .n8n-chat .chat-window {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
}

/* 2. Header - Transparencia y Gradiente */
.n8n-chat .chat-header {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(31, 41, 55, 0.95) 100%) !important;
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-top-left-radius: 24px !important;
    border-top-right-radius: 24px !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

/* 3. Body Background */
.n8n-chat .chat-body {
    background-color: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(8px) !important;
}

.dark .n8n-chat .chat-body {
    background-color: rgba(17, 24, 39, 0.9) !important;
}

/* 4. Chat Toggle (Button) */
.chat-window-toggle {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 25px -5px rgba(34, 197, 94, 0.6) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border-radius: 50% !important;
    width: 60px !important;
    height: 60px !important;
}

.chat-window-toggle:hover {
    transform: scale(1.1) rotate(5deg) !important;
    box-shadow: 0 15px 30px -5px rgba(34, 197, 94, 0.8) !important;
}

/* 5. Mensajes del Usuario (Verde Status 200) */
.chat-message-from-user .chat-message-markdown,
.chat-message-user {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    color: #ffffff !important;
    border-radius: 18px !important;
    border-bottom-right-radius: 2px !important;
    box-shadow: 0 4px 6px -1px rgba(34, 197, 94, 0.3) !important;
}

/* 6. Mensajes del Bot (Gris Soft) */
.chat-message-from-bot .chat-message-markdown,
.chat-message-bot {
    background-color: #f3f4f6 !important;
    color: #1f2937 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 18px !important;
    border-bottom-left-radius: 2px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

/* 7. Inputs & Footer */
.chat-footer {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-bottom-left-radius: 24px !important;
    border-bottom-right-radius: 24px !important;
}

.dark .chat-footer {
    background-color: rgba(17, 24, 39, 0.95) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.chat-input textarea,
.chat-input input {
    background-color: #f9fafb !important;
    border-radius: 9999px !important;
    /* Pill shape */
    border: 1px solid #e5e7eb !important;
    padding: 12px 20px !important;
    color: #1f2937 !important;
    transition: all 0.3s ease !important;
}

.dark .chat-input textarea,
.dark .chat-input input {
    background-color: #111827 !important;
    border-color: #374151 !important;
    color: #f3f4f6 !important;
}

.chat-input textarea:focus,
.chat-input input:focus {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2) !important;
    background-color: #ffffff !important;
}

.dark .chat-input textarea:focus {
    background-color: #1f2937 !important;
}

/* Botón de enviar */
.chat-input-send-button {
    color: #22c55e !important;
    background: rgba(34, 197, 94, 0.1) !important;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: 8px !important;
    transition: all 0.2s !important;
}

.chat-input-send-button:hover:not(:disabled) {
    background: #22c55e !important;
    color: white !important;
    transform: scale(1.1);
}

.chat-input-send-button:disabled {
    color: #9ca3af !important;
    background: transparent !important;
}

/* Ocultar footer/marca de agua */
.chat-footer>a {
    display: none !important;
}