/* =====================================================
   VISHAL JEWELLERS — ANIMATION SYSTEM
   GSAP-ready + CSS Micro-animations
   ===================================================== */

/* ── Scroll Reveal Base States ─────────────────────── */
/* Elements with these classes start hidden; GSAP reveals them */
[data-reveal] {
  opacity: 0;
  will-change: transform, opacity;
}

[data-reveal="up"]    { transform: translateY(40px); }
[data-reveal="down"]  { transform: translateY(-40px); }
[data-reveal="left"]  { transform: translateX(-40px); }
[data-reveal="right"] { transform: translateX(40px); }
[data-reveal="scale"] { transform: scale(0.92); }
[data-reveal="fade"]  { transform: none; }

/* When GSAP adds .revealed class */
[data-reveal].revealed {
  opacity: 1;
  transform: none;
}

/* ── Stagger Children ──────────────────────────────── */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(24px);
  will-change: transform, opacity;
}
[data-stagger].revealed > * {
  opacity: 1;
  transform: none;
}

/* ── Gold Shimmer Text ─────────────────────────────── */
.vj-shimmer-text {
  background: linear-gradient(
    120deg,
    var(--vj-gold-deep) 0%,
    var(--vj-gold-shimmer) 40%,
    var(--vj-gold-deep) 60%,
    var(--vj-gold-shimmer) 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: goldShimmer 3s linear infinite;
}
@keyframes goldShimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* ── Floating Animation ────────────────────────────── */
.vj-float {
  animation: vjFloat 4s ease-in-out infinite;
}
@keyframes vjFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* ── Pulse Glow (gold ring) ────────────────────────── */
.vj-pulse-glow {
  animation: vjPulseGlow 2s ease-in-out infinite;
}
@keyframes vjPulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,168,76,0.4); }
  50%       { box-shadow: 0 0 0 12px rgba(201,168,76,0); }
}

/* ── Spin (loading indicator) ──────────────────────── */
.vj-spin {
  animation: vjSpin 1s linear infinite;
}
@keyframes vjSpin {
  to { transform: rotate(360deg); }
}

/* ── Counter animation ─────────────────────────────── */
.vj-counter { transition: all 0.3s; }

/* ── Entrance Animations (CSS-only, no JS) ─────────── */
.vj-anim-fade-up {
  animation: vjFadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.vj-anim-fade-in {
  animation: vjFadeIn 0.5s ease both;
}
.vj-anim-scale-in {
  animation: vjScaleIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.vj-anim-slide-right {
  animation: vjSlideRight 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes vjFadeUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes vjFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes vjScaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes vjSlideRight {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Delay utilities */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

/* ── Gold Line Draw ────────────────────────────────── */
.vj-line-draw {
  position: relative;
}
.vj-line-draw::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--vj-gold);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.vj-line-draw:hover::after,
.vj-line-draw.active::after { width: 100%; }

/* ── Ripple Effect ─────────────────────────────────── */
.vj-ripple {
  position: relative;
  overflow: hidden;
}
.vj-ripple::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(201,168,76,0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
  opacity: 0;
}
.vj-ripple:active::after {
  width: 200px; height: 200px;
  opacity: 1;
  transition: none;
}

/* ── Page Transition ───────────────────────────────── */
.vj-page-enter {
  animation: vjPageEnter 0.4s ease both;
}
@keyframes vjPageEnter {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Parallax Container ─────────────────────────────── */
.vj-parallax-wrap { overflow: hidden; }
.vj-parallax { will-change: transform; }

/* ── Stagger Delays for Grid ────────────────────────── */
.vj-stagger > *:nth-child(1)  { animation-delay: 0ms; }
.vj-stagger > *:nth-child(2)  { animation-delay: 80ms; }
.vj-stagger > *:nth-child(3)  { animation-delay: 160ms; }
.vj-stagger > *:nth-child(4)  { animation-delay: 240ms; }
.vj-stagger > *:nth-child(5)  { animation-delay: 320ms; }
.vj-stagger > *:nth-child(6)  { animation-delay: 400ms; }
.vj-stagger > *:nth-child(7)  { animation-delay: 480ms; }
.vj-stagger > *:nth-child(8)  { animation-delay: 560ms; }
.vj-stagger > *:nth-child(9)  { animation-delay: 640ms; }
.vj-stagger > *:nth-child(10) { animation-delay: 720ms; }
.vj-stagger > *:nth-child(11) { animation-delay: 800ms; }
.vj-stagger > *:nth-child(12) { animation-delay: 880ms; }

/* ── Counter Roll ───────────────────────────────────── */
@keyframes numberRoll {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.vj-stat-number { animation: numberRoll 0.5s ease both; }

/* ── Accordion / Collapsible ───────────────────────── */
.vj-collapsible-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1), padding 0.3s ease;
}
.vj-collapsible-body.open {
  max-height: 600px;
}

/* ── Gold Border Hover ─────────────────────────────── */
.vj-border-hover {
  border: 1.5px solid var(--vj-border-light);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.vj-border-hover:hover {
  border-color: var(--vj-gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.10);
}

/* ── Image Reveal Overlay ────────────────────────────── */
.vj-img-reveal {
  position: relative;
  overflow: hidden;
}
.vj-img-reveal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--vj-champagne);
  z-index: 1;
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}
.vj-img-reveal.revealed::before {
  transform: scaleX(0);
}

/* ── Marquee (horizontal scroll) ───────────────────── */
.vj-marquee-wrap { overflow: hidden; }
.vj-marquee-track {
  display: flex;
  width: max-content;
  animation: vjMarquee 20s linear infinite;
}
.vj-marquee-track:hover { animation-play-state: paused; }
@keyframes vjMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

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