/* ============================================
   SNOW EFFECT - Winter Theme
   Kış temalı kar yağışı efekti
   Light/Dark mod desteği ile
   ============================================ */

/* Snow Container */
.snow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: var(--z-max);
}

/* Individual Snowflake - Base */
.snowflake {
  position: absolute;
  top: -20px;
  pointer-events: none;
  animation: snowfall linear infinite;
  will-change: transform, opacity;
  transform: translateZ(0); /* Force GPU layer */
  backface-visibility: hidden;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  line-height: 1;
  text-align: center;
  contain: strict; /* Isolate paint/layout */
}

/* Snowflake Types */
.snowflake--crystal::before {
  content: "❄";
}

.snowflake--star::before {
  content: "❅";
}

.snowflake--flake::before {
  content: "❆";
}

.snowflake--dot::before {
  content: "•";
}

/* Dark Theme - White/Ice Blue Snowflakes (Optimized - single shadow) */
[data-theme="dark"] .snowflake {
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 0 6px rgba(200, 230, 255, 0.5);
  /* filter removed for performance */
}

[data-theme="dark"] .snowflake--dot::before {
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.7);
}

/* Light Theme - Subtle Blue-Gray Snowflakes (Optimized - single shadow) */
[data-theme="light"] .snowflake {
  color: rgba(100, 130, 170, 0.7);
  text-shadow: 0 0 4px rgba(100, 130, 170, 0.3);
  /* filter removed for performance */
}

[data-theme="light"] .snowflake--dot::before {
  text-shadow: 0 0 3px rgba(100, 130, 170, 0.4);
}

/* Snowfall Animation */
@keyframes snowfall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 1;
  }
  25% {
    transform: translateY(25vh) translateX(15px) rotate(45deg);
  }
  50% {
    transform: translateY(50vh) translateX(-10px) rotate(90deg);
  }
  75% {
    transform: translateY(75vh) translateX(20px) rotate(135deg);
  }
  100% {
    transform: translateY(105vh) translateX(5px) rotate(180deg);
    opacity: 0.3;
  }
}

/* Gentle float animation for variety */
@keyframes snowFloat {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 1;
  }
  33% {
    transform: translateY(33vh) translateX(-20px) rotate(60deg);
  }
  66% {
    transform: translateY(66vh) translateX(25px) rotate(120deg);
  }
  100% {
    transform: translateY(105vh) translateX(-5px) rotate(180deg);
    opacity: 0.4;
  }
}

/* Slow drift animation */
@keyframes snowDrift {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0.9;
  }
  50% {
    transform: translateY(50vh) translateX(30px) rotate(90deg);
  }
  100% {
    transform: translateY(105vh) translateX(-15px) rotate(180deg);
    opacity: 0.2;
  }
}

/* Animation variants */
.snowflake--float {
  animation-name: snowFloat;
}

.snowflake--drift {
  animation-name: snowDrift;
}

/* Performance: Reduce snowflakes on mobile */
@media (max-width: 768px) {
  .snow-container {
    opacity: 0.7;
  }

  .snowflake {
    text-shadow: none;
    filter: none;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .snow-container {
    display: none;
  }
}
