/**
 * E-MAX Christmas Mode
 * Snowfall effect with ISP-themed elements + Interactive Effects
 */

/* Snowfall container */
.christmas-snowfall {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* Individual snowflake */
.snowflake {
    position: absolute;
    color: #fff;
    font-size: 1rem;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    pointer-events: none;
    user-select: none;
    will-change: transform, left, top;
}

/* Network-themed snowflakes (Font Awesome icons) */
.snowflake.network {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 12px rgba(22, 111, 211, 0.9), 0 0 25px rgba(22, 111, 211, 0.5);
}

.snowflake.network.small {
    font-size: 0.7rem;
}

.snowflake.network.medium {
    font-size: 1rem;
}

.snowflake.network.large {
    font-size: 1.3rem;
}

/* Snowflake sizes */
.snowflake.small {
    font-size: 0.6rem;
}

.snowflake.medium {
    font-size: 1rem;
}

.snowflake.large {
    font-size: 1.4rem;
}

/* Burst snowflakes */
.snowflake.burst {
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

/* Burst flash effect */
.burst-flash {
    position: absolute;
    width: 60px;
    height: 60px;
    margin-left: -30px;
    margin-top: -30px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    animation: flash-burst 0.4s ease-out forwards;
    pointer-events: none;
}

@keyframes flash-burst {
    0% {
        transform: scale(0.2);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Cursor trail sparkles */
.cursor-trail {
    position: absolute;
    color: #fff;
    font-size: 0.8rem;
    pointer-events: none;
    animation: trail-fade 0.8s ease-out forwards;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8), 0 0 15px rgba(255, 215, 0, 0.5);
}

@keyframes trail-fade {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    100% {
        transform: scale(0.3) translateY(-30px);
        opacity: 0;
    }
}

/* Christmas toggle button */
.christmas-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10000;
    background: linear-gradient(135deg, #c41e3a 0%, #1a472a 100%);
    border: 2px solid #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 20px rgba(196, 30, 58, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: toggle-pulse 3s ease-in-out infinite;
}

@keyframes toggle-pulse {
    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 15px rgba(0, 0, 0, 0.3), 0 0 30px rgba(26, 71, 42, 0.5);
    }
}

.christmas-toggle:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4), 0 0 35px rgba(196, 30, 58, 0.5);
}

.christmas-toggle.active {
    background: linear-gradient(135deg, #1a472a 0%, #c41e3a 100%);
    animation: toggle-active-pulse 2s ease-in-out infinite;
}

@keyframes toggle-active-pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 25px rgba(26, 71, 42, 0.6);
    }
    50% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 40px rgba(196, 30, 58, 0.7);
    }
}

/* Christmas accent colors for the site */
.christmas-mode .header-main-menu {
    background: linear-gradient(135deg, rgba(26, 71, 42, 0.95) 0%, rgba(23, 20, 34, 0.98) 100%) !important;
}

.christmas-mode .top-header {
    background: linear-gradient(90deg, #c41e3a 0%, #1a472a 100%) !important;
}

/* Festive glow on logo */
.christmas-mode .navbar-brand img {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    transition: filter 0.3s ease;
    animation: logo-glow 3s ease-in-out infinite;
}

@keyframes logo-glow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8)) drop-shadow(0 0 30px rgba(255, 100, 100, 0.4));
    }
}

/* Christmas lights - individual bulbs */
.christmas-lights {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 12px;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 0 10px;
    z-index: 100;
}

.light-bulb {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bulb-color, #fff);
    box-shadow: 0 0 8px var(--bulb-color, #fff), 0 0 15px var(--bulb-color, #fff);
    animation: bulb-twinkle 1.5s ease-in-out infinite;
    position: relative;
}

.light-bulb::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 5px;
    background: #333;
    border-radius: 2px 2px 0 0;
}

.light-bulb::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--bulb-color, #fff);
    opacity: 0.3;
    filter: blur(2px);
}

@keyframes bulb-twinkle {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 8px var(--bulb-color, #fff), 0 0 15px var(--bulb-color, #fff);
    }
    50% {
        opacity: 0.6;
        box-shadow: 0 0 4px var(--bulb-color, #fff), 0 0 8px var(--bulb-color, #fff);
    }
}

/* Wire between bulbs */
.christmas-lights::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #222;
    z-index: -1;
}

/* Subtle snow accumulation on footer */
.christmas-mode .footer-section {
    position: relative;
}

.christmas-mode .footer-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    border-radius: 0 0 100% 100% / 0 0 50% 50%;
}

/* Festive buttons */
.christmas-mode .btn-primary,
.christmas-mode .btn-theme {
    position: relative;
    overflow: hidden;
}

.christmas-mode .btn-primary::after,
.christmas-mode .btn-theme::after {
    content: '✦';
    position: absolute;
    font-size: 0.6rem;
    top: 5px;
    right: 8px;
    animation: btn-sparkle 2s ease-in-out infinite;
    opacity: 0.7;
}

@keyframes btn-sparkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Santa Sleigh with Reindeer */
.santa-sleigh {
    position: absolute;
    font-size: 3.5rem;
    white-space: nowrap;
    z-index: 10001;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
    pointer-events: none;
}

.santa-sleigh .reindeer {
    letter-spacing: -5px;
    display: inline-block;
}

.santa-sleigh .sleigh {
    display: inline-block;
}

.santa-sleigh.fly-left {
    right: -250px;
    animation: santa-fly-left 8s linear forwards;
}

.santa-sleigh.fly-right {
    left: -250px;
    animation: santa-fly-right 8s linear forwards;
}

.santa-sleigh.fly-right .reindeer,
.santa-sleigh.fly-right .sleigh {
    display: inline-block;
    transform: scaleX(-1);
}

@keyframes santa-fly-left {
    0% {
        right: -250px;
        transform: translateY(0) rotate(0deg);
    }
    10% {
        transform: translateY(-15px) rotate(-3deg);
    }
    20% {
        transform: translateY(10px) rotate(2deg);
    }
    30% {
        transform: translateY(-20px) rotate(-2deg);
    }
    40% {
        transform: translateY(5px) rotate(1deg);
    }
    50% {
        transform: translateY(-10px) rotate(-1deg);
    }
    60% {
        transform: translateY(15px) rotate(2deg);
    }
    70% {
        transform: translateY(-5px) rotate(-2deg);
    }
    80% {
        transform: translateY(10px) rotate(1deg);
    }
    90% {
        transform: translateY(-10px) rotate(-1deg);
    }
    100% {
        right: calc(100% + 250px);
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes santa-fly-right {
    0% {
        left: -250px;
        transform: translateY(0) rotate(0deg);
    }
    10% {
        transform: translateY(-15px) rotate(3deg);
    }
    20% {
        transform: translateY(10px) rotate(-2deg);
    }
    30% {
        transform: translateY(-20px) rotate(2deg);
    }
    40% {
        transform: translateY(5px) rotate(-1deg);
    }
    50% {
        transform: translateY(-10px) rotate(1deg);
    }
    60% {
        transform: translateY(15px) rotate(-2deg);
    }
    70% {
        transform: translateY(-5px) rotate(2deg);
    }
    80% {
        transform: translateY(10px) rotate(-1deg);
    }
    90% {
        transform: translateY(-10px) rotate(1deg);
    }
    100% {
        left: calc(100% + 250px);
        transform: translateY(0) rotate(0deg);
    }
}

/* Santa trail sparkles */
.santa-sleigh::after {
    content: '✨✨✨';
    position: absolute;
    top: 50%;
    font-size: 0.8rem;
    opacity: 0.8;
    animation: sparkle-trail 0.5s ease-in-out infinite;
}

.santa-sleigh.fly-left::after {
    right: -40px;
}

.santa-sleigh.fly-right::after {
    left: -40px;
}

@keyframes sparkle-trail {
    0%, 100% {
        opacity: 0.4;
        transform: translateY(-50%) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.1);
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .snowflake,
    .christmas-toggle,
    .light-bulb,
    .christmas-mode .navbar-brand img,
    .cursor-trail,
    .burst-flash,
    .santa-sleigh {
        animation: none !important;
    }

    .christmas-snowfall {
        display: none;
    }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    .christmas-snowfall {
        pointer-events: none;
    }

    .light-bulb {
        width: 6px;
        height: 6px;
    }

    .cursor-trail {
        display: none;
    }

    .santa-sleigh {
        font-size: 2.5rem;
    }
}
