"use client";

import { ContactShadows, Environment as DreiEnvironment, Sky } from "@react-three/drei";

export default function Environment() {
  return (
    <>
      <color attach="background" args={["#dff3ff"]} />

      <fog attach="fog" args={["#dff3ff", 28, 58]} />

      <ambientLight intensity={1.25} />

      <hemisphereLight
        intensity={1.4}
        color="#ffffff"
        groundColor="#b7c9ad"
      />

      <directionalLight
        position={[12, 18, 10]}
        intensity={3.2}
        color="#fff4d6"
        castShadow
        shadow-mapSize-width={2048}
        shadow-mapSize-height={2048}
        shadow-camera-near={0.5}
        shadow-camera-far={55}
        shadow-camera-left={-20}
        shadow-camera-right={20}
        shadow-camera-top={20}
        shadow-camera-bottom={-20}
        shadow-bias={-0.00012}
      />

      <directionalLight
        position={[-10, 8, -12]}
        intensity={0.8}
        color="#8fd8ff"
      />

      <Sky
        distance={450000}
        sunPosition={[8, 5, 10]}
        inclination={0.52}
        azimuth={0.2}
        mieCoefficient={0.004}
        mieDirectionalG={0.82}
        rayleigh={1.6}
        turbidity={7}
      />

      <DreiEnvironment preset="city" environmentIntensity={0.65} />

      <ContactShadows
        position={[0, 0.01, 0]}
        opacity={0.34}
        scale={34}
        blur={2.8}
        far={18}
        resolution={1024}
      />
    </>
  );
}
