/* ═══════════════════════════════════════════════════════════════
   VK CREATIVES — ANIMATIONS
   Micro-animations, transitions, and motion design
   ═══════════════════════════════════════════════════════════════ */

/* ── Entrance Animations ─────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3); }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}

/* ── Utility Classes ─────────────────────────────────────────── */
.animate-fadeIn { animation: fadeIn 0.4s ease; }
.animate-fadeInUp { animation: fadeInUp 0.5s ease; }
.animate-fadeInDown { animation: fadeInDown 0.5s ease; }
.animate-fadeInLeft { animation: fadeInLeft 0.5s ease; }
.animate-fadeInRight { animation: fadeInRight 0.5s ease; }
.animate-scaleIn { animation: scaleIn 0.4s ease; }
.animate-bounceIn { animation: bounceIn 0.6s ease; }

/* Stagger delays */
.delay-1 { animation-delay: 50ms; animation-fill-mode: both; }
.delay-2 { animation-delay: 100ms; animation-fill-mode: both; }
.delay-3 { animation-delay: 150ms; animation-fill-mode: both; }
.delay-4 { animation-delay: 200ms; animation-fill-mode: both; }
.delay-5 { animation-delay: 250ms; animation-fill-mode: both; }
.delay-6 { animation-delay: 300ms; animation-fill-mode: both; }

/* ── Pulse Effect (for live indicator) ────────────────────────── */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Live dot */
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  color: rgba(34, 197, 94, 0.4);
  animation: pulse 2s infinite;
}

/* ── Clock Button Tap Effect ──────────────────────────────────── */
@keyframes clockTap {
  0% { transform: scale(1); }
  15% { transform: scale(0.92); }
  30% { transform: scale(1.03); }
  45% { transform: scale(0.99); }
  60% { transform: scale(1); }
}

.clock-btn.tapped {
  animation: clockTap 0.4s ease;
}

/* ── Success Checkmark ────────────────────────────────────────── */
@keyframes checkmark {
  0% { stroke-dashoffset: 48; }
  100% { stroke-dashoffset: 0; }
}

@keyframes checkmark-circle {
  0% { stroke-dashoffset: 240; }
  100% { stroke-dashoffset: 0; }
}

.check-animation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.check-animation svg {
  width: 56px;
  height: 56px;
}

.check-animation .checkmark-circle {
  stroke: var(--color-success);
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: checkmark-circle 0.6s 0.1s ease-in-out forwards;
  fill: none;
  stroke-width: 2;
}

.check-animation .checkmark-check {
  stroke: var(--color-success);
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkmark 0.3s 0.6s ease-in-out forwards;
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Count Up Animation ───────────────────────────────────────── */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.count-up {
  animation: countUp 0.6s ease;
}

/* ── Shimmer on stat cards ────────────────────────────────────── */
@keyframes shimmer-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  pointer-events: none;
}

.stat-card:hover::after {
  animation: shimmer-sweep 0.8s ease;
}

/* ── Page Transition ──────────────────────────────────────────── */
@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-enter {
  animation: pageEnter 0.35s ease;
}

/* ── Floating Label ───────────────────────────────────────────── */
@keyframes floatLabel {
  from {
    transform: translateY(0);
    font-size: var(--font-base);
  }
  to {
    transform: translateY(-24px);
    font-size: var(--font-xs);
  }
}

/* ── Logo Spin (Loading) ──────────────────────────────────────── */
@keyframes logoSpin {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

.logo-loading {
  animation: logoSpin 2s ease-in-out infinite;
  perspective: 1000px;
}

/* ── Gradient Border ──────────────────────────────────────────── */
.gradient-border {
  position: relative;
  border: none !important;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--vk-green), var(--vk-navy), var(--vk-coral), var(--vk-amber));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ── Theme Transition ─────────────────────────────────────────── */
.theme-transitioning * {
  transition: background-color 0.3s ease,
              color 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease !important;
}

/* ── Notification Bell Shake ──────────────────────────────────── */
@keyframes bellShake {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(15deg); }
  30% { transform: rotate(-12deg); }
  45% { transform: rotate(8deg); }
  60% { transform: rotate(-5deg); }
  75% { transform: rotate(3deg); }
}

.bell-shake {
  animation: bellShake 0.6s ease;
}

/* ── Reduced Motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
