/* ================================================================= */
/*          ULTIMATIVE SEASONAL ANIMATIONS & EFFEKTE              */
/* ================================================================= */

/* =============== GLOBALE ANIMATIONEN =============== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

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

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

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

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
  40%, 43% { transform: translateY(-15px); }
  70% { transform: translateY(-7px); }
  90% { transform: translateY(-2px); }
}

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

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

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

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

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

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(5deg); }
  75% { transform: rotate(-5deg); }
}

/* =============== LOADING ANIMATIONEN =============== */
@keyframes spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes dots {
  0%, 80%, 100% { transform: scale(0); opacity: 0; }
  40% { transform: scale(1); opacity: 1; }
}

@keyframes ripple {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(4); opacity: 0; }
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--bg-tertiary);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spinner 1s linear infinite;
}

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

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

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

.ripple-effect {
  position: relative;
  overflow: hidden;
}

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

/* =============== PARTIKEL SYSTEME =============== */
.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--z-base);
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.7;
}

/* Floating Partikel */
@keyframes particleFloat {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.7;
  }
  90% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(-100px) translateX(100px) rotate(360deg);
    opacity: 0;
  }
}

.particle-float {
  animation: particleFloat 15s linear infinite;
}

/* Funkelnde Partikel */
@keyframes sparkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* =============== THEME-SPEZIFISCHE ANIMATIONEN =============== */

/* ============ FRÜHLING ANIMATIONEN ============ */
body.theme-spring {
  --animation-duration: 3s;
}

@keyframes springGrow {
  0% { transform: scale(0) rotate(0deg); opacity: 0; }
  50% { transform: scale(1.1) rotate(180deg); opacity: 0.8; }
  100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

@keyframes leafSway {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-5px); }
}

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

@keyframes grassWave {
  0%, 100% { transform: scaleY(1) skewX(0deg); }
  25% { transform: scaleY(1.1) skewX(1deg); }
  75% { transform: scaleY(0.9) skewX(-1deg); }
}

body.theme-spring .card {
  animation: springGrow 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.theme-spring .btn {
  animation: bloomIn 0.6s ease-out;
  animation-fill-mode: both;
}

body.theme-spring .nav-link {
  transition: all var(--transition-md);
}

body.theme-spring .nav-link:hover {
  animation: leafSway 0.6s ease-in-out;
}

/* Frühlings-Partikel */
body.theme-spring .particle-leaf {
  background: var(--leaf-color-1);
  width: 8px;
  height: 12px;
  border-radius: 0 100% 0 100%;
  animation: leafSway 4s ease-in-out infinite, particleFloat 12s linear infinite;
}

body.theme-spring .particle-flower {
  background: radial-gradient(var(--flower-color), transparent);
  width: 6px;
  height: 6px;
  animation: sparkle 3s ease-in-out infinite;
}

/* ============ SOMMER ANIMATIONEN ============ */
@keyframes sunBeam {
  0% { transform: scale(0) rotate(0deg); opacity: 0; }
  50% { transform: scale(1) rotate(180deg); opacity: 1; }
  100% { transform: scale(1.5) rotate(360deg); opacity: 0; }
}

@keyframes heatShimmer {
  0%, 100% { transform: translateY(0) scaleX(1); }
  33% { transform: translateY(-2px) scaleX(1.02); }
  66% { transform: translateY(2px) scaleX(0.98); }
}

@keyframes fireFlicker {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  25% { transform: scale(1.1) rotate(1deg); opacity: 1; }
  50% { transform: scale(0.9) rotate(-1deg); opacity: 0.9; }
  75% { transform: scale(1.05) rotate(0.5deg); opacity: 1; }
}

@keyframes sunGlow {
  0%, 100% { 
    box-shadow: 0 0 20px var(--glow-color), 0 0 40px var(--glow-color);
  }
  50% { 
    box-shadow: 0 0 40px var(--glow-color), 0 0 80px var(--glow-color), 0 0 120px var(--glow-color);
  }
}

body.theme-summer .card {
  animation: fadeInScale 0.8s ease-out;
}

body.theme-summer .btn {
  animation: sunBeam 0.8s ease-out;
  animation-fill-mode: both;
}

body.theme-summer .btn:hover {
  animation: sunGlow 2s ease-in-out infinite;
}

body.theme-summer .progress-bar {
  animation: heatShimmer 3s ease-in-out infinite;
}

/* Sommer-Partikel */
body.theme-summer .particle-sun {
  background: radial-gradient(var(--sun-color), var(--particle-color-1));
  width: 10px;
  height: 10px;
  animation: fireFlicker 2s ease-in-out infinite, float 8s ease-in-out infinite;
}

body.theme-summer .particle-heat {
  background: linear-gradient(transparent, var(--heat-shimmer), transparent);
  width: 3px;
  height: 20px;
  animation: heatShimmer 1.5s ease-in-out infinite;
}

/* ============ HERBST ANIMATIONEN ============ */
@keyframes leafFall {
  0% {
    transform: translateY(-50px) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) translateX(-100px) rotate(360deg);
    opacity: 0.3;
  }
}

@keyframes windBlow {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(10px) rotate(2deg); }
  75% { transform: translateX(-10px) rotate(-2deg); }
}

@keyframes autumnGlow {
  0%, 100% { 
    box-shadow: 0 0 15px var(--glow-color);
    filter: hue-rotate(0deg);
  }
  33% { 
    box-shadow: 0 0 25px var(--particle-color-2);
    filter: hue-rotate(30deg);
  }
  66% { 
    box-shadow: 0 0 20px var(--particle-color-3);
    filter: hue-rotate(-30deg);
  }
}

@keyframes rustleLeaves {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.02) rotate(0.5deg); }
  75% { transform: scale(0.98) rotate(-0.5deg); }
}

body.theme-autumn .card {
  animation: windBlow 4s ease-in-out infinite;
}

body.theme-autumn .btn {
  animation: fadeIn 0.8s ease-out;
}

body.theme-autumn .btn:hover {
  animation: autumnGlow 3s ease-in-out infinite;
}

body.theme-autumn .nav-link:hover {
  animation: rustleLeaves 0.8s ease-in-out;
}

/* Herbst-Partikel */
body.theme-autumn .particle-leaf-fall {
  background: var(--leaf-fall-1);
  width: 8px;
  height: 10px;
  border-radius: 0 100% 0 100%;
  animation: leafFall 8s linear infinite;
}

body.theme-autumn .particle-leaf-fall:nth-child(2n) {
  background: var(--leaf-fall-2);
  animation-duration: 10s;
  animation-delay: -2s;
}

body.theme-autumn .particle-leaf-fall:nth-child(3n) {
  background: var(--leaf-fall-3);
  animation-duration: 12s;
  animation-delay: -4s;
}

/* ============ WINTER ANIMATIONEN ============ */
@keyframes snowFall {
  0% {
    transform: translateY(-50px) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) translateX(50px) rotate(180deg);
    opacity: 0.8;
  }
}

@keyframes crystalGrow {
  0% { 
    transform: scale(0) rotate(0deg); 
    opacity: 0;
  }
  50% { 
    transform: scale(1.2) rotate(90deg); 
    opacity: 0.8;
  }
  100% { 
    transform: scale(1) rotate(180deg); 
    opacity: 1;
  }
}

@keyframes frostSpread {
  0% { 
    background-size: 0% 0%;
    opacity: 0;
  }
  100% { 
    background-size: 100% 100%;
    opacity: 0.3;
  }
}

@keyframes iceShimmer {
  0%, 100% { 
    box-shadow: 0 0 20px var(--glow-color);
    filter: brightness(1);
  }
  50% { 
    box-shadow: 0 0 40px var(--ice-color), 0 0 60px var(--crystal-color);
    filter: brightness(1.2);
  }
}

@keyframes freeze {
  0% { transform: scale(1); filter: blur(0px); }
  50% { transform: scale(0.95); filter: blur(1px); }
  100% { transform: scale(1); filter: blur(0px); }
}

body.theme-winter .card {
  animation: crystalGrow 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.theme-winter .btn {
  animation: fadeIn 0.8s ease-out;
}

body.theme-winter .btn:hover {
  animation: iceShimmer 2s ease-in-out infinite;
}

body.theme-winter .modal-content {
  animation: freeze 0.6s ease-out;
}

/* Winter-Partikel */
body.theme-winter .particle-snow {
  background: var(--snow-color);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  animation: snowFall 8s linear infinite;
  box-shadow: 0 0 6px var(--snow-color);
}

body.theme-winter .particle-snow:nth-child(2n) {
  width: 6px;
  height: 6px;
  animation-duration: 12s;
  animation-delay: -2s;
}

body.theme-winter .particle-snow:nth-child(3n) {
  width: 3px;
  height: 3px;
  animation-duration: 6s;
  animation-delay: -4s;
}

body.theme-winter .particle-crystal {
  background: var(--crystal-color);
  width: 8px;
  height: 8px;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: crystalGrow 3s ease-in-out infinite, float 6s ease-in-out infinite;
}

/* ============ HALLOWEEN ANIMATIONEN ============ */
@keyframes spookyGlow {
  0%, 100% { 
    box-shadow: 0 0 20px var(--glow-color);
    filter: brightness(1);
  }
  25% { 
    box-shadow: 0 0 40px var(--flame-color), 0 0 60px var(--glow-color);
    filter: brightness(1.3);
  }
  75% { 
    box-shadow: 0 0 30px var(--glow-color), 0 0 50px var(--flame-color);
    filter: brightness(0.8);
  }
}

@keyframes ghostFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
  50% { transform: translateY(-20px) rotate(5deg); opacity: 0.7; }
}

@keyframes flameFlicker {
  0%, 100% { 
    transform: scale(1) skewX(0deg);
    filter: hue-rotate(0deg);
  }
  25% { 
    transform: scale(1.1) skewX(2deg);
    filter: hue-rotate(10deg);
  }
  75% { 
    transform: scale(0.9) skewX(-2deg);
    filter: hue-rotate(-10deg);
  }
}

@keyframes batFly {
  0% { transform: translateX(-100px) translateY(0) rotate(0deg); }
  25% { transform: translateX(25vw) translateY(-20px) rotate(-5deg); }
  75% { transform: translateX(75vw) translateY(-10px) rotate(5deg); }
  100% { transform: translateX(100vw) translateY(-30px) rotate(0deg); }
}

@keyframes creepyShadow {
  0%, 100% { 
    box-shadow: 0 0 0 var(--shadow-creep);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 0 50px var(--shadow-creep);
    transform: scale(1.02);
  }
}

body.theme-halloween .card {
  animation: fadeIn 1s ease-out;
}

body.theme-halloween .btn {
  animation: spookyGlow 3s ease-in-out infinite;
}

body.theme-halloween .modal {
  animation: creepyShadow 4s ease-in-out infinite;
}

body.theme-halloween .progress-bar {
  animation: flameFlicker 2s ease-in-out infinite;
}

/* Halloween-Partikel */
body.theme-halloween .particle-flame {
  background: linear-gradient(to top, var(--flame-color), var(--particle-color-1));
  width: 6px;
  height: 15px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flameFlicker 1.5s ease-in-out infinite;
}

body.theme-halloween .particle-ghost {
  background: var(--ghost-color);
  width: 12px;
  height: 16px;
  border-radius: 50% 50% 0 0;
  animation: ghostFloat 4s ease-in-out infinite;
}

body.theme-halloween .particle-bat {
  background: var(--bat-color);
  width: 8px;
  height: 6px;
  border-radius: 0;
  clip-path: polygon(0% 50%, 25% 0%, 50% 40%, 75% 0%, 100% 50%, 85% 100%, 50% 80%, 15% 100%);
  animation: batFly 8s linear infinite;
}

/* ============ OSTERN ANIMATIONEN ============ */
@keyframes easterBloom {
  0% { 
    transform: scale(0) rotate(0deg);
    opacity: 0;
    filter: hue-rotate(0deg);
  }
  50% { 
    transform: scale(1.2) rotate(180deg);
    opacity: 0.8;
    filter: hue-rotate(90deg);
  }
  100% { 
    transform: scale(1) rotate(360deg);
    opacity: 1;
    filter: hue-rotate(0deg);
  }
}

@keyframes bunnyHop {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-15px) scale(1.1); }
}

@keyframes colorShift {
  0%, 100% { filter: hue-rotate(0deg); }
  33% { filter: hue-rotate(120deg); }
  66% { filter: hue-rotate(240deg); }
}

@keyframes petalFall {
  0% {
    transform: translateY(-20px) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) translateX(30px) rotate(360deg);
    opacity: 0.5;
  }
}

@keyframes eggWobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(3deg); }
  75% { transform: rotate(-3deg); }
}

body.theme-easter .card {
  animation: easterBloom 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.theme-easter .btn {
  animation: bunnyHop 2s ease-in-out infinite;
}

body.theme-easter .nav-link:hover {
  animation: colorShift 2s ease-in-out infinite;
}

body.theme-easter .modal-content {
  animation: eggWobble 1s ease-in-out infinite;
}

/* Ostern-Partikel */
body.theme-easter .particle-petal {
  background: var(--egg-color-1);
  width: 6px;
  height: 8px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: petalFall 6s linear infinite;
}

body.theme-easter .particle-egg {
  background: linear-gradient(45deg, var(--egg-color-1), var(--egg-color-2));
  width: 8px;
  height: 10px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: float 4s ease-in-out infinite, colorShift 6s ease-in-out infinite;
}

body.theme-easter .particle-bunny {
  background: var(--bunny-color);
  width: 6px;
  height: 8px;
  border-radius: 50%;
  animation: bunnyHop 3s ease-in-out infinite;
}

/* =============== HOVER-EFFEKTE =============== */
.hover-glow:hover {
  animation: glow 2s ease-in-out infinite;
}

.hover-bounce:hover {
  animation: bounce 1s ease-in-out;
}

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

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

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

.hover-rotate:hover {
  animation: rotate 2s linear infinite;
}

/* =============== ENTRANCE ANIMATIONEN =============== */
.animate-fade-in {
  animation: fadeIn 0.8s ease-out;
}

.animate-slide-in-left {
  animation: slideInLeft 0.8s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.8s ease-out;
}

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

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

.animate-scale-in {
  animation: fadeInScale 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* =============== STAGGER 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; }

/* =============== MOTION PREFERENCES =============== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .particles-container {
    display: none !important;
  }
}

/* =============== PERFORMANCE OPTIMIERUNGEN =============== */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}