/* snowfall-style.css - Fixed fluffy snow effect */

.snow-pile {
    position: fixed;
    bottom: 0;
    background: transparent;
    z-index: 9998;
    pointer-events: none;
    transition: all 3s ease-out;
    border-radius: 50% 50% 0 0;
    transform-origin: bottom;
    clip-path: polygon(
        0% 100%,
        10% 85%, 20% 75%, 30% 65%, 40% 60%,
        50% 55%, 60% 60%, 70% 65%, 80% 75%,
        90% 85%, 100% 100%
    );
    overflow: hidden;
}

/* Solid snow base */
.snow-pile-base {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--snow-color, #ffffff);
    z-index: 1;
    box-shadow: 
        inset 0 2px 10px rgba(255, 255, 255, 0.8),
        0 -3px 15px rgba(255, 255, 255, 0.6);
}

/* Fluffy top layer */
.snow-fluffy-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 0.7) 20%,
        rgba(255, 255, 255, 0.5) 40%,
        rgba(255, 255, 255, 0.3) 60%,
        rgba(255, 255, 255, 0.1) 80%,
        transparent 100%
    );
    border-radius: 50% 50% 0 0;
    pointer-events: none;
    z-index: 2;
    backdrop-filter: blur(4px);
    mix-blend-mode: lighten;
    box-shadow: 
        inset 0 8px 15px rgba(255, 255, 255, 0.6),
        0 4px 8px rgba(255, 255, 255, 0.4);
    transform: skewX(var(--wind-skew, 0deg));
    transition: transform 1.5s ease-out;
}

/* Snow surface texture */
.snow-fluffy-layer::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 10%;
    right: 10%;
    height: 500px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.8) 20%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(255, 255, 255, 0.8) 80%,
        transparent 100%
    );
    border-radius: 50%;
    filter: blur(1px);
    opacity: 0.8;
}

/* Sparkle effect */
.snow-sparkle {
    position: absolute;
    width: 40%;
    height: 3px;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 80%
    );
    border-radius: 50%;
    z-index: 3;
    animation: sparkle-twinkle 3s ease-in-out infinite;
    filter: blur(0.8px);
    pointer-events: none;
}

@keyframes sparkle-twinkle {
    0%, 100% { 
        opacity: 0.7; 
        transform: scale(1) rotate(0deg);
    }
    25% { 
        opacity: 0.9; 
        transform: scale(1.1) rotate(90deg);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2) rotate(180deg);
    }
    75% { 
        opacity: 0.8; 
        transform: scale(1.1) rotate(270deg);
    }
}

/* Height-based variations */
.snow-pile.small-pile .snow-fluffy-layer {
    height: 20px;
    backdrop-filter: blur(3px);
    opacity: 0.8;
}

.snow-pile.medium-pile .snow-fluffy-layer {
    height: 30px;
    backdrop-filter: blur(4px);
    opacity: 0.9;
}

.snow-pile.large-pile .snow-fluffy-layer {
    height: 40px;
    backdrop-filter: blur(5px);
    opacity: 1;
}

.snow-pile.small-pile .snow-sparkle {
    height: 2px;
    top: 8px;
    left: 35%;
    width: 30%;
}

.snow-pile.medium-pile .snow-sparkle {
    height: 3px;
    top: 12px;
    left: 30%;
    width: 40%;
}

.snow-pile.large-pile .snow-sparkle {
    height: 4px;
    top: 15px;
    left: 25%;
    width: 50%;
}

#snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.snow-flake {
    position: absolute;
    user-select: none;
    z-index: 9999;
    pointer-events: none;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.5));
    will-change: transform;
    transition: transform 0.3s ease-out;
    animation: wind-blown-snow 4s ease-in-out infinite;
    --wind-drift: 0px;
}

@keyframes wind-blown-snow {
    0% { 
        transform: 
            translateX(calc(var(--wind-drift, 0px) * 0.5)) 
            translateY(0) 
            rotate(calc(var(--wind-drift, 0deg) * 0.1));
    }
    50% { 
        transform: 
            translateX(calc(var(--wind-drift, 0px) * 1.5)) 
            translateY(-3px) 
            rotate(calc(var(--wind-drift, 0deg) * 0.3));
    }
    100% { 
        transform: 
            translateX(calc(var(--wind-drift, 0px) * 0.5)) 
            translateY(0) 
            rotate(calc(var(--wind-drift, 0deg) * 0.1));
    }
}

@keyframes wind-gust {
    0% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(calc(var(--wind-drift, 0px) * 3)) rotate(15deg); }
    50% { transform: translateX(calc(var(--wind-drift, 0px) * 2)) rotate(-10deg); }
    75% { transform: translateX(calc(var(--wind-drift, 0px) * 4)) rotate(20deg); }
    100% { transform: translateX(calc(var(--wind-drift, 0px) * 1)) rotate(0deg); }
}

.wind-left .snow-flake {
    --wind-drift: -20px;
}

.wind-right .snow-flake {
    --wind-drift: 20px;
}

.snow-flake.gust {
    animation: wind-gust 0.8s ease-in-out;
}

@keyframes natural-snow-shift {
    0%, 100% { 
        clip-path: polygon(
            0% 100%,
            8% 88%, 18% 78%, 28% 68%, 38% 62%,
            50% 58%, 62% 62%, 72% 68%, 82% 78%,
            92% 88%, 100% 100%
        );
    }
    33% { 
        clip-path: polygon(
            0% 100%,
            10% 86%, 20% 76%, 30% 66%, 40% 60%,
            52% 56%, 60% 60%, 70% 66%, 80% 76%,
            90% 86%, 100% 100%
        );
    }
    66% { 
        clip-path: polygon(
            0% 100%,
            12% 84%, 22% 74%, 32% 64%, 42% 58%,
            48% 54%, 58% 58%, 68% 64%, 78% 74%,
            88% 84%, 100% 100%
        );
    }
}

.snow-pile {
    animation: natural-snow-shift 30s ease-in-out infinite;
}

.avalanche-flake {
    position: fixed !important;
    z-index: 10000 !important;
    opacity: 1 !important;
    filter: 
        drop-shadow(0 2px 4px rgba(255, 255, 255, 0.8)) 
        blur(1px) !important;
    transition: all 1s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
    will-change: transform, opacity;
}

@keyframes avalanche-fall {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1.2);
        opacity: 1;
        filter: blur(0px);
    }
    50% {
        transform: translate(var(--avalanche-drift, 0px), 50px) rotate(90deg) scale(1.5);
        opacity: 0.8;
        filter: blur(1px);
    }
    100% {
        transform: translate(var(--avalanche-drift, 0px), 120px) rotate(180deg) scale(1);
        opacity: 0;
        filter: blur(2px);
    }
}

.avalanche-flake {
    animation: avalanche-fall 1.2s ease-out forwards;
}

/* Snow removal button styles */
#snow-removal-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
    padding: 10px 15px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

#s snow-removal-btn:hover {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

#snow-removal-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#snow-removal-btn:disabled {
    background: #8c8f94;
    cursor: not-allowed;
    transform: none;
}

/* Snow plow truck styles */
#snow-plow-truck {
    position: fixed;
    bottom: 0;
    left: -100px;
    z-index: 10000;
    font-size: 40px;
    pointer-events: none;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.5));
    transition: left 0.1s linear;
}

@keyframes dust-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.8; }
    100% { transform: translateY(-80px) rotate(180deg); opacity: 0; }
}

@media screen and (max-width: 768px) {
    .snow-pile {
        transition: all 4s ease-out;
    }
    
    .snow-fluffy-layer {
        backdrop-filter: blur(3px);
    }
    
    .snow-pile.small-pile .snow-fluffy-layer {
        height: 15px;
    }
    
    .snow-pile.medium-pile .snow-fluffy-layer {
        height: 25px;
    }
    
    .snow-pile.large-pile .snow-fluffy-layer {
        height: 35px;
    }
    
    /* Mobile styles for snow removal button */
    #snow-removal-btn {
        bottom: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    #snow-plow-truck {
        font-size: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .snow-flake,
    .snow-pile {
        animation: none;
    }
    
    .snow-sparkle {
        animation: none;
        opacity: 0.5;
    }
    
    .snow-fluffy-layer {
        transition: none;
    }
    
    #snow-plow-truck {
        animation: none;
        transition: none;
    }
    
    #snow-removal-btn {
        transition: none;
    }
}

/* Snow dust animation */
@keyframes snow-dust-rise {
    0% { 
        transform: translateY(0) scale(0.8); 
        opacity: 0.7;
    }
    50% { 
        transform: translateY(-40px) scale(1.2); 
        opacity: 0.9;
    }
    100% { 
        transform: translateY(-80px) scale(0.5); 
        opacity: 0;
    }
}

.snow-dust-particle {
    animation: snow-dust-rise 1s ease-out forwards;
}

/* Snow dust animations */
@keyframes snow-dust-rise {
    0% { 
        transform: translateY(0) scale(0.8); 
        opacity: 0.7;
    }
    50% { 
        transform: translateY(-40px) scale(1.2); 
        opacity: 0.9;
    }
    100% { 
        transform: translateY(-80px) scale(0.5); 
        opacity: 0;
    }
}

@keyframes snow-dust-front {
    0% { 
        transform: translateX(0) scale(0.8) rotate(0deg); 
        opacity: 0.7;
    }
    50% { 
        transform: translateX(-40px) scale(1.1) rotate(-5deg); 
        opacity: 0.8;
    }
    100% { 
        transform: translateX(-80px) scale(0.6) rotate(-10deg); 
        opacity: 0;
    }
}

.snow-dust-particle {
    animation: snow-dust-rise 1s ease-out forwards;
}

.snow-dust-cloud {
    animation: snow-dust-front 1.2s ease-out forwards;
}