/* Dark Interstellar Atmosphere - Deep Space Polish */

.crystal-bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  
  /* Using the high-quality background copy */
  background-image: url('../../images/Commite_bg copy.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  
  /* Ensuring maximum sharpness */
  image-rendering: -webkit-optimize-contrast;

  /* Simulating life in the crystals */
  animation: majesticDrift 40s ease-in-out infinite alternate, crystalBreathe 10s infinite ease-in-out;
  will-change: transform, filter;
}

@keyframes majesticDrift {
  0% { transform: scale(1) translate(0, 0) rotate(0deg); }
  100% { transform: scale(1.04) translate(-1%, -0.5%) rotate(0.1deg); }
}

@keyframes crystalBreathe {
  0%, 100% { filter: brightness(1) contrast(1); }
  50% { filter: brightness(1.1) contrast(1.05); }
}

/* --- New Glass & Crystal Animations --- */

/* Sweeping Light Refraction (Glint) */
.crystal-bg-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.05) 45%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.05) 55%,
    transparent 70%
  );
  transform: skewX(-20deg);
  animation: glassGlint 15s infinite ease-in-out;
  pointer-events: none;
  z-index: 2;
}

@keyframes glassGlint {
  0% { left: -150%; }
  20% { left: 150%; }
  100% { left: 150%; }
}

/* Floating Crystal Shards (Abstract pieces) */
.crystal-bg-container::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 100px 100px;
  animation: shardDrift 60s linear infinite;
  opacity: 0.5;
  pointer-events: none;
}

@keyframes shardDrift {
  from { background-position: 0 0; }
  to { background-position: 500px 1000px; }
}

/* Individual Crystal Sparkles (Scintillements) */
.crystal-sparkle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 15px 2px rgba(255, 255, 255, 0.9);
  animation: sparklePulse 5s infinite ease-in-out;
  pointer-events: none;
  z-index: 5;
}

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

@keyframes spaceShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Subtler Neon Rose Mist - Opacity reduced for depth without distraction */
.neon-mist {
  position: absolute;
  width: 100vw;
  height: 100vh;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 0, 127, 0.08) 0%, transparent 75%);
  filter: blur(150px);
  z-index: 0;
  pointer-events: none;
  animation: mistFloat 40s ease-in-out infinite alternate;
}

.mist-1 { top: -20%; left: -20%; }
.mist-2 { bottom: -20%; right: -20%; animation-delay: -15s; }
.mist-3 { top: 30%; left: 20%; animation-duration: 80s; opacity: 0.4; }

@keyframes mistFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(150px, 80px) scale(1.1); }
  100% { transform: translate(-80px, -150px) scale(0.95); }
}

#bgCrystalCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Highly Discrete corner glows */
.neon-glow-sphere {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  animation: pulseGlow 15s ease-in-out infinite alternate;
}

.glow-1 { top: -150px; left: -150px; background: radial-gradient(circle, rgba(138, 43, 226, 0.03) 0%, transparent 70%); }
.glow-2 { bottom: -150px; right: -150px; background: radial-gradient(circle, rgba(255, 0, 127, 0.02) 0%, transparent 70%); }

@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 0.2; }
  100% { transform: scale(1.2); opacity: 0.4; }
}

/* Dynamic Archive Mist */
.dynamic-archive-mist {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: 
        radial-gradient(circle at 20% 30%, var(--mist-color-1, rgba(0, 191, 255, 0.05)) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, var(--mist-color-2, rgba(255, 69, 0, 0.05)) 0%, transparent 50%);
    filter: blur(100px);
    transition: background 0.5s ease;
}

/* Shooting Stars Effect - Premium Galaxy Style */
.shooting-stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    perspective: 1000px;
}

.shooting-star {
    position: absolute;
    width: 1px; /* Very fine line */
    height: 1px;
    background: transparent;
    border-radius: 50%;
    opacity: 0.6;
}

.shooting-star::before {
    content: "";
    position: absolute;
    top: 0;
    width: 100px; /* Fine trail */
    height: 1px;
    background: linear-gradient(90deg, var(--star-color, #fff), transparent);
    transform: translateX(-100%);
}

/* Directional variants and Animations */
.star-dir-1 { animation: shoot-diag-1 4s linear infinite; }
.star-dir-2 { animation: shoot-diag-2 6s linear infinite; }
.star-dir-3 { animation: shoot-diag-3 5s linear infinite; }
.star-dir-4 { animation: shoot-diag-4 7s linear infinite; }

@keyframes shoot-diag-1 {
    0% { transform: translate(100vw, -10vh) rotate(-45deg); opacity: 0; }
    10% { opacity: 1; }
    100% { transform: translate(-20vw, 110vh) rotate(-45deg); opacity: 0; }
}

@keyframes shoot-diag-2 {
    0% { transform: translate(-10vw, -10vh) rotate(45deg); opacity: 0; }
    15% { opacity: 1; }
    100% { transform: translate(110vw, 110vh) rotate(45deg); opacity: 0; }
}

@keyframes shoot-diag-3 {
    0% { transform: translate(110vw, 50vh) rotate(-30deg); opacity: 0; }
    5% { opacity: 0.8; }
    100% { transform: translate(-10vw, 80vh) rotate(-30deg); opacity: 0; }
}

@keyframes shoot-diag-4 {
    0% { transform: translate(-10vw, 20vh) rotate(30deg); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translate(110vw, 50vh) rotate(30deg); opacity: 0; }
}

/* Edition Specific mist */
.edition-mist {
    position: absolute;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    filter: blur(150px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.15;
    mix-blend-mode: screen;
}

.mist-XXXI {
    background: radial-gradient(circle, rgba(0, 242, 255, 0.4) 0%, transparent 70%);
}

.mist-XXX {
    background: radial-gradient(circle, rgba(255, 69, 0, 0.4) 0%, transparent 70%);
}
