/* =========================================
    SISTEMA VISUAL CODESITESTUDIO ELITE
    ========================================= */
:root {
    --primary: #050508;
    --secondary: #0d0d12;
    --accent: #8b5cf6;          /* Morado Eléctrico */
    --accent-alt: #4f46e5;      /* Indigo Profundo */
    --accent-glow: rgba(139, 92, 246, 0.3);
    --white: #ffffff;
    --text-main: #e2e8f0;
    --text-dim: #94a3b8;
    --glass-bg: rgba(10, 10, 15, 0.75);
    --border: rgba(255, 255, 255, 0.08);
    --grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-alt) 100%);
    --transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--primary);
    /* Efecto de luces ambientales al fondo mejorado */
    background-image: 
        radial-gradient(circle at 50% -10%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(79, 70, 229, 0.1) 0%, transparent 40%);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* =========================================
    HEADER & LOGO (Efecto Cristal)
    ========================================= */
.wp-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 0;
}

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

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--white);
    text-decoration: none;
    letter-spacing: -1px;
}

.logo span {
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.main-nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative; /* Agregado para el indicador */
}

.main-nav a:hover {
    color: var(--accent);
}

/* Indicador Elite en Nav */
.main-nav a::after {
    content: "";
    position: absolute;
    bottom: -5px; left: 0; width: 0; height: 2px;
    background: var(--grad);
    transition: var(--transition);
}
.main-nav a:hover::after { width: 100%; }

/* =========================================
    HERO SECTION (Impacto)
    ========================================= */
.hero-section {
    padding: 180px 0 100px;
    text-align: center;
}

.hero-tag {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 50px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 900;
    color: var(--white);
    letter-spacing: -2px;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.hero-subtitle {
    color: var(--text-dim);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 3.5rem;
}

/* =========================================
    FORMULARIO (Look Moderno)
    ========================================= */
.card-form-wrapper {
    max-width: 500px;
    margin: 0 auto;
    padding: 1px;
    background: linear-gradient(135deg, var(--border), transparent, var(--border));
    border-radius: 24px;
}

.card-form {
    background: var(--secondary);
    padding: 2.5rem;
    border-radius: 23px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

input, select {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--white);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(139, 92, 246, 0.05);
}

button.full-width {
    width: 100%;
    padding: 1rem;
    background: var(--grad);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative; /* Para el escáner */
    overflow: hidden;    /* Para el escáner */
}

/* Efecto Escáner Elite */
button.full-width::after {
    content: "";
    position: absolute;
    top: -50%; left: -100%; width: 50%; height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: rotate(25deg);
    transition: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

button.full-width:hover::after { left: 150%; }

button.full-width:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px var(--accent-glow);
    filter: brightness(1.1);
}

/* =========================================
    GRID DE SERVICIOS
    ========================================= */
.grid-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.card-service {
    background: var(--secondary);
    padding: 3rem 2rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    transition: var(--transition);
    text-align: left;
    position: relative; /* Para borde de luz */
    overflow: hidden;
}

/* Borde de luz superior */
.card-service::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), transparent);
}

.card-service:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    background: rgba(15, 15, 25, 1);
}

.card-service .icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

/* Títulos con efecto metálico */
.card-service h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to bottom, #ffffff 20%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

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

/* =========================================
   CHATBOT WIDGET OPTIMIZADO (RESPONSIVO)
   ========================================= */
#chat-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--grad);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px var(--accent-glow);
    z-index: 1000;
    transition: var(--transition);
}

/* Pulso de atención Chatbot */
#chat-bubble::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--accent);
    animation: contact-pulse 2s infinite;
}

@keyframes contact-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

#chat-bubble:hover { transform: scale(1.1); }
#chat-bubble svg { width: 28px; fill: white; }

#chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    max-width: calc(100vw - 40px); /* Adaptable a móviles */
    height: 500px;
    max-height: 70vh; /* Control de altura en móviles */
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 24px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transition: var(--transition);
}

.chat-header {
    background: var(--grad);
    padding: 1rem 1.2rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    flex-shrink: 0;
}

.close-chat {
    background: rgba(0,0,0,0.2);
    border: none;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-content {
    flex: 1;
    padding: 1.2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

.bot-msg {
    background: rgba(255,255,255,0.05);
    padding: 0.9rem 1.1rem;
    border-radius: 18px 18px 18px 4px;
    font-size: 0.9rem;
    max-width: 90%;
    border: 1px solid var(--border);
    align-self: flex-start;
}

/* Footer con Grid para acceso táctil en celulares */
.chat-footer {
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    flex-shrink: 0;
}

.chat-footer button {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.6rem 0.4rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin: 0;
}

.chat-footer button:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

/* Media Query para optimización extrema en celulares */
@media (max-width: 480px) {
    #chat-widget {
        right: 20px;
        bottom: 90px;
        width: calc(100vw - 40px);
        height: 450px;
    }
}

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

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

/* =========================================
    FOOTER
    ========================================= */
.wp-footer {
    padding: 5rem 0 3rem;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

.footer-logo {
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 1rem;
    display: inline-block;
}

@media (max-width: 768px) {
    .main-nav { display: none; }
    .hero-section h1 { font-size: 2.8rem; }
}

/* =========================================
    ADICIÓN: FUNCIONALIDAD DE BURBUJAS ELITE
    ========================================= */

/* Estado inicial de las tarjetas (Burbujas comprimidas) */
.reveal .card-service {
    opacity: 0;
    transform: scale(0.8) translateY(50px);
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, opacity;
}

/* Estado cuando entran en pantalla */
.reveal.visible .card-service {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Efecto escalonado (una tras otra) */
.reveal.visible .card-service:nth-child(1) { transition-delay: 0.1s; }
.reveal.visible .card-service:nth-child(2) { transition-delay: 0.2s; }
.reveal.visible .card-service:nth-child(3) { transition-delay: 0.3s; }
.reveal.visible .card-service:nth-child(4) { transition-delay: 0.4s; }
.reveal.visible .card-service:nth-child(5) { transition-delay: 0.5s; }
.reveal.visible .card-service:nth-child(6) { transition-delay: 0.6s; }

/* Animación de flotación interna al pasar el mouse */
.card-service:hover .icon {
    animation: bubble-float 0.6s ease forwards;
}

@keyframes bubble-float {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) translateY(-10px); }
    100% { transform: scale(1.1) translateY(-5px); }
}