/* UaG-Soon Coming Soon Styles */
:root {
  --ug-bg-900: #0a0a0f;
  --ug-bg-800: #11111a;
  --ug-gold-soft: rgba(212, 175, 55, 0.22);
  --ug-gold-glow: rgba(212, 175, 55, 0.35);
  --text-color: #e8e8e8;
}

/* Import display font from theme if available */
@font-face {
  font-family: 'UG-Display';
  src: url('../../../themes/undergroundandgroovy/assets/fonts/police.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html, body {
  height: 100%;
}

body.uag-soon-body {
  margin: 0;
  font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text-color);
  background:
    radial-gradient(ellipse at top, rgba(15, 15, 23, 0.9) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(25, 35, 45, 0.8) 0%, transparent 50%),
    linear-gradient(135deg, #0a0a0f 0%, #151520 50%, #1a1a25 100%);
  background-attachment: fixed;
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
}

/* Clouds background, using CSS variables set inline from PHP */
.uag-clouds {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 1; /* above star pseudo-elements, below content */
  pointer-events: none;
}

/* Disable old backdrop, but keep ::after for comet */
.uag-clouds::before { display: none; }

/* Comet: fast diagonal sweep R->L, top-right to bottom-left */
.uag-clouds::after {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 160px; height: 2px;
  pointer-events: none;
  z-index: 0; /* derrière les nuages dans le conteneur */
  background: linear-gradient(90deg,
    rgba(255,255,255,0.95) 0%,
    rgba(255,255,255,0.6) 12%,
    rgba(255,255,255,0.0) 100%);
  border-radius: 2px;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.5)) drop-shadow(0 0 14px rgba(120,160,255,0.35));
  transform: translate3d(20vw, -10vh, 0) rotate(-35deg);
  animation: ug-comet-run 12s linear infinite;
  opacity: 0; /* invisible par défaut (gérée par l'anim) */
}

/* Soft twinkle to simulate subtle flicker */
@keyframes twinkle {
  0%   { opacity: 0.16; filter: brightness(0.9); }
  35%  { opacity: 0.30; filter: brightness(1); }
  70%  { opacity: 0.22; filter: brightness(0.95); }
  100% { opacity: 0.28; filter: brightness(1); }
}

/* DOM-based particles (like theme), positioned behind cloud */
.uag-clouds .particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  z-index: 0; /* behind cloud */
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.25));
}

/* Upward particles (start bottom) */
.uag-clouds .particle.up {
  bottom: -12px;
  animation: floatUp var(--dur, 14s) linear var(--delay, 0s) infinite,
             twinkle calc(var(--dur,14s) / 4) ease-in-out infinite alternate;
}

/* Downward particles (start top) */
.uag-clouds .particle.down {
  top: -12px;
  animation: floatDown var(--dur, 12s) linear var(--delay, 0s) infinite,
             twinkle calc(var(--dur,12s) / 4) ease-in-out infinite alternate;
}

/* Variations using nth-of-type so the preceding .cloud div doesn't affect indices */
.uag-clouds span.particle:nth-of-type(1)  { left: 8%;  width: 3px; height: 3px; background: radial-gradient(circle, rgba(255,255,255,0.65) 0%, transparent 70%);  --dur: 12s; --delay: 0s;   --x:  60px; }
.uag-clouds span.particle:nth-of-type(2)  { left: 16%; width: 2px; height: 2px; background: radial-gradient(circle, rgba(255,255,255,0.5) 0%,  transparent 70%);  --dur: 16s; --delay: 1.2s; --x:  90px; }
.uag-clouds span.particle:nth-of-type(3)  { left: 24%; width: 4px; height: 4px; background: radial-gradient(circle, rgba(255,255,255,0.55) 0%, transparent 70%);  --dur: 14s; --delay: 2.6s; --x: 110px; }
.uag-clouds span.particle:nth-of-type(4)  { left: 32%; width: 2px; height: 2px; background: radial-gradient(circle, rgba(255,255,255,0.45) 0%, transparent 70%);  --dur: 18s; --delay: 0.8s; --x:  70px; }
.uag-clouds span.particle:nth-of-type(5)  { left: 40%; width: 3px; height: 3px; background: radial-gradient(circle, rgba(255,255,255,0.6)  0%, transparent 70%);  --dur: 13s; --delay: 3.0s; --x:  95px; }
.uag-clouds span.particle:nth-of-type(6)  { left: 48%; width: 2px; height: 2px; background: radial-gradient(circle, rgba(255,255,255,0.5)  0%, transparent 70%);  --dur: 17s; --delay: 1.6s; --x:  80px; }
.uag-clouds span.particle:nth-of-type(7)  { left: 56%; width: 4px; height: 4px; background: radial-gradient(circle, rgba(255,255,255,0.55) 0%, transparent 70%);  --dur: 15s; --delay: 2.1s; --x: 120px; }
.uag-clouds span.particle:nth-of-type(8)  { left: 64%; width: 2px; height: 2px; background: radial-gradient(circle, rgba(255,255,255,0.5)  0%, transparent 70%);  --dur: 19s; --delay: 0.4s; --x:  85px; }
.uag-clouds span.particle:nth-of-type(9)  { left: 72%; width: 3px; height: 3px; background: radial-gradient(circle, rgba(255,255,255,0.45) 0%, transparent 70%);  --dur: 11s; --delay: 2.9s; --x: 100px; }
.uag-clouds span.particle:nth-of-type(10) { left: 80%; width: 2px; height: 2px; background: radial-gradient(circle, rgba(255,255,255,0.55) 0%, transparent 70%);  --dur: 16s; --delay: 1.0s; --x:  75px; }
.uag-clouds span.particle:nth-of-type(11) { left: 88%; width: 3px; height: 3px; background: radial-gradient(circle, rgba(255,255,255,0.6)  0%, transparent 70%);  --dur: 14s; --delay: 3.4s; --x: 105px; }
.uag-clouds span.particle:nth-of-type(12) { left: 20%; width: 2px; height: 2px; background: radial-gradient(circle, rgba(255,255,255,0.5)  0%, transparent 70%);  --dur: 18s; --delay: 2.2s; --x:  90px; }

@keyframes floatUp {
  0%   { bottom: -12px; opacity: 0;   transform: translateX(0) rotate(0deg); }
  5%   {                 opacity: 0.8; }
  90%  {                 opacity: 0.8; }
  100% { bottom: 100vh;  opacity: 0;   transform: translateX(var(--x, 100px)) rotate(360deg); }
}

@keyframes floatDown {
  0%   { top: -12px; opacity: 0;   transform: translateX(0) rotate(0deg); }
  5%   {               opacity: 0.8; }
  90%  {               opacity: 0.8; }
  100% { top: 100vh;   opacity: 0;   transform: translateX(calc(var(--x, 100px) * -1)) rotate(-360deg); }
}

.cloud {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  opacity: 0.28;
  z-index: 1; /* above particles */
  background-repeat: no-repeat; /* single cloud only */
  /* reduce visual size by ~50% */
  background-size: 450px auto;
  transform: translateZ(0);
}

.cloud1 { 
  background-image: var(--cloud1-url);
  background-position: 50% var(--cloudY1, 12%);
  will-change: transform;
  animation: moveCloudX 60s linear infinite;
}

/* Single cloud continuous pass R->L */
@keyframes moveCloudX {
  0%   { transform: translateX(60vw); }
  100% { transform: translateX(-60vw); }
}

/* (no entrance animation; cloud is visible immediately) */

/* Foreground stage */
.uag-stage {
  position: relative;
  z-index: 2; /* above clouds */
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
}

/* Card */
.uag-card {
  background: linear-gradient(180deg, rgba(20,20,28,0.85), rgba(10,10,16,0.85));
  border-radius: 14px;
  padding: 36px 28px;
  width: min(720px, calc(100% - 24px));
  border: 1px solid var(--ug-gold-soft);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.02);
  position: relative;
  overflow: hidden;
}

/* Decorative subtle corners */
.uag-card::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, var(--ug-gold-soft), transparent 20%) top left / 120px 1px no-repeat,
    linear-gradient(180deg, var(--ug-gold-soft), transparent 20%) top left / 1px 120px no-repeat,
    linear-gradient(270deg, var(--ug-gold-soft), transparent 20%) top right / 120px 1px no-repeat,
    linear-gradient(180deg, var(--ug-gold-soft), transparent 20%) top right / 1px 120px no-repeat,
    linear-gradient(90deg, var(--ug-gold-soft), transparent 20%) bottom left / 120px 1px no-repeat,
    linear-gradient(0deg, var(--ug-gold-soft), transparent 20%) bottom left / 1px 120px no-repeat,
    linear-gradient(270deg, var(--ug-gold-soft), transparent 20%) bottom right / 120px 1px no-repeat,
    linear-gradient(0deg, var(--ug-gold-soft), transparent 20%) bottom right / 1px 120px no-repeat;
  opacity: 0.7;
}

/* Logo area */
.uag-logo { display: flex; justify-content: center; margin-bottom: 16px; }
.uag-logo img { max-height: 42px; width: auto; filter: drop-shadow(0 0 16px rgba(100, 181, 246, 0.28)); }

/* Titles */
.ug-display-title { font-family: 'UG-Display', 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, sans-serif; text-transform: uppercase; letter-spacing: 0.2em; }
.uag-title {
  font-size: clamp(1.8rem, 2vw, 2rem);
  font-weight: 400;
  text-align: center;
  margin: 8px auto 14px;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 30%, #90caf9 60%, #64b5f6 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(144, 202, 249, 0.35);
}

/* Text */
.uag-text { color: #c5c5c5; text-align: center; max-width: 62ch; margin: 0 auto; letter-spacing: 0.3px; }
.uag-text p { margin: 0.5rem 0; }

/* Rotator crossfade styles */
.uag-rotator { position: relative; min-height: 120px; }
.uag-rotator .uag-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 600ms ease-in-out;
}
.uag-rotator .uag-slide.active { opacity: 1; position: relative; }

/* Etoiles: deux couches derrière les nuages */
body.uag-soon-body::before,
body.uag-soon-body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* Nebula gradients + sparse stars (seamless SVG). Order matters: gradients first, stars last */
  background-image:
    radial-gradient(1000px 700px at 65% 28%, rgba(88, 46, 179, 0.20) 0%, rgba(22, 10, 40, 0.12) 35%, rgba(0,0,0,0) 65%),
    radial-gradient(900px 600px at 18% 72%, rgba(0, 153, 255, 0.18) 0%, rgba(0,0,0,0) 60%),
    url('../../images/étoile.svg');
  background-repeat: no-repeat, no-repeat, repeat;
  background-position: center, center, 0 0;
  z-index: 0; /* sous .uag-clouds qui sera z-index:1 */
  opacity: 0.32; /* très discret */
}

body.uag-soon-body::before {
  background-size: cover, cover, 600px 600px; /* grandes nébuleuses + étoiles très espacées */
  animation: ug-twinkle-1 10s ease-in-out infinite, ug-drift-chaos-1 28s linear infinite alternate, ug-rotate-cw 240s linear infinite;
  transform-origin: 50% 50%;
  will-change: transform;
}

body.uag-soon-body::after {
  background-size: cover, cover, 900px 900px; /* encore plus espacé */
  opacity: 0.22;
  animation: ug-twinkle-2 16s ease-in-out infinite, ug-drift-chaos-2 36s linear infinite alternate, ug-rotate-cw 360s linear infinite;
  transform-origin: 50% 50%;
  will-change: transform;
}

@keyframes ug-twinkle-1 {
  0%,100% { filter: brightness(0.95); }
  50%     { filter: brightness(1.08); }
}
@keyframes ug-twinkle-2 {
  0%,100% { filter: brightness(0.9); }
  50%     { filter: brightness(1.05); }
}

/* Chaotic multi-step drift of the star tile (affects only the SVG layer index) */
@keyframes ug-drift-chaos-1 {
  0%   { background-position: center center, center center, 0px 0px; }
  12%  { background-position: center center, center center, -4px 3px; }
  25%  { background-position: center center, center center, 6px -5px; }
  38%  { background-position: center center, center center, -2px -1px; }
  51%  { background-position: center center, center center, 8px 4px; }
  64%  { background-position: center center, center center, -7px 6px; }
  77%  { background-position: center center, center center, 3px -6px; }
  90%  { background-position: center center, center center, -5px 2px; }
  100% { background-position: center center, center center, 0px 0px; }
}
@keyframes ug-drift-chaos-2 {
  0%   { background-position: center center, center center, 0px 0px; }
  15%  { background-position: center center, center center, 5px 2px; }
  30%  { background-position: center center, center center, -3px 7px; }
  45%  { background-position: center center, center center, 9px -4px; }
  60%  { background-position: center center, center center, -8px -3px; }
  75%  { background-position: center center, center center, 4px 6px; }
  90%  { background-position: center center, center center, -6px 1px; }
  100% { background-position: center center, center center, 0px 0px; }
}

/* Slow clockwise rotation for the star field */
@keyframes ug-rotate-cw {
  /* add scale so rotated layer always covers viewport and avoids edge reveal */
  0%   { transform: scale(1.35) rotate(0deg); }
  100% { transform: scale(1.35) rotate(360deg); }
}

/* Comet pass: mostly invisible, brief bright sweep */
@keyframes ug-comet-run {
  0%   { opacity: 0; transform: translate3d(24vw, -14vh, 0) rotate(-35deg); }
  5%   { opacity: 1; transform: translate3d(14vw, -2vh, 0) rotate(-35deg); }
  8%   { opacity: 0.9; transform: translate3d(8vw, 6vh, 0) rotate(-35deg); }
  12%  { opacity: 0; transform: translate3d(0vw, 16vh, 0) rotate(-35deg); }
  70%  { opacity: 0; transform: translate3d(-60vw, 70vh, 0) rotate(-35deg); }
  100% { opacity: 0; transform: translate3d(-120vw, 120vh, 0) rotate(-35deg); }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  body.uag-soon-body::before,
  body.uag-soon-body::after { animation: none !important; }
  .uag-clouds::after { display: none !important; }
  .uag-clouds .particle { animation: none !important; opacity: 0.18; }
  .cloud1 { animation: none !important; }
  .uag-rotator .uag-slide { transition: none !important; }
}