/* Christmas Theme Styles */

/* Christmas Color Palette */
:root {
    --christmas-red: #c41e3a;
    --christmas-green: #165b33;
    --christmas-gold: #ffd700;
    --christmas-white: #ffffff;
    --christmas-dark-red: #8b0000;
    --christmas-light-green: #98fb98;
}

/* Merry Christmas Artistic Text - On the Christmas Tree */
.christmas-header-text {
    position: absolute;
    bottom: 150px; /* Position above the tree */
    left: 60%; /* Move more to the right to ensure MER is fully visible */
    transform: translateX(-50%);
    z-index: 100; /* Low z-index since header text is contained within tree element and doesn't need to layer above other UI elements */
    text-align: center;
    pointer-events: none;
    font-family: 'Arial Black', 'Arial Bold', sans-serif;
    font-size: 18px;
    font-weight: bold;
    color: var(--christmas-gold);
    text-shadow: 
        1px 1px 0px var(--christmas-red),
        2px 2px 0px var(--christmas-dark-red),
        -1px -1px 0px var(--christmas-white),
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.6);
    letter-spacing: 1px;
    animation: christmasGlow 3s ease-in-out infinite;
    white-space: nowrap;
}

@keyframes christmasGlow {
    0%, 100% {
        text-shadow: 
            1px 1px 0px var(--christmas-red),
            2px 2px 0px var(--christmas-dark-red),
            -1px -1px 0px var(--christmas-white),
            0 0 10px rgba(255, 215, 0, 0.8),
            0 0 20px rgba(255, 215, 0, 0.6);
    }
    50% {
        text-shadow: 
            1px 1px 0px var(--christmas-red),
            2px 2px 0px var(--christmas-dark-red),
            -1px -1px 0px var(--christmas-white),
            0 0 15px rgba(255, 215, 0, 1),
            0 0 30px rgba(255, 215, 0, 0.8);
    }
}

/* Hide on mobile for better readability */
@media (max-width: 768px) {
    .christmas-header-text {
        font-size: 14px;
        bottom: 145px;
    }
    }
}

/* Body Christmas Background */
body {
    background: linear-gradient(135deg, #165b33 0%, #0f4025 50%, #165b33 100%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

/* Header Christmas Styling */
.header {
    background: linear-gradient(90deg, var(--christmas-red) 0%, var(--christmas-dark-red) 100%) !important;
    border-bottom: 3px solid var(--christmas-gold);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Sidebar Christmas Styling */
.sidebar {
    background: linear-gradient(180deg, var(--christmas-green) 0%, #0a2818 100%) !important;
    border-right: 3px solid var(--christmas-gold);
}

.sidebar-menu li a {
    color: var(--christmas-white) !important;
    transition: all 0.3s ease;
}

.sidebar-menu li a:hover {
    background-color: var(--christmas-red) !important;
    border-left: 4px solid var(--christmas-gold);
}

/* Buttons Christmas Styling */
.btn-primary {
    background: linear-gradient(90deg, var(--christmas-red) 0%, var(--christmas-dark-red) 100%) !important;
    border-color: var(--christmas-gold) !important;
    color: var(--christmas-white) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(90deg, var(--christmas-dark-red) 0%, var(--christmas-red) 100%) !important;
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

/* Server Cards Christmas Styling */
.server-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 248, 248, 0.95) 100%) !important;
    border: 2px solid var(--christmas-gold) !important;
    box-shadow: 0 6px 12px rgba(196, 30, 58, 0.3) !important;
    transition: all 0.3s ease;
}

.server-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(196, 30, 58, 0.5) !important;
    border-color: var(--christmas-red) !important;
}

/* Content Area */
.content {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Footer Christmas Styling */
.footer {
    background: linear-gradient(90deg, var(--christmas-green) 0%, #0a2818 100%) !important;
    color: var(--christmas-white) !important;
    border-top: 3px solid var(--christmas-gold);
}

.footer a {
    color: var(--christmas-gold) !important;
}

.footer a:hover {
    color: var(--christmas-light-green) !important;
}

/* Music Toggle Button */
#christmas-music-toggle {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10004; /* Above header but still accessible */
    background: linear-gradient(135deg, var(--christmas-red) 0%, var(--christmas-dark-red) 100%);
    color: var(--christmas-white);
    border: 2px solid var(--christmas-gold);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    font-size: 24px;
}

#christmas-music-toggle:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 16px rgba(255, 215, 0, 0.6);
}

#christmas-music-toggle.playing {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

/* Snowflake Animation */
.snowflake {
    position: absolute;
    top: -10px;
    color: white;
    font-size: 1em;
    font-family: Arial, sans-serif;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    animation: snowfall linear infinite;
    user-select: none;
}

@keyframes snowfall {
    0% {
        top: -10%;
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0.3;
    }
}

/* Different snowflake sizes and speeds */
.snowflake:nth-child(odd) {
    animation-duration: 10s;
}

.snowflake:nth-child(even) {
    animation-duration: 15s;
}

.snowflake:nth-child(3n) {
    animation-duration: 12s;
    font-size: 0.8em;
}

.snowflake:nth-child(4n) {
    animation-duration: 18s;
    font-size: 1.2em;
}

.snowflake:nth-child(5n) {
    animation-duration: 14s;
    font-size: 0.9em;
}

/* Christmas Decorations */
.title-block h3 {
    color: var(--christmas-red);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Add subtle Christmas lights effect to header */
@keyframes lights {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

.header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--christmas-gold) 10%, 
        transparent 20%,
        var(--christmas-red) 30%,
        transparent 40%,
        var(--christmas-green) 50%,
        transparent 60%,
        var(--christmas-gold) 70%,
        transparent 80%,
        var(--christmas-red) 90%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: lights 3s linear infinite;
    will-change: opacity;
}

/* Floating Christmas Tree (Bottom Left) - Centered inside sidebar */
#floating-christmas-tree {
    position: fixed;
    bottom: 20px;
    left: 55px; /* Centered inside sidebar: (230px - 120px) / 2 = 55px */
    width: 120px;
    height: 140px;
    cursor: pointer;
    z-index: 10004; /* Above sidebar (10003) to ensure tree is not blocked when sidebar appears */
    transition: transform 0.3s ease, left 0.3s ease;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
}

/* On mobile/narrow screens when sidebar is collapsed, move tree to the left edge */
@media (max-width: 991px) {
    #floating-christmas-tree {
        left: 20px;
    }
    
    /* When sidebar is open on mobile, center tree inside sidebar */
    /* Note: sidebar-open class is applied to .app element, tree is sibling in body */
    .app.sidebar-open ~ #floating-christmas-tree {
        left: 55px; /* Centered inside sidebar */
    }
}

#floating-christmas-tree:hover {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.9));
}

.christmas-tree {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Tree top star */
.tree-star {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 15px solid var(--christmas-gold);
    animation: starTwinkle 2s ease-in-out infinite;
}

.tree-star::before {
    content: '';
    position: absolute;
    top: 8px;
    left: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 15px solid var(--christmas-gold);
}

@keyframes starTwinkle {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 5px var(--christmas-gold));
    }
    50% {
        opacity: 0.7;
        filter: drop-shadow(0 0 15px var(--christmas-gold));
    }
}

/* Tree triangles (layers) */
.tree-layer {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 40px solid var(--christmas-green);
}

.tree-layer:nth-child(2) {
    top: 20px;
    border-left-width: 30px;
    border-right-width: 30px;
    border-bottom-width: 35px;
}

.tree-layer:nth-child(3) {
    top: 45px;
    border-left-width: 40px;
    border-right-width: 40px;
    border-bottom-width: 40px;
}

.tree-layer:nth-child(4) {
    top: 75px;
    border-left-width: 50px;
    border-right-width: 50px;
    border-bottom-width: 45px;
}

/* Tree trunk */
.tree-trunk {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 25px;
    background: #8b4513;
    border-radius: 2px;
}

/* Tree ornaments */
.tree-ornament {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: ornamentGlow 3s ease-in-out infinite;
}

.tree-ornament:nth-child(5) {
    top: 35px;
    left: 35px;
    background: var(--christmas-red);
    animation-delay: 0s;
}

.tree-ornament:nth-child(6) {
    top: 40px;
    right: 35px;
    background: var(--christmas-gold);
    animation-delay: 0.5s;
}

.tree-ornament:nth-child(7) {
    top: 60px;
    left: 25px;
    background: #ff69b4;
    animation-delay: 1s;
}

.tree-ornament:nth-child(8) {
    top: 65px;
    right: 25px;
    background: #4169e1;
    animation-delay: 1.5s;
}

.tree-ornament:nth-child(9) {
    top: 85px;
    left: 45px;
    background: var(--christmas-red);
    animation-delay: 2s;
}

.tree-ornament:nth-child(10) {
    top: 90px;
    right: 45px;
    background: var(--christmas-gold);
    animation-delay: 2.5s;
}

@keyframes ornamentGlow {
    0%, 100% {
        box-shadow: 0 0 5px currentColor;
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 15px currentColor;
        opacity: 0.8;
    }
}

/* Christmas blessing popup */
#christmas-blessing {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, var(--christmas-red) 0%, var(--christmas-dark-red) 100%);
    color: var(--christmas-white);
    padding: 40px 50px;
    border-radius: 20px;
    border: 5px solid var(--christmas-gold);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    text-align: center;
    max-width: 500px;
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 0;
}

#christmas-blessing.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

#christmas-blessing h2 {
    font-size: 36px;
    margin: 0 0 20px 0;
    color: var(--christmas-gold);
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.8);
    font-family: 'Arial Black', sans-serif;
    animation: blessingGlow 2s ease-in-out infinite;
}

#christmas-blessing p {
    font-size: 18px;
    line-height: 1.6;
    margin: 15px 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

#christmas-blessing .blessing-close {
    margin-top: 25px;
    padding: 12px 30px;
    background: var(--christmas-gold);
    color: var(--christmas-dark-red);
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#christmas-blessing .blessing-close:hover {
    background: var(--christmas-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

@keyframes blessingGlow {
    0%, 100% {
        text-shadow: 
            2px 2px 4px rgba(0, 0, 0, 0.5),
            0 0 20px rgba(255, 215, 0, 0.8);
    }
    50% {
        text-shadow: 
            2px 2px 4px rgba(0, 0, 0, 0.5),
            0 0 40px rgba(255, 215, 0, 1),
            0 0 60px rgba(255, 215, 0, 0.8);
    }
}

/* Overlay for blessing popup */
#blessing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: none;
    backdrop-filter: blur(5px);
}

#blessing-overlay.show {
    display: block;
}

/* Christmas Splash Screen */
#christmas-splash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        var(--christmas-dark-red) 0%, 
        var(--christmas-red) 50%, 
        var(--christmas-green) 100%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

#christmas-splash.show {
    opacity: 1;
}

#christmas-splash.fade-out {
    opacity: 0;
}

.splash-content {
    text-align: center;
    color: var(--christmas-white);
    max-width: 600px;
    padding: 40px;
    animation: splashFadeIn 1s ease-out;
}

@keyframes splashFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Splash Tree */
.splash-tree {
    position: relative;
    width: 120px;
    height: 140px;
    margin: 0 auto 30px;
}

.splash-tree .tree-star {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
    animation: starTwinkle 2s ease-in-out infinite;
}

.splash-tree .tree-layer {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--christmas-green);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.splash-tree .tree-layer-1 {
    top: 15px;
    width: 40px;
    height: 35px;
}

.splash-tree .tree-layer-2 {
    top: 40px;
    width: 60px;
    height: 40px;
}

.splash-tree .tree-layer-3 {
    top: 70px;
    width: 80px;
    height: 45px;
}

.splash-tree .tree-trunk {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 25px;
    background: #8b4513;
    border-radius: 2px;
}

.splash-title {
    font-family: 'Arial Black', sans-serif;
    font-size: 48px;
    font-weight: bold;
    margin: 20px 0;
    color: var(--christmas-gold);
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 40px rgba(255, 215, 0, 0.5);
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow: 
            2px 2px 4px rgba(0, 0, 0, 0.5),
            0 0 20px rgba(255, 215, 0, 0.8),
            0 0 40px rgba(255, 215, 0, 0.5);
    }
    50% {
        text-shadow: 
            2px 2px 4px rgba(0, 0, 0, 0.5),
            0 0 30px rgba(255, 215, 0, 1),
            0 0 60px rgba(255, 215, 0, 0.7);
    }
}

.splash-subtitle {
    font-size: 24px;
    margin-bottom: 40px;
    color: var(--christmas-white);
    opacity: 0.95;
}

.splash-button {
    background: linear-gradient(135deg, var(--christmas-gold) 0%, #ffa500 100%);
    border: 3px solid var(--christmas-white);
    border-radius: 50px;
    padding: 20px 50px;
    font-size: 20px;
    font-weight: bold;
    color: var(--christmas-dark-red);
    cursor: pointer;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 215, 0, 0.5);
    transition: all 0.3s ease;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    animation: buttonPulse 2s ease-in-out infinite;
}

.splash-button:hover {
    transform: scale(1.1);
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 215, 0, 0.8);
}

@keyframes buttonPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.button-icon {
    font-size: 32px;
    animation: iconBounce 1s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.button-text {
    font-size: 24px;
}

.button-subtext {
    font-size: 14px;
    opacity: 0.8;
}

.splash-hint {
    margin-top: 30px;
    font-size: 16px;
    color: var(--christmas-gold);
    animation: hintFade 2s ease-in-out infinite;
}

@keyframes hintFade {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Mobile responsiveness for splash */
@media (max-width: 768px) {
    .splash-title {
        font-size: 32px;
    }
    
    .splash-subtitle {
        font-size: 18px;
    }
    
    .splash-button {
        padding: 15px 35px;
        font-size: 16px;
    }
    
    .button-text {
        font-size: 18px;
    }
    
    .button-icon {
        font-size: 24px;
    }
}

/* Scrolling Blessings Banner at Top */
#christmas-scrolling-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(90deg, 
        var(--christmas-red) 0%, 
        var(--christmas-dark-red) 25%,
        var(--christmas-gold) 50%,
        var(--christmas-dark-red) 75%,
        var(--christmas-red) 100%);
    background-size: 200% 100%;
    animation: bannerGradient 5s linear infinite;
    z-index: 9997;
    overflow: hidden;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid var(--christmas-gold);
}

@keyframes bannerGradient {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

.scrolling-text {
    display: inline-block;
    white-space: nowrap;
    animation: scrollText 30s linear infinite;
    padding: 8px 0;
    font-size: 18px;
    font-weight: bold;
    font-family: 'Arial Black', 'Arial Bold', sans-serif;
    color: var(--christmas-gold);
    text-shadow: 
        1px 1px 2px var(--christmas-dark-red),
        -1px -1px 2px rgba(255, 255, 255, 0.5),
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.5);
    letter-spacing: 1px;
}

@keyframes scrollText {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Add sparkle effect to banner */
#christmas-scrolling-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
    animation: sparkle 3s linear infinite;
}

@keyframes sparkle {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

/* Mobile responsive for banner */
@media (max-width: 768px) {
    #christmas-scrolling-banner {
        height: 35px;
    }
    
    .scrolling-text {
        font-size: 14px;
        padding: 7px 0;
    }
}

/* ================================================
   Z-Index Fix: Prevent Christmas decorations from blocking UI elements
   ================================================ */

/* Make scrolling banner not block clicks - users can still see it but click through */
#christmas-scrolling-banner {
    pointer-events: none;
}

/* Ensure sidebar overlay and mobile menu handles are above Christmas decorations */
.sidebar-overlay {
    z-index: 10001 !important;
}

.sidebar-mobile-menu-handle,
.mobile-menu-handle {
    z-index: 10002 !important;
}

/* Keep sidebar and header interactive */
.sidebar {
    z-index: 10003 !important;
}

.header {
    z-index: 10000 !important;
}

/* Ensure collapse button remains clickable */
.header .header-block-collapse,
.header .collapse-btn,
#sidebar-collapse-btn {
    z-index: 10001 !important;
    position: relative;
}

/* Ensure Christmas tree remains clickable for blessing popups */
#floating-christmas-tree {
    pointer-events: auto; /* Tree should still be clickable for blessings */
}

/* Christmas blessing popup and overlay should be on top of everything */
#blessing-overlay {
    z-index: 10005 !important;
}

#christmas-blessing {
    z-index: 10006 !important;
}

/* Splash screen should be absolutely on top */
#christmas-splash {
    z-index: 99999 !important;
}
