/* ================================
   Christmas Animations
   ================================ */

/* Snowfall Container */
.christmas-snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* Individual Snowflake */
.snowflake {
    position: absolute;
    top: -10px;
    color: #fff;
    font-size: 1em;
    font-family: Arial, sans-serif;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    animation: fall linear infinite;
    opacity: 0.8;
}

/* Snowfall Animation */
@keyframes fall {
    0% {
        transform: translateY(0vh) translateX(0) rotate(0deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) translateX(100px) rotate(360deg);
        opacity: 0.3;
    }
}

/* Christmas Lights Container */
.christmas-lights {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px;
    pointer-events: none;
    z-index: 9998;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    overflow: hidden;
}

/* String Container */
.lights-string {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Light Wire/String */
.lights-string::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    animation: stringSwing 3s ease-in-out infinite;
}

@keyframes stringSwing {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(5px);
    }
}

/* Individual Light Bulb */
.light {
    position: absolute;
    width: 10px;
    height: 15px;
    border-radius: 0 0 5px 5px;
    top: 0;
    animation: twinkle 1.5s ease-in-out infinite, swing 3s ease-in-out infinite;
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

/* Light Colors */
.light.red {
    background: linear-gradient(180deg, #ff0000 0%, #cc0000 100%);
    color: #ff0000;
}

.light.green {
    background: linear-gradient(180deg, #00ff00 0%, #00cc00 100%);
    color: #00ff00;
}

.light.blue {
    background: linear-gradient(180deg, #0088ff 0%, #0066cc 100%);
    color: #0088ff;
}

.light.yellow {
    background: linear-gradient(180deg, #ffff00 0%, #cccc00 100%);
    color: #ffff00;
}

.light.purple {
    background: linear-gradient(180deg, #ff00ff 0%, #cc00cc 100%);
    color: #ff00ff;
}

.light.orange {
    background: linear-gradient(180deg, #ff8800 0%, #cc6600 100%);
    color: #ff8800;
}

/* Twinkling Animation */
@keyframes twinkle {
    0%, 100% {
        opacity: 1;
        filter: brightness(1);
    }
    50% {
        opacity: 0.3;
        filter: brightness(0.5);
    }
}

/* Swinging Animation */
@keyframes swing {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(5px) rotate(2deg);
    }
    75% {
        transform: translateY(5px) rotate(-2deg);
    }
}

/* Christmas Corner Decorations */
.christmas-decoration {
    position: fixed;
    pointer-events: none;
    z-index: 9997;
    animation: decorationFloat 4s ease-in-out infinite;
}

.christmas-decoration.top-left {
    top: 80px;
    left: 20px;
}

.christmas-decoration.top-right {
    top: 80px;
    right: 20px;
}

.christmas-decoration.bottom-left {
    bottom: 20px;
    left: 20px;
}

.christmas-decoration.bottom-right {
    bottom: 20px;
    right: 20px;
}

@keyframes decorationFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

/* Christmas Tree Icon */
.christmas-tree {
    font-size: 60px;
    filter: drop-shadow(0 0 10px rgba(0, 255, 0, 0.5));
}

/* Snowman Icon */
.snowman {
    font-size: 50px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.7));
}

/* Gift Icon */
.gift {
    font-size: 45px;
    filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.5));
}

/* Star Icon */
.star {
    font-size: 40px;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
}

/* Santa Hat (optional floating element) */
.santa-hat {
    position: fixed;
    top: 150px;
    right: 50px;
    font-size: 50px;
    pointer-events: none;
    z-index: 9997;
    animation: hatBounce 3s ease-in-out infinite;
}

@keyframes hatBounce {
    0%, 100% {
        transform: translateY(0) rotate(-10deg);
    }
    50% {
        transform: translateY(-15px) rotate(10deg);
    }
}

/* Sparkle Effect */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px white;
    animation: sparkleAnim 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sparkleAnim {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* Garland Effect */
.christmas-garland {
    position: fixed;
    top: 50px;
    left: 0;
    width: 100%;
    height: 30px;
    pointer-events: none;
    z-index: 9998;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 40px,
        rgba(34, 139, 34, 0.3) 40px,
        rgba(34, 139, 34, 0.3) 50px
    );
    animation: garlandWave 4s ease-in-out infinite;
}

@keyframes garlandWave {
    0%, 100% {
        clip-path: ellipse(150% 100% at 50% 0%);
    }
    50% {
        clip-path: ellipse(150% 100% at 50% 30%);
    }
}

/* Glowing Border Effect for Sections */
.christmas-glow {
    animation: christmasGlow 3s ease-in-out infinite;
}

@keyframes christmasGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 0, 0, 0.3),
                    0 0 20px rgba(0, 255, 0, 0.3),
                    0 0 30px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.6),
                    0 0 30px rgba(0, 255, 0, 0.6),
                    0 0 40px rgba(255, 215, 0, 0.6);
    }
}

/* Ribbon Effect */
.christmas-ribbon {
    position: fixed;
    width: 150px;
    height: 150px;
    pointer-events: none;
    z-index: 9996;
    opacity: 0.1;
    animation: ribbonRotate 20s linear infinite;
}

.christmas-ribbon.ribbon-1 {
    top: 200px;
    left: 10%;
}

.christmas-ribbon.ribbon-2 {
    top: 400px;
    right: 10%;
}

.christmas-ribbon svg {
    width: 100%;
    height: 100%;
    fill: rgba(255, 0, 0, 0.2);
}

@keyframes ribbonRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .christmas-lights {
        height: 80px;
    }
    
    .light {
        width: 8px;
        height: 12px;
    }
    
    .christmas-decoration {
        display: none;
    }
    
    .santa-hat {
        font-size: 35px;
        top: 100px;
        right: 20px;
    }
    
    .christmas-tree,
    .snowman,
    .gift,
    .star {
        font-size: 30px;
    }
}

/* Disable animations on reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .snowflake,
    .light,
    .christmas-decoration,
    .star,
    .santa-hat,
    .sparkle,
    .christmas-garland,
    .christmas-ribbon {
        animation: none !important;
    }
}

/* Christmas Toggle Button */
.christmas-toggle {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 10000;
    background: linear-gradient(135deg, #ff0000 0%, #00ff00 100%);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: white;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: none; /* Hidden by default - controlled by config */
    align-items: center;
    justify-content: center;
}

.christmas-toggle.visible {
    display: flex; /* Only show when explicitly enabled in config */
}

.christmas-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.christmas-toggle.active {
    animation: togglePulse 1.5s ease-in-out infinite;
}

@keyframes togglePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Christmas Cursor Trail Effect */
.cursor-trail {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    font-size: 20px;
    animation: cursorTrailFade 1s ease-out forwards;
}

@keyframes cursorTrailFade {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) rotate(180deg);
    }
}

/* Festive Cursor */
body.christmas-mode {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><text y="28" font-size="28">🎄</text></svg>'), auto;
}

body.christmas-mode a,
body.christmas-mode button {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><text y="28" font-size="28">🎁</text></svg>'), pointer;
}

/* Smooth Page Transitions */
@keyframes pageGlow {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.02);
    }
}

body.christmas-mode {
    animation: pageGlow 8s ease-in-out infinite;
}

/* Header Glow Effect */
.christmas-header-glow {
    position: relative;
}

.christmas-header-glow::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(
        45deg,
        rgba(255, 0, 0, 0.3),
        rgba(0, 255, 0, 0.3),
        rgba(0, 0, 255, 0.3),
        rgba(255, 215, 0, 0.3)
    );
    background-size: 400% 400%;
    animation: gradientShift 10s ease infinite;
    border-radius: inherit;
    z-index: -1;
    filter: blur(15px);
    opacity: 0.5;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

