/* Custom CSS para complementar Tailwind */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Animaciones personalizadas */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes bounceGentle {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

/* Efectos de hover personalizados */
.card-hover {
    transition: all 0.3s ease;
}

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

/* Estilo para el backdrop blur del navbar */
.backdrop-blur-md {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Efecto gradient text */
.gradient-text {
    background: linear-gradient(135deg, #0070f3, #00c6ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Animación para elementos que aparecen al hacer scroll */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Efectos de partículas sutiles en el hero */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(0, 112, 243, 0.3);
    border-radius: 50%;
    animation: float 6s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}

/* Estilo para números destacados */
.stat-number {
    background: linear-gradient(135deg, #0070f3, #00c6ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* Efecto de loading sutil */
.loading-dot {
    animation: loadingDot 1.4s infinite ease-in-out both;
}

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

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

/* Responsive improvements */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        line-height: 1.6;
    }
}

/* Focus states mejorados para accesibilidad */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.3);
}

/* Estilo para botones con efecto ripple */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.6s, height 0.6s;
    transform: translate(-50%, -50%);
}

.btn-ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Mejoras en la tipografía */
.text-balance {
    text-wrap: balance;
}

/* Estilo para indicadores de progreso */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 112, 243, 0.2);
    z-index: 9999;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0070f3, #00c6ff);
    width: 0%;
    transition: width 0.3s ease;
}

/* Estilo para tooltips */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Enhanced Gradient Text Effects */
.gradient-text-animated {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientShift 4s ease infinite;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Glassmorphism Effects */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

/* Enhanced Card Hover Effects */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

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

/* Floating Animation for Elements */
.float {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Pulsing Glow Effect */
.pulse-glow {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
    }
}

/* Morphing Shapes */
.morph-circle {
    border-radius: 50%;
    animation: morphing 4s ease-in-out infinite;
}

@keyframes morphing {
    0%, 100% { border-radius: 50%; }
    25% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    75% { border-radius: 70% 30% 50% 50% / 30% 50% 50% 70%; }
}

/* Enhanced Typography */
.text-shadow-sm {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.text-shadow-md {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.text-shadow-lg {
    text-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
}

/* Neon Glow Text */
.neon-text {
    color: #fff;
    text-shadow: 
        0 0 5px #0066ff,
        0 0 10px #0066ff,
        0 0 20px #0066ff,
        0 0 40px #0066ff;
    animation: neonFlicker 1.5s infinite alternate;
}

@keyframes neonFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Geometric Patterns */
.pattern-dots {
    background-image: radial-gradient(circle, #0066ff 1px, transparent 1px);
    background-size: 20px 20px;
}

.pattern-lines {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 102, 255, 0.1) 10px,
        rgba(0, 102, 255, 0.1) 20px
    );
}

/* Enhanced Scroll Animations */
.reveal-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease-out;
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease-out;
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* Magnetic Button Effect */
.magnetic-btn {
    transition: transform 0.2s ease;
}

.magnetic-btn:hover {
    transform: scale(1.05);
    cursor: pointer;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0066ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Parallax Container */
.parallax-container {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.parallax-element {
    transform: translateZ(-1px) scale(2);
}

/* Wavy Animation */
.wave {
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    75% { transform: rotate(-10deg); }
}

/* Enhanced Shadow Effects */
.shadow-colored {
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.2);
}

.shadow-colored-lg {
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3);
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #0066ff;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #0066ff; }
}

/* Glitch Effect */
.glitch {
    position: relative;
    animation: glitch 2s infinite;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

/* Enhanced Mobile Styles */
@media (max-width: 768px) {
    .mobile-center {
        text-align: center !important;
    }
    
    .mobile-stack {
        flex-direction: column !important;
    }
    
    .mobile-full {
        width: 100% !important;
    }
    
    /* Reduce animations on mobile for performance */
    .reduce-motion * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .dark-theme-auto {
        background-color: #1a1a1a;
        color: #ffffff;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .high-contrast {
        border: 2px solid;
        background: transparent;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.6;
        color: #000;
    }
    
    .print-break {
        page-break-before: always;
    }
    
    .print-avoid-break {
        page-break-inside: avoid;
    }
}

/* Dark theme specific styles */
.dark {
    color-scheme: dark;
}

/* Theme Toggle Button Styles */
.theme-toggle {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Toggle Circle Animation */
#toggle-circle, #mobile-toggle-circle {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

#theme-icon, #mobile-theme-icon {
    transition: all 0.3s ease;
}

/* Enhanced Dark Mode Animations */
html.dark {
    transition: background-color 0.3s ease, color 0.3s ease;
}

html.dark body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Smooth transitions for all elements when switching themes */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Icon rotation animation */
@keyframes iconRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.icon-rotate {
    animation: iconRotate 0.3s ease-in-out;
}

/* Dark mode specific gradient backgrounds */
.dark .hero-bg-dark {
    background: linear-gradient(135deg, #1f2937 0%, #111827 50%, #0f172a 100%);
}

/* Enhanced focus states for dark mode */
.dark .focus-ring:focus {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.5);
}

/* Dark mode particle effects */
.dark .particle {
    background: rgba(96, 165, 250, 0.4);
}

/* Dark mode progress bar */
.dark .progress-bar {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* Dark mode tooltips */
.dark .tooltip::after {
    background: #374151;
    border: 1px solid #4b5563;
}

/* Dark mode glassmorphism */
.dark .glass {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dark mode shadow effects */
.dark .shadow-colored {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.dark .shadow-colored-lg {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Dark mode neon effects */
.dark .neon-text {
    text-shadow: 
        0 0 5px #60a5fa,
        0 0 10px #60a5fa,
        0 0 20px #60a5fa,
        0 0 40px #60a5fa;
}

/* Dark mode patterns */
.dark .pattern-dots {
    background-image: radial-gradient(circle, #60a5fa 1px, transparent 1px);
}

.dark .pattern-lines {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(96, 165, 250, 0.1) 10px,
        rgba(96, 165, 250, 0.1) 20px
    );
}

/* Special animation for theme switch */
@keyframes themeSwitch {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

.theme-switch-animation {
    animation: themeSwitch 0.6s ease-in-out;
}

/* Smooth background transitions for sections */
.dark section {
    transition: background-color 0.5s ease;
}

/* Enhanced card styles for dark mode */
.dark .card-hover {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.dark .card-hover:hover {
    background: rgba(55, 65, 81, 0.9);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Dark mode specific animations */
@keyframes darkModeGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(96, 165, 250, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(96, 165, 250, 0.4);
    }
}

.dark .pulse-glow {
    animation: darkModeGlow 2s infinite;
}

/* Accessibility improvements for dark mode */
@media (prefers-color-scheme: dark) {
    .dark-theme-auto {
        background-color: #1f2937;
        color: #f9fafb;
    }
}

@media (prefers-contrast: high) {
    .high-contrast {
        filter: contrast(2);
    }
}

@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }
    
    .print-break {
        page-break-before: always;
    }
    
    .print-avoid-break {
        page-break-inside: avoid;
    }
}

/* Ajustes específicos para resoluciones de zoom */
@media (min-resolution: 110dpi), (min-resolution: 1.1dppx) {
    h1[data-translate-key="hero.title"] {
        font-size: 2.8rem !important;
        line-height: 1.2 !important;
    }
}

@media (min-resolution: 125dpi), (min-resolution: 1.25dppx) {
    h1[data-translate-key="hero.title"] {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
    }
}

/* También podemos usar una solución alternativa con media queries basadas en ancho */
@media (min-width: 1024px) and (max-width: 1280px) {
    h1[data-translate-key="hero.title"] {
        font-size: calc(2.5rem + 1vw) !important;
        line-height: 1.2 !important;
    }
}