/* ===== Animation Keyframes ===== */

/* Loading Animations */
@keyframes pixelPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(124, 179, 66, 0);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(124, 179, 66, 0.5);
  }
}

@keyframes textGlow {
  0% {
    text-shadow: 0 0 5px rgba(124, 179, 66, 0.5);
  }
  100% {
    text-shadow: 0 0 20px rgba(124, 179, 66, 0.8), 0 0 30px rgba(124, 179, 66, 0.4);
  }
}

/* Hero Section Animations */
@keyframes heroTitleGlow {
  0% {
    text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
  }
  100% {
    text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 255, 255, 0.3);
  }
}

@keyframes backgroundMove {
  0% {
    transform: translateX(0) translateY(0);
  }
  25% {
    transform: translateX(-32px) translateY(0);
  }
  50% {
    transform: translateX(-32px) translateY(-32px);
  }
  75% {
    transform: translateX(0) translateY(-32px);
  }
  100% {
    transform: translateX(0) translateY(0);
  }
}

/* Button Hover Effects */
@keyframes buttonPixelPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

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

/* Status Indicator Animations */
@keyframes statusPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes statusBlink {
  0%, 50%, 100% {
    opacity: 1;
  }
  25%, 75% {
    opacity: 0.3;
  }
}

/* Particle Effects */
@keyframes pixelFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
    opacity: 1;
  }
}

@keyframes pixelFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Scroll Animations */
@keyframes fadeInUp {
  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 scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Dynmap Loading Animation */
@keyframes mapLoad {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Pixel Particle System */
@keyframes pixelSparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1) rotate(180deg);
  }
}

/* Glitch Effect */
@keyframes pixelGlitch {
  0%, 90%, 100% {
    transform: translateX(0);
  }
  10% {
    transform: translateX(-2px);
  }
  20% {
    transform: translateX(2px);
  }
  30% {
    transform: translateX(-2px);
  }
  40% {
    transform: translateX(2px);
  }
  50% {
    transform: translateX(-2px);
  }
  60% {
    transform: translateX(2px);
  }
  70% {
    transform: translateX(-2px);
  }
  80% {
    transform: translateX(2px);
  }
}

/* Typing Animation */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blinkCursor {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--color-primary);
  }
}

/* ===== Animation Classes ===== */

/* Scroll-triggered animations */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
  opacity: 1;
}

.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-left {
  animation: fadeInLeft 0.8s ease-out forwards;
}

.fade-in-right {
  animation: fadeInRight 0.8s ease-out forwards;
}

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

/* Hover Effects */
.pixel-hover {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

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

.pixel-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Button Animations */
.btn-animated {
  position: relative;
  overflow: hidden;
}

.btn-animated::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-animated:active::after {
  width: 300px;
  height: 300px;
}

/* Pixel Particles */
.pixel-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.pixel-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--color-primary);
  image-rendering: pixelated;
  animation: pixelFloat 3s ease-in-out infinite;
}

.pixel-particle:nth-child(2n) {
  background: var(--color-accent);
  animation-delay: -1s;
  animation-duration: 4s;
}

.pixel-particle:nth-child(3n) {
  background: var(--color-info);
  animation-delay: -2s;
  animation-duration: 5s;
}

/* Loading States */
.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: pixelShimmer 2s infinite;
}

/* Interactive Elements */
.clickable-pixel {
  cursor: pointer;
  transition: all 0.2s ease;
}

.clickable-pixel:hover {
  animation: buttonPixelPop 0.3s ease;
}

.clickable-pixel:active {
  transform: scale(0.95);
}

/* Status Indicators */
.status-animated .status-dot {
  animation: statusBlink 1.5s ease-in-out infinite;
}

.status-animated.online .status-dot {
  background: var(--color-success);
  box-shadow: 0 0 10px var(--color-success);
}

.status-animated.offline .status-dot {
  background: var(--color-danger);
  box-shadow: 0 0 10px var(--color-danger);
  animation: statusBlink 0.8s ease-in-out infinite;
}

/* Typewriter Effect */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--color-primary);
  white-space: nowrap;
  animation: typewriter 3s steps(40, end), blinkCursor 0.75s step-end infinite;
}

/* Glitch Text */
.glitch-text {
  position: relative;
  color: var(--color-primary);
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch-text::before {
  animation: pixelGlitch 0.3s infinite;
  color: var(--color-danger);
  z-index: -1;
}

.glitch-text::after {
  animation: pixelGlitch 0.3s infinite reverse;
  color: var(--color-info);
  z-index: -2;
}

/* Parallax Elements */
.parallax-element {
  transition: transform 0.1s ease-out;
}

/* Dynmap Specific Animations */
.dynmap-container {
  animation: mapLoad 1s ease-out;
}

.dynmap-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 400px;
  background: var(--bg-card);
  border: 2px dashed var(--color-primary);
}

.dynmap-loading .pixel-loader {
  margin-bottom: var(--spacing-md);
}

/* Responsive Animation Adjustments */
@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;
  }
  
  .parallax-element {
    transform: none !important;
  }
}

@media (max-width: 768px) {
  .pixel-particles {
    display: none;
  }
  
  .animate-on-scroll {
    animation-duration: 0.5s;
  }
  
  .pixel-hover:hover {
    transform: none;
  }
} 