/* ========================================
   ESTILOS PERSONALIZADOS - AnalitycsDigital
   Diseño 3D y Moderno
   ======================================== */

* {
    box-sizing: border-box;
}

/* Variables CSS para efectos 3D */
:root {
    --shadow-3d-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-3d-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-3d-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-3d-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    --shadow-3d-2xl: 0 35px 60px -12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.1);
    --shadow-colored: 0 20px 40px -10px rgba(31, 162, 206, 0.4), 0 0 0 1px rgba(31, 162, 206, 0.1);
}

body {
    perspective: 1000px;
    transform-style: preserve-3d;
}

/* Gradiente de fondo mejorado con efectos 3D */
.gradient-bg {
    background: linear-gradient(135deg, #1fa2ce 0%, #731f44 100%);
    position: relative;
    overflow: hidden;
}

.gradient-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate-gradient 20s linear infinite;
    pointer-events: none;
}

.gradient-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(31, 162, 206, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(115, 31, 68, 0.3) 0%, transparent 50%);
    pointer-events: none;
}

@keyframes rotate-gradient {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Efecto hover en cards con 3D */
.card-hover {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
    position: relative;
}

.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.card-hover:hover {
    transform: translateY(-12px) rotateX(2deg) rotateY(-2deg) scale(1.02);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 40px rgba(31, 162, 206, 0.3);
}

.card-hover:hover::before {
    opacity: 1;
}

/* Animación de pulso */
.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Animación de fade in mejorada con 3D */
.fade-in {
    animation: fadeIn3D 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform-style: preserve-3d;
}

@keyframes fadeIn3D {
    from {
        opacity: 0;
        transform: translateY(30px) translateZ(-50px) rotateX(-10deg);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateZ(0) rotateX(0deg);
        filter: blur(0);
    }
}

/* Efectos 3D para elementos flotantes */
.float-3d {
    animation: float3D 6s ease-in-out infinite;
    transform-style: preserve-3d;
}

@keyframes float3D {
    0%, 100% {
        transform: translateY(0) translateZ(0) rotateX(0deg) rotateY(0deg);
    }
    33% {
        transform: translateY(-10px) translateZ(10px) rotateX(2deg) rotateY(-2deg);
    }
    66% {
        transform: translateY(-5px) translateZ(5px) rotateX(-1deg) rotateY(2deg);
    }
}

/* View Transition */
@view-transition {
    navigation: auto;
}

/* Estilos adicionales para formularios */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    ring: 2px;
    ring-color: #1fa2ce;
    border-color: transparent;
}

/* Mejoras de accesibilidad */
button:focus {
    outline: 2px solid #1fa2ce;
    outline-offset: 2px;
}

/* ========================================
   ESTILOS DE LA CALCULADORA
   ======================================== */

.calculator-input {
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
    background-color: white !important;
}

.calculator-input:focus {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(31, 162, 206, 0.2);
    z-index: 20;
}

/* Asegurar que los inputs sean interactivos */
input[type="number"],
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
}

/* Asegurar que el contenedor del input no bloquee */
.relative {
    position: relative;
    z-index: 1;
}

.relative input,
.relative select {
    position: relative;
    z-index: 10;
}

/* Animación de resultados */
#calculator-results > div {
    animation: slideInUp 0.5s ease-out;
    animation-fill-mode: both;
}

#calculator-results > div:nth-child(1) { animation-delay: 0.1s; }
#calculator-results > div:nth-child(2) { animation-delay: 0.2s; }
#calculator-results > div:nth-child(3) { animation-delay: 0.3s; }
#calculator-results > div:nth-child(4) { animation-delay: 0.4s; }
#calculator-results > div:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efecto hover en cards de resultados */
#calculator-results > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* ========================================
   ESTILOS PARA GRÁFICOS DE MÉTRICAS
   ======================================== */

/* Gráficos de barras de progreso */
#daily-chart,
#weekly-chart {
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Gráfico de barras mensual */
.monthly-chart-bar {
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(115, 31, 68, 0.3);
    min-height: 20px;
}

.monthly-chart-bar:hover {
    transform: scaleY(1.05);
    box-shadow: 0 4px 12px rgba(115, 31, 68, 0.5);
}

/* Cards de métricas */
.metrics-card {
    transition: all 0.3s ease;
}

.metrics-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Animación de números en métricas */
.metrics-value {
    transition: all 0.3s ease;
}

/* Efectos visuales para gráficos */
.chart-container {
    position: relative;
    overflow: hidden;
}

.chart-bar {
    position: relative;
    overflow: hidden;
}

.chart-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* ========================================
   EFECTOS 3D Y GLASSMORPHISM
   ======================================== */

/* Glassmorphism - Efecto de vidrio */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.37),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Cards con efecto 3D profundo */
.card-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

/* Asegurar que los elementos interactivos dentro de card-3d sean clickeables */
.card-3d input,
.card-3d select,
.card-3d textarea,
.card-3d button {
    position: relative !important;
    z-index: 1000 !important;
    pointer-events: auto !important;
    isolation: isolate;
}

/* Asegurar que los pseudo-elementos no bloqueen los inputs */
.card-3d::before,
.card-3d::after,
.border-glow::before,
.border-glow::after,
.depth-layer::before,
.depth-layer::after {
    pointer-events: none !important;
    z-index: -1 !important;
}

/* Específico para inputs de calculadora */
#investment-amount,
#investment-period {
    position: relative !important;
    z-index: 1000 !important;
    pointer-events: auto !important;
    isolation: isolate;
    background-color: white !important;
}

.card-3d:hover {
    transform: translateY(-15px) rotateX(5deg) rotateY(-3deg) scale(1.03);
    box-shadow: 
        0 30px 60px -12px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 60px rgba(31, 162, 206, 0.4),
        inset 0 0 40px rgba(255, 255, 255, 0.1);
}

/* Efecto de elevación 3D */
.elevation-3d {
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        0 1px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateZ(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.elevation-3d:hover {
    transform: translateZ(40px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Botones con efecto 3D */
.btn-3d {
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.2),
        0 3px 6px rgba(0, 0, 0, 0.1);
}

.btn-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn-3d:hover {
    transform: translateY(-3px) translateZ(10px) scale(1.05);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.3),
        0 5px 10px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(31, 162, 206, 0.4);
}

.btn-3d:hover::before {
    opacity: 1;
}

.btn-3d:active {
    transform: translateY(-1px) translateZ(5px) scale(1.02);
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.2),
        0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Efecto de neomorphism mejorado */
.neo-3d {
    background: #ffffff;
    box-shadow: 
        20px 20px 60px #d1d1d1,
        -20px -20px 60px #ffffff,
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.neo-3d:hover {
    box-shadow: 
        25px 25px 70px #c1c1c1,
        -25px -25px 70px #ffffff,
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    transform: translateY(-5px) translateZ(10px);
}

/* Gradientes 3D animados */
.gradient-3d {
    background: linear-gradient(135deg, #1fa2ce 0%, #8b5cf6 50%, #731f44 100%);
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
    position: relative;
}

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

/* Efectos de profundidad con múltiples capas */
.depth-layer {
    position: relative;
}

.depth-layer::before,
.depth-layer::after {
    content: '';
    position: absolute;
    border-radius: inherit;
    pointer-events: none;
}

.depth-layer::before {
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(31, 162, 206, 0.3), rgba(115, 31, 68, 0.3));
    z-index: -1 !important;
    filter: blur(10px);
    opacity: 0.5;
    pointer-events: none !important;
}

.depth-layer::after {
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: rgba(255, 255, 255, 0.1);
    z-index: -1 !important;
    filter: blur(5px);
    opacity: 0.3;
    pointer-events: none !important;
}

/* Efectos de brillo y resplandor */
.glow-effect {
    position: relative;
}

.glow-effect::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(31, 162, 206, 0.4) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: -1;
    filter: blur(20px);
    animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Efectos de rotación 3D */
.rotate-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rotate-3d:hover {
    transform: rotateY(5deg) rotateX(-5deg) translateZ(20px);
}

/* Sombras coloreadas dinámicas */
.shadow-colored-blue {
    box-shadow: 
        0 10px 30px rgba(31, 162, 206, 0.4),
        0 0 0 1px rgba(31, 162, 206, 0.2);
}

.shadow-colored-purple {
    box-shadow: 
        0 10px 30px rgba(115, 31, 68, 0.4),
        0 0 0 1px rgba(115, 31, 68, 0.2);
}

.shadow-colored-yellow {
    box-shadow: 
        0 10px 30px rgba(247, 175, 34, 0.4),
        0 0 0 1px rgba(247, 175, 34, 0.2);
}

/* Efectos de partículas 3D */
.particle-3d {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: particle-float-3d 8s infinite;
    transform-style: preserve-3d;
}

@keyframes particle-float-3d {
    0% {
        transform: translateY(0) translateX(0) translateZ(0) rotateY(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-200px) translateX(100px) translateZ(50px) rotateY(360deg);
        opacity: 0;
    }
}

/* Enlaces de navegación 3D */
.nav-link-3d {
    position: relative;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-link-3d::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #1fa2ce, #731f44);
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 10px rgba(31, 162, 206, 0.5);
}

.nav-link-3d:hover::after {
    width: 100%;
}

.nav-link-3d:hover {
    transform: translateY(-2px);
    text-shadow: 0 2px 10px rgba(31, 162, 206, 0.3);
}

/* Secciones con efecto 3D */
.section-3d {
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Cards de servicios con efecto 3D mejorado */
.service-card-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.service-card-3d::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(31, 162, 206, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.service-card-3d:hover {
    transform: translateY(-15px) rotateX(5deg) rotateY(-3deg) scale(1.05) translateZ(30px);
    box-shadow: 
        0 30px 60px -12px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        0 0 60px rgba(31, 162, 206, 0.5),
        inset 0 0 40px rgba(255, 255, 255, 0.1);
}

.service-card-3d:hover::before {
    opacity: 1;
}

/* Efectos de hover mejorados para cards */
.card-hover-3d {
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.card-hover-3d:hover {
    transform: translateY(-10px) rotateX(3deg) rotateY(-2deg) scale(1.03) translateZ(20px);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        0 0 50px rgba(31, 162, 206, 0.4);
}

/* Efectos de texto 3D */
.text-3d {
    text-shadow: 
        0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 0 rgba(0, 0, 0, 0.1),
        0 3px 0 rgba(0, 0, 0, 0.1),
        0 4px 0 rgba(0, 0, 0, 0.1),
        0 5px 0 rgba(0, 0, 0, 0.1),
        0 6px 1px rgba(0, 0, 0, 0.1),
        0 0 5px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.3),
        0 3px 5px rgba(0, 0, 0, 0.2),
        0 5px 10px rgba(0, 0, 0, 0.25),
        0 10px 10px rgba(0, 0, 0, 0.2),
        0 20px 20px rgba(0, 0, 0, 0.15);
}

/* Efectos de fondo animado 3D */
.bg-animated-3d {
    position: relative;
    overflow: hidden;
}

.bg-animated-3d::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(31, 162, 206, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(115, 31, 68, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(247, 175, 34, 0.1) 0%, transparent 50%);
    animation: bg-rotate-3d 20s linear infinite;
    pointer-events: none;
}

@keyframes bg-rotate-3d {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* Efectos de borde luminoso */
.border-glow {
    position: relative;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.border-glow::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #1fa2ce, #731f44, #f7af22);
    border-radius: inherit;
    z-index: -1 !important;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(10px);
    pointer-events: none !important;
    isolation: isolate;
}

.border-glow:hover::before {
    opacity: 0.6;
}

/* Responsive - Ajustes para móviles */
@media (max-width: 768px) {
    .card-3d:hover {
        transform: translateY(-5px) scale(1.02);
    }
    
    .service-card-3d:hover {
        transform: translateY(-8px) scale(1.03);
    }
    
    .btn-3d:hover {
        transform: translateY(-2px) scale(1.03);
    }
    
    .elevation-3d {
        transform: translateZ(10px);
    }
    
    .elevation-3d:hover {
        transform: translateZ(20px) scale(1.01);
    }
    
    .gradient-bg::before {
        animation-duration: 30s;
    }
    
    .float-3d {
        animation-duration: 8s;
    }
}

/* Mejoras adicionales para mejor rendimiento */
.card-3d,
.service-card-3d,
.btn-3d,
.elevation-3d {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Efectos de entrada mejorados */
@keyframes slideIn3D {
    from {
        opacity: 0;
        transform: translateY(50px) translateZ(-100px) rotateX(-20deg);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateZ(0) rotateX(0deg);
        filter: blur(0);
    }
}

.animate-slide-in-3d {
    animation: slideIn3D 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ========================================
   ESTILOS PARA BOTÓN DE AGENDAR CITA
   ======================================== */

#submitBtn {
    position: relative !important;
    z-index: 1000 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#submitBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(31, 162, 206, 0.3) !important;
}

#submitBtn:active {
    transform: translateY(0);
}

#submitBtn:focus {
    outline: 3px solid rgba(31, 162, 206, 0.5);
    outline-offset: 2px;
}

#submitBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Asegurar que el formulario sea interactivo */
#appointmentForm {
    position: relative;
    z-index: 1;
}

#appointmentForm input,
#appointmentForm select,
#appointmentForm textarea {
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

