/* =========================================
   FESTIVAL UI DECORATIONS
   ========================================= */

/* --- Common Animations --- */
@keyframes spin-slow {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 10px var(--theme-color);
    }

    50% {
        box-shadow: 0 0 25px var(--theme-color), 0 0 10px white;
    }
}

@keyframes float-badge {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* --- Base Avatar Decoration --- */
/* The decoration container will be injected via JS or we target #userAvatar directly */

/* 1. NEW YEAR (Golden/Red) */
body.festival-newyear #userAvatar {
    position: relative;
    border: 2px solid #ffd700 !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    animation: pulse-glow 2s infinite;
    --theme-color: #ffd700;
}

body.festival-newyear #userAvatar::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 16px;
    /* Slightly larger than avatar radius */
    border: 2px dashed #ff4757;
    animation: spin-slow 10s linear infinite;
    pointer-events: none;
}

body.festival-newyear .festival-badge {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: #ffd700;
    border: 1px solid #ffd700;
}

/* 2. VALENTINE (Pink/Red) */
body.festival-valentine #userAvatar {
    border: 2px solid #ff69b4 !important;
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.6);
    --theme-color: #ff69b4;
    animation: pulse-glow 1.5s infinite;
}

body.festival-valentine #userAvatar::before {
    content: '❤';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 16px;
    color: #ff69b4;
    animation: float-badge 2s ease-in-out infinite;
    background: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

/* 3. WOMEN'S DAY (Floral/Elegant) */
body.festival-womensday #userAvatar {
    border: 2px solid #ff7eb3 !important;
    box-shadow: 0 0 12px rgba(255, 126, 179, 0.5);
}

body.festival-womensday #userAvatar::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 14px;
    border: 2px dotted #ff758c;
    opacity: 0.7;
}

/* 4. MID-AUTUMN (Lantern/Moon) */
body.festival-midautumn #userAvatar {
    border: 2px solid #ff9f43 !important;
    box-shadow: 0 0 15px rgba(255, 159, 67, 0.6);
    --theme-color: #ff9f43;
}

/* 5. HALLOWEEN (Spooky) */
body.festival-halloween #userAvatar {
    border: 2px solid #a55eea !important;
    box-shadow: 0 0 15px rgba(165, 94, 234, 0.6);
    --theme-color: #a55eea;
}

body.festival-halloween #userAvatar::before {
    content: '🦇';
    position: absolute;
    top: -8px;
    left: -8px;
    font-size: 14px;
    animation: float-badge 3s ease-in-out infinite;
}

/* --- Greeting Badge (Injected via JS) --- */
.festival-greeting-badge {
    position: fixed;
    bottom: 20px;
    left: 80px;
    /* Near sidebar */
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: float-badge 3s ease-in-out infinite;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    /* Let clicks pass through */
}

/* Mobile: Move badge above bottom nav AND chat widget */
@media (max-width: 768px) {
    .festival-greeting-badge {
        bottom: 160px;
        /* Above chat widget (~90px) + nav (~70px) */
        left: 16px;
        right: auto;
        transform: none;
        font-size: 11px;
        padding: 6px 12px;
        max-width: calc(100vw - 100px);
        /* Leave room for chat bubble */
    }
}