/* ============================================
   GOD-LEVEL ANIMATIONS FOR TLDS EVENTS
   ============================================ */

/* ===== FADE IN UP ANIMATION ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(60px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== FADE IN DOWN ANIMATION ===== */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-60px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== FADE IN LEFT ANIMATION ===== */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== FADE IN RIGHT ANIMATION ===== */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== SCALE IN ANIMATION ===== */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== ROTATE IN ANIMATION ===== */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

/* ===== BOUNCE ANIMATION ===== */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

/* ===== PULSE ANIMATION ===== */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(162, 128, 255, 0.7);
  }
  70% {
    transform: scale(1.02);
    box-shadow: 0 0 0 20px rgba(162, 128, 255, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(162, 128, 255, 0);
  }
}

/* ===== GLOW PULSE ANIMATION ===== */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 5px var(--accent), 0 0 10px var(--accent), 0 0 15px var(--accent);
  }
  50% {
    box-shadow: 0 0 20px var(--accent), 0 0 30px var(--accent), 0 0 40px var(--accent);
  }
}

/* ===== FLOAT ANIMATION ===== */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

/* ===== SHIMMER ANIMATION ===== */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ===== SPIN ANIMATION ===== */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

/* ===== RIPPLE ANIMATION ===== */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* ===== TYPING ANIMATION ===== */
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--accent); }
}

/* ===== GLITCH ANIMATION ===== */
@keyframes glitch {
  0% {
    clip-path: inset(40% 0 61% 0);
    transform: translate(-2px, 2px);
  }
  20% {
    clip-path: inset(92% 0 1% 0);
    transform: translate(2px, -2px);
  }
  40% {
    clip-path: inset(43% 0 1% 0);
    transform: translate(-2px, 2px);
  }
  60% {
    clip-path: inset(25% 0 58% 0);
    transform: translate(2px, -2px);
  }
  80% {
    clip-path: inset(54% 0 7% 0);
    transform: translate(-2px, 2px);
  }
  100% {
    clip-path: inset(58% 0 43% 0);
    transform: translate(2px, -2px);
  }
}

/* ===== PARTICLE ANIMATION ===== */
@keyframes particle {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ===== HEARTBEAT ANIMATION ===== */
@keyframes heartbeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.1); }
  28% { transform: scale(1); }
  42% { transform: scale(1.1); }
  70% { transform: scale(1); }
}

/* ===== WOBBLE ANIMATION ===== */
@keyframes wobble {
  0% { transform: translateX(0); }
  15% { transform: translateX(-15px) rotate(-5deg); }
  30% { transform: translateX(10px) rotate(3deg); }
  45% { transform: translateX(-10px) rotate(-3deg); }
  60% { transform: translateX(5px) rotate(2deg); }
  75% { transform: translateX(-5px) rotate(-1deg); }
  100% { transform: translateX(0); }
}

/* ===== JELLO ANIMATION ===== */
@keyframes jello {
  0%, 100% { transform: scale3d(1, 1, 1); }
  30% { transform: scale3d(1.25, 0.75, 1); }
  40% { transform: scale3d(0.75, 1.25, 1); }
  50% { transform: scale3d(1.15, 0.85, 1); }
  65% { transform: scale3d(0.95, 1.05, 1); }
  75% { transform: scale3d(1.05, 0.95, 1); }
}

/* ===== RUBBER BAND ANIMATION ===== */
@keyframes rubberBand {
  0% { transform: scale3d(1, 1, 1); }
  30% { transform: scale3d(1.25, 0.75, 1); }
  40% { transform: scale3d(0.75, 1.25, 1); }
  50% { transform: scale3d(1.15, 0.85, 1); }
  65% { transform: scale3d(0.95, 1.05, 1); }
  75% { transform: scale3d(1.05, 0.95, 1); }
  100% { transform: scale3d(1, 1, 1); }
}

/* ===== FLIP IN X ANIMATION ===== */
@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);
  }
}

/* ===== ZOOM IN ANIMATION ===== */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  50% {
    opacity: 1;
  }
}

/* ===== SLIDE IN UP ANIMATION ===== */
@keyframes slideInUp {
  from {
    transform: translate3d(0, 100%, 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

/* ============================================
   ANIMATION CLASSES
   ============================================ */

.animate-fadeInUp {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fadeInDown {
  animation: fadeInDown 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fadeInLeft {
  animation: fadeInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fadeInRight {
  animation: fadeInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-scaleIn {
  animation: scaleIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-rotateIn {
  animation: rotateIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-glow {
  animation: glowPulse 2s infinite;
}

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

.animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

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

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

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

.animate-wobble {
  animation: wobble 1s ease-in-out;
}

.animate-jello {
  animation: jello 0.9s both;
}

.animate-rubberBand {
  animation: rubberBand 1s both;
}

.animate-flipInX {
  animation: flipInX 0.8s both;
}

.animate-zoomIn {
  animation: zoomIn 0.5s both;
}

.animate-slideInUp {
  animation: slideInUp 0.5s both;
}

/* ============================================
   INTERSECTION OBSERVER ANIMATIONS
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

.reveal-rotate {
  opacity: 0;
  transform: rotate(-10deg) scale(0.9);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-rotate.active {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

.hover-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(162, 128, 255, 0.3);
}

.hover-scale {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(162, 128, 255, 0.5);
}

.hover-rotate {
  transition: transform 0.3s ease;
}

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

.hover-shine {
  position: relative;
  overflow: hidden;
}

.hover-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.hover-shine:hover::before {
  left: 100%;
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(162, 128, 255, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-dots {
  display: flex;
  gap: 8px;
}

.loading-dots span {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  animation: bounce 1.4s ease-in-out infinite both;
}

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

/* ============================================
   STAGGER ANIMATION DELAYS
   ============================================ */

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.stagger-7 { animation-delay: 0.7s; }
.stagger-8 { animation-delay: 0.8s; }

/* ============================================
   PARALLAX EFFECT
   ============================================ */

.parallax {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ============================================
   MAGNETIC BUTTON EFFECT
   ============================================ */

.magnetic-btn {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   TEXT REVEAL ANIMATION
   ============================================ */

.text-reveal {
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

/* ============================================
   GRADIENT BORDER ANIMATION
   ============================================ */

.gradient-border {
  position: relative;
  background: var(--card);
  border-radius: 16px;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  background: linear-gradient(45deg, #A280FF, #7B68EE, #A280FF, #7B68EE);
  background-size: 300% 300%;
  animation: gradientShift 3s ease infinite;
  z-index: -1;
}

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

/* ============================================
   NEON EFFECT
   ============================================ */

.neon {
  text-shadow: 
    0 0 5px var(--accent),
    0 0 10px var(--accent),
    0 0 20px var(--accent),
    0 0 40px var(--accent);
  animation: neonFlicker 2s infinite alternate;
}

@keyframes neonFlicker {
  0%, 100% { opacity: 1; }
  41% { opacity: 1; }
  42% { opacity: 0.8; }
  43% { opacity: 1; }
  45% { opacity: 0.8; }
  46% { opacity: 1; }
}

/* ============================================
   MORPHING ANIMATION
   ============================================ */

.morph {
  animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
  0% { border-radius: 60% 40% 30% 70%/60% 30% 70% 40%; }
  50% { border-radius: 30% 60% 70% 40%/50% 60% 30% 60%; }
  100% { border-radius: 60% 40% 30% 70%/60% 30% 70% 40%; }
}

/* ============================================
   SKEW ON SCROLL
   ============================================ */

.skew-scroll {
  transition: transform 0.1s ease-out;
}

/* ============================================
   CURSOR EFFECTS (FIXED)
   ============================================ */

.cursor-trail {
  cursor: none;
  transition: all 0.2s ease-out;
  pointer-events: none;
}

.cursor-dot {
  cursor: none;
  transition: all 0.1s ease-out;
  pointer-events: none;
}

/* Disable default cursor on body for custom cursor */
body {
  cursor: none;
}

/* Show default cursor on text inputs and text areas */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  cursor: text !important;
}

/* Show pointer cursor on interactive elements */
a,
button,
[onclick],
.btn,
.event-card,
.hover-lift,
.hover-scale {
  cursor: pointer !important;
}

/* Smooth cursor transitions */
* {
  transition: cursor 0.1s ease;
}

.cursor-glow {
  cursor: pointer;
  transition: all 0.3s ease;
}

.cursor-glow:hover {
  filter: drop-shadow(0 0 10px var(--accent));
}

/* Ensure cursor works on all elements */
* {
  cursor: inherit !important;
}

/* Override for specific elements */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  cursor: text !important;
}

a,
button,
[onclick],
.btn,
.event-card,
.hover-lift,
.hover-scale {
  cursor: pointer !important;
}

/* ============================================
   PAGE TRANSITION
   ============================================ */

.page-transition {
  animation: pageTransition 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================
   CONFETTI EFFECT
   ============================================ */

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--accent);
  animation: confetti-fall 3s linear forwards;
  pointer-events: none;
  z-index: 9999;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ============================================
   TILT EFFECT
   ============================================ */

.tilt {
  transform-style: preserve-3d;
  transform: perspective(1000px);
}

/* ============================================
   MOBILE-OPTIMIZED ANIMATIONS
   ============================================ */

/* Reduce animation intensity on mobile for better performance */
@media (max-width: 768px) {
  /* Faster animations on mobile */
  .animate-fadeInUp {
    animation-duration: 0.6s;
  }
  
  .animate-fadeInDown {
    animation-duration: 0.6s;
  }
  
  .animate-scaleIn {
    animation-duration: 0.4s;
  }
  
  /* Reduce parallax effect on mobile */
  .parallax {
    transform: none !important;
  }
  
  /* Disable complex hover effects on mobile */
  .hover-lift:hover {
    transform: none;
  }
  
  .hover-scale:hover {
    transform: none;
  }
  
  /* Simplified tilt effect on mobile */
  .tilt {
    transform: none !important;
  }
  
  /* Disable cursor trail on mobile */
  .cursor-trail,
  .cursor-dot {
    display: none !important;
  }
  
  body {
    cursor: auto !important;
  }
  
  /* Optimized animations for mobile */
  @keyframes mobileFadeInUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .mobile-animate {
    animation: mobileFadeInUp 0.5s ease-out forwards;
  }
  
  /* Reduce stagger delays on mobile */
  .stagger-1 { animation-delay: 0.05s; }
  .stagger-2 { animation-delay: 0.1s; }
  .stagger-3 { animation-delay: 0.15s; }
  .stagger-4 { animation-delay: 0.2s; }
  .stagger-5 { animation-delay: 0.25s; }
  .stagger-6 { animation-delay: 0.3s; }
  .stagger-7 { animation-delay: 0.35s; }
  .stagger-8 { animation-delay: 0.4s; }
}

/* Touch-friendly animations */
@media (hover: none) and (pointer: coarse) {
  /* Disable hover animations on touch devices */
  .hover-glow:hover {
    filter: none;
  }
  
  .hover-shine::before {
    display: none;
  }
  
  /* Use tap animations instead */
  .btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
  
  .event-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
}

/* Enhanced mobile reveal animations */
@media (max-width: 768px) {
  .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
  }
  
  .reveal.active {
    opacity: 1;
    transform: translateY(0);
  }
  
  .reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease;
  }
  
  .reveal-left.active {
    opacity: 1;
    transform: translateX(0);
  }
  
  .reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s ease;
  }
  
  .reveal-right.active {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Mobile-optimized loading animations */
@media (max-width: 768px) {
  .loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 2px;
  }
  
  .loading-dots span {
    width: 10px;
    height: 10px;
  }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
  /* Reduce GPU usage on mobile */
  .animate-glow,
  .animate-pulse,
  .animate-float {
    animation: none;
  }
  
  /* Simplified shimmer effect */
  .animate-shimmer {
    background: none;
  }
  
  /* Disable complex transforms */
  .animate-rotateIn,
  .animate-jello,
  .animate-rubberBand {
    animation: fadeInUp 0.6s ease;
  }
}
