/* 
 * TechHearts Advanced Animations
 * Inspired by: Aceternity UI + Magic UI
 * No npm dependencies - Pure CSS/JS
 */

/* ============================================
   1. KEYFRAMES ANIMATIONS
   ============================================ */

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

@keyframes pulse-glow {
  0%, 100% { 
    opacity: 1;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
  }
  50% { 
    opacity: 0.8;
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.8);
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes slide-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in-down {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes number-ticker {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-100%);
  }
}

@keyframes particle-float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.3;
  }
  33% {
    transform: translate(30px, -30px) scale(1.2);
    opacity: 0.6;
  }
  66% {
    transform: translate(-20px, -60px) scale(0.8);
    opacity: 0.4;
  }
}

/* ============================================
   2. GLOW EFFECTS
   ============================================ */

.glow-cyan {
  box-shadow: 
    0 0 10px rgba(6, 182, 212, 0.3),
    0 0 20px rgba(6, 182, 212, 0.2),
    0 0 30px rgba(6, 182, 212, 0.1);
}

.glow-cyan-strong {
  box-shadow: 
    0 0 20px rgba(6, 182, 212, 0.6),
    0 0 40px rgba(6, 182, 212, 0.4),
    0 0 60px rgba(6, 182, 212, 0.2);
}

.glow-purple {
  box-shadow: 
    0 0 10px rgba(168, 85, 247, 0.3),
    0 0 20px rgba(168, 85, 247, 0.2),
    0 0 30px rgba(168, 85, 247, 0.1);
}

.glow-purple-strong {
  box-shadow: 
    0 0 20px rgba(168, 85, 247, 0.6),
    0 0 40px rgba(168, 85, 247, 0.4),
    0 0 60px rgba(168, 85, 247, 0.2);
}

.text-glow-cyan {
  text-shadow: 
    0 0 10px rgba(6, 182, 212, 0.8),
    0 0 20px rgba(6, 182, 212, 0.6),
    0 0 30px rgba(6, 182, 212, 0.4);
}

.text-glow-purple {
  text-shadow: 
    0 0 10px rgba(168, 85, 247, 0.8),
    0 0 20px rgba(168, 85, 247, 0.6),
    0 0 30px rgba(168, 85, 247, 0.4);
}

/* ============================================
   3. ANIMATED BACKGROUNDS
   ============================================ */

.bg-gradient-animated {
  background: linear-gradient(
    135deg,
    #0f172a 0%,
    #1e293b 25%,
    #0f172a 50%,
    #1e293b 75%,
    #0f172a 100%
  );
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
}

.bg-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(6, 182, 212, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 3s infinite;
}

/* ============================================
   4. SPOTLIGHT EFFECT (Aceternity UI Style)
   ============================================ */

.spotlight-container {
  position: relative;
  overflow: hidden;
}

.spotlight {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(6, 182, 212, 0.15) 0%,
    rgba(6, 182, 212, 0.05) 40%,
    transparent 70%
  );
  pointer-events: none;
  transition: transform 0.3s ease-out;
}

/* ============================================
   5. 3D CARD TILT EFFECT
   ============================================ */

.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.card-3d:hover {
  transform: perspective(1000px) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg)) scale(1.05);
}

.card-3d-inner {
  transform: translateZ(30px);
}

/* ============================================
   6. PARTICLES BACKGROUND
   ============================================ */

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.5);
  animation: particle-float 6s ease-in-out infinite;
}

.particle:nth-child(2n) {
  background: rgba(168, 85, 247, 0.5);
  animation-delay: -2s;
  animation-duration: 8s;
}

.particle:nth-child(3n) {
  animation-delay: -4s;
  animation-duration: 10s;
}

/* ============================================
   7. ANIMATED BUTTONS
   ============================================ */

.btn-glow {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
  transition: all 0.3s ease;
}

.btn-glow::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;
}

.btn-glow:hover::before {
  width: 300px;
  height: 300px;
}

.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(6, 182, 212, 0.4);
}

.btn-pulse {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ============================================
   8. SCROLL ANIMATIONS (Applied via JS)
   ============================================ */

.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
}

.slide-up {
  transform: translateY(30px);
}

.slide-up.animated {
  transform: translateY(0);
}

.slide-down {
  transform: translateY(-30px);
}

.slide-down.animated {
  transform: translateY(0);
}

.scale-up {
  transform: scale(0.9);
}

.scale-up.animated {
  transform: scale(1);
}

/* ============================================
   9. FLOATING ELEMENTS
   ============================================ */

.float-slow {
  animation: float 6s ease-in-out infinite;
}

.float-medium {
  animation: float 4s ease-in-out infinite;
  animation-delay: -1s;
}

.float-fast {
  animation: float 3s ease-in-out infinite;
  animation-delay: -2s;
}

/* ============================================
   10. GRID BACKGROUND PATTERN
   ============================================ */

.grid-background {
  background-image: 
    linear-gradient(rgba(6, 182, 212, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  background-position: center center;
}

/* ============================================
   11. HOVER INTERACTIONS
   ============================================ */

.interactive {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive:hover {
  transform: translateY(-5px);
}

.interactive:active {
  transform: translateY(-2px) scale(0.98);
}

/* ============================================
   12. NUMBER TICKER
   ============================================ */

.number-ticker {
  display: inline-block;
  overflow: hidden;
  height: 1.2em;
  line-height: 1.2em;
}

.number-ticker-inner {
  display: flex;
  flex-direction: column;
  animation: number-ticker 2s ease-out forwards;
}

/* ============================================
   13. LOADING STATES
   ============================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(30, 41, 59, 0.4) 25%,
    rgba(51, 65, 85, 0.4) 50%,
    rgba(30, 41, 59, 0.4) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ============================================
   14. UTILITY CLASSES
   ============================================ */

.blur-sm {
  backdrop-filter: blur(8px);
}

.blur-md {
  backdrop-filter: blur(12px);
}

.blur-lg {
  backdrop-filter: blur(16px);
}

.border-glow-cyan {
  border: 1px solid rgba(6, 182, 212, 0.3);
  transition: border-color 0.3s ease;
}

.border-glow-cyan:hover {
  border-color: rgba(6, 182, 212, 0.8);
}

.border-glow-purple {
  border: 1px solid rgba(168, 85, 247, 0.3);
  transition: border-color 0.3s ease;
}

.border-glow-purple:hover {
  border-color: rgba(168, 85, 247, 0.8);
}

/* ============================================
   15. RESPONSIVE ANIMATIONS
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 768px) {
  .spotlight {
    width: 400px;
    height: 400px;
  }
  
  .particle {
    display: none; /* Disable on mobile for performance */
  }
}
