/* ==========================================================================
   IIEC OS — Animation System & Visual Effects Stylesheet
   Based on animation.md specification
   ========================================================================== */

/* 1. Multi-Stage Page Loader */
.page-loader {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #05070f 0%, #0a0d18 50%, #05070f 100%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
              visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.02);
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Pulsing Logo Shadow */
.loader-logo {
  width: 90px; height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(245, 165, 36, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  animation: loader-pulse 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loader-logo img {
  width: 75px;
  height: auto;
  object-fit: contain;
}

@keyframes loader-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(255, 183, 3, 0.3)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 30px rgba(255, 183, 3, 0.6)); }
}

.loader-bar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Staggered Dot Wave */
.loader-dots-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 35px;
}

.loader-dot {
  width: 12px; height: 12px;
  background: linear-gradient(135deg, #ffb703, #ffd166);
  border-radius: 50%;
  animation: dotWave 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loader-dot:nth-child(1) { animation-delay: 0s; }
.loader-dot:nth-child(2) { animation-delay: 0.12s; }
.loader-dot:nth-child(3) { animation-delay: 0.24s; }
.loader-dot:nth-child(4) { animation-delay: 0.36s; }
.loader-dot:nth-child(5) { animation-delay: 0.48s; }

@keyframes dotWave {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.4; }
  40%, 60% { transform: translateY(-18px) scale(1.15); opacity: 1; box-shadow: 0 0 25px rgba(255, 183, 3, 0.7); }
}

/* Shimmer Progress Track */
.loader-bar-wrapper {
  width: 320px; height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  overflow: hidden;
}

.loader-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ffb703, #ffd166, #ffb703);
  background-size: 200% 100%;
  border-radius: 100px;
  transition: width 0.3s ease-out;
  animation: loader-shimmer 1.5s ease-in-out infinite;
}

@keyframes loader-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loader-info-row {
  font-family: var(--font-bebas);
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.loader-percentage-num {
  color: var(--color-accent);
}

/* 2. Particle Canvas Network */
#particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

/* 3. Glowing Rainbow Announcement Header Bar */
.announcement-bar {
  position: relative;
  z-index: 301;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 1.5rem;
  background: linear-gradient(90deg, #ff0844, #ffb199, #7b2ff7, #00d4ff, #ff0844);
  background-size: 300% 100%;
  animation: announceGradient 6s linear infinite;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(255, 8, 68, 0.4);
}

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

.announcement-shimmer {
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: announceShimmer 3s ease-in-out infinite;
}

@keyframes announceShimmer {
  0% { left: -100%; }
  100% { left: 200%; }
}

.announcement-bar-content {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.announcement-pulse {
  width: 10px; height: 10px;
  background: #fff;
  border-radius: 50%;
  animation: announcePulse 1s ease-in-out infinite;
}

@keyframes announcePulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 8px rgba(255,255,255,0.8); }
  50% { opacity: 0.6; transform: scale(1.5); box-shadow: 0 0 16px rgba(255,255,255,1); }
}

.announcement-cta {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
}

/* 4. Ambient Glowing Orbs */
.glow-orb-wrapper {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 165, 36, 0.15) 0%, rgba(245, 165, 36, 0.04) 40%, transparent 70%);
  filter: blur(60px);
  transform: translate(-50%, -50%);
  top: 30%; left: 50%;
  transition: transform 0.1s ease-out;
}

/* 5. Scroll Entrance & Viewport Reveal Classes */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.7s ease;
}

[data-animate="scale"] { transform: scale(0.92); }
[data-animate="left"] { transform: translateX(-40px); }
[data-animate="right"] { transform: translateX(40px); }

[data-animate].in-view {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
  filter: blur(0);
}

/* Reusable Keyframe Library */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.float-anim {
  animation: float 4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 183, 3, 0.3); }
  50% { box-shadow: 0 0 40px rgba(255, 183, 3, 0.6), 0 0 60px rgba(255, 183, 3, 0.3); }
}

.glow-anim {
  animation: glowPulse 3s ease-in-out infinite;
}

/* ========================================================================
   ANIMATION RESPONSIVE OVERRIDES
   ======================================================================== */

@media (max-width: 1024px) {
  .announcement-bar {
    padding: 8px 1rem;
    font-size: 0.8rem;
  }

  .announcement-cta {
    font-size: 0.7rem;
    padding: 2px 8px;
  }
}

@media (max-width: 640px) {
  /* Loader compact */
  .loader-logo {
    width: 70px;
    height: 70px;
  }

  .loader-logo img {
    width: 55px;
  }

  .loader-content {
    gap: 1rem;
  }

  .loader-dots-wrapper {
    gap: 6px;
    height: 28px;
  }

  .loader-dot {
    width: 9px;
    height: 9px;
  }

  .loader-bar-wrapper {
    width: 220px;
    height: 3px;
  }

  .loader-info-row {
    font-size: 1rem;
  }

  /* Reduce particle density on mobile for perf */
  #particle-canvas {
    opacity: 0.5;
  }

  /* Smaller announcement bar */
  .announcement-bar {
    padding: 6px 0.75rem;
    font-size: 0.72rem;
  }

  .announcement-pulse {
    width: 7px;
    height: 7px;
  }

  .announcement-text {
    font-size: 0.72rem;
  }

  .announcement-cta {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .announcement-bar-content {
    gap: 6px;
  }

  /* Glow orbs smaller */
  .glow-orb {
    width: 300px;
    height: 300px;
    filter: blur(40px);
  }

  /* Scroll animation distances reduced */
  [data-animate] {
    transform: translateY(20px);
  }

  [data-animate="left"] { transform: translateX(-20px); }
  [data-animate="right"] { transform: translateX(20px); }
  [data-animate="scale"] { transform: scale(0.95); }
}

@media (max-width: 400px) {
  .loader-logo {
    width: 60px;
    height: 60px;
  }

  .loader-logo img {
    width: 45px;
  }

  .loader-bar-wrapper {
    width: 180px;
  }

  .announcement-bar {
    padding: 5px 0.5rem;
    font-size: 0.68rem;
  }
}

