/* ============================================================
   LiveChat Pro - Animations CSS
   ============================================================ */

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

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Staggered card animations */
.stats-grid .stat-card:nth-child(1) { animation: pageEnter 0.3s 0.05s both; }
.stats-grid .stat-card:nth-child(2) { animation: pageEnter 0.3s 0.1s both; }
.stats-grid .stat-card:nth-child(3) { animation: pageEnter 0.3s 0.15s both; }
.stats-grid .stat-card:nth-child(4) { animation: pageEnter 0.3s 0.2s both; }
.stats-grid .stat-card:nth-child(5) { animation: pageEnter 0.3s 0.25s both; }
.stats-grid .stat-card:nth-child(6) { animation: pageEnter 0.3s 0.3s both; }

/* ==================== FLOATING PARTICLES (Login) ==================== */
.particles-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(99, 102, 241, 0.6);
  border-radius: 50%;
  animation: float-particle var(--duration, 15s) var(--delay, 0s) ease-in-out infinite;
}

.particle:nth-child(2n) { background: rgba(6, 182, 212, 0.5); width: 3px; height: 3px; }
.particle:nth-child(3n) { background: rgba(139, 92, 246, 0.4); width: 5px; height: 5px; }

@keyframes float-particle {
  0% { transform: translateY(100vh) translateX(0) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100px) translateX(var(--drift, 50px)) scale(1); opacity: 0; }
}

/* ==================== ANIMATED GRADIENT ORBS ==================== */
.orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.15;
  z-index: 0;
  max-width: 100vw;
  overflow: hidden;
}

@media (max-width: 768px) {
  .orb {
    display: none !important;
  }
}

.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #6366f1, transparent);
  top: -200px; left: -200px;
  animation: orbFloat 20s ease-in-out infinite;
}

.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #06b6d4, transparent);
  bottom: -150px; right: -100px;
  animation: orbFloat 25s ease-in-out infinite reverse;
}

.orb-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #8b5cf6, transparent);
  top: 40%; left: 40%;
  animation: orbFloat 18s 5s ease-in-out infinite;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 50px) scale(0.95); }
  75% { transform: translate(-50px, -20px) scale(1.02); }
}

/* ==================== LOGIN SPECIFIC ==================== */
.login-card {
  background: rgba(15, 15, 35, 0.85);
  backdrop-filter: blur(40px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 10;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 60px rgba(99,102,241,0.1);
  animation: loginCardEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes loginCardEnter {
  from { transform: scale(0.8) translateY(40px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
  box-shadow: 0 0 40px rgba(99,102,241,0.5);
  animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(99,102,241,0.5); }
  50% { box-shadow: 0 0 60px rgba(99,102,241,0.8), 0 0 100px rgba(99,102,241,0.3); }
}

.login-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f1f5f9, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Login grid decorations */
.login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    repeating-linear-gradient(0deg, transparent, transparent 80px, rgba(99,102,241,0.03) 80px, rgba(99,102,241,0.03) 81px),
    repeating-linear-gradient(90deg, transparent, transparent 80px, rgba(99,102,241,0.03) 80px, rgba(99,102,241,0.03) 81px);
  pointer-events: none;
  z-index: 0;
}

/* ==================== CHAT ANIMATIONS ==================== */
.message-bubble {
  animation: messageIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes messageIn {
  from { transform: scale(0.8) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: var(--bg-card);
  border-radius: 18px;
  width: fit-content;
}

.typing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s ease infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ==================== VISITOR PING ==================== */
.visitor-ping {
  position: relative;
  display: inline-flex;
}
.visitor-ping::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--accent-green);
  opacity: 0;
  animation: pingWave 2s ease-in-out infinite;
}
@keyframes pingWave {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ==================== COUNT UP ANIMATION ==================== */
.count-up { animation: countPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes countPop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==================== LOADING SCREEN ==================== */
.loading-screen {
  display: none !important;
}

.loading-logo {
  width: 60px; height: 60px;
  background: var(--grad-primary);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  animation: loadingPulse 1s ease-in-out infinite;
}
@keyframes loadingPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(99,102,241,0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 40px rgba(99,102,241,0.7); }
}

.loading-bar {
  width: 160px; height: 3px;
  background: rgba(99,102,241,0.2);
  border-radius: 10px;
  overflow: hidden;
}
.loading-bar-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 10px;
  animation: loadingBar 1.5s ease-in-out infinite;
}
@keyframes loadingBar {
  0% { width: 0%; margin-left: 0; }
  50% { width: 80%; }
  100% { width: 0%; margin-left: 100%; }
}

/* ==================== NOTIFICATION ANIMATIONS ==================== */
.notification-enter {
  animation: notifEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes notifEnter {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==================== CHART SKELETON ==================== */
.chart-loading {
  height: 200px;
  background: var(--skeleton-gradient, linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%));
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius);
}

/* ==================== HOVER LIFT ==================== */
.hover-lift { transition: var(--transition); }
.hover-lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-primary); }

/* ==================== GLOW EFFECTS ==================== */
.glow-primary { box-shadow: 0 0 20px rgba(99,102,241,0.4); }
.glow-green { box-shadow: 0 0 20px rgba(16,185,129,0.4); }
.glow-red { box-shadow: 0 0 20px rgba(239,68,68,0.4); }

/* ==================== GRADIENT TEXT ==================== */
.gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-cyan {
  background: var(--grad-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
