/* Holiday Effects Container */
#holiday-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* Snow (Christmas) */
.snowflake {
    position: absolute;
    top: -10vh;
    color: #fff;
    opacity: 0.8;
    text-shadow: 0 0 5px rgba(255,255,255,0.8);
    animation: fall linear infinite;
}
@keyframes fall {
    0% { transform: translateY(0vh) translateX(0); }
    100% { transform: translateY(110vh) translateX(20px); }
}

/* Confetti (German Unity Day) */
.confetti {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 20px;
    animation: confetti-fall linear infinite;
    border-radius: 2px;
}
@keyframes confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* Fireworks (New Year) */
.firework {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: explode 2.5s ease-out infinite;
    opacity: 0;
}
@keyframes explode {
    0% { transform: scale(1); box-shadow: 0 0 0 #ff0, 0 0 0 #f0f, 0 0 0 #0ff, 0 0 0 #0f0; opacity: 1; }
    50% { opacity: 1; }
    100% { transform: scale(8); box-shadow: -40px -40px 15px #ff0, 40px -40px 15px #f0f, -40px 40px 15px #0ff, 40px 40px 15px #0f0; opacity: 0; }
}

/* Halloween Overhaul */
.halloween-item {
    position: absolute;
    font-size: 3rem;
    opacity: 0.8;
    animation: spooky-float ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 87, 34, 0.6));
}

@keyframes spooky-float {
    0% { transform: translateY(0) scale(1) rotate(0deg); }
    50% { transform: translateY(-40px) scale(1.1) rotate(15deg); }
    100% { transform: translateY(0) scale(1) rotate(0deg); }
}

body.theme-halloween {
    --bg-color: #1a0f00 !important;
    --container-bg: rgba(30, 15, 0, 0.85) !important;
    --container-border: #ff5722 !important;
    --brand-orange: #ff5722 !important;
}

body.theme-halloween section {
    box-shadow: 0 4px 20px rgba(255, 87, 34, 0.15) !important;
}

body.theme-halloween::before {
    content: "🦇";
    position: fixed;
    top: 10%;
    left: -10%;
    font-size: 4rem;
    z-index: 9998;
    pointer-events: none;
    animation: spooky-flight 18s linear infinite;
    opacity: 0.5;
}

@keyframes spooky-flight {
    0% { transform: translate(0, 0) scale(1.5); }
    50% { transform: translate(120vw, 40vh) scale(0.8) rotate(15deg); }
    100% { transform: translate(120vw, 40vh); opacity: 0; }
}

/* Easter (Ostern) CSS */
.easter-item {
    position: absolute;
    top: -10vh;
    opacity: 0.9;
    animation: easter-fall linear infinite;
    filter: drop-shadow(0 4px 5px rgba(0,0,0,0.1));
}

@keyframes easter-fall {
    0% { transform: translateY(0) rotate(-15deg); }
    100% { transform: translateY(110vh) rotate(360deg); }
}

body.theme-easter {
    --bg-color: #f7fcf5 !important;
    --container-bg: rgba(255, 255, 255, 0.9) !important;
    --container-border: #81c784 !important;
    --brand-orange: #ec407a !important; /* Spring pinkish */
}

body.dark-mode.theme-easter {
    --bg-color: #0d1a10 !important;
    --container-bg: rgba(20, 35, 20, 0.85) !important;
    --container-border: #4caf50 !important;
    --brand-orange: #ff80ab !important;
}

/* Theme Unity */
body.theme-unity {
    border-top: 8px solid transparent;
    border-image: linear-gradient(to right, #000 33%, #FF0000 33%, #FF0000 66%, #FFCC00 66%) 1;
}

/* ---------------------------------
   Holiday Greeting Card Inline 
   --------------------------------- */
.holiday-greeting-card {
    display: block;
    width: fit-content;
    margin: 12px auto 0 auto;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 20px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: #fff;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    animation: greeting-pop 5.5s forwards ease-in-out;
    white-space: nowrap;
    overflow: hidden;
}

@keyframes greeting-pop {
    0% { transform: translateY(-10px); opacity: 0; max-height: 60px; margin-top: 12px; margin-bottom: 0; padding-top: 8px; padding-bottom: 8px; border-width: 1px; }
    10% { transform: translateY(0); opacity: 1; filter: drop-shadow(0 0 10px white); }
    15% { transform: translateY(0); opacity: 1; filter: drop-shadow(0 0 0 transparent); }
    85% { transform: translateY(0); opacity: 1; max-height: 60px; margin-top: 12px; margin-bottom: 0; padding-top: 8px; padding-bottom: 8px; border-width: 1px; }
    95% { transform: translateY(0); opacity: 0; max-height: 60px; margin-top: 12px; margin-bottom: 0; padding-top: 8px; padding-bottom: 8px; border-width: 1px; }
    100% { transform: translateY(0); opacity: 0; max-height: 0px; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; border-width: 0px; }
}

@media screen and (max-width: 768px) {
    .holiday-greeting-card {
        font-size: 0.95rem;
        padding: 5px 15px;
        white-space: normal;
        max-width: 90%;
    }
}

/* Greeting Sub-themes */
body.theme-halloween .holiday-greeting-card {
    color: #ff5722;
    background: rgba(10, 5, 0, 0.85);
    border-color: #ff5722;
}
body.theme-unity .holiday-greeting-card {
    background: linear-gradient(135deg, rgba(0,0,0,0.85), rgba(255,0,0,0.85), rgba(255,204,0,0.85));
    border: none;
}
body.theme-christmas .holiday-greeting-card {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #fff;
    color: #005f73;
    text-shadow: 0 0 10px white;
}
body.dark-mode.theme-christmas .holiday-greeting-card {
    color: #fff;
}
body.theme-easter .holiday-greeting-card {
    background: rgba(255, 64, 129, 0.85);
    color: #fff;
    border: none;
}
body.theme-newyear .holiday-greeting-card {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid gold;
    color: gold;
}

/* Safari Old Browser Fallbacks matching animations */
@-webkit-keyframes fall {
    0% { -webkit-transform: translateY(0vh) translateX(0); }
    100% { -webkit-transform: translateY(110vh) translateX(20px); }
}
@-webkit-keyframes confetti-fall {
    0% { -webkit-transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { -webkit-transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
@-webkit-keyframes explode {
    0% { -webkit-transform: scale(1); box-shadow: 0 0 0 #ff0, 0 0 0 #f0f, 0 0 0 #0ff, 0 0 0 #0f0; opacity: 1; }
    50% { opacity: 1; }
    100% { -webkit-transform: scale(8); box-shadow: -40px -40px 15px #ff0, 40px -40px 15px #f0f, -40px 40px 15px #0ff, 40px 40px 15px #0f0; opacity: 0; }
}
@-webkit-keyframes spooky-float {
    0% { -webkit-transform: translateY(0) scale(1) rotate(0deg); }
    50% { -webkit-transform: translateY(-40px) scale(1.1) rotate(15deg); }
    100% { -webkit-transform: translateY(0) scale(1) rotate(0deg); }
}
@-webkit-keyframes easter-fall {
    0% { -webkit-transform: translateY(0) rotate(-15deg); }
    100% { -webkit-transform: translateY(110vh) rotate(360deg); }
}

.snowflake { -webkit-animation: fall linear infinite; }
.confetti { -webkit-animation: confetti-fall linear infinite; }
.firework { -webkit-animation: explode 2.5s ease-out infinite; }
.halloween-item { -webkit-animation: spooky-float ease-in-out infinite; }
.easter-item { -webkit-animation: easter-fall linear infinite; }
body.reduced-motion #holiday-effects {
    display: none !important;
}

body.reduced-motion .holiday-greeting-card {
    animation: none !important;
    opacity: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
    #holiday-effects {
        display: none !important;
    }

    .holiday-greeting-card {
        animation: none !important;
        opacity: 1 !important;
    }
}
