/* Snow Animation Styles - Realistic Snow Effect */
.snow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -10px;
  color: #ffffff;
  font-size: 1em;
  font-family: Arial, sans-serif;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.9),
    0 0 12px rgba(255, 255, 255, 0.5);
  animation: fall linear infinite;
  animation-iteration-count: infinite;
  animation-fill-mode: none;
  user-select: none;
  opacity: 0.9;
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Light mode - lighter gray snow for better visibility on light background */
body.a11y-theme-light .snowflake {
  color: #aaaaaa;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.2), 0 0 4px rgba(0, 0, 0, 0.15);
  opacity: 0.75;
}

/* Dark mode - bright white snow with glow */
body.a11y-theme-dark .snowflake {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.95),
    0 0 16px rgba(255, 255, 255, 0.6), 0 0 24px rgba(255, 255, 255, 0.3);
  opacity: 0.95;
}

/* Adaptive mode - follows device preference */
@media (prefers-color-scheme: dark) {
  body:not(.a11y-theme-light):not(.a11y-theme-dark) .snowflake {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.95),
      0 0 16px rgba(255, 255, 255, 0.6), 0 0 24px rgba(255, 255, 255, 0.3);
    opacity: 0.95;
  }
}

@media (prefers-color-scheme: light) {
  body:not(.a11y-theme-light):not(.a11y-theme-dark) .snowflake {
    color: #aaaaaa;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.2), 0 0 4px rgba(0, 0, 0, 0.15);
    opacity: 0.75;
  }
}

/* Animation keyframes - optimized for performance */
@keyframes fall {
  0% {
    transform: translateY(-100px) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(calc(100vh + 100px)) translateX(var(--drift-x, 0px))
      rotate(360deg);
    opacity: 0;
  }
}

/* Additional fallback animations with drift for realistic movement */
@keyframes fall-drift-left {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
  }
  50% {
    transform: translateY(50vh) translateX(-20px) rotate(180deg);
  }
  100% {
    transform: translateY(100vh) translateX(-40px) rotate(360deg);
  }
}

@keyframes fall-drift-right {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
  }
  50% {
    transform: translateY(50vh) translateX(20px) rotate(180deg);
  }
  100% {
    transform: translateY(100vh) translateX(40px) rotate(360deg);
  }
}

/* Different sizes for variety - realistic snow sizes */
.snowflake.small {
  font-size: 0.6em;
  opacity: 0.7;
  filter: blur(0.5px);
}

.snowflake.medium {
  font-size: 1em;
  opacity: 0.85;
  filter: blur(0.3px);
}

.snowflake.large {
  font-size: 1.4em;
  opacity: 0.95;
  filter: blur(0.2px);
}

/* Light mode adjustments for different snowflake sizes */
body.a11y-theme-light .snowflake.small {
  opacity: 0.65;
  color: #bbbbbb;
}

body.a11y-theme-light .snowflake.medium {
  opacity: 0.75;
  color: #aaaaaa;
}

body.a11y-theme-light .snowflake.large {
  opacity: 0.8;
  color: #999999;
}

/* Different animation speeds - realistic falling speeds */
.snowflake.slow {
  animation-duration: 10s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.snowflake.normal {
  animation-duration: 6s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.snowflake.fast {
  animation-duration: 4s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* Realistic snowflake opacity variations - removed to allow infinite loop */

/* Performance optimization */
.snow-container {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
  contain: layout style paint;
  isolation: isolate;
}

/* Smooth transitions for theme changes */
.snowflake {
  transition: color 0.3s ease, text-shadow 0.3s ease, opacity 0.3s ease;
}
