/* ===== CSS Custom Properties ===== */
:root {
    /* Colors */
    --primary-color: #1A73E8;
    --primary-light: #5294f5;
    --primary-dark: #1254a8;
    --bg-white: #FFFFFF;
    --bg-light: #F8FBFF;
    --bg-blue-light: #EAF4FF;
    --text-dark: #1F2937;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;
    --border-color: #E5E7EB;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(26, 115, 232, 0.4);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-white);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
    position: relative;
}

.bg-light {
    background-color: var(--bg-light);
}

.bg-white {
    background-color: var(--bg-white);
}

.bg-gradient {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: var(--bg-white);
}

/* ===== Typography Components ===== */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
    text-align: center;
    position: relative;
}

.section-title.text-left {
    text-align: left;
}

.section-title.text-white {
    color: var(--bg-white);
}

.bg-gradient .section-title {
    color: var(--bg-white);
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 500;
    text-align: center;
    margin-bottom: 3rem;
}

.section-subtitle.text-left {
    text-align: left;
}

.section-intro {
    font-size: 1.125rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem auto;
}

.text-white-70 {
    color: rgba(255, 255, 255, 0.8) !important;
}

.text-center {
    text-align: center;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.mt-4 {
    margin-top: 2rem;
}

.mt-5 {
    margin-top: 3rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn .arrow {
    margin-left: 0.5rem;
    transition: transform var(--transition-normal);
}

.btn:hover .arrow {
    transform: translateX(4px);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    color: white;
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-white {
    background-color: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.btn-white:hover {
    background-color: var(--bg-blue-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: 12px;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: all var(--transition-normal);
    background-color: transparent;
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 0;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 40px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.95rem;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-color);
    transition: width var(--transition-normal);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    transition: all var(--transition-fast);
    border-radius: 3px;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 400px;
    height: 100vh;
    background-color: white;
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transition: right var(--transition-normal);
}

.mobile-nav.open {
    right: 0;
}

.mobile-nav a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.mobile-nav a:hover {
    color: var(--primary-color);
}

/* ===== Hero Section ===== */
.hero {
    height: 100vh;
    min-height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--bg-white);
    overflow: hidden;
    padding-top: 60px; /* Offset for navbar */
}

#tsparticles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    pointer-events: none; /* Let clicks pass through to particles if desired, but we want the button clickable */
}

.hero-content > * {
    pointer-events: auto;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s ease forwards;
}

.hero-subtitle {
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s ease 0.2s forwards;
}

.hero-tagline {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s ease 0.4s forwards;
}

.hero .btn {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s ease 0.6s forwards;
}

/* ===== Cards Grid (Objetivos) ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--bg-white);
    padding: 2.5rem 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    width: 48px;
    height: 48px;
    background-color: var(--bg-blue-light);
    color: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===== Stepper (Metodología) ===== */
.stepper {
    position: relative;
    max-width: 800px;
    margin: 0 auto 4rem auto;
}

.stepper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    height: 100%;
    width: 2px;
    background-color: var(--bg-blue-light);
    z-index: 1;
}

.step {
    display: flex;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.step:last-child {
    margin-bottom: 0;
}

.step-marker {
    width: 50px;
    height: 50px;
    min-width: 50px;
    background-color: var(--bg-white);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 2rem;
    transition: all var(--transition-normal);
}

.step:hover .step-marker {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 15px rgba(26, 115, 232, 0.4);
    transform: scale(1.1);
}

.step-content {
    background: var(--bg-white);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    flex-grow: 1;
}

.step:hover .step-content {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    transform: translateX(5px);
}

.step-content h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.step-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.callout {
    background-color: var(--bg-blue-light);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem 2rem;
    border-radius: 0 12px 12px 0;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.callout-icon {
    font-size: 1.5rem;
}

.callout-text {
    color: var(--primary-dark);
    font-size: 1rem;
}

/* ===== Timeline (Hoja de Ruta) ===== */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 2px;
    background-color: var(--bg-blue-light);
    z-index: 1;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
    padding-left: 60px;
    z-index: 2;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 17px;
    top: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--bg-blue-light);
    transition: all var(--transition-fast);
}

.timeline-item:hover .timeline-dot {
    box-shadow: 0 0 0 6px rgba(26, 115, 232, 0.2);
    transform: scale(1.2);
}

.timeline-content {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.timeline-item:hover .timeline-content {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.timeline-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-content h3 {
    font-size: 1.125rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===== Demo Section ===== */
.demo-wrapper {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.demo-wrapper > * {
    flex: 1;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.metric-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.metric-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    background: var(--bg-white);
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.chat-mockup {
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

.chat-header {
    background: var(--bg-light);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.chat-dots {
    display: flex;
    gap: 6px;
    margin-right: 1.5rem;
}

.chat-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.chat-dots span:nth-child(1) { background-color: #FF5F56; }
.chat-dots span:nth-child(2) { background-color: #FFBD2E; }
.chat-dots span:nth-child(3) { background-color: #27C93F; }

.chat-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
    flex-grow: 1;
    text-align: center;
    margin-right: 48px; /* Balance the dots */
}

.chat-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: #FAFAFA;
}

.message {
    display: flex;
    gap: 1rem;
    max-width: 85%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
}

.msg-content {
    padding: 1rem 1.25rem;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
}

.system .msg-content {
    background-color: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    border-top-left-radius: 4px;
}

.user .msg-content {
    background-color: var(--primary-color);
    color: white;
    border-top-right-radius: 4px;
}

/* Typing Indicator Animation */
.typing-indicator-msg {
    margin-top: 0.5rem;
    align-self: flex-start;
    flex-direction: row;
}

.typing {
    display: flex;
    gap: 4px;
    background-color: var(--bg-white);
    padding: 1rem;
    border-radius: 16px;
    border-top-left-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.typing span {
    width: 6px;
    height: 6px;
    background-color: var(--text-light);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing span:nth-child(1) { animation-delay: -0.32s; }
.typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ===== Footer ===== */
.footer {
    background-color: var(--bg-light);
    padding: 4rem 0 0 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    max-width: 300px;
}

.footer-logo img {
    height: 32px;
    margin-bottom: 1rem;
}

.footer-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    background-color: #EEF2F6;
    padding: 1.5rem 0;
    text-align: center;
    border-top: 1px solid #E5E9F0;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-bottom a {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== Animations & Utilities ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

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

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

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

/* ===== Responsive Mobile ===== */
@media (max-width: 900px) {
    .demo-wrapper {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .section {
        padding: 4rem 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .stepper::before {
        left: 20px;
    }

    .step-marker {
        width: 40px;
        height: 40px;
        min-width: 40px;
        margin-right: 1.5rem;
    }

    .step-content {
        padding: 1.25rem;
    }

    .callout {
        flex-direction: column;
        gap: 0.75rem;
        border-radius: 12px;
        border-left: none;
        border-top: 4px solid var(--primary-color);
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer-logo {
        margin: 0 auto;
    }
    
    .footer-bottom .container {
        flex-direction: column;
        justify-content: center;
    }
}
