/* ══════════════════════════════════════════════════════════
   hjLabs.in — Visual Effects Library v2.0
   Crazy awesome effects: cursor glow, 3D tilt, shimmer,
   sparkle, ripple, aurora, gradient borders, counters.
   ══════════════════════════════════════════════════════════ */

/* ── Custom Glow Cursor ──────────────────────────────────── */
#cursor-glow {
  position: fixed;
  width: 36px; height: 36px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999999;
  mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(99,102,241,0.7) 0%, rgba(6,182,212,0.3) 50%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background 0.2s;
  will-change: transform;
}
#cursor-glow.cursor-hover {
  width: 56px; height: 56px;
  background: radial-gradient(circle, rgba(6,182,212,0.6) 0%, rgba(99,102,241,0.2) 60%, transparent 80%);
}
#cursor-glow.cursor-click {
  width: 70px; height: 70px;
  opacity: 0;
  transition: width 0.3s, height 0.3s, opacity 0.3s;
}
/* Hide custom cursor on touch devices */
@media (hover: none), (pointer: coarse) {
  #cursor-glow { display: none !important; }
}

/* ── Scroll Progress Bar ─────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #6366f1 0%, #818cf8 40%, #06b6d4 70%, #6366f1 100%);
  background-size: 200% 100%;
  z-index: 999998;
  box-shadow: 0 0 12px rgba(99,102,241,0.9), 0 0 4px rgba(6,182,212,0.6);
  transition: width 0.08s linear;
  animation: progress-shimmer 2s linear infinite;
}
@keyframes progress-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Card Shine (3D tilt highlight) ─────────────────────── */
.card-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s;
}
.glass-card:hover .card-shine,
.product-card:hover .card-shine {
  opacity: 1;
}

/* ── Animated Gradient Border on Hover ───────────────────── */
.glass-card,
.product-card,
.testimonial-card,
.solution-card,
.job-card,
.feature-card {
  position: relative;
  isolation: isolate;
}
/* rotating border removed */

/* ── Ripple Effect on Click ──────────────────────────────── */
.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  width: 8px; height: 8px;
  margin-top: -4px; margin-left: -4px;
  pointer-events: none;
  animation: ripple-out 0.65s ease-out forwards;
  z-index: 10;
}
@keyframes ripple-out {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(40); opacity: 0; }
}

/* ── Sparkle Particles ───────────────────────────────────── */
.sparkle-dot {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 20;
  animation: sparkle-burst 0.65s ease-out forwards;
}
@keyframes sparkle-burst {
  0%   { transform: translate(0, 0) scale(1.2); opacity: 1; }
  100% { transform: translate(var(--sx, 0px), var(--sy, -40px)) scale(0); opacity: 0; }
}

/* ── Shimmer Sweep on Buttons ────────────────────────────── */
.btn-primary-glow,
.btn-quote,
.btn-add-quote,
.btn-whatsapp,
a.btn-primary-glow {
  position: relative;
  overflow: hidden;
}
.btn-primary-glow::after,
.btn-quote::after,
.btn-add-quote::after {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,0.22) 50%, transparent 80%);
  transform: skewX(-15deg);
  pointer-events: none;
}
.btn-primary-glow:hover::after,
.btn-quote:hover::after,
.btn-add-quote:hover::after {
  animation: shimmer-slide 0.55s ease-out;
}
@keyframes shimmer-slide {
  to { left: 160%; }
}

/* ── Aurora Background Blobs ─────────────────────────────── */
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(72px);
  opacity: 0;
  animation: aurora-fade-in 1.2s ease-out forwards, aurora-drift 9s ease-in-out infinite alternate;
}
.aurora-blob-1 {
  width: 55vw; height: 55vw; max-width: 600px; max-height: 600px;
  background: radial-gradient(circle at 40% 40%, rgba(99,102,241,0.55), transparent 65%);
  top: -15%; left: -10%;
  animation-delay: 0s, 0.2s;
}
.aurora-blob-2 {
  width: 45vw; height: 45vw; max-width: 500px; max-height: 500px;
  background: radial-gradient(circle at 60% 40%, rgba(6,182,212,0.4), transparent 65%);
  top: 10%; right: -8%;
  animation-delay: 0.3s, -3s;
}
.aurora-blob-3 {
  width: 35vw; height: 35vw; max-width: 400px; max-height: 400px;
  background: radial-gradient(circle at 50% 50%, rgba(139,92,246,0.35), transparent 65%);
  bottom: 5%; left: 30%;
  animation-delay: 0.6s, -6s;
}
@keyframes aurora-fade-in {
  to { opacity: 1; }
}
@keyframes aurora-drift {
  0%   { transform: translate(0px, 0px) scale(1); }
  33%  { transform: translate(25px, -20px) scale(1.07); }
  66%  { transform: translate(-15px, 15px) scale(0.96); }
  100% { transform: translate(10px, -10px) scale(1.04); }
}

/* ── Floating icon animation ─────────────────────────────── */
.feature-icon-wrap,
.solution-icon {
  animation: icon-float 3.5s ease-in-out infinite;
}
@keyframes icon-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-6px); }
}

/* ── Staggered grid reveal ───────────────────────────────── */
.stagger-grid > * {
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.stagger-grid.visible > *:nth-child(1)  { opacity:1; transform:none; transition-delay:0.04s; }
.stagger-grid.visible > *:nth-child(2)  { opacity:1; transform:none; transition-delay:0.12s; }
.stagger-grid.visible > *:nth-child(3)  { opacity:1; transform:none; transition-delay:0.20s; }
.stagger-grid.visible > *:nth-child(4)  { opacity:1; transform:none; transition-delay:0.28s; }
.stagger-grid.visible > *:nth-child(5)  { opacity:1; transform:none; transition-delay:0.36s; }
.stagger-grid.visible > *:nth-child(6)  { opacity:1; transform:none; transition-delay:0.44s; }
.stagger-grid.visible > *:nth-child(7)  { opacity:1; transform:none; transition-delay:0.52s; }
.stagger-grid.visible > *:nth-child(8)  { opacity:1; transform:none; transition-delay:0.60s; }

/* Fallback: ensure stagger-grid children are visible if JS is slow or disabled */
@media (prefers-reduced-motion: reduce) {
  .stagger-grid > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .stagger-grid.visible > * {
    transition-delay: 0s !important;
  }
}

/* Noscript fallback */
.no-js .stagger-grid > * {
  opacity: 1 !important;
  transform: none !important;
}

/* ── Product card image overlay on hover ─────────────────── */
.product-card-img-wrap {
  position: relative;
  overflow: hidden;
}
.product-card-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0) 0%, rgba(6,182,212,0) 100%);
  transition: background 0.4s ease;
  z-index: 1;
  pointer-events: none;
}
.product-card:hover .product-card-img-wrap::after {
  background: linear-gradient(135deg, rgba(99,102,241,0.18) 0%, rgba(6,182,212,0.12) 100%);
}
.product-card-img {
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}
.product-card:hover .product-card-img {
  transform: scale(1.07) !important;
}

/* ── Hero image glow ring ────────────────────────────────── */
.hero-img-wrap,
.hero-image-wrap {
  position: relative;
}
.hero-img-wrap::after,
.hero-image-wrap::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 20px;
  background: radial-gradient(circle, rgba(99,102,241,0.5), rgba(6,182,212,0.3), rgba(139,92,246,0.4));
  z-index: -1;
  filter: blur(20px);
  opacity: 0.5;
}

/* ── Pulsing badge ring ───────────────────────────────────── */
.hero-badge,
.featured-badge,
.category-badge {
  position: relative;
}
.hero-badge::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1.5px solid rgba(99,102,241,0.5);
  animation: pulse-ring 2.5s ease-out infinite;
  pointer-events: none;
}
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ── Neon heading glow ───────────────────────────────────── */
.hero-title,
.section-title,
.hero-heading {
  filter: drop-shadow(0 0 20px rgba(99,102,241,0.25));
}

/* ── Stats number glow ───────────────────────────────────── */
.stat-number,
[class*="stat"] [class*="number"],
[class*="stat"] strong {
  text-shadow: 0 0 20px rgba(99,102,241,0.5);
}

/* ── Testimonial card star glow ──────────────────────────── */
.testimonial-stars {
  text-shadow: 0 0 8px rgba(245,158,11,0.6);
  animation: star-twinkle 3s ease-in-out infinite alternate;
}
@keyframes star-twinkle {
  0%   { text-shadow: 0 0 8px rgba(245,158,11,0.6); }
  100% { text-shadow: 0 0 16px rgba(245,158,11,0.9), 0 0 30px rgba(245,158,11,0.3); }
}

/* ── Glow on hover for links ─────────────────────────────── */
.nav-link-custom:hover,
.site-navbar .nav-link:hover {
  text-shadow: 0 0 12px rgba(99,102,241,0.5);
}

/* ── CTA section enhancement ─────────────────────────────── */
.cta-section,
section[style*="linear-gradient"] {
  position: relative;
  overflow: hidden;
}

/* ── Gradient text animation on headings ─────────────────── */
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.hero-title,
.section-title {
  background-size: 200% auto !important;
  animation: gradient-shift 5s ease infinite;
}

/* ── Scroll-down bounce indicator ────────────────────────── */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.5;
  animation: bounce-down 2s ease-in-out infinite;
  cursor: pointer;
  z-index: 5;
}
.scroll-indicator span {
  width: 20px; height: 20px;
  border-right: 2px solid #818cf8;
  border-bottom: 2px solid #818cf8;
  transform: rotate(45deg);
  animation: chevron-fade 2s ease-in-out infinite;
}
.scroll-indicator span:nth-child(2) { animation-delay: 0.2s; margin-top: -12px; }
.scroll-indicator span:nth-child(3) { animation-delay: 0.4s; margin-top: -12px; }
@keyframes bounce-down {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}
@keyframes chevron-fade {
  0%   { opacity: 0; }
  50%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── WhatsApp button green pulse ─────────────────────────── */
.btn-whatsapp,
a[href*="wa.me"] {
  position: relative;
}
.btn-whatsapp::before,
a[href*="wa.me"].btn::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: rgba(37,211,102,0.3);
  z-index: -1;
  animation: wa-pulse 2s ease-out infinite;
}
@keyframes wa-pulse {
  0%   { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.15); opacity: 0; }
}

/* ── Tilt card transition ────────────────────────────────── */
.glass-card,
.product-card,
.testimonial-card {
  transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.3s ease !important;
  transform-style: preserve-3d;
  will-change: transform;
}

/* ── Section divider glow ────────────────────────────────── */
.section-divider {
  box-shadow: 0 0 12px rgba(99,102,241,0.6), 0 0 24px rgba(6,182,212,0.3);
  animation: divider-pulse 3s ease-in-out infinite alternate;
}
@keyframes divider-pulse {
  0%   { box-shadow: 0 0 12px rgba(99,102,241,0.6); }
  100% { box-shadow: 0 0 20px rgba(99,102,241,0.9), 0 0 40px rgba(6,182,212,0.4); }
}

/* ── Image lazy load fade-in ─────────────────────────────── */
img.lazy-loaded {
  animation: img-fade-in 0.5s ease forwards;
}
@keyframes img-fade-in {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Mobile: disable expensive effects ───────────────────── */
@media (max-width: 768px) {
  .aurora-blob { filter: blur(50px); opacity: 0.7; }
  .glass-card::before, .product-card::before { display: none; }
}

/* ── Logo in navbar ──────────────────────────────────────── */
.navbar-logo {
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
  filter: brightness(1.1);
  transition: filter 0.2s, opacity 0.2s;
}
.navbar-logo:hover { filter: brightness(1.3); opacity: 0.9; }

html[data-theme="light"] .navbar-logo {
  filter: brightness(0.85) saturate(1.2);
}

/* ── Enhanced Page Entrance ─────────────────────────────── */
main, article { animation: page-fade-in 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes page-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
