/**
 * Animation Enhancements
 * Smooth transitions, loading animations, and interaction feedback
 */

/* Base Transitions */
* {
  transition-property: background-color, border-color, color, opacity, transform, box-shadow;
  transition-duration: var(--transition-base);
  transition-timing-function: ease-in-out;
}

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

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

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.1);
 3px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

/* Slide In */
@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-in-up {
  animation: slideInUp 0.3s ease-out;
}

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

.slide-in-down {
  animation: slideInDown 0.3s ease-out;
}

/* Modal Animations */
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.modal {
  animation: modalFadeIn 0.2s ease-out;
}

.modal-content {
  animation: modalSlideIn 0.3s ease-out;
}

/* Toast Animations */
@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast {
  animation: toastSlideIn 0.3s ease-out;
}

.toast.fade-out {
  animation: toastSlideOut 0.3s ease-in;
}

/* Card Hover Effects */
.card,
.event-card,
.gig-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover,
.event-card:hover,
.gig-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Button Hover Effects */
button,
.btn {
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

button:active,
.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

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

button::after,
.btn::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  width: 100px;
  height: 100px;
  margin-top: -50px;
  margin-left: -50px;
  top: 50%;
  left: 50%;
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

button:active::after,
.btn:active::after {
  animation: ripple 0.6s ease-out;
}

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

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

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

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

/* Skeleton Loading */
@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--panel) 0px,
    var(--panel-light) 40px,
    var(--panel) 80px
  );
  background-size: 200px 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Page Transitions */
@keyframes pageFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.page {
  animation: pageFadeIn 0.3s ease-in-out;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Focus Ring Animation */
@keyframes focusRing {
  0% {
    box-shadow: 0 0 0 0 rgba(143, 125, 243, 0.4);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(143, 125, 243, 0);
  }
}

*:focus {
  animation: focusRing 0.3s ease-out;
}

/* Stagger Animation for Lists */
.stagger-item {
  opacity: 0;
  animation: fadeIn 0.3s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }
.stagger-item:nth-child(7) { animation-delay: 0.35s; }
.stagger-item:nth-child(8) { animation-delay: 0.4s; }
.stagger-item:nth-child(9) { animation-delay: 0.45s; }
.stagger-item:nth-child(10) { animation-delay: 0.5s; }


