/* ============================================
   GLASS ANIMATIONS
   Animation utilities for glass mode components
   Uses CSS animations for performance (GPU-accelerated)
   ============================================ */

/* ==========================================
   FLOAT ANIMATION
   For 3D elements and floating cards
   ========================================== */

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(2deg);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-float-slow {
  animation: float 8s ease-in-out infinite;
}

.animate-float-fast {
  animation: float 4s ease-in-out infinite;
}

/* ==========================================
   PULSE GLOW
   For glowing elements and highlights
   ========================================== */

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(236, 72, 153, 0.6);
  }
}

.animate-pulse-glow {
  animation: pulseGlow 3s ease-in-out infinite;
}

/* ==========================================
   ROTATE
   For 3D cube and rotating elements
   ========================================== */

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-rotate {
  animation: rotate 20s linear infinite;
}

.animate-rotate-slow {
  animation: rotate 30s linear infinite;
}

@keyframes rotate3d {
  from {
    transform: rotateX(0deg) rotateY(0deg);
  }
  to {
    transform: rotateX(360deg) rotateY(360deg);
  }
}

.animate-rotate-3d {
  animation: rotate3d 15s linear infinite;
}

/* ==========================================
   FADE IN
   Smooth fade in animation
   ========================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-fade-in {
  animation: fadeIn var(--transition-slow);
}

.animate-fade-in-up {
  animation: fadeInUp var(--transition-slow);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   SLIDE IN
   Slide animations for panels and modals
   ========================================== */

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in-right {
  animation: slideInRight var(--transition-base);
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in-left {
  animation: slideInLeft var(--transition-base);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-in-up {
  animation: slideInUp var(--transition-base);
}

/* ==========================================
   SCALE
   Scale animations for buttons and cards
   ========================================== */

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-scale-in {
  animation: scaleIn var(--transition-base);
}

@keyframes scaleOnHover {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.animate-scale-hover:hover {
  animation: scaleOnHover var(--transition-base);
}

/* ==========================================
   SHIMMER
   Shimmer effect for loading states
   ========================================== */

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    var(--glass-bg-surface) 0%,
    var(--glass-bg-hover) 50%,
    var(--glass-bg-surface) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* ==========================================
   GRADIENT SHIFT
   Animated gradient backgrounds
   ========================================== */

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

/* ==========================================
   BOUNCE
   Subtle bounce for attention
   ========================================== */

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.animate-bounce {
  animation: bounce 2s ease-in-out infinite;
}

/* ==========================================
   SPIN
   Loading spinner animation
   ========================================== */

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ==========================================
   ORBIT
   For orbital elements around a center
   ========================================== */

@keyframes orbit {
  from {
    transform: rotate(0deg) translateX(100px) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translateX(100px) rotate(-360deg);
  }
}

.animate-orbit {
  animation: orbit 10s linear infinite;
}

/* ==========================================
   WAVE
   Wave animation for backgrounds
   ========================================== */

@keyframes wave {
  0%, 100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-5px);
  }
  75% {
    transform: translateY(5px);
  }
}

.animate-wave {
  animation: wave 3s ease-in-out infinite;
}

/* ==========================================
   STAGGERED ANIMATIONS
   Delay utilities for sequential animations
   ========================================== */

.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; }
.delay-900 { animation-delay: 900ms; }
.delay-1000 { animation-delay: 1000ms; }

/* ==========================================
   DURATION UTILITIES
   Custom animation durations
   ========================================== */

.duration-fast { animation-duration: var(--duration-fast); }
.duration-base { animation-duration: var(--duration-base); }
.duration-slow { animation-duration: var(--duration-slow); }
.duration-1000 { animation-duration: 1000ms; }
.duration-2000 { animation-duration: 2000ms; }
.duration-3000 { animation-duration: 3000ms; }

/* ==========================================
   EASING UTILITIES
   Custom animation timing functions
   ========================================== */

.ease-linear { animation-timing-function: linear; }
.ease-in { animation-timing-function: var(--ease-in); }
.ease-out { animation-timing-function: var(--ease-out); }
.ease-in-out { animation-timing-function: var(--ease-in-out); }
.ease-bounce { animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); }

/* ==========================================
   3D TRANSFORM UTILITIES
   For 3D element positioning
   ========================================== */

.perspective-1000 {
  perspective: 1000px;
}

.perspective-2000 {
  perspective: 2000px;
}

.transform-style-3d {
  transform-style: preserve-3d;
}

.backface-hidden {
  backface-visibility: hidden;
}

/* ==========================================
   HOVER EFFECTS
   Interactive hover animations
   ========================================== */

.hover-lift {
  transition: transform var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

.hover-scale {
  transition: transform var(--transition-base);
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: var(--glass-shadow-lg);
}

/* ==========================================
   GLASS CARD SPECIFIC ANIMATIONS
   ========================================== */

.glass-card-enter {
  animation: fadeInUp var(--transition-base);
}

.glass-card-hover {
  transition: all var(--transition-base);
}

.glass-card-hover:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--glass-shadow-xl);
  border-color: var(--glass-border-strong);
}

/* ==========================================
   GLASS BUTTON SPECIFIC ANIMATIONS
   ========================================== */

.btn-glass-press {
  transition: all var(--transition-fast);
}

.btn-glass-press:active {
  transform: scale(0.95);
}

/* ==========================================
   PARTICLE ANIMATIONS
   For background particle effects
   ========================================== */

@keyframes particleFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.5;
  }
  25% {
    transform: translate(10px, -20px) scale(1.1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-5px, -40px) scale(1);
    opacity: 0.5;
  }
  75% {
    transform: translate(-15px, -20px) scale(0.9);
    opacity: 0.7;
  }
}

.animate-particle {
  animation: particleFloat 10s ease-in-out infinite;
}

/* ==========================================
   TEXT ANIMATIONS
   For text reveals and highlights
   ========================================== */

@keyframes textReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-text-reveal {
  animation: textReveal var(--transition-base);
}

@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

.animate-typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--color-accent);
  animation: typewriter 3s steps(40) forwards, blink 0.75s step-end infinite;
}

@keyframes blink {
  50% { border-color: transparent; }
}

/* ==========================================
   LOADING STATES
   Skeleton and loading animations
   ========================================== */

@keyframes skeletonPulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.skeleton {
  background: var(--glass-bg-surface);
  animation: skeletonPulse 2s ease-in-out infinite;
}

/* ==========================================
   REDUCED MOTION
   Respect user's motion preferences
   ========================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .animate-float,
  .animate-float-slow,
  .animate-float-fast,
  .animate-pulse-glow,
  .animate-rotate,
  .animate-rotate-slow,
  .animate-rotate-3d,
  .animate-bounce,
  .animate-spin,
  .animate-orbit,
  .animate-wave,
  .animate-particle {
    animation: none;
  }

  .hover-lift:hover,
  .hover-scale:hover {
    transform: none;
  }
}

/* ==========================================
   PRINT STYLES
   Disable animations for printing
   ========================================== */

@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
