/* Floating Ghosts Animation */
.ghost {
    position: fixed;
    font-size: 3rem;
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
    animation: floatGhost 15s infinite ease-in-out;
}

.ghost:nth-child(1) {
    left: 10%;
    top: 20%;
    animation-delay: 0s;
    animation-duration: 12s;
}

.ghost:nth-child(2) {
    left: 80%;
    top: 60%;
    animation-delay: 3s;
    animation-duration: 18s;
}

.ghost:nth-child(3) {
    left: 50%;
    top: 10%;
    animation-delay: 6s;
    animation-duration: 15s;
}

.ghost:nth-child(4) {
    left: 20%;
    top: 70%;
    animation-delay: 9s;
    animation-duration: 20s;
}

.ghost:nth-child(5) {
    left: 70%;
    top: 30%;
    animation-delay: 12s;
    animation-duration: 16s;
}

@keyframes floatGhost {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.2;
    }
    25% {
        transform: translate(30px, -50px) rotate(5deg);
        opacity: 0.4;
    }
    50% {
        transform: translate(-20px, -100px) rotate(-5deg);
        opacity: 0.3;
    }
    75% {
        transform: translate(40px, -70px) rotate(3deg);
        opacity: 0.35;
    }
}

/* Fog Animation */
.fog-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.fog {
    position: absolute;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--fog-color-1) 25%,
        var(--fog-color-2) 50%,
        var(--fog-color-1) 75%,
        transparent 100%
    );
    animation: fogMove 30s linear infinite;
    transition: background 0.5s ease;
}

.fog-layer-1 {
    top: 0;
    animation-duration: 25s;
    opacity: 0.6;
}

.fog-layer-2 {
    top: 30%;
    animation-duration: 35s;
    animation-delay: -10s;
    opacity: 0.4;
}

.fog-layer-3 {
    top: 60%;
    animation-duration: 40s;
    animation-delay: -20s;
    opacity: 0.5;
}

@keyframes fogMove {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0%);
    }
}

/* Pumpkin decorations */
.pumpkin {
    position: fixed;
    font-size: 2.5rem;
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
    animation: pumpkinGlow 3s ease-in-out infinite;
}

.pumpkin:nth-child(1) {
    left: 5%;
    bottom: 10%;
    animation-delay: 0s;
}

.pumpkin:nth-child(2) {
    right: 5%;
    bottom: 15%;
    animation-delay: 1.5s;
}

@keyframes pumpkinGlow {
    0%, 100% {
        filter: drop-shadow(0 0 5px #ff8c00);
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 20px #ff8c00) drop-shadow(0 0 30px #ff8c00);
        transform: scale(1.1);
    }
}

/* Bat flying animation */
.bat {
    position: fixed;
    font-size: 2rem;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
    animation: flyBat 20s linear infinite;
}

.bat:nth-child(1) {
    top: 15%;
    animation-delay: 0s;
}

.bat:nth-child(2) {
    top: 40%;
    animation-delay: 7s;
}

.bat:nth-child(3) {
    top: 65%;
    animation-delay: 14s;
}

@keyframes flyBat {
    0% {
        left: -5%;
        transform: translateY(0) scaleX(1);
    }
    25% {
        transform: translateY(-30px) scaleX(1);
    }
    50% {
        left: 50%;
        transform: translateY(0) scaleX(1);
    }
    51% {
        transform: scaleX(-1);
    }
    75% {
        transform: translateY(-20px) scaleX(-1);
    }
    100% {
        left: 105%;
        transform: translateY(0) scaleX(-1);
    }
}

/* Sparkle effects */
.sparkle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    animation: sparkleAnimation 3s ease-in-out infinite;
}

.sparkle:nth-child(1) {
    left: 15%;
    top: 25%;
    animation-delay: 0s;
}

.sparkle:nth-child(2) {
    left: 85%;
    top: 45%;
    animation-delay: 1s;
}

.sparkle:nth-child(3) {
    left: 40%;
    top: 15%;
    animation-delay: 2s;
}

.sparkle:nth-child(4) {
    left: 60%;
    top: 75%;
    animation-delay: 1.5s;
}

.sparkle:nth-child(5) {
    left: 25%;
    top: 85%;
    animation-delay: 0.5s;
}

@keyframes sparkleAnimation {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 10px #fff, 0 0 20px #8a2be2;
    }
}
