/**
 * WP Christmas Snow - Styles
 * Effetto neve natalizia per WordPress
 */

#wp-christmas-snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999999;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -20px;
    pointer-events: none;
    user-select: none;
    will-change: transform;
    filter: blur(0.5px);
}

/* Forme fiocchi di neve */
.snowflake::before {
    content: '❄';
    display: block;
}

/* Varianti di forma */
.snowflake.variant-1::before {
    content: '❄';
}

.snowflake.variant-2::before {
    content: '❅';
}

.snowflake.variant-3::before {
    content: '❆';
}

.snowflake.variant-4::before {
    content: '✻';
}

.snowflake.variant-5::before {
    content: '✼';
}

/* Animazione caduta base */
@keyframes snowfall {
    0% {
        transform: translateY(-20px) rotate(0deg);
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* Animazione con vento */
@keyframes snowfall-wind {
    0% {
        transform: translateY(-20px) translateX(0) rotate(0deg);
    }
    25% {
        transform: translateY(25vh) translateX(30px) rotate(90deg);
    }
    50% {
        transform: translateY(50vh) translateX(-20px) rotate(180deg);
    }
    75% {
        transform: translateY(75vh) translateX(40px) rotate(270deg);
    }
    100% {
        transform: translateY(100vh) translateX(10px) rotate(360deg);
    }
}

/* Animazione ondeggiamento delicato */
@keyframes sway {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(20px);
    }
}

/* Velocità animazioni */
.snowflake.speed-slow {
    animation-duration: 15s;
}

.snowflake.speed-medium {
    animation-duration: 10s;
}

.snowflake.speed-fast {
    animation-duration: 5s;
}

/* Animazione senza vento */
.snowflake.no-wind {
    animation-name: snowfall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* Animazione con vento */
.snowflake.with-wind {
    animation-name: snowfall-wind;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

/* Effetto brillantezza */
.snowflake.sparkle {
    animation: snowfall 10s linear infinite, sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0.6;
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.9), 0 0 30px rgba(255, 255, 255, 0.5);
    }
}

/* Accumulo neve in basso (opzionale, disattivato di default) */
.snow-ground {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 999998;
}

/* Media query per dispositivi mobili */
@media (max-width: 768px) {
    .snowflake {
        filter: blur(0.3px);
    }
}

/* Rispetta le preferenze di riduzione del movimento */
@media (prefers-reduced-motion: reduce) {
    .snowflake {
        animation: none !important;
        opacity: 0.5;
    }
}

/* Print: nascondi neve */
@media print {
    #wp-christmas-snow-container {
        display: none !important;
    }
}

/* ================================
   AUDIO PLAYER STYLES
   ================================ */

.christmas-audio-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999998;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
    padding: 10px 15px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 20px rgba(196, 30, 58, 0.3);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.christmas-audio-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(196, 30, 58, 0.5);
}

.audio-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 25px;
    transition: background 0.3s ease;
}

.audio-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.audio-icon {
    font-size: 20px;
}

.volume-slider {
    width: 80px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Audio widget playing state */
.christmas-audio-widget.playing {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 20px rgba(196, 30, 58, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 40px rgba(196, 30, 58, 0.6);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .christmas-audio-widget {
        bottom: 15px;
        right: 15px;
        padding: 8px 12px;
    }
    
    .volume-slider {
        width: 60px;
    }
}

/* Hide on very small screens if preferred */
@media (max-width: 400px) {
    .volume-slider {
        display: none;
    }
}

/* Print: hide audio player */
@media print {
    .christmas-audio-widget {
        display: none !important;
    }
}
