/* Halloween Decorations CSS - Using Custom Images */

/* Ghost Image */
.ghost {
    position: fixed;
    width: 50px;
    height: 50px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1000;
    pointer-events: none;
    animation: ghostFloat 8s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

/* Bat Image */
.bat {
    position: fixed;
    width: 45px;
    height: 45px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1000;
    pointer-events: none;
    animation: batFly 10s linear infinite;
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.8));
}

/* Cobweb Image */
.cobweb {
    position: fixed;
    width: 40px;
    height: 40px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1000;
    pointer-events: none;
    animation: cobwebSway 15s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(200, 200, 200, 0.6));
    opacity: 0.8;
}

/* Pumpkin Image */
.pumpkin {
    position: fixed;
    width: 55px;
    height: 55px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1000;
    pointer-events: none;
    animation: pumpkinBounce 6s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(255, 102, 0, 0.6));
}

/* Edge-Focused Animations */
@keyframes ghostFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-30px) rotate(3deg); }
    50% { transform: translateY(-15px) rotate(-2deg); }
    75% { transform: translateY(-40px) rotate(4deg); }
}

@keyframes batFly {
    0% { transform: translateX(-100px) translateY(0px) rotate(0deg); }
    25% { transform: translateX(25vw) translateY(-80px) rotate(10deg); }
    50% { transform: translateX(50vw) translateY(0px) rotate(0deg); }
    75% { transform: translateX(75vw) translateY(-60px) rotate(-10deg); }
    100% { transform: translateX(100vw) translateY(0px) rotate(0deg); }
}

@keyframes spiderCrawl {
    0% { transform: translateX(-80px) translateY(0px); }
    25% { transform: translateX(25vw) translateY(30px); }
    50% { transform: translateX(50vw) translateY(0px); }
    75% { transform: translateX(75vw) translateY(-30px); }
    100% { transform: translateX(100vw) translateY(0px); }
}

@keyframes cobwebSway {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(8deg) scale(1.1); }
    50% { transform: rotate(0deg) scale(1); }
    75% { transform: rotate(-8deg) scale(0.9); }
}

@keyframes pumpkinBounce {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-25px) rotate(2deg); }
    50% { transform: translateY(-10px) rotate(0deg); }
    75% { transform: translateY(-35px) rotate(-2deg); }
}

@keyframes skullRotate {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.1); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(0.9); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Edge positioning classes - ONLY on edges */
.pos-1 { top: 2%; left: 2%; }      /* Top-left corner */
.pos-2 { top: 2%; right: 2%; }     /* Top-right corner */
.pos-3 { bottom: 2%; left: 2%; }   /* Bottom-left corner */
.pos-4 { bottom: 2%; right: 2%; }  /* Bottom-right corner */
.pos-5 { top: 10%; left: 1%; }     /* Left edge */
.pos-6 { top: 25%; left: 1%; }     /* Left edge */
.pos-7 { top: 40%; left: 1%; }     /* Left edge */
.pos-8 { top: 55%; left: 1%; }     /* Left edge */
.pos-9 { top: 70%; left: 1%; }     /* Left edge */
.pos-10 { top: 10%; right: 1%; }   /* Right edge */
.pos-11 { top: 25%; right: 1%; }   /* Right edge */
.pos-12 { top: 40%; right: 1%; }   /* Right edge */
.pos-13 { top: 55%; right: 1%; }   /* Right edge */
.pos-14 { top: 70%; right: 1%; }   /* Right edge */
.pos-15 { top: 1%; left: 10%; }    /* Top edge */
.pos-16 { top: 1%; left: 25%; }    /* Top edge */
.pos-17 { top: 1%; left: 40%; }    /* Top edge */
.pos-18 { top: 1%; left: 55%; }    /* Top edge */
.pos-19 { top: 1%; left: 70%; }    /* Top edge */
.pos-20 { top: 1%; left: 85%; }    /* Top edge */
.pos-21 { bottom: 1%; left: 10%; } /* Bottom edge */
.pos-22 { bottom: 1%; left: 25%; } /* Bottom edge */
.pos-23 { bottom: 1%; left: 40%; } /* Bottom edge */
.pos-24 { bottom: 1%; left: 55%; } /* Bottom edge */
.pos-25 { bottom: 1%; left: 70%; } /* Bottom edge */
.pos-26 { bottom: 1%; left: 85%; } /* Bottom edge */

/* Animation delays for variety */
.delay-1 { animation-delay: 0s; }
.delay-2 { animation-delay: 1s; }
.delay-3 { animation-delay: 2s; }
.delay-4 { animation-delay: 3s; }
.delay-5 { animation-delay: 4s; }
.delay-6 { animation-delay: 5s; }

/* Fog Effect - Base styles for dynamic fog */
.halloween-fog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
    background: transparent;
    animation: fogMove 25s ease-in-out infinite, fogPulse 8s ease-in-out infinite, fogDrift 15s linear infinite;
}

/* Individual fog patches for dynamic positioning */
.fog-patch {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.3) 30%, transparent 70%);
    filter: blur(3px);
    animation: fogFloat 20s ease-in-out infinite;
}

.fog-patch-1 { width: 300px; height: 150px; animation-delay: 0s; }
.fog-patch-2 { width: 450px; height: 200px; animation-delay: 2s; }
.fog-patch-3 { width: 250px; height: 120px; animation-delay: 4s; }
.fog-patch-4 { width: 400px; height: 180px; animation-delay: 6s; }
.fog-patch-5 { width: 350px; height: 160px; animation-delay: 8s; }
.fog-patch-6 { width: 500px; height: 220px; animation-delay: 10s; }
.fog-patch-7 { width: 280px; height: 140px; animation-delay: 12s; }
.fog-patch-8 { width: 380px; height: 170px; animation-delay: 14s; }
.fog-patch-9 { width: 320px; height: 155px; animation-delay: 16s; }
.fog-patch-10 { width: 420px; height: 190px; animation-delay: 18s; }

/* Fog Animations */
@keyframes fogMove {
    0%, 100% {
        transform: translateX(0px) translateY(0px) scale(1);
    }
    25% {
        transform: translateX(-30px) translateY(-15px) scale(1.05);
    }
    50% {
        transform: translateX(20px) translateY(-25px) scale(0.95);
    }
    75% {
        transform: translateX(-25px) translateY(10px) scale(1.02);
    }
}

@keyframes fogPulse {
    0%, 100% {
        opacity: 0.6;
        filter: blur(1px);
    }
    25% {
        opacity: 0.8;
        filter: blur(2px);
    }
    50% {
        opacity: 0.7;
        filter: blur(1.5px);
    }
    75% {
        opacity: 0.9;
        filter: blur(2.5px);
    }
}

@keyframes fogDrift {
    0% {
        transform: translateX(0px) translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateX(15px) translateY(-20px) rotate(1deg);
    }
    66% {
        transform: translateX(-10px) translateY(15px) rotate(-1deg);
    }
    100% {
        transform: translateX(5px) translateY(-5px) rotate(0.5deg);
    }
}

@keyframes fogFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
        opacity: 0.4;
    }
    25% {
        transform: translateY(-20px) scale(1.1);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-10px) scale(0.9);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-30px) scale(1.05);
        opacity: 0.8;
    }
}

/* Fog Density Variations - Much More Visible */
.fog-light { 
    opacity: 0.4; 
    filter: brightness(1.2) blur(0.5px);
}
.fog-medium { 
    opacity: 0.6; 
    filter: brightness(1.1) blur(1px);
}
.fog-heavy { 
    opacity: 0.8; 
    filter: brightness(1.0) blur(1.5px);
}
.fog-very-heavy { 
    opacity: 0.95; 
    filter: brightness(0.9) blur(2px);
}

/* Cursor Chasing Spider - Desktop Only */
.cursor-spider {
    position: fixed;
    width: 80px;
    height: 80px;
    z-index: 9999;
    pointer-events: none;
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.8));
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform-origin: center center;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    transition: none;
    /* Firefox-specific optimizations */
    will-change: transform;
    backface-visibility: hidden;
    -moz-transform: translateZ(0);
    transform: translateZ(0);
}


/* Spider movement animation */
@keyframes spiderCrawl {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(2deg) scale(1.05);
    }
    50% {
        transform: rotate(0deg) scale(0.95);
    }
    75% {
        transform: rotate(-2deg) scale(1.02);
    }
}

/* Spider Toggle Button */
.spider-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: 2px solid #FF0000;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.spider-toggle:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: #FF6666;
    transform: scale(1.05);
}

.spider-toggle.disabled {
    background: rgba(0, 0, 0, 0.6);
    border-color: #666;
    color: #999;
}

.spider-toggle.disabled:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: #888;
    transform: none;
}

/* Hide spider on mobile devices */
@media screen and (max-width: 768px) {
    .cursor-spider {
        display: none !important;
    }
    
    .spider-toggle {
        display: none !important;
    }
}
