/* Animation Styles for PlayWin Documentation Portal */

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

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

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

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

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

@keyframes slideInUp {
  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);
  }
}

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

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Hover Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(124, 58, 237, 0.6);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: rotate(0deg);
  }
}

@keyframes rotateOut {
  from {
    opacity: 1;
    transform: rotate(0deg);
  }
  to {
    opacity: 0;
    transform: rotate(10deg);
  }
}

/* Gradient Animations */
@keyframes gradientShift {
  0% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
  100% {
    background-position: 0% center;
  }
}

@keyframes gradientFlow {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

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

@keyframes dot-pulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

@keyframes wave {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Application Classes */

/* Scroll Reveal */
.scroll-reveal {
  opacity: 0;
  animation: scrollRevealFadeUp 0.6s ease-out forwards;
}

.scroll-reveal.delay-1 {
  animation-delay: 0.1s;
}

.scroll-reveal.delay-2 {
  animation-delay: 0.2s;
}

.scroll-reveal.delay-3 {
  animation-delay: 0.3s;
}

.scroll-reveal.delay-4 {
  animation-delay: 0.4s;
}

.scroll-reveal-left {
  animation: scrollRevealFadeLeft 0.6s ease-out forwards;
}

.scroll-reveal-right {
  animation: scrollRevealFadeRight 0.6s ease-out forwards;
}

.scroll-reveal-scale {
  animation: scrollRevealScale 0.6s ease-out forwards;
}

/* Entrance Animations */
.animate-slide-down {
  animation: slideInDown 0.5s ease-out forwards;
}

.animate-slide-up {
  animation: slideInUp 0.5s ease-out forwards;
}

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

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

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.animate-zoom-in {
  animation: zoomIn 0.5s ease-out forwards;
}

.animate-rotate-in {
  animation: rotateIn 0.5s ease-out forwards;
}

/* Hover Effects */
.hover-pulse:hover {
  animation: pulse 2s infinite;
}

.hover-glow:hover {
  animation: glow 2s infinite;
}

.hover-float:hover {
  animation: float 3s ease-in-out infinite;
}

.hover-bounce:hover {
  animation: bounce 0.6s ease-out;
}

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

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

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

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-wave {
  animation: wave 1.5s ease-in-out infinite;
}

/* Gradient Animations */
.gradient-animate {
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

.gradient-flow {
  background-size: 200% 200%;
  animation: gradientFlow 4s ease infinite;
}

/* Loading States */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(124, 58, 237, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: dot-pulse 1.4s infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

.loading-wave {
  display: inline-flex;
  gap: 4px;
  align-items: flex-end;
  height: 20px;
}

.loading-wave span {
  width: 4px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 2px;
  animation: wave 1.2s ease-in-out infinite;
}

.loading-wave span:nth-child(2) {
  animation-delay: 0.1s;
}

.loading-wave span:nth-child(3) {
  animation-delay: 0.2s;
}

.loading-wave span:nth-child(4) {
  animation-delay: 0.3s;
}

/* Transition Utilities */
.transition-fast {
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-base {
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-slow {
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ripple Effect */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

/* Page Transition */
@keyframes pageEnter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.page-enter {
  animation: pageEnter 0.3s ease-out;
}

/* Skeleton Loading */
@keyframes skeleton-loading {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 1000px 100%;
  animation: skeleton-loading 2s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-card {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-lg);
}

/* Stagger Animation */
.stagger-item {
  animation: slideInUp 0.5s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.2s; }
.stagger-item:nth-child(4) { animation-delay: 0.3s; }
.stagger-item:nth-child(5) { animation-delay: 0.4s; }
.stagger-item:nth-child(6) { animation-delay: 0.5s; }

/* Fade In with Stagger */
.fade-stagger-item {
  animation: fadeIn 0.5s ease-out forwards;
}

.fade-stagger-item:nth-child(1) { animation-delay: 0s; }
.fade-stagger-item:nth-child(2) { animation-delay: 0.1s; }
.fade-stagger-item:nth-child(3) { animation-delay: 0.2s; }
.fade-stagger-item:nth-child(4) { animation-delay: 0.3s; }
.fade-stagger-item:nth-child(5) { animation-delay: 0.4s; }

/* Badge Animation */
.badge-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Notification Enter/Exit */
@keyframes notificationEnter {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.notification-enter {
  animation: notificationEnter 0.3s ease-out;
}

.notification-exit {
  animation: notificationExit 0.3s ease-out forwards;
}

/* Smooth Color Transition */
.color-transition {
  transition: color 0.3s ease;
  transition: background-color 0.3s ease;
  transition: border-color 0.3s ease;
}

/* Transform Transition */
.transform-transition {
  transition: transform 0.3s ease;
}

/* Shadow Transition */
.shadow-transition {
  transition: box-shadow 0.3s ease;
}

/* Hover Scale */
.hover-scale:hover {
  transform: scale(1.05);
}

.hover-scale-lg:hover {
  transform: scale(1.1);
}

/* Smooth Scroll Behavior */
html.smooth-scroll {
  scroll-behavior: smooth;
}

/* Focus Visible Styles */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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