/* Christmas Snowflakes Effect - iPalengke Website */

.snowflakes-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999999 !important;
    overflow: hidden;
    /* DEBUG: Temporary background to see container */
    /* background: rgba(255, 0, 0, 0.1); */
}

.snowflake {
    color: #ffffff !important;
    font-size: 1.2em !important; /* More natural size */
    font-family: Arial, sans-serif;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5) !important;
    position: absolute;
    top: -50px;
    user-select: none;
    cursor: default;
    pointer-events: none;
    animation: snowflakes-fall var(--fall-duration, 12s) ease-in-out infinite !important;
    animation-play-state: running !important;
    opacity: var(--opacity, 0.8) !important;
    z-index: 999999 !important;
    /* DEBUG: Temporary background for visibility */
    /* background: rgba(255, 255, 255, 0.3); */
    /* padding: 5px; */
    /* border-radius: 50%; */
}

/* Different snowflake sizes */
.snowflake.small {
    --size: 0.8em;
    --fall-duration: 8s;
    --shake-duration: 2s;
    --opacity: 0.6;
}

.snowflake.medium {
    --size: 1em;
    --fall-duration: 10s;
    --shake-duration: 3s;
    --opacity: 0.8;
}

.snowflake.large {
    --size: 1.2em;
    --fall-duration: 12s;
    --shake-duration: 4s;
    --opacity: 0.9;
}

/* Natural snowfall with drift */
@keyframes snowflakes-fall {
    0% { 
        transform: translateY(-100px) translateX(0px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    25% {
        transform: translateY(25vh) translateX(-20px) rotate(90deg);
    }
    50% {
        transform: translateY(50vh) translateX(15px) rotate(180deg);
    }
    75% {
        transform: translateY(75vh) translateX(-10px) rotate(270deg);
    }
    90% {
        opacity: 1;
    }
    100% { 
        transform: translateY(calc(100vh + 100px)) translateX(5px) rotate(360deg);
        opacity: 0;
    }
}

/* Create different drift patterns for more natural effect */
.snowflake:nth-child(2n) {
    animation-name: snowflakes-fall-alt;
}

.snowflake:nth-child(3n) {
    animation-name: snowflakes-fall-alt2;
}

/* Alternative fall pattern 1 */
@keyframes snowflakes-fall-alt {
    0% { 
        transform: translateY(-100px) translateX(0px) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 1; }
    25% {
        transform: translateY(25vh) translateX(30px) rotate(120deg);
    }
    50% {
        transform: translateY(50vh) translateX(-15px) rotate(240deg);
    }
    75% {
        transform: translateY(75vh) translateX(20px) rotate(300deg);
    }
    90% { opacity: 1; }
    100% { 
        transform: translateY(calc(100vh + 100px)) translateX(-10px) rotate(360deg);
        opacity: 0;
    }
}

/* Alternative fall pattern 2 */
@keyframes snowflakes-fall-alt2 {
    0% { 
        transform: translateY(-100px) translateX(0px) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 1; }
    25% {
        transform: translateY(25vh) translateX(-15px) rotate(60deg);
    }
    50% {
        transform: translateY(50vh) translateX(25px) rotate(150deg);
    }
    75% {
        transform: translateY(75vh) translateX(-5px) rotate(250deg);
    }
    90% { opacity: 1; }
    100% { 
        transform: translateY(calc(100vh + 100px)) translateX(15px) rotate(360deg);
        opacity: 0;
    }
}

/* Different animation variations */
.snowflake:nth-child(5n) {
    --fall-duration: 15s;
    --shake-duration: 5s;
}

.snowflake:nth-child(6n) {
    --fall-duration: 8s;
    --shake-duration: 2s;
}

.snowflake:nth-child(7n) {
    --fall-duration: 18s;
    --shake-duration: 6s;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .snowflake {
        font-size: calc(var(--size, 1em) * 0.8);
    }
    
    .snowflakes-container {
        z-index: 999;
    }
}

@media (max-width: 480px) {
    .snowflake {
        font-size: calc(var(--size, 1em) * 0.6);
    }
    
    @keyframes snowflakes-shake {
        0%, 100% { 
            transform: translateX(0px);
        }
        25% { 
            transform: translateX(15px);
        }
        50% { 
            transform: translateX(-15px);
        }
        75% { 
            transform: translateX(7px);
        }
    }
}

/* Performance optimization */
.snowflakes-container {
    will-change: transform;
}

.snowflake {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

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