/* ==========================================
   AD NOVA - ANIMATIONS SYSTEM
   ========================================== */

/* ==========================================
   KEYFRAMES
   ========================================== */

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

@keyframes logo-pulse {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(255,46,159,0.5)); }
  50% { filter: drop-shadow(0 0 40px rgba(0,229,255,0.5)); }
}

@keyframes loading-bar {
  0% { width: 0%; }
  30% { width: 40%; }
  70% { width: 75%; }
  100% { width: 100%; }
}

@keyframes float1 {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  33% { transform: translate(30px,-20px) rotate(5deg); }
  66% { transform: translate(-20px, 15px) rotate(-3deg); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  50% { transform: translate(-40px, 20px) rotate(-5deg); }
}

@keyframes float-card {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(1deg); }
}

@keyframes float-card2 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(-1deg); }
}

@keyframes neon-border-pulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255,46,159,0.3), 0 0 20px rgba(255,46,159,0.15), inset 0 0 10px rgba(255,46,159,0.05);
    border-color: rgba(255,46,159,0.4);
  }
  50% {
    box-shadow: 0 0 20px rgba(0,229,255,0.4), 0 0 40px rgba(0,229,255,0.2), inset 0 0 20px rgba(0,229,255,0.05);
    border-color: rgba(0,229,255,0.5);
  }
}

@keyframes counter-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes progress-glow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes scan-line {
  0% { top: -2px; }
  100% { top: 100%; }
}

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

@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes dash-draw {
  from { stroke-dashoffset: 251; }
  to { stroke-dashoffset: 0; }
}

@keyframes sparkle {
  0% { opacity: 0; transform: scale(0) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(180deg); }
  100% { opacity: 0; transform: scale(0) rotate(360deg); }
}

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

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes bounce-in {
  0% { opacity: 0; transform: scale(0.6); }
  60% { opacity: 1; transform: scale(1.1); }
  80% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-cursor {
  50% { border-color: transparent; }
}

@keyframes live-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.8); opacity: 0; }
}

@keyframes particles-float {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-100px) translateX(30px) rotate(360deg); opacity: 0; }
}

@keyframes reward-unlock {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  60% { transform: scale(1.3) rotate(10deg); }
  80% { transform: scale(0.95) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes number-tick {
  0% { opacity: 0; transform: translateY(-100%); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes ring-fill {
  from { stroke-dashoffset: 251; }
}

/* ==========================================
   SCROLL REVEAL SYSTEM
   ========================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1), transform 0.7s cubic-bezier(0.4,0,0.2,1);
}

[data-reveal="left"] { transform: translateX(-30px); }
[data-reveal="right"] { transform: translateX(30px); }
[data-reveal="up"] { transform: translateY(30px); }
[data-reveal="scale"] { transform: scale(0.9); }
[data-reveal="fade"] { transform: none; }

[data-reveal].revealed {
  opacity: 1;
  transform: none;
}

[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="300"] { transition-delay: 0.3s; }
[data-delay="400"] { transition-delay: 0.4s; }
[data-delay="500"] { transition-delay: 0.5s; }
[data-delay="600"] { transition-delay: 0.6s; }

/* ==========================================
   LIVE INDICATOR
   ========================================== */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--success);
}

.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  position: relative;
}

.live-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--success);
  animation: live-pulse 1.5s ease-out infinite;
}

/* ==========================================
   NEON ANIMATED BORDER
   ========================================== */
.neon-border-animated {
  animation: neon-border-pulse 3s ease-in-out infinite;
}

/* ==========================================
   ANIMATED BACKGROUND GRADIENT
   ========================================== */
.animated-gradient-bg {
  background: linear-gradient(-45deg, #0B0F1A, #0F1422, #1a0a1e, #0a1520);
  background-size: 400% 400%;
  animation: gradient-shift 12s ease infinite;
}

/* ==========================================
   SPARKLE PARTICLES
   ========================================== */
.particles-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--pink);
  animation: particles-float 4s ease-out infinite;
}

.particle:nth-child(2n) { background: var(--blue); animation-delay: -1s; animation-duration: 5s; }
.particle:nth-child(3n) { background: var(--success); animation-delay: -2s; animation-duration: 3.5s; }
.particle:nth-child(4n) { animation-delay: -0.5s; }

/* ==========================================
   SHIMMER LOADING
   ========================================== */
.shimmer {
  background: linear-gradient(90deg, var(--glass) 25%, var(--glass2) 50%, var(--glass) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ==========================================
   SCAN LINE EFFECT
   ========================================== */
.scan-effect {
  position: relative;
  overflow: hidden;
}

.scan-effect::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0,229,255,0.6), transparent);
  animation: scan-line 3s linear infinite;
  top: 0;
}

/* ==========================================
   CHART BARS ANIMATION
   ========================================== */
.chart-bar {
  transform-origin: bottom;
  animation: chart-grow 1s cubic-bezier(0.4,0,0.2,1) forwards;
  animation-delay: var(--delay, 0s);
  transform: scaleY(0);
}

@keyframes chart-grow {
  to { transform: scaleY(1); }
}

/* ==========================================
   ROTATING GRADIENT BORDER
   ========================================== */
.rotating-border {
  position: relative;
}

.rotating-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--angle, 0deg), var(--pink), var(--blue), var(--pink));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rotate-angle 4s linear infinite;
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotate-angle {
  to { --angle: 360deg; }
}

/* ==========================================
   PAGE TRANSITIONS
   ========================================== */
.page-enter {
  animation: page-in 0.5s cubic-bezier(0.4,0,0.2,1) forwards;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   ACTIVITY PULSE
   ========================================== */
.activity-row {
  animation: slide-in-right 0.5s ease forwards;
  animation-fill-mode: both;
}

.activity-row:nth-child(1) { animation-delay: 0.1s; }
.activity-row:nth-child(2) { animation-delay: 0.2s; }
.activity-row:nth-child(3) { animation-delay: 0.3s; }
.activity-row:nth-child(4) { animation-delay: 0.4s; }
.activity-row:nth-child(5) { animation-delay: 0.5s; }

/* ==========================================
   REWARD ANIMATION
   ========================================== */
.reward-popup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  text-align: center;
  pointer-events: none;
}

.reward-popup.show .reward-icon {
  animation: reward-unlock 0.8s cubic-bezier(0.4,0,0.2,1) forwards;
}

.reward-icon {
  width: 100px; height: 100px;
  background: linear-gradient(135deg, var(--success), var(--blue));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  margin: 0 auto 16px;
  box-shadow: 0 0 60px rgba(0,255,136,0.6);
}

/* ==========================================
   COUNTDOWN TIMER
   ========================================== */
.countdown-circle {
  position: relative;
  width: 80px; height: 80px;
}

.countdown-circle svg {
  transform: rotate(-90deg);
}

.countdown-track { fill: none; stroke: var(--glass2); stroke-width: 4; }

.countdown-fill {
  fill: none;
  stroke: url(#countdown-gradient);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 251;
  transition: stroke-dashoffset 1s linear;
}

.countdown-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--blue);
}

/* ==========================================
   REFERRAL TREE
   ========================================== */
.ref-tree { padding: 20px 0; }

.ref-level {
  display: flex;
  justify-content: center;
  gap: 16px;
  position: relative;
  margin-bottom: 16px;
}

.ref-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ref-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
  box-shadow: 0 0 15px rgba(255,46,159,0.3);
  border: 2px solid var(--glass-border2);
  position: relative;
  z-index: 1;
}

.ref-name { font-size: 11px; color: var(--text2); font-weight: 500; }
.ref-earn { font-size: 11px; color: var(--success); font-weight: 600; }

.ref-connector {
  width: 2px;
  height: 24px;
  background: linear-gradient(var(--pink), var(--blue));
  margin: 0 auto;
  opacity: 0.4;
}

/* ==========================================
   MOBILE MENU TOGGLE
   ========================================== */
.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: var(--transition);
}

.menu-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: var(--transition);
}

@media (max-width: 1024px) {
  .menu-toggle { display: flex; }
}

/* ==========================================
   ANIMATED EARNINGS COUNTER
   ========================================== */
.earnings-live {
  font-variant-numeric: tabular-nums;
}

/* ==========================================
   GRADIENT MESH BACKGROUND
   ========================================== */
.mesh-bg {
  background-color: var(--bg);
  background-image:
    radial-gradient(at 20% 30%, rgba(255,46,159,0.08) 0px, transparent 50%),
    radial-gradient(at 80% 70%, rgba(0,229,255,0.07) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(255,46,159,0.03) 0px, transparent 60%);
}

/* ==========================================
   INPUT FOCUS ANIMATION
   ========================================== */
.form-input-animated {
  position: relative;
}

.form-input-animated::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--pink), var(--blue));
  transition: width 0.3s ease, left 0.3s ease;
}

.form-input-animated:focus-within::after {
  width: 100%;
  left: 0;
}

/* ==========================================
   STEP INDICATORS
   ========================================== */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid var(--glass-border);
  color: var(--text3);
  transition: var(--transition);
}

.step.active .step-circle {
  background: var(--pink);
  border-color: var(--pink);
  color: white;
  box-shadow: 0 0 20px rgba(255,46,159,0.4);
}

.step.done .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--glass2);
  min-width: 40px;
  transition: background 0.5s ease;
}

.step-line.done { background: linear-gradient(90deg, var(--success), var(--pink)); }
