/* ==========================================================================
   BinariaOS — Hoja de Estilos Principal Mejorada
   Complemento a Tailwind CSS (CDN Base)
   Estilo: Dark Cyberpunk / Neón Futurista
   Autor: BinariaOS Dev Team
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES CSS GLOBALES
   -------------------------------------------------------------------------- */
:root {
  --neon-cyan: #22D3EE;
  --neon-blue: #0EA5E9;
  --neon-pink: #EC4899;
  --neon-purple: #A855F7;
  --neon-green: #10B981;
  --cyber-900: #030712;
  --cyber-800: #0B1121;
  --glow-cyan: 0 0 15px rgba(34, 211, 238, 0.4), 0 0 30px rgba(34, 211, 238, 0.2);
  --glow-blue: 0 0 15px rgba(14, 165, 233, 0.4), 0 0 30px rgba(14, 165, 233, 0.2);
  --glow-pink: 0 0 15px rgba(236, 72, 153, 0.4), 0 0 30px rgba(236, 72, 153, 0.2);
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. SCROLLBAR PERSONALIZADA (Oculta pero funcional)
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  display: none; /* Oculta la barra en Chrome, Safari y Opera */
  width: 0;
  background: transparent;
}

/* Firefox e IE/Edge */
* {
  -ms-overflow-style: none;  /* IE y Edge */
  scrollbar-width: none;  /* Firefox */
}

/* --------------------------------------------------------------------------
   3. BASE Y RESET
   -------------------------------------------------------------------------- */
body {
  overflow-x: hidden;
}

/* Selección de texto con estilo neón */
::selection {
  background: var(--neon-cyan);
  color: #000;
}

/* --------------------------------------------------------------------------
   4. EFECTO GLITCH PARA TIPOGRAFÍA CINÉTICA
   -------------------------------------------------------------------------- */
.cyberpunk-glitch {
  position: relative;
  display: inline-block;
}

.cyberpunk-glitch::before,
.cyberpunk-glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  /* Heredar el gradiente del texto padre */
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-image: inherit;
}

.cyberpunk-glitch::before {
  left: 3px;
  text-shadow: -2px 0 var(--neon-cyan);
  animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.cyberpunk-glitch::after {
  left: -3px;
  text-shadow: 2px 0 var(--neon-blue);
  animation: glitch-anim-2 3.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0%   { clip-path: inset(20% 0 80% 0); }
  10%  { clip-path: inset(60% 0 10% 0); }
  20%  { clip-path: inset(40% 0 50% 0); }
  30%  { clip-path: inset(80% 0 5% 0); }
  40%  { clip-path: inset(10% 0 70% 0); }
  50%  { clip-path: inset(30% 0 20% 0); }
  60%  { clip-path: inset(70% 0 15% 0); }
  70%  { clip-path: inset(5% 0 85% 0); }
  80%  { clip-path: inset(50% 0 30% 0); }
  90%  { clip-path: inset(15% 0 60% 0); }
  100% { clip-path: inset(45% 0 25% 0); }
}

@keyframes glitch-anim-2 {
  0%   { clip-path: inset(10% 0 60% 0); }
  10%  { clip-path: inset(30% 0 20% 0); }
  20%  { clip-path: inset(70% 0 10% 0); }
  30%  { clip-path: inset(50% 0 30% 0); }
  40%  { clip-path: inset(20% 0 50% 0); }
  50%  { clip-path: inset(80% 0 5% 0); }
  60%  { clip-path: inset(25% 0 45% 0); }
  70%  { clip-path: inset(60% 0 20% 0); }
  80%  { clip-path: inset(35% 0 40% 0); }
  90%  { clip-path: inset(75% 0 10% 0); }
  100% { clip-path: inset(40% 0 35% 0); }
}

/* --------------------------------------------------------------------------
   5. EFECTO TILT 3D (Perspectiva para cards)
   -------------------------------------------------------------------------- */
.tilt-card {
  transform-style: preserve-3d;
  transform: perspective(1000px);
}

.tilt-content {
  transform: translateZ(30px);
}

/* --------------------------------------------------------------------------
   6. BORDES NEÓN CON GLOW ANIMADO
   -------------------------------------------------------------------------- */
.neon-border {
  position: relative;
  overflow: hidden;
}

/* Borde superior animado tipo scan-line */
.neon-border::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  animation: neon-scan 3s linear infinite;
  z-index: 10;
}

@keyframes neon-scan {
  0%   { left: -100%; }
  100% { left: 100%; }
}

/* --------------------------------------------------------------------------
   7. GLOW HOVER PARA CARDS
   -------------------------------------------------------------------------- */
.card-glow {
  position: relative;
  transition: all 0.5s var(--transition-smooth);
}

.card-glow::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue), var(--neon-purple));
  opacity: 0;
  z-index: -1;
  transition: opacity 0.5s var(--transition-smooth);
  filter: blur(8px);
}

.card-glow:hover::after {
  opacity: 0.4;
}

/* --------------------------------------------------------------------------
   8. EFECTO DE RUIDO DE FONDO SUTIL
   -------------------------------------------------------------------------- */
.bg-noise {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   9. GRADIENTE RADIAL PARA VIÑETA (usado en Aurora)
   -------------------------------------------------------------------------- */
.bg-radial-vignette {
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.7) 70%, rgba(0,0,0,0.95) 100%);
}

/* --------------------------------------------------------------------------
   10. ANIMACIONES DE ENTRADA PERSONALIZADAS
   -------------------------------------------------------------------------- */

/* Fade + slide desde abajo con escala */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Pulso neón suave */
@keyframes neonPulse {
  0%, 100% {
    box-shadow: 0 0 5px rgba(34, 211, 238, 0.3),
                0 0 10px rgba(34, 211, 238, 0.2),
                0 0 20px rgba(34, 211, 238, 0.1);
  }
  50% {
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.5),
                0 0 20px rgba(34, 211, 238, 0.3),
                0 0 40px rgba(34, 211, 238, 0.2);
  }
}

.neon-pulse {
  animation: neonPulse 2s ease-in-out infinite;
}

/* Flotación suave */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-10px); }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Rotación lenta */
@keyframes slowSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.animate-slow-spin {
  animation: slowSpin 20s linear infinite;
}

/* --------------------------------------------------------------------------
   11. EFECTO TYPING / CURSOR PARPADEANTE
   -------------------------------------------------------------------------- */
.typing-cursor::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--neon-cyan);
  font-weight: 100;
}

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

/* --------------------------------------------------------------------------
   12. LÍNEAS DE ESCANEO (Efecto CRT sutil)
   -------------------------------------------------------------------------- */
.scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 5;
}

/* --------------------------------------------------------------------------
   13. GRADIENTE ANIMADO DE FONDO (para hero y secciones especiales)
   -------------------------------------------------------------------------- */
.animated-gradient-bg {
  background: linear-gradient(
    -45deg,
    var(--cyber-900),
    #0a1628,
    #091220,
    #030712
  );
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

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

/* --------------------------------------------------------------------------
   14. EFECTO SHIMMER / BRILLO DESLIZANTE
   -------------------------------------------------------------------------- */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
  transition: none;
  animation: shimmer 4s ease-in-out infinite;
  z-index: 1;
}

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

/* --------------------------------------------------------------------------
   15. BOTÓN NEÓN PREMIUM
   -------------------------------------------------------------------------- */
.btn-neon {
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--transition-smooth);
}

.btn-neon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-blue));
  opacity: 0;
  transition: opacity 0.4s;
  z-index: -1;
}

.btn-neon:hover::before {
  opacity: 1;
}

.btn-neon:hover {
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.5),
              0 0 40px rgba(34, 211, 238, 0.3);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   16. CONTADOR / STATS CON EFECTO
   -------------------------------------------------------------------------- */
.stat-number {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --------------------------------------------------------------------------
   17. EFECTO MAGNÉTICO PARA LOGOS DE CLIENTES
   -------------------------------------------------------------------------- */
.logo-magnetic {
  transition: all 0.4s var(--transition-smooth);
  filter: grayscale(1) brightness(0.5);
}

.logo-magnetic:hover {
  filter: grayscale(0) brightness(1);
  transform: scale(1.15);
}

/* --------------------------------------------------------------------------
   18. LÍNEA DE PROGRESO DECORATIVA
   -------------------------------------------------------------------------- */
.progress-line {
  position: relative;
  overflow: hidden;
}

.progress-line::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-blue));
  transition: width 0.6s var(--transition-smooth);
}

.progress-line:hover::after {
  width: 100%;
}

/* --------------------------------------------------------------------------
   19. EFECTO DE PARTÍCULAS FLOTANTES (CSS puro para decoración)
   -------------------------------------------------------------------------- */
.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--neon-cyan);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 6s ease-in-out infinite;
}

@keyframes particleFloat {
  0%   { opacity: 0; transform: translateY(0) scale(0); }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-100vh) scale(1); }
}

/* --------------------------------------------------------------------------
   20. PREFERS-REDUCED-MOTION — Accesibilidad
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cyberpunk-glitch::before,
  .cyberpunk-glitch::after {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   21. RESPONSIVE AJUSTES FINOS
   -------------------------------------------------------------------------- */

/* En móvil, reducir intensidad de efectos para rendimiento */
@media (max-width: 768px) {
  .cyberpunk-glitch::before,
  .cyberpunk-glitch::after {
    display: none; /* Desactivar glitch en móvil para legibilidad */
  }
  
  .shimmer::before {
    display: none; /* Desactivar shimmer en móvil */
  }
  
  .card-glow::after {
    display: none; /* Sin glow extra en móvil */
  }
}

/* --------------------------------------------------------------------------
   22. TRANSICIÓN DE PÁGINA SUAVE (loader)
   -------------------------------------------------------------------------- */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--cyber-900);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s, visibility 0.5s;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader .loader-bar {
  width: 120px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.page-loader .loader-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  animation: loaderSlide 1s ease-in-out infinite;
}

@keyframes loaderSlide {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* --------------------------------------------------------------------------
   23. FORMULARIO — ESTILOS DE FOCUS MEJORADOS
   -------------------------------------------------------------------------- */
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2),
              0 0 15px rgba(34, 211, 238, 0.1);
}

/* Estilo para select con flecha personalizada */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2322D3EE' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

/* --------------------------------------------------------------------------
   24. TOOLTIP GENÉRICO
   -------------------------------------------------------------------------- */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #000;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--transition-smooth);
  border: 1px solid rgba(34, 211, 238, 0.3);
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   25. WHATSAPP BUTTON MEJORADO
   -------------------------------------------------------------------------- */
.whatsapp-float {
  animation: whatsappBounce 2s ease-in-out infinite;
}

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

.whatsapp-float:hover {
  animation: none;
}
