/* ============================================================
   ANIMATIONS CSS — Keyframes, AOS, GSAP helpers, Transitions
   Umesh Pardeshi Portfolio
   ============================================================ */

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-12px) rotate(1deg); }
  66%       { transform: translateY(-6px) rotate(-1deg); }
}

@keyframes floatReverse {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(12px) rotate(-1deg); }
  66%       { transform: translateY(6px) rotate(1deg); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(99,102,241,0.3); }
  50%       { box-shadow: 0 0 40px rgba(99,102,241,0.6), 0 0 80px rgba(139,92,246,0.2); }
}

@keyframes border-glow {
  0%, 100% { border-color: rgba(99,102,241,0.2); }
  50%       { border-color: rgba(99,102,241,0.6); }
}

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

@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes orbit {
  from { transform: rotate(0deg) translateX(80px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(80px) rotate(-360deg); }
}

@keyframes morph {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  25%       { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  50%       { border-radius: 50% 60% 30% 60% / 30% 40% 60% 50%; }
  75%       { border-radius: 60% 30% 50% 40% / 50% 30% 50% 60%; }
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

@keyframes typewriter {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

@keyframes bounce-in {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.1); }
  80%  { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes wave {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(0.4); }
}

@keyframes counter-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* ============================================================
   ANIMATION UTILITY CLASSES
   ============================================================ */
.animate-fade-in     { animation: fadeIn 0.6s ease forwards; }
.animate-fade-up     { animation: fadeInUp 0.6s ease forwards; }
.animate-fade-down   { animation: fadeInDown 0.6s ease forwards; }
.animate-fade-left   { animation: fadeInLeft 0.6s ease forwards; }
.animate-fade-right  { animation: fadeInRight 0.6s ease forwards; }
.animate-scale-in    { animation: scaleIn 0.5s ease forwards; }
.animate-float       { animation: float 6s ease-in-out infinite; }
.animate-float-rev   { animation: floatReverse 7s ease-in-out infinite; }
.animate-glow        { animation: glow-pulse 3s ease infinite; }
.animate-rotate      { animation: rotate 20s linear infinite; }
.animate-morph       { animation: morph 12s ease infinite; }
.animate-shimmer     { animation: shimmer 2s ease infinite; }
.animate-bounce-in   { animation: bounce-in 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards; }
.animate-ping        { animation: ping 1.5s cubic-bezier(0,0,0.2,1) infinite; }
.animate-gradient    {
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
}

/* Delay utilities */
.delay-100  { animation-delay: 0.1s; }
.delay-200  { animation-delay: 0.2s; }
.delay-300  { animation-delay: 0.3s; }
.delay-400  { animation-delay: 0.4s; }
.delay-500  { animation-delay: 0.5s; }
.delay-600  { animation-delay: 0.6s; }
.delay-700  { animation-delay: 0.7s; }
.delay-800  { animation-delay: 0.8s; }
.delay-1000 { animation-delay: 1s; }
.delay-1500 { animation-delay: 1.5s; }

/* Duration utilities */
.duration-300  { animation-duration: 0.3s; }
.duration-500  { animation-duration: 0.5s; }
.duration-700  { animation-duration: 0.7s; }
.duration-1000 { animation-duration: 1s; }
.duration-2000 { animation-duration: 2s; }

/* ============================================================
   GSAP INITIAL STATES (prevent flash before GSAP loads)
   ============================================================ */
[data-reveal] {
  opacity: 0;
}

[data-stagger] > * {
  opacity: 0;
}

/* ============================================================
   HOVER EFFECTS
   ============================================================ */
.hover-lift {
  transition: transform var(--transition-base);
}
.hover-lift:hover { transform: translateY(-6px); }

.hover-scale {
  transition: transform var(--transition-base);
}
.hover-scale:hover { transform: scale(1.04); }

.hover-glow {
  transition: box-shadow var(--transition-base);
}
.hover-glow:hover {
  box-shadow: 0 0 30px rgba(99,102,241,0.35);
}

.hover-bright {
  transition: filter var(--transition-base);
}
.hover-bright:hover { filter: brightness(1.15); }

/* ============================================================
   SHIMMER LOADING EFFECT
   ============================================================ */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.04),
    transparent
  );
  animation: shimmer 1.5s ease infinite;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-card {
  height: 280px;
  border-radius: var(--radius-xl);
}

.skeleton-image {
  height: 200px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ============================================================
   GRADIENT BORDERS
   ============================================================ */
.border-gradient {
  position: relative;
}

.border-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-primary);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ============================================================
   TYPING CURSOR EFFECT
   ============================================================ */
.typing-cursor::after {
  content: '|';
  animation: blink-cursor 1s step-end infinite;
  color: var(--color-primary);
  font-weight: 300;
}

/* ============================================================
   SPOTLIGHT / GLOW BACKGROUNDS
   ============================================================ */
.section-glow {
  position: relative;
}

.section-glow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: spotlight 6s ease infinite;
}

/* ============================================================
   STAGGERED GRID ENTRANCE
   ============================================================ */
.stagger-grid > *:nth-child(1)  { animation-delay: 0.05s; }
.stagger-grid > *:nth-child(2)  { animation-delay: 0.10s; }
.stagger-grid > *:nth-child(3)  { animation-delay: 0.15s; }
.stagger-grid > *:nth-child(4)  { animation-delay: 0.20s; }
.stagger-grid > *:nth-child(5)  { animation-delay: 0.25s; }
.stagger-grid > *:nth-child(6)  { animation-delay: 0.30s; }
.stagger-grid > *:nth-child(7)  { animation-delay: 0.35s; }
.stagger-grid > *:nth-child(8)  { animation-delay: 0.40s; }
.stagger-grid > *:nth-child(9)  { animation-delay: 0.45s; }
.stagger-grid > *:nth-child(10) { animation-delay: 0.50s; }

/* ============================================================
   WAVE BARS (audio visualizer style)
   ============================================================ */
.wave-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}

.wave-bar {
  width: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
  animation: wave 1.2s ease infinite;
}

.wave-bar:nth-child(1) { height: 60%; animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.wave-bar:nth-child(3) { height: 40%; animation-delay: 0.4s; }
.wave-bar:nth-child(4) { height: 80%; animation-delay: 0.1s; }
.wave-bar:nth-child(5) { height: 60%; animation-delay: 0.3s; }

/* ============================================================
   FLOATING ELEMENTS
   ============================================================ */
.floating-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  opacity: 0.15;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--color-primary);
  top: -100px;
  right: -100px;
  animation: float 8s ease-in-out infinite;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--color-secondary);
  bottom: -80px;
  left: -80px;
  animation: floatReverse 10s ease-in-out infinite;
}

.orb-3 {
  width: 200px;
  height: 200px;
  background: var(--color-accent);
  top: 50%;
  right: 20%;
  animation: float 12s ease-in-out infinite;
}

/* ============================================================
   ANIMATED GRADIENT TEXT
   ============================================================ */
.text-gradient-animated {
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4, #6366f1);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
}

/* ============================================================
   ENTRY ANIMATIONS (JS-triggered via class add)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

/* ============================================================
   TRANSITION HELPERS
   ============================================================ */
.transition-all  { transition: all var(--transition-base); }
.transition-fast { transition: all var(--transition-fast); }
.transition-slow { transition: all var(--transition-slow); }
.transition-spring { transition: all var(--transition-spring); }

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