/**
 * CANVAS BACKGROUND STYLES
 * Styling for animated background canvas
 */

/* Canvas Container */
#backgroundCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.dark-mode #backgroundCanvas {
  opacity: 0.3;
}

/* Canvas Instruction Text */
.canvas-instruction {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  border-radius: 25px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 100;
  opacity: 0;
  animation: instructionFade 5s ease-in-out;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@keyframes instructionFade {
  0%,
  100% {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  10%,
  90% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Hide instruction on mobile */
@media (max-width: 768px) {
  .canvas-instruction {
    display: none;
  }
}

/* Reduce canvas opacity on scroll */
body.scrolled #backgroundCanvas {
  opacity: 0.3;
}

.dark-mode.scrolled #backgroundCanvas {
  opacity: 0.15;
}

/* Performance optimization - disable on very small screens */
@media (max-width: 480px) {
  #backgroundCanvas {
    display: none;
  }
}

/* Accessibility - respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  #backgroundCanvas {
    display: none;
  }

  .canvas-instruction {
    display: none;
  }
}

/* Loading state */
#backgroundCanvas.loading {
  opacity: 0;
}

/* Canvas overlay gradient (optional enhancement) */
#backgroundCanvas::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at 50% 50%,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 100%
  );
  pointer-events: none;
}

.dark-mode #backgroundCanvas::after {
  background: radial-gradient(
    circle at 50% 50%,
    transparent 0%,
    rgba(0, 0, 0, 0.3) 100%
  );
}
