/* ============================================
   ANIMATIONS & KEYFRAMES
   ============================================ */

/* ── PAGE LOAD ENTRANCE ── */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── COUNTER ANIMATION ── */
.count-up {
  transition: all 0.05s linear;
}

/* ── TRANSLATE ANIMATION ── */
.translate-flash {
  animation: translateFlash 0.5s ease;
}

@keyframes translateFlash {
  0%   { background: rgba(0, 245, 255, 0.0); }
  30%  { background: rgba(0, 245, 255, 0.08); }
  100% { background: transparent; }
}

/* ── WAVE TEXT ANIMATION ── */
.wave-text span {
  display: inline-block;
  animation: wave 1.5s ease-in-out infinite;
}

.wave-text span:nth-child(1)  { animation-delay: 0s; }
.wave-text span:nth-child(2)  { animation-delay: 0.1s; }
.wave-text span:nth-child(3)  { animation-delay: 0.2s; }
.wave-text span:nth-child(4)  { animation-delay: 0.3s; }
.wave-text span:nth-child(5)  { animation-delay: 0.4s; }
.wave-text span:nth-child(6)  { animation-delay: 0.5s; }
.wave-text span:nth-child(7)  { animation-delay: 0.6s; }
.wave-text span:nth-child(8)  { animation-delay: 0.7s; }

@keyframes wave {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-6px); }
}

/* ── RIPPLE BUTTON EFFECT ── */
.ripple-btn {
  position: relative;
  overflow: hidden;
}

.ripple-btn::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
  opacity: 0;
}

.ripple-btn:active::after {
  width: 200px;
  height: 200px;
  opacity: 0;
  transition: 0s;
}

/* ── TYPING ANIMATION ── */
@keyframes typingDots {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40%            { transform: scale(1.2); opacity: 1; }
}

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 1rem 1.5rem;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--neon-cyan);
  border-radius: 50%;
  animation: typingDots 1.4s ease-in-out infinite;
  box-shadow: 0 0 6px var(--neon-cyan);
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ── BORDER TRACE ANIMATION ── */
@keyframes borderTrace {
  0%   { stroke-dashoffset: 1000; }
  100% { stroke-dashoffset: 0; }
}

/* ── FLICKER ── */
@keyframes flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    opacity: 1;
    text-shadow: 0 0 5px var(--neon-cyan), 0 0 15px var(--neon-cyan);
  }
  20%, 22%, 24%, 55% {
    opacity: 0.7;
    text-shadow: none;
  }
}

/* ── MATRIX RAIN (for panels) ── */
.matrix-overlay {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.04;
}

/* ── PROGRESS BAR ANIMATED ── */
.progress-bar-animated .lang-bar-fill {
  animation: fillBar 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fillBar {
  from { width: 0 !important; }
}

/* ── SUCCESS BURST ── */
@keyframes successBurst {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,255,136,0.7); }
  70%  { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(0,255,136,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,255,136,0); }
}

.success-burst {
  animation: successBurst 0.6s ease-out;
}

/* ── FLOAT ── */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

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

/* ── RADAR SWEEP ── */
.radar-container {
  position: relative;
  width: 100px;
  height: 100px;
}

.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(0,245,255,0.3) 15deg,
    rgba(0,245,255,0.05) 30deg,
    transparent 60deg
  );
  animation: radarSpin 3s linear infinite;
}

@keyframes radarSpin {
  to { transform: rotate(360deg); }
}

/* ── TOOLTIP ── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);   /* neeche */
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 99999;
}

[data-tooltip]:hover::before {
  opacity: 1;
}
