/* --- New Year & Christmas Theme Fixes --- */

:root {
    --snow-white: #ffffff;
    --festive-glow: rgba(255, 255, 255, 0.4);
}

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

.snowflake {
    position: absolute;
    top: -20px;
    color: var(--snow-white);
    user-select: none;
    pointer-events: none;
    z-index: 9999;
    filter: drop-shadow(0 0 3px var(--festive-glow));
    animation: fall linear forwards;
}

@keyframes fall {
    0% { transform: translateY(-20px) translateX(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(105vh) translateX(30px) rotate(360deg); opacity: 0; }
}

/* --- Big Snow Pile at Bottom (Multi-layered) --- */
.snow-ground {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px; /* Much taller for big heaps */
    z-index: 9998;
    pointer-events: none;
}

/* Layer 1: Thick Base */
.snow-ground::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 80" preserveAspectRatio="none"><path d="M0,80 L0,40 C100,20 200,60 300,40 C400,20 500,60 600,40 C700,20 800,60 900,40 C1000,20 1000,40 1000,80 Z" fill="white" opacity="0.6"/></svg>');
    background-size: 800px 80px;
    filter: blur(8px);
    opacity: 0.7;
}

/* Layer 2: Middle Pile */
.snow-ground::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 60" preserveAspectRatio="none"><path d="M0,60 L0,30 C150,10 300,50 450,30 C600,10 750,50 900,30 C1000,10 1000,30 1000,60 Z" fill="white" opacity="0.8"/></svg>');
    background-size: 600px 60px;
    filter: blur(4px);
    opacity: 0.9;
}

/* Layer 3: Top Sharp Edge */
.snow-pile-top {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 40" preserveAspectRatio="none"><path d="M0,40 L0,20 C50,0 150,30 250,20 C350,10 450,40 550,20 C650,0 750,30 850,20 C950,10 1000,30 1000,40 Z" fill="white"/></svg>');
    background-size: 400px 40px;
    z-index: 10;
    filter: drop-shadow(0 -5px 10px rgba(255,255,255,0.8));
}

.snowflake.landed {
    animation: none !important;
    position: absolute !important;
    top: auto !important;
    transition: opacity 3s ease;
    opacity: 0.95 !important;
    filter: blur(1px);
    z-index: 11; /* Above the SVG layers */
}




/* Ensure navbar content is always on top */
.navbar > div {
    z-index: 20;
    position: relative;
}

/* --- Light String (Fairy Lights) --- */
.fairy-lights {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    z-index: 10001; /* Highest layer at the very top */
    pointer-events: none;
    display: flex;
    justify-content: space-around;
    padding: 0;
    margin: 0;
    list-style: none;
    background: transparent; /* Clean transparent look */
}

.light-bulb {
    width: 12px;
    height: 18px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    top: -2px;
    animation-duration: 1.2s;
    animation-iteration-count: infinite;
}

.light-bulb::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 4px;
    width: 4px;
    height: 3px;
    background: #444;
}
@keyframes glow-red { 0%, 100% { background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d; } 50% { background: #800000; } }
@keyframes glow-gold { 0%, 100% { background: #ffd700; box-shadow: 0 0 8px #ffd700; } 50% { background: #b8860b; } }
@keyframes glow-blue { 0%, 100% { background: #00bfff; box-shadow: 0 0 8px #00bfff; } 50% { background: #00008b; } }
@keyframes glow-green { 0%, 100% { background: #32cd32; box-shadow: 0 0 8px #32cd32; } 50% { background: #006400; } }

.light-red { animation-name: glow-red; }
.light-gold { animation-name: glow-gold; animation-delay: 0.3s; }
.light-blue { animation-name: glow-blue; animation-delay: 0.6s; }
/* --- High-Impact Navbar Countdown Styling --- */
#nav-countdown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 18px;
    background: rgba(13, 27, 62, 0.85); /* Deep contrast */
    border: 2px solid transparent;
    background-image: linear-gradient(rgba(13, 27, 62, 0.85), rgba(13, 27, 62, 0.85)), 
                      linear-gradient(to right, #ffd700, #ff4d4d, #ffd700);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border-radius: 50px;
    color: #fff;
    font-family: 'K2D', sans-serif;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4),
                inset 0 0 10px rgba(255, 215, 0, 0.1);
    margin: 0 15px;
    animation: countdown-pulse 2s infinite ease-in-out;
}

@keyframes countdown-pulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); border-color: rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 25px rgba(255, 77, 77, 0.6); border-color: rgba(255, 77, 77, 0.8); }
}

#nav-countdown .cd-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: #ffd700;
    margin-right: 8px;
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

#nav-countdown .cd-time-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 42px;
}

#nav-countdown .cd-number {
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8),
                 0 0 15px rgba(255, 77, 77, 0.4);
}

#nav-countdown .cd-unit {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    color: #00d4ff;
    letter-spacing: 0.5px;
}

#nav-countdown .cd-sep {
    font-size: 18px;
    font-weight: 900;
    color: #ffd700;
    margin-top: -8px;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0.3; }
}

.light-green { animation-name: glow-green; animation-delay: 0.9s; }


/* --- Winter Snow & Fireworks Overlay --- */
.festive-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Deep Night Blue to Purple Gradient - Perfect text contrast */
    background: radial-gradient(circle at center, 
                rgba(25, 42, 86, 0.85) 0%, 
                rgba(13, 27, 62, 0.90) 40%, 
                rgba(27, 20, 100, 0.92) 70%, 
                rgba(16, 12, 63, 0.95) 100%);
    backdrop-filter: blur(12px) saturate(130%);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
    z-index: 25000;
    opacity: 0;
    visibility: hidden;
    transition: all 1.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Add subtle stars/sparkle pattern */
.festive-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 85%, white, transparent),
        radial-gradient(1px 1px at 15% 95%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    opacity: 0.4;
    pointer-events: none;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.festive-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Intro auto-close countdown */
.intro-close-countdown {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25005;
    color: #000;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 1s ease 2s;
    white-space: nowrap;
}

.festive-overlay.show .intro-close-countdown {
    opacity: 1;
}

#intro-cd-value {
    color: #ffd700;
    font-weight: bold;
}

/* --- Grand Snow Pile for Intro Overlay --- */
.festive-intro-snow {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 15rem; /* Massive height for the intro */
    z-index: 25002; /* Above the canvas but behind text */
    pointer-events: none;
    opacity: 0;
    transform: translateY(100px);
    transition: all 1.5s ease 0.5s;
}

.festive-overlay.show .festive-intro-snow {
    opacity: 1;
    transform: translateY(0);
}

.intro-snow-heap {
    position: absolute;
    bottom: -20px;
    left: -10%;
    width: 120%;
    height: 12rem;
    background: radial-gradient(ellipse at top, #fff 0%, rgba(255,255,255,0.8) 50%, transparent 100%);
    border-radius: 50% 50% 0 0;
    filter: blur(15px);
    box-shadow: 0 -10px 50px rgba(255, 255, 255, 0.4);
}

.intro-snow-heap-2 {
    position: absolute;
    bottom: -10px;
    left: -5%;
    width: 110%;
    height: 8rem;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path d="M0,100 L0,50 C100,20 200,80 300,50 C450,10 600,90 750,50 C850,30 1000,70 1000,50 L1000,100 Z" fill="white"/></svg>');
    background-size: 100% 100%;
    filter: drop-shadow(0 -5px 15px rgba(255, 255, 255, 0.6));
}

/* Add a third layer for more "fluffiness" */
.festive-intro-snow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5rem;
    background: linear-gradient(to top, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    filter: blur(5px);
}

.new-year-greeting {
    z-index: 25002;
    text-align: center;
    pointer-events: none;
    transform: scale(0.5);
    transition: all 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.festive-overlay.show .new-year-greeting {
    transform: scale(1);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.greeting-text {
    font-family: 'Pattaya', 'K2D', sans-serif;
    font-size: 6rem;
    font-weight: 700;
    /* Ultra-Vibrant Festive Gradient */
    background: linear-gradient(to bottom, #fff000 0%, #ffcc00 25%, #ff3300 75%, #cc0000 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Multi-layered glow for visibility */
    filter: drop-shadow(4px 4px 0px rgba(0,0,0,0.8))
            drop-shadow(0 0 25px rgba(255, 204, 0, 0.6))
            drop-shadow(0 0 50px rgba(255, 51, 0, 0.4));
    white-space: nowrap;
    animation: text-pulse 2s infinite alternate;
    letter-spacing: 2px;
}

@keyframes text-pulse {
    from { transform: scale(1); filter: drop-shadow(4px 4px 0px rgba(0,0,0,0.8)) drop-shadow(0 0 20px rgba(255, 204, 0, 0.5)); }
    to { transform: scale(1.02); filter: drop-shadow(4px 4px 0px rgba(0,0,0,0.8)) drop-shadow(0 0 40px rgba(255, 51, 0, 0.7)); }
}

.blessing-text {
    font-size: 2.2rem;
    font-weight: 600;
    margin-top: 1.5rem;
    /* Bright Festive Green/Gold */
    background: linear-gradient(to bottom, #ffffff 0%, #00ff88 50%, #00cc66 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.8))
            drop-shadow(0 0 15px rgba(0, 255, 136, 0.5));
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease 0.5s;
}

.festive-overlay.show .blessing-text {
    opacity: 1;
    transform: translateY(0);
}

.blessing-text-sub {
    font-size: 1.8rem;
    font-weight: 500;
    color: #ffd700;
    margin-top: 1rem;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.9),
                 0 0 10px rgba(255, 215, 0, 0.4);
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease 0.8s;
}

.festive-overlay.show .blessing-text-sub {
    opacity: 1;
    transform: translateY(0);
}

.school-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 2rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8),
                 0 0 20px rgba(255, 215, 0, 0.4);
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease 1.2s;
    line-height: 1.6;
    background: linear-gradient(to right, #ffd700, #fff, #ffd700);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.festive-overlay.show .school-text {
    opacity: 1;
    transform: translateY(0);
}

/* Firework Canvas */
#firework-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 25001;
    pointer-events: none;
}

/* Floating Festive Elements */
.festive-float {
    position: absolute;
    font-size: 3rem;
    opacity: 0.8;
    z-index: 25003;
    pointer-events: none;
    animation: float-around 8s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3));
}

@keyframes float-around {
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
    }
    25% { 
        transform: translateY(-15px) rotate(5deg); 
    }
    50% { 
        transform: translateY(0) rotate(0deg); 
    }
    75% { 
        transform: translateY(-10px) rotate(-5deg); 
    }
}

.festive-float:nth-child(odd) {
    animation-duration: 6s;
}

.festive-float:nth-child(even) {
    animation-duration: 10s;
    animation-direction: reverse;
}

/* --- Mobile & Tablet Adjustments --- */
@media (max-width: 768px) {
    .new-year-greeting {
        width: 90%;
        max-width: 95%;
        padding: 1.5rem !important;
        border-radius: 1rem !important;
        backdrop-filter: blur(5px); /* Reduced for performance */
        -webkit-backdrop-filter: blur(5px);
    }

    .greeting-text {
        font-size: 2.2rem;
        letter-spacing: 1px;
        padding: 0;
        line-height: 1.2;
        filter: drop-shadow(2px 2px 0 #000); /* Simplified */
        will-change: transform, opacity;
    }
    
    .festive-overlay {
        backdrop-filter: blur(5px); /* Much lower for mobile */
        -webkit-backdrop-filter: blur(5px);
    }

    .festive-float {
        font-size: 2rem;
        opacity: 0.6;
        animation-duration: 10s; /* Slower = lighter */
        filter: none; /* Disable shadow */
        will-change: transform;
    }

    .intro-snow-heap, .intro-snow-heap-2 {
        filter: blur(5px); /* Lower blur */
    }
}

/* Extra small phones */
@media (max-width: 480px) {
    .greeting-text {
        font-size: 1.8rem;
        letter-spacing: 0;
    }
    
    .blessing-text {
        font-size: 0.95rem;
        padding: 0 10px;
    }

    .school-text {
        font-size: 0.8rem;
    }
}


