/**
 * TechForest Software - Advanced Cinematic Animation Suite
 * Integrated AnimVault, GSAP, AOS, CodePen VFX
 * 100% GPU-accelerated, lightweight, responsive (Desktop + Mobile optimized)
 */

/* ==========================================================================
   1. INTERACTIVE GLOWING CURSOR (AnimVault - Desktop Only)
   ========================================================================== */
@media (hover: hover) and (pointer: fine) {
  .tfs-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: #38bdf8;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 12px #38bdf8, 0 0 24px rgba(56, 189, 248, 0.8);
    transition: width 0.2s ease, height 0.2s ease, background 0.2s ease, opacity 0.2s ease;
    mix-blend-mode: screen;
  }

  .tfs-cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 38px;
    height: 38px;
    border: 1.5px solid rgba(56, 189, 248, 0.6);
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, rgba(124, 58, 237, 0.05) 70%, transparent 100%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999998;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
                height 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.25s ease, 
                background 0.25s ease, 
                transform 0.1s linear, 
                opacity 0.25s ease;
    backdrop-filter: blur(0.5px);
  }

  /* Hover state when over clickable items */
  .tfs-cursor-hover .tfs-cursor-dot {
    width: 14px;
    height: 14px;
    background: #818cf8;
    box-shadow: 0 0 16px #818cf8, 0 0 30px rgba(129, 140, 248, 0.9);
  }

  .tfs-cursor-hover .tfs-cursor-ring {
    width: 58px;
    height: 58px;
    border-color: rgba(168, 85, 247, 0.85);
    background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, rgba(56, 189, 248, 0.1) 70%, transparent 100%);
    box-shadow: 0 0 28px rgba(168, 85, 247, 0.45);
  }

  .tfs-cursor-hidden .tfs-cursor-dot,
  .tfs-cursor-hidden .tfs-cursor-ring {
    opacity: 0;
  }
}

/* Fallback: Hide custom cursor on mobile touch */
@media (hover: none) or (pointer: coarse) {
  .tfs-cursor-dot,
  .tfs-cursor-ring {
    display: none !important;
  }
}

/* ==========================================================================
   2. BUTTON HOVER & CLICK ANIMATIONS (AnimVault / CodePen)
   ========================================================================== */
/* Glass Shine Light Sweep on Hover */
button, .btn-anim, a[href*="contact"], a[href*="products"] {
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              background-color 0.3s ease, 
              border-color 0.3s ease !important;
}

button:hover, .btn-anim:hover {
  transform: translateY(-2px) scale(1.02);
}

button:active, .btn-anim:active {
  transform: translateY(1px) scale(0.98);
}

/* Shimmer Light Reflection Pseudo */
button::after, .btn-anim::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -120%;
  width: 60%;
  height: 200%;
  background: linear-gradient(
    60deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.08) 30%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0.08) 70%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg);
  pointer-events: none;
  transition: left 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 5;
}

button:hover::after, .btn-anim:hover::after {
  left: 160%;
}

/* Click Ripple Wave (AnimVault) */
.tfs-ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.7) 0%, rgba(56, 189, 248, 0.4) 60%, transparent 100%);
  transform: scale(0);
  animation: tfsRippleAnim 0.65s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  pointer-events: none;
  z-index: 10;
}

@keyframes tfsRippleAnim {
  0% {
    transform: scale(0);
    opacity: 0.8;
  }
  100% {
    transform: scale(3.5);
    opacity: 0;
  }
}

/* ==========================================================================
   3. CARD HOVER ANIMATIONS (AnimVault / CodePen)
   ========================================================================== */
/* Dynamic Spotlight Effect on Cards */
.anim-card, 
.service-card, 
.product-card,
[class*="rounded-2xl"][class*="border-white"],
[class*="rounded-3xl"][class*="border-white"],
.group[class*="border-slate"] {
  position: relative;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  will-change: transform, box-shadow;
}

.anim-card:hover, 
.service-card:hover, 
.product-card:hover {
  transform: translateY(-6px) translateZ(0);
  box-shadow: 0 25px 50px -12px rgba(56, 189, 248, 0.25), 
              0 0 30px rgba(124, 58, 237, 0.15) !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
}

/* Mouse-tracking dynamic radial spotlight illumination */
.card-spotlight {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(56, 189, 248, 0.12),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}

.anim-card:hover .card-spotlight,
.service-card:hover .card-spotlight,
.product-card:hover .card-spotlight {
  opacity: 1;
}

/* Card Icon Pop Effect on Hover */
.anim-card:hover i,
.anim-card:hover svg,
.service-card:hover i,
.product-card:hover i {
  transform: scale(1.12) rotate(4deg);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ==========================================================================
   4. IMAGE ANIMATIONS (AnimVault / GSAP)
   ========================================================================== */
/* Smooth Ambient Floating */
.anim-float {
  animation: tfsFloat 6s ease-in-out infinite;
  will-change: transform;
}

.anim-float-delayed {
  animation: tfsFloat 7s ease-in-out 1.5s infinite;
  will-change: transform;
}

.anim-float-reverse {
  animation: tfsFloatReverse 6.5s ease-in-out 0.8s infinite;
  will-change: transform;
}

@keyframes tfsFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-14px) rotate(1.5deg);
  }
}

@keyframes tfsFloatReverse {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(14px) rotate(-1.5deg);
  }
}

/* Image Shimmer & 3D Tilt on Hover */
.anim-img-hover {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
              filter 0.5s ease, 
              box-shadow 0.5s ease;
}

.anim-img-hover:hover {
  transform: scale(1.04) translateY(-4px);
  filter: brightness(1.06) contrast(1.04);
  box-shadow: 0 20px 40px rgba(56, 189, 248, 0.25);
}

/* Glowing Ambient Pulse */
.anim-glow-pulse {
  animation: tfsGlowPulse 4s ease-in-out infinite;
}

@keyframes tfsGlowPulse {
  0%, 100% {
    filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 30px rgba(168, 85, 247, 0.7));
  }
}

/* ==========================================================================
   5. TEXT ANIMATIONS (GSAP / AnimVault)
   ========================================================================== */
/* Flowing Holographic Gradient Text */
.anim-gradient-text,
.gradient-text-flow {
  background: linear-gradient(
    135deg,
    #38bdf8 0%,
    #818cf8 25%,
    #c084fc 50%,
    #38bdf8 75%,
    #818cf8 100%
  );
  background-size: 250% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: tfsGradientFlow 6s linear infinite;
  display: inline-block;
}

@keyframes tfsGradientFlow {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 250% center;
  }
}

/* Text Shimmer Sweep */
.anim-text-shimmer {
  background: linear-gradient(
    90deg,
    #ffffff 0%,
    #ffffff 40%,
    #38bdf8 50%,
    #ffffff 60%,
    #ffffff 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: tfsTextShimmer 4s ease-in-out infinite;
}

@keyframes tfsTextShimmer {
  0% {
    background-position: 100% center;
  }
  100% {
    background-position: -100% center;
  }
}

/* ==========================================================================
   6. AOS SCROLL ANIMATION TWEAKS & SPEED TUNING
   ========================================================================== */
[data-aos] {
  pointer-events: auto !important;
  will-change: transform, opacity;
}

/* High performance cubic-bezier easing for AOS */
html:not(.no-js) [data-aos="fade-up"] {
  transform: translate3d(0, 35px, 0);
  opacity: 0;
  transition-property: transform, opacity;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1) !important;
}

html:not(.no-js) [data-aos="fade-up"].aos-animate {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

html:not(.no-js) [data-aos="zoom-in"] {
  transform: scale(0.92) translateZ(0);
  opacity: 0;
  transition-property: transform, opacity;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1) !important;
}

html:not(.no-js) [data-aos="zoom-in"].aos-animate {
  transform: scale(1) translateZ(0);
  opacity: 1;
}

/* ==========================================================================
   7. PARALLAX & BACKGROUND MESH ORBS
   ========================================================================== */
.parallax-orb {
  will-change: transform;
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.1, 1, 0.2, 1);
}

/* Mobile responsive safeguards */
@media (max-width: 768px) {
  .anim-card:hover {
    transform: none !important;
  }
  .parallax-orb {
    transform: none !important;
  }
}
