/* Animation and Transition Styles */

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

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

@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 slideInUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

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

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

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

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

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -30px, 0);
  }
  70% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-10px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(10px);
  }
}

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

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

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

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px var(--primary-color);
  }
  50% {
    box-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color);
  }
}

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

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

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  50% {
    opacity: 1;
  }
}

@keyframes zoomOut {
  from {
    opacity: 1;
  }
  50% {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  to {
    opacity: 0;
  }
}

@keyframes flipInX {
  from {
    transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    animation-timing-function: ease-in;
    opacity: 0;
  }
  40% {
    transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    animation-timing-function: ease-in;
  }
  60% {
    transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
    opacity: 1;
  }
  80% {
    transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
  }
  to {
    transform: perspective(400px);
  }
}

@keyframes flipInY {
  from {
    transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
    animation-timing-function: ease-in;
    opacity: 0;
  }
  40% {
    transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
    animation-timing-function: ease-in;
  }
  60% {
    transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
    opacity: 1;
  }
  80% {
    transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
  }
  to {
    transform: perspective(400px);
  }
}

/* Animation Classes */
.animate-fadeIn {
  animation: fadeIn var(--duration-500) ease-out;
}

.animate-fadeOut {
  animation: fadeOut var(--duration-500) ease-out;
}

.animate-fadeInUp {
  animation: fadeInUp var(--duration-700) ease-out;
}

.animate-fadeInDown {
  animation: fadeInDown var(--duration-700) ease-out;
}

.animate-fadeInLeft {
  animation: fadeInLeft var(--duration-700) ease-out;
}

.animate-fadeInRight {
  animation: fadeInRight var(--duration-700) ease-out;
}

.animate-slideInUp {
  animation: slideInUp var(--duration-500) ease-out;
}

.animate-slideInDown {
  animation: slideInDown var(--duration-500) ease-out;
}

.animate-slideInLeft {
  animation: slideInLeft var(--duration-500) ease-out;
}

.animate-slideInRight {
  animation: slideInRight var(--duration-500) ease-out;
}

.animate-scaleIn {
  animation: scaleIn var(--duration-300) ease-out;
}

.animate-scaleOut {
  animation: scaleOut var(--duration-300) ease-out;
}

.animate-bounce {
  animation: bounce var(--duration-1000) infinite;
}

.animate-pulse {
  animation: pulse var(--duration-1000) infinite;
}

.animate-shake {
  animation: shake var(--duration-500) ease-in-out;
}

.animate-spin {
  animation: spin var(--duration-1000) linear infinite;
}

.animate-ping {
  animation: ping var(--duration-1000) cubic-bezier(0, 0, 0.2, 1) infinite;
}

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

.animate-glow {
  animation: glow 2s ease-in-out infinite alternate;
}

.animate-slideUp {
  animation: slideUp var(--duration-500) ease-out;
}

.animate-slideDown {
  animation: slideDown var(--duration-500) ease-out;
}

.animate-zoomIn {
  animation: zoomIn var(--duration-500) ease-out;
}

.animate-zoomOut {
  animation: zoomOut var(--duration-500) ease-out;
}

.animate-flipInX {
  animation: flipInX var(--duration-700) ease-out;
}

.animate-flipInY {
  animation: flipInY var(--duration-700) ease-out;
}

/* Animation Delays */
.animate-delay-75 { animation-delay: var(--duration-75); }
.animate-delay-100 { animation-delay: var(--duration-100); }
.animate-delay-150 { animation-delay: var(--duration-150); }
.animate-delay-200 { animation-delay: var(--duration-200); }
.animate-delay-300 { animation-delay: var(--duration-300); }
.animate-delay-500 { animation-delay: var(--duration-500); }
.animate-delay-700 { animation-delay: var(--duration-700); }
.animate-delay-1000 { animation-delay: var(--duration-1000); }

/* Animation Durations */
.animate-duration-75 { animation-duration: var(--duration-75); }
.animate-duration-100 { animation-duration: var(--duration-100); }
.animate-duration-150 { animation-duration: var(--duration-150); }
.animate-duration-200 { animation-duration: var(--duration-200); }
.animate-duration-300 { animation-duration: var(--duration-300); }
.animate-duration-500 { animation-duration: var(--duration-500); }
.animate-duration-700 { animation-duration: var(--duration-700); }
.animate-duration-1000 { animation-duration: var(--duration-1000); }

/* Transition Classes */
.transition-all {
  transition: all var(--transition-base);
}

.transition-colors {
  transition: color var(--transition-base), background-color var(--transition-base), border-color var(--transition-base);
}

.transition-opacity {
  transition: opacity var(--transition-base);
}

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

.transition-shadow {
  transition: box-shadow var(--transition-base);
}

.transition-fast {
  transition-duration: var(--transition-fast);
}

.transition-slow {
  transition-duration: var(--transition-slow);
}

.transition-slower {
  transition-duration: var(--transition-slower);
}

/* Hover Animations */
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

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

.hover-rotate:hover {
  transform: rotate(5deg);
}

.hover-glow:hover {
  box-shadow: 0 0 20px var(--primary-color);
}

.hover-bounce:hover {
  animation: bounce var(--duration-500) ease-in-out;
}

.hover-pulse:hover {
  animation: pulse var(--duration-500) ease-in-out;
}

/* Scroll Animations */
.scroll-fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--duration-700) ease-out;
}

.scroll-fade-in.in-view {
  opacity: 1;
  transform: translateY(0);
}

.scroll-slide-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all var(--duration-700) ease-out;
}

.scroll-slide-left.in-view {
  opacity: 1;
  transform: translateX(0);
}

.scroll-slide-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all var(--duration-700) ease-out;
}

.scroll-slide-right.in-view {
  opacity: 1;
  transform: translateX(0);
}

.scroll-scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--duration-700) ease-out;
}

.scroll-scale-in.in-view {
  opacity: 1;
  transform: scale(1);
}

/* Loading Animations */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin var(--duration-1000) linear infinite;
}

.loading-dots {
  display: inline-block;
}

.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% {
    content: '';
  }
  40% {
    content: '.';
  }
  60% {
    content: '..';
  }
  80%, 100% {
    content: '...';
  }
}

.loading-pulse {
  animation: pulse var(--duration-1000) ease-in-out infinite;
}

/* Stagger Animations */
.stagger-children > * {
  animation-delay: calc(var(--stagger-delay, 100ms) * var(--index, 0));
}

/* Page Transition Animations */
.page-enter {
  opacity: 0;
  transform: translateY(20px);
}

.page-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: all var(--duration-500) ease-out;
}

.page-exit {
  opacity: 1;
  transform: translateY(0);
}

.page-exit-active {
  opacity: 0;
  transform: translateY(-20px);
  transition: all var(--duration-300) ease-in;
}

/* Modal Animations */
.modal-enter {
  opacity: 0;
  transform: scale(0.9);
}

.modal-enter-active {
  opacity: 1;
  transform: scale(1);
  transition: all var(--duration-200) ease-out;
}

.modal-exit {
  opacity: 1;
  transform: scale(1);
}

.modal-exit-active {
  opacity: 0;
  transform: scale(0.9);
  transition: all var(--duration-150) ease-in;
}

/* Backdrop Animations */
.backdrop-enter {
  opacity: 0;
}

.backdrop-enter-active {
  opacity: 1;
  transition: opacity var(--duration-200) ease-out;
}

.backdrop-exit {
  opacity: 1;
}

.backdrop-exit-active {
  opacity: 0;
  transition: opacity var(--duration-150) ease-in;
}

/* Reduced Motion */
@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;
  }
  
  .animate-bounce,
  .animate-pulse,
  .animate-spin,
  .animate-ping,
  .animate-float,
  .animate-glow {
    animation: none !important;
  }
}

/* Print Animations */
@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

