/* ============================================
   DeFiBall.io - Global Animated Background
   Diseño moderno con efectos de rifa/lotería
   ============================================ */

:root {
  /* Paleta de colores extraída de defiball.io */
  --bg: #000000;
  --bg-gradient: linear-gradient(135deg, #000000 0%, #0a0e1a 100%);
  --fg: #e2e8f0;
  --line: #334155;
  --btn: #1f2937;
  --btnHover: #111827;
  --blue: #1E40AF;
  --red: #DC143C;
  --purple: #a855f7;
  --card-bg: #0a0e1a;
  
  /* Glows con colores de marca */
  --glow-blue: 0 0 20px rgba(30, 64, 175, 0.5);
  --glow-red: 0 0 20px rgba(220, 20, 60, 0.5);
  --glow-purple: 0 0 20px rgba(168, 85, 247, 0.5);
  --glow-green: 0 0 20px rgba(34, 197, 94, 0.5);
  
  /* Colores para efectos de fondo */
  --star-color: rgba(30, 64, 175, 0.8);
  --confetti-blue: #1E40AF;
  --confetti-red: #DC143C;
  --confetti-purple: #a855f7;
  --glow-orbit: rgba(168, 85, 247, 0.3);
}

/* ============================================
   FONDO ANIMADO - Contenedor Principal
   ============================================ */

body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Canvas para efectos animados */
#animated-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background: var(--bg-gradient);
}

/* Capa de gradientes radiales animados */
.animated-bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
}

/* Gradiente radial azul animado */
.bg-gradient-blue {
  background: radial-gradient(circle at 20% 30%, rgba(30, 64, 175, 0.15) 0%, transparent 50%);
  animation: gradientPulse 8s ease-in-out infinite;
}

/* Gradiente radial rojo animado */
.bg-gradient-red {
  background: radial-gradient(circle at 80% 70%, rgba(220, 20, 60, 0.12) 0%, transparent 50%);
  animation: gradientPulse 10s ease-in-out infinite reverse;
}

/* Gradiente radial púrpura animado */
.bg-gradient-purple {
  background: radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.1) 0%, transparent 60%);
  animation: gradientPulse 12s ease-in-out infinite;
}

/* Formas geométricas con glow */
.bg-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.15;
  animation: floatShape 20s ease-in-out infinite;
}

.bg-shape-1 {
  width: 400px;
  height: 400px;
  background: var(--blue);
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.bg-shape-2 {
  width: 300px;
  height: 300px;
  background: var(--red);
  top: 60%;
  right: 15%;
  animation-delay: 5s;
}

.bg-shape-3 {
  width: 350px;
  height: 350px;
  background: var(--purple);
  bottom: 20%;
  left: 50%;
  animation-delay: 10s;
}

/* Estrellas parpadeantes */
.stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--star-color);
  border-radius: 50%;
  box-shadow: 0 0 4px var(--star-color);
  animation: twinkle 3s ease-in-out infinite;
}

/* Confeti sutil cayendo */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--confetti-blue);
  opacity: 0.6;
  animation: confettiFall linear infinite;
}

.confetti-piece:nth-child(2n) {
  background: var(--confetti-red);
  width: 5px;
  height: 5px;
}

.confetti-piece:nth-child(3n) {
  background: var(--confetti-purple);
  width: 4px;
  height: 4px;
}

/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes gradientPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

@keyframes floatShape {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 30px) scale(0.9);
  }
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.5);
  }
}

@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 0.6;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Luz que se desplaza suavemente */
@keyframes lightSweep {
  0% {
    transform: translateX(-100%) translateY(-100%);
    opacity: 0;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    transform: translateX(200%) translateY(200%);
    opacity: 0;
  }
}

.light-sweep {
  position: fixed;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(30, 64, 175, 0.4) 0%, transparent 70%);
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
  animation: lightSweep 15s linear infinite;
}

/* ============================================
   GLASSMORPHISM - Efectos de vidrio
   ============================================ */

.glass-card {
  background: rgba(10, 14, 26, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-card-hover {
  transition: all 0.3s ease;
}

.glass-card-hover:hover {
  background: rgba(10, 14, 26, 0.8);
  border-color: rgba(30, 64, 175, 0.5);
  box-shadow: var(--glow-blue),
              0 12px 40px rgba(0, 0, 0, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* ============================================
   BOTONES MODERNOS CON GRADIENTES
   ============================================ */

.btn-modern {
  position: relative;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  border: 2px solid transparent;
}

.btn-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-modern:hover::before {
  left: 100%;
}

.btn-blue {
  background: linear-gradient(135deg, var(--blue), #3b82f6);
  color: #fff;
  box-shadow: var(--glow-blue), 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-blue:hover {
  background: linear-gradient(135deg, #3b82f6, var(--blue));
  transform: translateY(-2px);
  box-shadow: var(--glow-blue), 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn-red {
  background: linear-gradient(135deg, var(--red), #ef4444);
  color: #fff;
  box-shadow: var(--glow-red), 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-red:hover {
  background: linear-gradient(135deg, #ef4444, var(--red));
  transform: translateY(-2px);
  box-shadow: var(--glow-red), 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn-dark {
  background: linear-gradient(135deg, var(--btn), #2a2f3a);
  color: var(--fg);
  border-color: var(--line);
}

.btn-dark:hover {
  background: linear-gradient(135deg, var(--btnHover), #1a1f2e);
  border-color: var(--blue);
  box-shadow: var(--glow-blue), 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* ============================================
   RESPONSIVE Y OPTIMIZACIONES
   ============================================ */

/* Reducir animaciones en móviles para mejor rendimiento */
@media (max-width: 768px) {
  .bg-shape {
    filter: blur(40px);
    opacity: 0.1;
  }
  
  .confetti-piece {
    animation-duration: 8s;
  }
  
  .star {
    animation-duration: 4s;
  }
}

/* Respetar preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .bg-gradient-blue,
  .bg-gradient-red,
  .bg-gradient-purple,
  .bg-shape,
  .star,
  .confetti-piece,
  .light-sweep {
    animation: none !important;
    opacity: 0.3;
  }
}

