/* Bubble Background Effect */
.bubble-container {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, 
    rgba(52, 152, 219, 0.15) 0%, 
    rgba(46, 204, 113, 0.12) 50%, 
    rgba(155, 89, 182, 0.08) 100%);
  animation: float 20s infinite ease-in-out;
  box-shadow: 
    0 0 30px rgba(52, 152, 219, 0.1),
    inset 0 0 20px rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Bubble Sizes */
.bubble.tiny {
  width: 20px;
  height: 20px;
  animation-delay: 0s;
  animation-duration: 25s;
}

.bubble.small {
  width: 30px;
  height: 30px;
  animation-delay: 0s;
  animation-duration: 25s;
}

.bubble.medium {
  width: 60px;
  height: 60px;
  animation-delay: 5s;
  animation-duration: 30s;
}

.bubble.large {
  width: 100px;
  height: 100px;
  animation-delay: 10s;
  animation-duration: 35s;
}

.bubble.xlarge {
  width: 150px;
  height: 150px;
  animation-delay: 15s;
  animation-duration: 40s;
}

/* Bubble Animations for JavaScript */
@keyframes float {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0.3;
  }
  10% {
    opacity: 0.6;
  }
  50% {
    transform: translateY(-20vh) translateX(50px) rotate(180deg);
    opacity: 0.8;
  }
  90% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(100vh) translateX(-50px) rotate(360deg);
    opacity: 0.2;
  }
}

/* 3D All-Direction Animations */
@keyframes float3D {
  0% {
    transform: 
      translate3d(0, 100vh, 0) 
      translate3d(-100px, 0, 0) 
      scale(0.5) 
      rotate(0deg);
    opacity: 0.4;
  }
  10% {
    opacity: 0.8;
  }
  25% {
    transform: 
      translate3d(25vw, 70vh, 100px) 
      translate3d(50px, -50px, 0) 
      scale(0.8) 
      rotate(90deg);
  }
  50% {
    transform: 
      translate3d(50vw, 30vh, 0) 
      translate3d(-30px, -100px, 0) 
      scale(1) 
      rotate(180deg);
    opacity: 0.9;
  }
  75% {
    transform: 
      translate3d(75vw, 50vh, -100px) 
      translate3d(60px, -50px, 0) 
      scale(0.9) 
      rotate(270deg);
  }
  100% {
    transform: 
      translate3d(100vw, 100vh, 0) 
      translate3d(-100px, 0, 0) 
      scale(0.5) 
      rotate(360deg);
    opacity: 0.4;
  }
}

@keyframes float3DAlt1 {
  0% {
    transform: 
      translate3d(100vw, 100vh, 0) 
      translate3d(100px, 0, 0) 
      scale(0.5) 
      rotate(0deg);
    opacity: 0.4;
  }
  25% {
    transform: 
      translate3d(75vw, 40vh, 100px) 
      translate3d(-80px, -80px, 0) 
      scale(0.9) 
      rotate(120deg);
  }
  50% {
    transform: 
      translate3d(50vw, 10vh, -50px) 
      translate3d(100px, -120px, 0) 
      scale(1.1) 
      rotate(240deg);
    opacity: 0.9;
  }
  75% {
    transform: 
      translate3d(25vw, 60vh, 80px) 
      translate3d(-60px, -40px, 0) 
      scale(0.8) 
      rotate(320deg);
  }
  100% {
    transform: 
      translate3d(0, 100vh, 0) 
      translate3d(100px, 0, 0) 
      scale(0.5) 
      rotate(360deg);
    opacity: 0.4;
  }
}

@keyframes float3DAlt2 {
  0% {
    transform: 
      translate3d(50vw, 100vh, 0) 
      translate3d(0, 0, 0) 
      scale(0.6) 
      rotate(0deg);
    opacity: 0.3;
  }
  33% {
    transform: 
      translate3d(10vw, 20vh, 150px) 
      translate3d(120px, -80px, 0) 
      scale(1.2) 
      rotate(120deg);
    opacity: 0.9;
  }
  66% {
    transform: 
      translate3d(90vw, 60vh, -100px) 
      translate3d(-100px, -40px, 0) 
      scale(0.7) 
      rotate(240deg);
    opacity: 0.6;
  }
  100% {
    transform: 
      translate3d(50vw, 100vh, 0) 
      translate3d(0, 0, 0) 
      scale(0.6) 
      rotate(360deg);
    opacity: 0.3;
  }
}

@keyframes bubblePulse {
  0%, 100% {
    box-shadow: 
      0 0 40px rgba(52, 152, 219, 0.3),
      inset 0 0 30px rgba(255, 255, 255, 0.8);
  }
  50% {
    box-shadow: 
      0 0 60px rgba(46, 204, 113, 0.4),
      inset 0 0 40px rgba(255, 255, 255, 0.9),
      0 0 100px rgba(155, 89, 182, 0.2);
  }
}

@keyframes floatHorizontal {
  0% {
    transform: translateX(-100px) translateY(0) rotate(0deg);
  }
  50% {
    transform: translateX(100px) translateY(-50px) rotate(180deg);
  }
  100% {
    transform: translateX(-100px) translateY(0) rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 
      0 0 30px rgba(52, 152, 219, 0.1),
      inset 0 0 20px rgba(255, 255, 255, 0.5);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 
      0 0 40px rgba(46, 204, 113, 0.15),
      inset 0 0 25px rgba(255, 255, 255, 0.6);
  }
}

/* Interactive Bubbles (optional hover effect) */
.bubble.interactive {
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bubble.interactive:hover {
  transform: scale(1.2);
  box-shadow: 
    0 0 50px rgba(155, 89, 182, 0.2),
    inset 0 0 30px rgba(255, 255, 255, 0.7);
  animation-play-state: paused;
}

/* Bubble Groups for different sections */
.bubble-group-1 {
  background: linear-gradient(135deg, 
    rgba(52, 152, 219, 0.2) 0%, 
    rgba(46, 204, 113, 0.15) 100%);
}

.bubble-group-2 {
  background: linear-gradient(135deg, 
    rgba(155, 89, 182, 0.15) 0%, 
    rgba(52, 152, 219, 0.1) 100%);
}

.bubble-group-3 {
  background: linear-gradient(135deg, 
    rgba(46, 204, 113, 0.15) 0%, 
    rgba(241, 196, 15, 0.1) 100%);
}

/* Bubble Trail Effect */
.bubble-trail {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 70%,
    transparent 100%
  );
  animation: trailFade 2s infinite linear;
}

@keyframes trailFade {
  0% {
    opacity: 0;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

/* Special Laundry-themed Bubbles */
.bubble.soap {
  background: linear-gradient(135deg, 
    rgba(174, 214, 241, 0.25) 0%, 
    rgba(255, 255, 255, 0.2) 100%);
  animation-name: float3D, bubblePulse;
  animation-duration: 30s, 4s;
}

.bubble.water {
  background: linear-gradient(135deg, 
    rgba(52, 152, 219, 0.25) 0%, 
    rgba(86, 204, 242, 0.2) 100%);
  animation-name: float3DAlt1, bubblePulse;
  animation-duration: 28s, 5s;
}

.bubble.fabric {
  background: linear-gradient(135deg, 
    rgba(46, 204, 113, 0.2) 0%, 
    rgba(142, 68, 173, 0.15) 100%);
  animation-name: float3DAlt2, bubblePulse;
  animation-duration: 32s, 6s;
}

.bubble.detergent {
  background: linear-gradient(135deg, 
    rgba(241, 196, 15, 0.25) 0%, 
    rgba(243, 156, 18, 0.2) 100%);
  animation-name: float3D, bubblePulse;
  animation-duration: 26s, 7s;
}

/* Bubble Inner Glow */
.bubble::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 10%;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.3) 70%,
    transparent 100%
  );
  filter: blur(5px);
}

.bubble::after {
  content: '';
  position: absolute;
  top: 20%;
  left: 20%;
  width: 20%;
  height: 20%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  filter: blur(8px);
  animation: sparkle 3s infinite ease-in-out;
}

@keyframes sparkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.2);
  }
}

/* Animated bubble shimmer */
@keyframes shimmer {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.bubble.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .bubble {
    animation-duration: 15s !important;
  }
  
  .bubble.large {
    width: 80px;
    height: 80px;
  }
  
  .bubble.xlarge {
    width: 120px;
    height: 120px;
  }
  
  /* Reduce number of bubbles on mobile */
  .bubble:nth-child(n+8) {
    display: none;
  }
}

/* For high-performance devices */
@media (prefers-reduced-motion: no-preference) {
  .bubble {
    will-change: transform, opacity;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .bubble {
    animation: none;
    opacity: 0.1;
  }
}