/**
 * SISL Static Template - Animations
 * Version: 1.0
 */

/* ============================================
   1. KEYFRAME ANIMATIONS
   ============================================ */

/* Fade Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

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

/* Slide Animations */
@keyframes slideUp {
  from { 
    opacity: 0; 
    transform: translateY(30px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

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

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

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

/* Scale Animations */
@keyframes scaleIn {
  from { 
    opacity: 0; 
    transform: scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: scale(1); 
  }
}

@keyframes scaleOut {
  from { 
    opacity: 1; 
    transform: scale(1); 
  }
  to { 
    opacity: 0; 
    transform: scale(0.95); 
  }
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Pulse Scale Animation (for badges) */
@keyframes pulseScale {
  0%, 100% { 
    opacity: 0.3;
    transform: scale(1);
  }
  50% { 
    opacity: 0;
    transform: scale(1.5);
  }
}

/* Bounce Animation */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

/* Spin Animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Shimmer Animation (for loading states) */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Counter Animation */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   2. ANIMATION CLASSES
   ============================================ */

/* Base Animation Properties */
.animate {
  animation-fill-mode: both;
  animation-timing-function: ease-out;
}

/* Fade */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-fade-out {
  animation: fadeOut 0.6s ease-out forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-down {
  animation: fadeInDown 0.6s ease-out forwards;
}

/* Slide */
.animate-slide-up {
  animation: slideUp 0.6s ease-out forwards;
}

.animate-slide-down {
  animation: slideDown 0.6s ease-out forwards;
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease-out forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.6s ease-out forwards;
}

/* Scale */
.animate-scale-in {
  animation: scaleIn 0.3s ease-out forwards;
}

.animate-scale-out {
  animation: scaleOut 0.3s ease-out forwards;
}

/* Continuous Animations */
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    hsl(var(--muted)) 25%,
    hsl(var(--muted) / 0.5) 50%,
    hsl(var(--muted)) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ============================================
   3. ANIMATION DELAYS
   ============================================ */
.delay-100 { animation-delay: 100ms; }
.delay-150 { animation-delay: 150ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-700 { animation-delay: 700ms; }
.delay-1000 { animation-delay: 1000ms; }

/* ============================================
   4. ANIMATION DURATIONS
   ============================================ */
.duration-150 { animation-duration: 150ms; }
.duration-200 { animation-duration: 200ms; }
.duration-300 { animation-duration: 300ms; }
.duration-500 { animation-duration: 500ms; }
.duration-700 { animation-duration: 700ms; }
.duration-1000 { animation-duration: 1000ms; }

/* ============================================
   5. TRANSITION UTILITIES
   ============================================ */
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
}

.transition-colors {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
}

.transition-opacity {
  transition-property: opacity;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
}

.transition-transform {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
}

/* Transition Durations */
.transition-duration-150 { transition-duration: 150ms; }
.transition-duration-200 { transition-duration: 200ms; }
.transition-duration-300 { transition-duration: 300ms; }
.transition-duration-500 { transition-duration: 500ms; }

/* ============================================
   6. HOVER ANIMATIONS
   ============================================ */

/* Hover Scale */
.hover-scale {
  transition: transform 0.2s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* Hover Lift (for cards) */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Arrow Animation on Hover */
.group:hover .arrow-animate,
.hover-arrow:hover .arrow-animate {
  transform: translateX(4px);
}

.arrow-animate {
  transition: transform 0.2s ease;
}

/* Button Hover Effects */
.btn:active {
  transform: scale(0.98);
}

/* Link Underline Animation */
.link-underline {
  position: relative;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: hsl(var(--accent));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.link-underline:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ============================================
   7. SCROLL REVEAL ANIMATIONS
   ============================================ */

/* Initial hidden state for scroll reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Directional Reveals */
[data-reveal="left"] {
  transform: translateX(-30px);
}

[data-reveal="left"].revealed {
  transform: translateX(0);
}

[data-reveal="right"] {
  transform: translateX(30px);
}

[data-reveal="right"].revealed {
  transform: translateX(0);
}

[data-reveal="scale"] {
  transform: scale(0.95);
}

[data-reveal="scale"].revealed {
  transform: scale(1);
}

/* Staggered Reveal for Grids */
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

[data-reveal-stagger].revealed > *:nth-child(1) { transition-delay: 0ms; }
[data-reveal-stagger].revealed > *:nth-child(2) { transition-delay: 100ms; }
[data-reveal-stagger].revealed > *:nth-child(3) { transition-delay: 200ms; }
[data-reveal-stagger].revealed > *:nth-child(4) { transition-delay: 300ms; }
[data-reveal-stagger].revealed > *:nth-child(5) { transition-delay: 400ms; }
[data-reveal-stagger].revealed > *:nth-child(6) { transition-delay: 500ms; }

[data-reveal-stagger].revealed > * {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   8. SPECIAL EFFECTS
   ============================================ */

/* Play Button Pulse Effect */
.play-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  border-radius: 50%;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.play-button::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: hsl(var(--accent) / 0.4);
  animation: pulseScale 2s ease-out infinite;
}

.play-button:hover {
  transform: scale(1.1);
  background: hsl(var(--accent) / 0.9);
}

/* Gradient Border Animation */
.gradient-border {
  position: relative;
  background: hsl(var(--card));
  border-radius: var(--radius);
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: calc(var(--radius) + 2px);
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gradient-border:hover::before {
  opacity: 1;
}

/* Loading Spinner */
.loading-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid hsl(var(--muted));
  border-top-color: hsl(var(--accent));
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(
    90deg,
    hsl(var(--muted)) 25%,
    hsl(var(--muted) / 0.7) 50%,
    hsl(var(--muted)) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  height: 1.5rem;
  width: 60%;
  margin-bottom: 1rem;
}

.skeleton-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}
