/* ============================================
   Futuristic Bubble Background Animation
   Independent layer - does not affect existing code
   ============================================ */

.bubble-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2; /* Behind everything, including animated-bg */
    pointer-events: none; /* Allow clicks to pass through */
    overflow: hidden;
    isolation: isolate; /* Create new stacking context */
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(0, 240, 255, 0.4), rgba(255, 0, 255, 0.3));
    backdrop-filter: blur(1px);
    will-change: transform, opacity;
    transform: translateZ(0); /* GPU acceleration */
    pointer-events: auto; /* Enable mouse interaction */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bubble size variations */
.bubble.size-small {
    width: 40px;
    height: 40px;
    filter: blur(2px);
}

.bubble.size-medium {
    width: 80px;
    height: 80px;
    filter: blur(3px);
}

.bubble.size-large {
    width: 120px;
    height: 120px;
    filter: blur(4px);
}

.bubble.size-xlarge {
    width: 180px;
    height: 180px;
    filter: blur(5px);
}

/* Color variations with gradient */
.bubble.color-1 {
    background: radial-gradient(circle at 30% 30%, 
        rgba(0, 240, 255, 0.4), 
        rgba(0, 240, 255, 0.2),
        rgba(255, 0, 255, 0.3));
}

.bubble.color-2 {
    background: radial-gradient(circle at 30% 30%, 
        rgba(255, 0, 255, 0.4), 
        rgba(255, 0, 255, 0.2),
        rgba(0, 255, 136, 0.3));
}

.bubble.color-3 {
    background: radial-gradient(circle at 30% 30%, 
        rgba(0, 255, 136, 0.4), 
        rgba(0, 255, 136, 0.2),
        rgba(0, 240, 255, 0.3));
}

.bubble.color-4 {
    background: radial-gradient(circle at 30% 30%, 
        rgba(0, 240, 255, 0.3), 
        rgba(255, 0, 255, 0.3),
        rgba(0, 255, 136, 0.2));
}

/* Floating animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
    }
    25% {
        transform: translateY(-20px) translateX(10px) scale(1.05);
    }
    50% {
        transform: translateY(-40px) translateX(-10px) scale(0.95);
    }
    75% {
        transform: translateY(-20px) translateX(5px) scale(1.02);
    }
}

/* Color shift animation */
@keyframes colorShift {
    0%, 100% {
        filter: hue-rotate(0deg) brightness(1);
    }
    25% {
        filter: hue-rotate(90deg) brightness(1.1);
    }
    50% {
        filter: hue-rotate(180deg) brightness(0.9);
    }
    75% {
        filter: hue-rotate(270deg) brightness(1.05);
    }
}

/* Apply animations */
.bubble {
    animation: float 15s ease-in-out infinite, colorShift 20s ease-in-out infinite;
}

/* Stagger animation delays for natural movement */
.bubble:nth-child(1) { animation-delay: 0s, 0s; }
.bubble:nth-child(2) { animation-delay: 2s, 3s; }
.bubble:nth-child(3) { animation-delay: 4s, 6s; }
.bubble:nth-child(4) { animation-delay: 1s, 2s; }
.bubble:nth-child(5) { animation-delay: 3s, 4s; }
.bubble:nth-child(6) { animation-delay: 5s, 8s; }
.bubble:nth-child(7) { animation-delay: 1.5s, 1s; }
.bubble:nth-child(8) { animation-delay: 3.5s, 5s; }
.bubble:nth-child(9) { animation-delay: 2.5s, 7s; }
.bubble:nth-child(10) { animation-delay: 4.5s, 9s; }
.bubble:nth-child(11) { animation-delay: 0.5s, 1.5s; }
.bubble:nth-child(12) { animation-delay: 2.5s, 3.5s; }
.bubble:nth-child(13) { animation-delay: 4.5s, 5.5s; }
.bubble:nth-child(14) { animation-delay: 1.5s, 2.5s; }
.bubble:nth-child(15) { animation-delay: 3.5s, 4.5s; }

/* Repel effect on hover */
.bubble.repelling {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile optimization */
@media (max-width: 768px) {
    .bubble.size-xlarge {
        width: 100px;
        height: 100px;
    }
    
    .bubble.size-large {
        width: 70px;
        height: 70px;
    }
    
    .bubble.size-medium {
        width: 50px;
        height: 50px;
    }
    
    .bubble.size-small {
        width: 30px;
        height: 30px;
    }
    
    .bubble {
        filter: blur(2px);
        animation-duration: 20s, 25s;
    }
    
    /* Reduce number of bubbles on mobile */
    .bubble:nth-child(n+10) {
        display: none;
    }
}

/* Small mobile devices - further reduce animations */
@media (max-width: 480px) {
    .bubble {
        animation-duration: 25s, 30s;
        opacity: 0.6;
    }
    
    /* Further reduce bubbles */
    .bubble:nth-child(n+7) {
        display: none;
    }
}

/* Performance optimization */
@media (prefers-reduced-motion: reduce) {
    .bubble {
        animation: none;
    }
}

