/* ============================================
   AGENTO - Modern Glassmorphism Design 2025
   ============================================ */

:root {
    /* Colores principales - Paleta profesional y vibrante */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #22d3ee;
    --accent: #a855f7;
    --success: #10b981;
    --dark: #0f172a;
    --dark-alt: #1e293b;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    
    /* Tipografía */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Sora', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: #f8fafc;
    color: var(--dark);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: var(--font-display);
    font-weight: 700;
}

/* ============================================
   NAVBAR - Glass Effect
   ============================================ */
.navbar {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 1rem 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.logo-text {
    font-weight: 800;
    font-size: 1.6rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-link {
    font-weight: 500;
    color: var(--dark) !important;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: transform 0.3s ease;
}

.nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* ============================================
   HERO SECTION - Liquid Background
   ============================================ */
.hero-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    overflow: hidden;
    padding-top: 100px;
    padding-bottom: 120px;
}

/* Formas líquidas animadas en el fondo - OPTIMIZADO */
.hero-wrapper::before,
.hero-wrapper::after {
    content: '';
    position: absolute;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: morphing 30s ease-in-out infinite;
    opacity: 0.2;
    filter: blur(80px);
    will-change: transform;
}

.hero-wrapper::before {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    top: -150px;
    right: -100px;
    animation-delay: -10s;
}

.hero-wrapper::after {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    bottom: -200px;
    left: -150px;
    animation-delay: -20s;
}

@keyframes morphing {
    0%, 100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        border-radius: 60% 40% 30% 70% / 50% 60% 30% 60%;
        transform: translate(30px, 30px) rotate(180deg);
    }
}

/* Partículas flotantes - OPTIMIZADO */
.animated-bg-icons {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

.floating-icon {
    position: absolute;
    color: rgba(255, 255, 255, 0.08);
    animation: float 15s infinite ease-in-out;
    will-change: transform;
}

.icon-1 { top: 10%; left: 10%; font-size: 3rem; animation-delay: 0s; }
.icon-2 { top: 20%; right: 15%; font-size: 2.5rem; animation-delay: -5s; }
.icon-3 { bottom: 20%; left: 15%; font-size: 4rem; animation-delay: -10s; }
.icon-4 { bottom: 30%; right: 10%; font-size: 2rem; animation-delay: -7s; }
.icon-5 { top: 50%; left: 50%; font-size: 6rem; opacity: 0.04; animation: pulse 10s infinite; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.04; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.06; }
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: particleRise 20s linear infinite;
    will-change: transform;
}

@keyframes particleRise {
    0% { transform: translateY(100vh); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateY(-10vh); opacity: 0; }
}

/* Contenido del Hero */
.hero-content {
    position: relative;
    z-index: 2;
    color: white;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out;
}

.hero-badge i {
    color: var(--secondary);
    margin-right: 8px;
}

h1 {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.lead {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CTA Button con efecto glassmorphism - OPTIMIZADO */
.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    border: none;
    color: white;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(34, 211, 238, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.cta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.cta-btn:hover::before {
    left: 100%;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 45px rgba(34, 211, 238, 0.5);
    color: white;
}

.cta-btn:active {
    transform: translateY(0);
}

/* ============================================
   CHAT INTERACTIVO - Glassmorphism
   ============================================ */
.hero-visual-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.interactive-chat {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    animation: floatChat 8s ease-in-out infinite;
}

@keyframes floatChat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.chat-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-body {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
    color: white;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.chat-message {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 18px;
    border-radius: 18px 18px 18px 4px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-input-area {
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(34, 211, 238, 0.4);
}

.chat-send-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(34, 211, 238, 0.6);
}

/* ============================================
   SECTIONS - Light Background
   ============================================ */
.section-light {
    background: #f8fafc;
    position: relative;
    z-index: 2;
}

.glass-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.12);
}

.icon-box {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    font-size: 1.8rem;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    transition: transform 0.3s ease;
}

.icon-box:hover {
    transform: scale(1.05) rotate(3deg);
}

/* ============================================
   FORMS - Modern Styling
   ============================================ */
.form-control {
    border-radius: 12px;
    padding: 14px 18px;
    background: #f1f5f9;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

.form-control.is-invalid {
    border-color: #ef4444;
}

.form-label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

/* ============================================
   WAVE DIVIDER
   ============================================ */
.hero-wrapper > div:last-child {
    pointer-events: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991px) {
    .hero-wrapper {
        padding-top: 80px;
        padding-bottom: 80px;
    }
    
    .interactive-chat {
        margin-top: 3rem;
    }
    
    h1 {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
    
    .hero-wrapper::before,
    .hero-wrapper::after {
        width: 400px;
        height: 400px;
    }
    
    h1 {
        font-size: 2rem !important;
    }
    
    .cta-btn {
        padding: 14px 32px;
        font-size: 1rem;
    }
    
    .interactive-chat {
        max-width: 100%;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ls-2 {
    letter-spacing: 2px;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
/* Usar will-change solo en elementos que se animan */
.hero-badge,
.cta-btn,
.interactive-chat,
.floating-icon,
.particle {
    will-change: transform;
}

/* Forzar aceleración por hardware */
.glass-card,
.icon-box,
.chat-message {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reducir animaciones en dispositivos de bajo rendimiento */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
