/**
 * BlueSatTV - Three.js 3D Snow & Holiday Experience
 * Pure WebGL Canvas + Header & Toggle UI
 */

/* Fullscreen Three.js Snow & Card Accumulation Canvas */
#holidaySnowCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9990;
    opacity: 1;
    transition: opacity 0.4s ease;
}

body.holiday-snow-off #holidaySnowCanvas {
    opacity: 0;
}

body.holiday-snow-off .holiday-header-lights,
body.holiday-snow-off .holiday-logo-accent {
    opacity: 0 !important;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* =====================================================
   Header Fairy Lights Garland (Subtle & Classy)
   ===================================================== */
.holiday-header-lights {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 10px;
    pointer-events: none;
    z-index: 105;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.holiday-light-bulb {
    width: 6px;
    height: 8px;
    border-radius: 50% 50% 60% 60%;
    opacity: 0.75;
    animation: holidayTwinkle 2.6s ease-in-out infinite;
    will-change: opacity, transform;
}

.holiday-light-bulb:nth-child(4n+1) {
    background: #fbbf24;
    box-shadow: 0 0 8px 1px rgba(251, 191, 36, 0.65);
    animation-delay: 0s;
}

.holiday-light-bulb:nth-child(4n+2) {
    background: #60a5fa;
    box-shadow: 0 0 8px 1px rgba(96, 165, 250, 0.65);
    animation-delay: 0.65s;
}

.holiday-light-bulb:nth-child(4n+3) {
    background: #f87171;
    box-shadow: 0 0 8px 1px rgba(248, 113, 113, 0.6);
    animation-delay: 1.3s;
}

.holiday-light-bulb:nth-child(4n) {
    background: #34d399;
    box-shadow: 0 0 8px 1px rgba(52, 211, 153, 0.6);
    animation-delay: 1.95s;
}

@keyframes holidayTwinkle {
    0%, 100% {
        opacity: 0.45;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1.12);
    }
}

/* =====================================================
   Logo Winter Accent (Sparkling Snowflake)
   ===================================================== */
.logo {
    position: relative;
}

.holiday-logo-accent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    color: #60a5fa;
    filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.45));
    animation: holidaySpinSlow 14s linear infinite;
    pointer-events: none;
    flex-shrink: 0;
}

@keyframes holidaySpinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =====================================================
   Floating Snow Toggle Button (Bottom-Left)
   ===================================================== */
.holiday-snow-toggle {
    position: fixed;
    bottom: 26px;
    left: 26px;
    z-index: 998;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(64, 119, 187, 0.25);
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.25s ease,
                background-color 0.25s ease,
                color 0.25s ease;
}

[data-theme="dark"] .holiday-snow-toggle {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(96, 165, 250, 0.3);
    color: #f1f5f9;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.holiday-snow-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(64, 119, 187, 0.22);
}

.holiday-snow-toggle.is-off {
    opacity: 0.72;
}

.holiday-snow-toggle svg {
    width: 16px;
    height: 16px;
    color: #4077bb;
    transition: transform 0.4s ease;
}

[data-theme="dark"] .holiday-snow-toggle svg {
    color: #60a5fa;
}

.holiday-snow-toggle:not(.is-off) svg {
    animation: holidaySpinSlow 12s linear infinite;
}

@media (max-width: 768px) {
    .holiday-snow-toggle {
        bottom: 20px;
        left: 16px;
        padding: 10px 12px;
    }

    .holiday-snow-toggle .toggle-label {
        display: none;
    }

    .holiday-header-lights {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .holiday-light-bulb,
    .holiday-logo-accent,
    .holiday-snow-toggle:not(.is-off) svg {
        animation: none !important;
    }
}
