/*
---
ARCHIVO CSS PRINCIPAL (main.css)
Proyecto: Assets Consultores - VERSION DINAMICA
---
*/

/* --- 1. IMPORTACIÓN DE FUENTE Y VARIABLES GLOBALES --- */

/* Importamos la fuente 'Inter' de Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800;900&display=swap');

:root {
    /* Definimos nuestros colores "rompedores" para usarlos en Tailwind */
    /* Este es nuestro azul metálico/acento */
    --color-acento: #0a74da; 
    /* Un azul más oscuro para hover o fondos */
    --color-acento-oscuro: #085dae;
    /* Un gris muy claro para el fondo base */
    --color-fondo-claro: #fdfdfe;
    /* Un azul muy pálido para el gradiente */
    --color-fondo-dinamico: #f0f4f9; 
    /* Mantenemos un gris un poco más oscuro para sombras o bordes si es necesario */
    --color-gris-borde: #e9ecef; 
}

/* --- 2. ESTILOS BASE (CON FONDO DINÁMICO) --- */

/* Definimos la animación del fondo */
@keyframes moveBackground {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

/* NUEVO: Animación de partículas flotantes */
@keyframes float {
  0%, 100% { transform: translateY(0px) translateX(0px); }
  25% { transform: translateY(-20px) translateX(10px); }
  50% { transform: translateY(-10px) translateX(-10px); }
  75% { transform: translateY(-25px) translateX(5px); }
}

/* NUEVO: Partículas flotantes en el fondo */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
}

body::before {
    background: radial-gradient(circle, var(--color-acento) 0%, transparent 70%);
    top: 10%;
    left: 5%;
    animation: float 20s ease-in-out infinite;
}

body::after {
    background: radial-gradient(circle, var(--color-acento-oscuro) 0%, transparent 70%);
    bottom: 10%;
    right: 5%;
    animation: float 25s ease-in-out infinite reverse;
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;

    /* Fondo Animado y Ligero */
    background: linear-gradient(-45deg, var(--color-fondo-claro), var(--color-fondo-dinamico), var(--color-fondo-claro), var(--color-fondo-dinamico));
    background-size: 400% 400%;
    animation: moveBackground 30s ease infinite; /* Dura 30s, se repite */
    
    /* Dejamos espacio arriba para la Navbar fija */
    padding-top: 100px; 
    position: relative;
}

/* --- 3. NAVBAR (Diseño Simple y Fijo) --- */
#main-nav {
    position: fixed; /* La dejamos fija arriba */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50; /* Por encima del contenido normal */
    
    /* Estilo ÚNICO con glassmorphism */
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    color: #333;
    transition: all 0.3s ease;
}

/* NUEVO: Efecto hover en navbar */
#main-nav:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* Enlaces de navegación - NUEVO */
#main-nav nav a {
    font-size: 1.125rem; /* 18px */
    font-weight: 700;
    letter-spacing: 0.025em;
    position: relative;
    transition: all 0.3s ease;
}

/* NUEVO: Efecto underline animado */
#main-nav nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-acento), var(--color-acento-oscuro));
    transition: width 0.3s ease;
}

#main-nav nav a:hover::after {
    width: 100%;
}

/* Color de los botones/enlaces de la Navbar */
#main-nav #menu-open-btn {
    color: #333; /* Oscuro y usable */
}
#main-nav #login-btn,
#main-nav button:not(#menu-open-btn) {
    color: #333; /* Oscuro y usable */
}

/* Estilo del botón de Login con efecto hover */
#main-nav #login-btn {
    background-color: var(--color-acento);
    color: white;
    border-color: var(--color-acento);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* NUEVO: Efecto de onda en el botón */
#main-nav #login-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#main-nav #login-btn:hover::before {
    width: 300px;
    height: 300px;
}

#main-nav #login-btn:hover {
     background-color: var(--color-acento-oscuro);
     border-color: var(--color-acento-oscuro);
     transform: translateY(-2px);
     box-shadow: 0 4px 8px rgba(10, 116, 218, 0.3);
}


/* --- 4. MENÚ HAMBURGUESA OVERLAY --- */
#menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 25, 47, 0.95); /* Fondo oscuro casi opaco */
    backdrop-filter: blur(10px); /* Efecto cristal */
    z-index: 100; /* Por encima de todo */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#menu-overlay.visible {
    opacity: 1;
    visibility: visible;
}

#menu-close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
}

#menu-overlay nav a {
    color: white;
    font-size: 1.8rem; /* Tamaño grande para los enlaces */
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

#menu-overlay nav a:hover {
    color: var(--color-acento); /* Se pone azul al pasar el ratón */
}


/* --- 5. EFECTO PARALLAX --- */
.parallax-section {
    background-attachment: fixed; /* Clave para el parallax */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative; /* Necesario para la capa overlay */
    padding: 6rem 0; /* Espaciado generoso */
}

/* Capa de oscuridad sobre el fondo parallax */
.parallax-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Oscuridad del 60% */
    z-index: 10;
}

/* Contenido de texto sobre la capa overlay */
.parallax-content {
    position: relative;
    z-index: 2;
}

/* Imagen de fondo específica para la sección parallax */
#servicios-parallax {
    background-image: url('../img/bg-servicios-geometrico.jpg');
}


/* --- 6. SECCIÓN HERO DINAMICA --- */

/* NUEVO: Gradiente animado para ASSETS CONSULTORES */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#hero span.text-acento {
    background: linear-gradient(90deg, #0a74da, #0a9fd8, #0a74da, #085dae);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
    text-shadow: 0 0 30px rgba(10, 116, 218, 0.3);
}

/* NUEVO: Glassmorphism y efectos 3D en el rectángulo blanco */
#hero .grid {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.5s ease;
    position: relative;
}

/* NUEVO: Efecto breathing (respiro) */
@keyframes breathing {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

#hero .grid {
    animation: breathing 6s ease-in-out infinite;
}

/* NUEVO: Hover con transformación 3D */
#hero .grid:hover {
    transform: perspective(1000px) rotateX(2deg) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15), 
                0 0 100px rgba(10, 116, 218, 0.1);
}

/* NUEVO: Borde animado con gradiente */
#hero .grid::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(45deg, 
        var(--color-acento),
        var(--color-acento-oscuro),
        var(--color-acento),
        var(--color-fondo-dinamico)
    );
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: gradientRotate 6s linear infinite;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes gradientRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* NUEVO: Efecto hover en la imagen del hero */
#hero img {
    transition: all 0.5s ease;
    filter: brightness(1);
}

#hero img:hover {
    transform: scale(1.05) rotate(1deg);
    filter: brightness(1.1);
    box-shadow: 0 20px 40px rgba(10, 116, 218, 0.3);
}

/* NUEVO: Botón "Hablemos" más dinámico */
#hero a[href="#contacto"] {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

#hero a[href="#contacto"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

#hero a[href="#contacto"]:hover::before {
    left: 100%;
}

#hero a[href="#contacto"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(10, 116, 218, 0.4);
}


/* --- 7. SECCIÓN ESTUDIOS --- */
/* Quitamos la sombra de las imágenes de estudio para que se integren mejor */
.no-shadow-img {
   box-shadow: none !important; /* Forzamos que no haya sombra */
   border: 1px solid var(--color-gris-borde); /* Añadimos un borde sutil */
}

/* Contenedor para controlar la proporción de la imagen en Estudios */
.study-image-wrapper {
    position: relative;
    width: 100%;
    /* Definimos una proporción (ej. 16:9). Ajusta según tus imágenes */
    /* Este padding-bottom crea el espacio para el aspect ratio */
    padding-bottom: 56.25%; /* 9 / 16 * 100% para 16:9 */
    /* Para una imagen cuadrada podrías usar padding-bottom: 100%; */
    overflow: hidden;
    border-radius: 0.5rem; /* rounded-lg */
}

.study-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que la imagen cubra el contenedor manteniendo su proporción, recortando si es necesario */
    transition: transform 0.5s ease;
}

/* NUEVO: Efecto zoom en imágenes de estudios */
.study-image-wrapper:hover img {
    transform: scale(1.1);
}


/* --- 8. AJUSTES PARA LAS IMÁGENES DE PILARES --- */
.pillar-image {
    width: 100%; /* Ocupa todo el ancho disponible */
    height: 240px; /* Altura fija para todas las imágenes de pilares */
    object-fit: cover; /* CAMBIO: Asegura que la imagen cubra TODO el espacio, recortando si es necesario */
    margin-bottom: 1.5rem; /* mb-6 */
    border-radius: 0.375rem; /* rounded-md */
    transition: all 0.4s ease;
}

/* NUEVO: Efecto hover en imágenes de pilares */
.pillar-image:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(10, 116, 218, 0.2);
}


/* --- 9. ANIMACIONES DE SCROLL MEJORADAS --- */

/* Estado inicial (oculto) */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.animate-fade-in-up {
    transform: translateY(40px) scale(0.95);
}
.animate-fade-in {
    transform: scale(0.95);
}

/* Estado final (visible) - MEJORADO */
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* NUEVO: Efecto de texto que aparece letra por letra */
@keyframes fadeInLetters {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- 10. OTROS AJUSTES Y UTILIDADES --- */

/* Aseguramos que los enlaces internos (href="#...") tengan un scroll suave */
html {
  scroll-behavior: smooth;
}

/* NUEVO: Efecto cursor personalizado en elementos interactivos */
a, button {
    cursor: pointer;
    transition: all 0.3s ease;
}

/* NUEVO: Efecto de profundidad en cards */
.bg-white {
    transition: all 0.4s ease;
}

.bg-white:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* NUEVO: Animación de pulso sutil para el botón de contacto */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(10, 116, 218, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(10, 116, 218, 0);
    }
}

a[href="mailto:consultas@assetsconsultores.es"] {
    animation: pulse 2s infinite;
}

/* --- 11. RED HEXAGONAL EN LOS LATERALES --- */

/* Contenedores de hexágonos en los laterales */
.hexagon-container-left,
.hexagon-container-right {
    position: fixed;
    top: 0;
    width: 200px;
    height: 100vh;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.hexagon-container-left {
    left: 0;
}

.hexagon-container-right {
    right: 0;
}

/* Hexágono individual */
.hexagon {
    position: absolute;
    width: 80px;
    height: 46.19px;
    background: rgba(10, 116, 218, 0.3);
    border: 2px solid rgba(10, 116, 218, 0.7);
    transition: all 0.4s ease;
}

.hexagon::before,
.hexagon::after {
    content: "";
    position: absolute;
    width: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
}

.hexagon::before {
    bottom: 100%;
    border-bottom: 23.09px solid rgba(10, 116, 218, 0.3);
}

.hexagon::after {
    top: 100%;
    border-top: 23.09px solid rgba(10, 116, 218, 0.3);
}

/* Animación de iluminación en cascada */
@keyframes hexagonGlow {
    0%, 100% {
        background: rgba(10, 116, 218, 0.3);
        border-color: rgba(10, 116, 218, 0.15);
        box-shadow: 0 0 0 rgba(10, 116, 218, 0);
    }
    50% {
        background: rgba(10, 116, 218, 0.7);
        border-color: rgba(10, 116, 218, 0.5);
        box-shadow: 0 0 20px rgba(10, 116, 218, 0.4);
    }
}

/* Clases para diferentes tamaños de hexágonos */
.hexagon.small {
    width: 40px;
    height: 23.09px;
    opacity: 0.6;
}

.hexagon.small::before,
.hexagon.small::after {
    border-left-width: 20px;
    border-right-width: 20px;
}

.hexagon.small::before {
    border-bottom-width: 11.55px;
}

.hexagon.small::after {
    border-top-width: 11.55px;
}

.hexagon.large {
    width: 80px;
    height: 46.19px;
}

.hexagon.large::before,
.hexagon.large::after {
    border-left-width: 40px;
    border-right-width: 40px;
}

.hexagon.large::before {
    border-bottom-width: 23.09px;
}

.hexagon.large::after {
    border-top-width: 23.09px;
}

/* Animaciones individuales con delays diferentes para efecto cascada */
.hexagon:nth-child(1) { animation: hexagonGlow 4s ease-in-out 0s infinite; }
.hexagon:nth-child(2) { animation: hexagonGlow 4s ease-in-out 0.3s infinite; }
.hexagon:nth-child(3) { animation: hexagonGlow 4s ease-in-out 0.6s infinite; }
.hexagon:nth-child(4) { animation: hexagonGlow 4s ease-in-out 0.9s infinite; }
.hexagon:nth-child(5) { animation: hexagonGlow 4s ease-in-out 1.2s infinite; }
.hexagon:nth-child(6) { animation: hexagonGlow 4s ease-in-out 1.5s infinite; }
.hexagon:nth-child(7) { animation: hexagonGlow 4s ease-in-out 1.8s infinite; }
.hexagon:nth-child(8) { animation: hexagonGlow 4s ease-in-out 2.1s infinite; }
.hexagon:nth-child(9) { animation: hexagonGlow 4s ease-in-out 2.4s infinite; }

/* Ajuste para pantallas pequeñas */
@media (max-width: 768px) {
    .hexagon-container-left,
    .hexagon-container-right {
        width: 80px;
    }
    
    .hexagon {
        width: 40px;
        height: 23.09px;
    }
    
    .hexagon::before,
    .hexagon::after {
        border-left-width: 20px;
        border-right-width: 20px;
    }
    
    .hexagon::before {
        border-bottom-width: 11.55px;
    }
    
    .hexagon::after {
        border-top-width: 11.55px;
    }
}
@keyframes connectionPulse {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

.hex-connection.active {
    animation: connectionPulse 2s ease-in-out infinite;
}

/* Ajuste para pantallas pequeñas */
@media (max-width: 768px) {
    .hexagon-container-left,
    .hexagon-container-right {
        width: 80px;
    }
    
    .hexagon {
        width: 40px;
        height: 23.09px;
    }
    
    .hexagon::before,
    .hexagon::after {
        border-left-width: 20px;
        border-right-width: 20px;
    }
    
    .hexagon::before {
        border-bottom-width: 11.55px;
    }
    
    .hexagon::after {
        border-top-width: 11.55px;
    }
}

/* DEBUG: Hexágonos super visibles temporalmente */
.hexagon {
    background: rgba(10, 116, 218, 0.5) !important;
    border: 3px solid rgba(10, 116, 218, 1) !important;
    box-shadow: 0 0 15px rgba(10, 116, 218, 0.8) !important;
}

.hexagon::before {
    border-bottom-color: rgba(10, 116, 218, 0.5) !important;
}

.hexagon::after {
    border-top-color: rgba(10, 116, 218, 0.5) !important;
}