/**
 * Rs Christmas Santa - Christmas Lights / Fairy Lights
 * Pure CSS animated string lights that hang from the top of the page.
 * Multiple styles: classic, c9, round, star, icicle.
 */

/* Shared base for all light styles */
.rs-xmas-lights,
.rs-xmas-lights *,
.rs-xmas-lights *::before,
.rs-xmas-lights *::after {
    box-sizing: border-box;
}

.rs-xmas-lights {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99990;
    pointer-events: none;
    overflow-x: hidden;
    overflow-y: visible;
    min-height: 40px;
}

/* Offset lights when WordPress Admin Bar is present */
body.admin-bar .rs-xmas-lights:not(.rs-xmas-lights--bottom) {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .rs-xmas-lights:not(.rs-xmas-lights--bottom) {
        top: 46px;
    }
}

.rs-xmas-lights ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    justify-content: space-around;
    position: relative;
    top: -12px;
}

/* The wire / cable */
.rs-xmas-lights ul::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    height: 2px;
    background: #333;
    z-index: 1;
}

.rs-xmas-lights li {
    list-style: none !important;
    margin: 12px 0 0 0 !important;
    padding: 0 !important;
    position: relative;
    z-index: 2;
}

/* Wire drop per bulb */
.rs-xmas-lights li::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 12px;
    background: #333;
}

/* ============================
   STYLE: CLASSIC BULBS
   ============================ */
.rs-xmas-lights--classic li {
    width: 14px;
    height: 22px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: rs-lights-glow 1.8s ease-in-out infinite alternate;
    box-shadow: 0 2px 10px currentColor, inset 0 -3px 6px rgba(0,0,0,0.15);
}

/* ============================
   STYLE: C9 / LARGE BULBS
   ============================ */
.rs-xmas-lights--c9 li {
    width: 16px;
    height: 28px;
    border-radius: 5px 5px 50% 50%;
    animation: rs-lights-glow 2s ease-in-out infinite alternate;
    box-shadow: 0 3px 12px currentColor, inset 0 -4px 8px rgba(0,0,0,0.15);
}

/* Socket cap */
.rs-xmas-lights--c9 li::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 5px;
    background: #666;
    border-radius: 2px 2px 0 0;
}

/* ============================
   STYLE: ROUND / GLOBE
   ============================ */
.rs-xmas-lights--round li {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    animation: rs-lights-glow 1.5s ease-in-out infinite alternate;
    box-shadow: 0 2px 12px currentColor, inset 0 -2px 4px rgba(0,0,0,0.1);
}

/* ============================
   STYLE: STAR-SHAPED
   ============================ */
.rs-xmas-lights--star li {
    width: 18px;
    height: 18px;
    background: transparent !important;
    animation: rs-lights-star-glow 1.6s ease-in-out infinite alternate;
    position: relative;
}

.rs-xmas-lights--star li .rs-star-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    clip-path: polygon(
        50% 0%, 61% 35%, 98% 35%, 68% 57%,
        79% 91%, 50% 70%, 21% 91%, 32% 57%,
        2% 35%, 39% 35%
    );
}

/* ============================
   STYLE: ICICLE
   ============================ */
.rs-xmas-lights--icicle li {
    width: 6px;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    background: transparent !important;
    animation: rs-lights-icicle-glow 2.2s ease-in-out infinite alternate;
}

/* ============================
   COLOR SEQUENCES
   ============================ */
/* Multicolor */
.rs-xmas-lights--multicolor li:nth-child(6n+1) { color: #ff4136; background-color: #ff4136; }
.rs-xmas-lights--multicolor li:nth-child(6n+2) { color: #2ecc40; background-color: #2ecc40; }
.rs-xmas-lights--multicolor li:nth-child(6n+3) { color: #ffdc00; background-color: #ffdc00; }
.rs-xmas-lights--multicolor li:nth-child(6n+4) { color: #0074d9; background-color: #0074d9; }
.rs-xmas-lights--multicolor li:nth-child(6n+5) { color: #ff851b; background-color: #ff851b; }
.rs-xmas-lights--multicolor li:nth-child(6n+6) { color: #b10dc9; background-color: #b10dc9; }

/* Warm white */
.rs-xmas-lights--warm li { color: #ffe4a8; background-color: #ffe4a8; }

/* Red & Green */
.rs-xmas-lights--redgreen li:nth-child(odd) { color: #e12e20; background-color: #e12e20; }
.rs-xmas-lights--redgreen li:nth-child(even) { color: #1fa33e; background-color: #1fa33e; }

/* Blue & Silver */
.rs-xmas-lights--bluesilver li:nth-child(odd) { color: #4fc3f7; background-color: #4fc3f7; }
.rs-xmas-lights--bluesilver li:nth-child(even) { color: #e0e0e0; background-color: #e0e0e0; }

/* Gold */
.rs-xmas-lights--gold li { color: #ffd700; background-color: #ffd700; }

/* Icicle color overrides (uses border-top) */
.rs-xmas-lights--icicle.rs-xmas-lights--multicolor li:nth-child(6n+1) { border-top-color: #ff4136; }
.rs-xmas-lights--icicle.rs-xmas-lights--multicolor li:nth-child(6n+2) { border-top-color: #2ecc40; }
.rs-xmas-lights--icicle.rs-xmas-lights--multicolor li:nth-child(6n+3) { border-top-color: #ffdc00; }
.rs-xmas-lights--icicle.rs-xmas-lights--multicolor li:nth-child(6n+4) { border-top-color: #0074d9; }
.rs-xmas-lights--icicle.rs-xmas-lights--multicolor li:nth-child(6n+5) { border-top-color: #ff851b; }
.rs-xmas-lights--icicle.rs-xmas-lights--multicolor li:nth-child(6n+6) { border-top-color: #b10dc9; }
.rs-xmas-lights--icicle.rs-xmas-lights--warm li { border-top-color: #ffe4a8; }
.rs-xmas-lights--icicle.rs-xmas-lights--redgreen li:nth-child(odd) { border-top-color: #e12e20; }
.rs-xmas-lights--icicle.rs-xmas-lights--redgreen li:nth-child(even) { border-top-color: #1fa33e; }
.rs-xmas-lights--icicle.rs-xmas-lights--bluesilver li:nth-child(odd) { border-top-color: #4fc3f7; }
.rs-xmas-lights--icicle.rs-xmas-lights--bluesilver li:nth-child(even) { border-top-color: #e0e0e0; }
.rs-xmas-lights--icicle.rs-xmas-lights--gold li { border-top-color: #ffd700; }

/* Staggered animation delays for natural twinkling */
.rs-xmas-lights li:nth-child(6n+1) { animation-delay: 0s; }
.rs-xmas-lights li:nth-child(6n+2) { animation-delay: 0.3s; }
.rs-xmas-lights li:nth-child(6n+3) { animation-delay: 0.6s; }
.rs-xmas-lights li:nth-child(6n+4) { animation-delay: 0.15s; }
.rs-xmas-lights li:nth-child(6n+5) { animation-delay: 0.45s; }
.rs-xmas-lights li:nth-child(6n+6) { animation-delay: 0.75s; }

/* Icicle variable heights */
.rs-xmas-lights--icicle li:nth-child(4n+1) { border-top-width: 28px; }
.rs-xmas-lights--icicle li:nth-child(4n+2) { border-top-width: 38px; }
.rs-xmas-lights--icicle li:nth-child(4n+3) { border-top-width: 22px; }
.rs-xmas-lights--icicle li:nth-child(4n+4) { border-top-width: 44px; }

/* Star inner color matches parent */
.rs-xmas-lights--star.rs-xmas-lights--multicolor li:nth-child(6n+1) .rs-star-inner { background-color: #ff4136; filter: drop-shadow(0 0 6px #ff4136); }
.rs-xmas-lights--star.rs-xmas-lights--multicolor li:nth-child(6n+2) .rs-star-inner { background-color: #2ecc40; filter: drop-shadow(0 0 6px #2ecc40); }
.rs-xmas-lights--star.rs-xmas-lights--multicolor li:nth-child(6n+3) .rs-star-inner { background-color: #ffdc00; filter: drop-shadow(0 0 6px #ffdc00); }
.rs-xmas-lights--star.rs-xmas-lights--multicolor li:nth-child(6n+4) .rs-star-inner { background-color: #0074d9; filter: drop-shadow(0 0 6px #0074d9); }
.rs-xmas-lights--star.rs-xmas-lights--multicolor li:nth-child(6n+5) .rs-star-inner { background-color: #ff851b; filter: drop-shadow(0 0 6px #ff851b); }
.rs-xmas-lights--star.rs-xmas-lights--multicolor li:nth-child(6n+6) .rs-star-inner { background-color: #b10dc9; filter: drop-shadow(0 0 6px #b10dc9); }
.rs-xmas-lights--star.rs-xmas-lights--warm li .rs-star-inner { background-color: #ffe4a8; filter: drop-shadow(0 0 6px #ffe4a8); }
.rs-xmas-lights--star.rs-xmas-lights--redgreen li:nth-child(odd) .rs-star-inner { background-color: #e12e20; filter: drop-shadow(0 0 6px #e12e20); }
.rs-xmas-lights--star.rs-xmas-lights--redgreen li:nth-child(even) .rs-star-inner { background-color: #1fa33e; filter: drop-shadow(0 0 6px #1fa33e); }
.rs-xmas-lights--star.rs-xmas-lights--bluesilver li:nth-child(odd) .rs-star-inner { background-color: #4fc3f7; filter: drop-shadow(0 0 6px #4fc3f7); }
.rs-xmas-lights--star.rs-xmas-lights--bluesilver li:nth-child(even) .rs-star-inner { background-color: #e0e0e0; filter: drop-shadow(0 0 6px #e0e0e0); }
.rs-xmas-lights--star.rs-xmas-lights--gold li .rs-star-inner { background-color: #ffd700; filter: drop-shadow(0 0 6px #ffd700); }

/* ============================
   ANIMATIONS
   ============================ */
@keyframes rs-lights-glow {
    0%   { opacity: 0.55; filter: brightness(0.7); }
    100% { opacity: 1;    filter: brightness(1.3); }
}

@keyframes rs-lights-star-glow {
    0%   { opacity: 0.5; transform: scale(0.85); }
    100% { opacity: 1;   transform: scale(1.05); }
}

@keyframes rs-lights-icicle-glow {
    0%   { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ============================
   BOTTOM POSITION
   ============================ */
.rs-xmas-lights--bottom {
    top: auto !important;
    bottom: 0;
}

.rs-xmas-lights--bottom ul {
    top: auto;
}

.rs-xmas-lights--bottom ul::before {
    top: auto;
    bottom: 14px;
}

.rs-xmas-lights--bottom li {
    margin-top: 0;
    margin-bottom: 12px;
    transform: rotate(180deg);
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 600px) {
    .rs-xmas-lights--classic li { width: 10px; height: 16px; }
    .rs-xmas-lights--c9 li { width: 12px; height: 20px; }
    .rs-xmas-lights--round li { width: 12px; height: 12px; }
    .rs-xmas-lights--star li { width: 14px; height: 14px; }
    .rs-xmas-lights--icicle li:nth-child(4n+1) { border-top-width: 18px; }
    .rs-xmas-lights--icicle li:nth-child(4n+2) { border-top-width: 26px; }
    .rs-xmas-lights--icicle li:nth-child(4n+3) { border-top-width: 14px; }
    .rs-xmas-lights--icicle li:nth-child(4n+4) { border-top-width: 32px; }
}
