/* Micro-interaction CSS Utilities for Volt Components */

/* Hover Effects */
.hover-lift {
  @apply transition-transform duration-200 ease-out;
}
.hover-lift:hover {
  @apply -translate-y-0.5;
}

.hover-glow {
  @apply transition-shadow duration-200;
}
.hover-glow:hover {
  @apply shadow-lg;
}

.hover-dim {
  @apply transition-opacity duration-200;
}
.hover-dim:hover {
  @apply opacity-80;
}

.hover-brighten {
  @apply transition-all duration-200;
}
.hover-brighten:hover {
  filter: brightness(1.1);
}

/* Click Effects */
.click-scale {
  @apply transition-transform duration-100;
}
.click-scale:active {
  @apply scale-95;
}

.click-depth {
  @apply transition-all duration-100;
}
.click-depth:active {
  @apply shadow-inner;
}

/* Focus Effects */
.focus-ring {
  @apply transition-all duration-200;
  @apply focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2;
}

.focus-within-ring {
  @apply transition-all duration-200;
  @apply focus-within:ring-2 focus-within:ring-primary-500 focus-within:ring-offset-2;
}

/* Combined Effects */
.interactive {
  @apply hover-lift hover-glow click-scale focus-ring;
}

.interactive-subtle {
  @apply hover-dim click-scale focus-ring;
}

/* Icon Animations */
.icon-hover-spin {
  @apply transition-transform duration-300;
}
.icon-hover-spin:hover {
  @apply rotate-180;
}

.icon-hover-pulse {
  @apply transition-transform duration-200;
}
.icon-hover-pulse:hover {
  animation: pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Loading States */
.loading-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 20%,
    rgba(255, 255, 255, 0.5) 60%,
    rgba(255, 255, 255, 0)
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

.loading-pulse-bg {
  animation: pulse-bg 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-bg {
  0%, 100% {
    background-color: rgba(229, 231, 235, 1);
  }
  50% {
    background-color: rgba(229, 231, 235, 0.5);
  }
}

/* Smooth Transitions */
.transition-smooth {
  @apply transition-all duration-300 ease-in-out;
}

.transition-smooth-fast {
  @apply transition-all duration-150 ease-in-out;
}

.transition-smooth-slow {
  @apply transition-all duration-500 ease-in-out;
}

/* Entrance Animations */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

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

.slide-in-bottom {
  animation: slideInBottom 0.3s ease-out;
}

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

.scale-in {
  animation: scaleIn 0.2s ease-out;
}

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

/* Ripple Effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
  width: 300px;
  height: 300px;
}

/* State Transitions */
.state-transition {
  @apply transition-colors duration-200 ease-in-out;
}

.state-transition-all {
  @apply transition-all duration-200 ease-in-out;
}

/* Disabled State */
.disabled-state {
  @apply opacity-50 cursor-not-allowed pointer-events-none;
}

/* Success/Error Animations */
.success-pulse {
  animation: success-pulse 0.5s ease-in-out;
}

@keyframes success-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.error-shake {
  animation: error-shake 0.5s ease-in-out;
}

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

/* Skeleton Loading */
.skeleton {
  @apply bg-gray-200 dark:bg-gray-700 rounded;
  @apply animate-pulse;
}

.skeleton-text {
  @apply h-4 bg-gray-200 dark:bg-gray-700 rounded;
  @apply animate-pulse;
}

.skeleton-button {
  @apply h-10 bg-gray-200 dark:bg-gray-700 rounded-lg;
  @apply animate-pulse;
}

/* Tooltip Animations */
.tooltip-fade {
  @apply transition-opacity duration-200;
}

.tooltip-scale {
  @apply transition-all duration-200 origin-bottom;
  @apply scale-95 opacity-0;
}

.tooltip-scale.show {
  @apply scale-100 opacity-100;
}

/* Card Hover Effects */
.card-hover {
  @apply transition-all duration-300;
  @apply hover:shadow-xl hover:-translate-y-1;
}

.card-hover-subtle {
  @apply transition-shadow duration-300;
  @apply hover:shadow-md;
}

/* Button Press Effect */
.button-press {
  @apply transition-all duration-100;
  @apply active:scale-95 active:shadow-inner;
}

/* Link Underline Animation */
.link-underline {
  @apply relative;
}

.link-underline::after {
  content: '';
  @apply absolute bottom-0 left-0 w-0 h-0.5 bg-current;
  @apply transition-all duration-300;
}

.link-underline:hover::after {
  @apply w-full;
}

/* Badge Bounce */
.badge-bounce {
  animation: badge-bounce 0.3s ease-in-out;
}

@keyframes badge-bounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Notification Bell */
.notification-ring {
  animation: ring 1s ease-in-out;
}

@keyframes ring {
  0% {
    transform: rotate(0);
  }
  10%, 20% {
    transform: rotate(-10deg);
  }
  15%, 25% {
    transform: rotate(10deg);
  }
  30% {
    transform: rotate(0);
  }
}

/* Progress Bar Animation */
.progress-animate {
  @apply transition-all duration-500 ease-out;
}

.progress-stripe {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
  animation: progress-stripe 1s linear infinite;
}

@keyframes progress-stripe {
  0% {
    background-position: 1rem 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* Accordion Expand */
.accordion-expand {
  @apply transition-all duration-300 ease-in-out;
  @apply origin-top;
}

/* Tab Indicator */
.tab-indicator {
  @apply transition-all duration-300 ease-in-out;
}

/* Modal Backdrop */
.modal-backdrop-fade {
  @apply transition-opacity duration-300;
}

/* Toast Slide */
.toast-slide {
  animation: toast-slide 0.3s ease-out;
}

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

/* Dropdown Expand */
.dropdown-expand {
  @apply transition-all duration-200 ease-out;
  @apply origin-top scale-y-0 opacity-0;
}

.dropdown-expand.show {
  @apply scale-y-100 opacity-100;
}

/* Checkbox Check Animation */
.checkbox-check {
  @apply transition-all duration-200;
}

.checkbox-check.checked {
  animation: check 0.3s ease-in-out;
}

@keyframes check {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Switch Toggle */
.switch-toggle {
  @apply transition-all duration-200 ease-in-out;
}

/* Parallax Scroll (for advanced effects) */
.parallax {
  will-change: transform;
}

/* Performance Optimizations */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

.no-select {
  @apply select-none;
  -webkit-touch-callout: none;
}

/* Dark Mode Transitions */
.dark-transition {
  @apply transition-colors duration-300;
}