/**
 * FPA SaaS - 3D Background Styles
 * Overlay layers for Three.js canvas
 */

/* Base background layer with gradients */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 255, 136, 0.05) 0%, transparent 70%),
    linear-gradient(180deg, #030712 0%, #0a1628 50%, #030712 100%);
  pointer-events: none;
}

/* Noise texture overlay */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Vignette overlay */
#fpa-vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 0%, transparent 50%, rgba(3, 7, 18, 0.4) 100%);
}

/* Three.js container */
#fpa-background {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1 !important;
  pointer-events: none !important;
}

#fpa-background canvas {
  display: block;
}

/* Ensure body has dark background as fallback */
body {
  background-color: #030712;
  min-height: 100vh;
}

/* Make sure main content is above background */
#app,
.navbar,
main,
.hero,
.section,
footer {
  position: relative;
  z-index: 1;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  #fpa-background {
    display: none;
  }

  body::before {
    background:
      radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
      radial-gradient(ellipse at 80% 80%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
      linear-gradient(180deg, #030712 0%, #0a1628 50%, #030712 100%);
  }
}

/* Mobile optimization - slightly dimmer to ensure readability */
@media (max-width: 768px) {
  body::before {
    background:
      radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
      radial-gradient(ellipse at 80% 80%, rgba(0, 212, 255, 0.07) 0%, transparent 50%),
      linear-gradient(180deg, #030712 0%, #0a1628 50%, #030712 100%);
  }
}
