/* ============================================================
   CatFunTool.com — Animations Stylesheet
   ============================================================ */

/* ── Keyframes ─────────────────────────────────────────────── */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes bounce-scroll {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

@keyframes float-y {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

@keyframes float-y-slow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-20px) rotate(3deg); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

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

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

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

@keyframes scan-line {
  0%   { transform: translateY(-100%); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(100vh); opacity: 0; }
}

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

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

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

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

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

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

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

@keyframes border-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes orbit {
  from { transform: rotate(0deg) translateX(80px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(80px) rotate(-360deg); }
}

@keyframes wave {
  0%   { transform: scaleX(1); }
  50%  { transform: scaleX(0.92); }
  100% { transform: scaleX(1); }
}

@keyframes ripple {
  0%   { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

@keyframes draw-line {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}

@keyframes neon-flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: 0.4; }
}

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

/* ── Animation Utilities ───────────────────────────────────── */
.animate-float    { animation: float-y 4s ease-in-out infinite; }
.animate-float-2  { animation: float-y 5s ease-in-out infinite 1s; }
.animate-float-slow { animation: float-y-slow 7s ease-in-out infinite; }
.animate-glow     { animation: glow-pulse 2.5s ease-in-out infinite; }
.animate-spin     { animation: spin-slow 20s linear infinite; }
.animate-spin-r   { animation: spin-slow-reverse 25s linear infinite; }
.animate-shimmer  {
  background: linear-gradient(90deg, var(--accent-gold) 0%, var(--accent-gold-light) 40%, var(--accent-gold) 60%, var(--accent-gold) 100%);
  background-size: 200% auto;
  animation: shimmer 3s linear infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.animate-fade-in  { animation: fade-in 0.6s var(--ease) both; }
.animate-scale-in { animation: scale-in 0.5s var(--ease) both; }

/* ── Hero typing effect ────────────────────────────────────── */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 2.5s steps(40, end) both;
}

/* ── Glowing borders ───────────────────────────────────────── */
.glow-border {
  position: relative;
}
.glow-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-cyan), var(--accent-gold));
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  pointer-events: none;
}

/* ── Scanning line effect ──────────────────────────────────── */
.scan-container {
  position: relative;
  overflow: hidden;
}
.scan-container::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  animation: scan-line 5s linear infinite;
  pointer-events: none;
}

/* ── Particle canvas ───────────────────────────────────────── */
#particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Orbit decorations ─────────────────────────────────────── */
.orbit-container {
  position: relative;
  width: 200px;
  height: 200px;
}
.orbit-ring {
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(201,165,90,0.2);
  border-radius: 50%;
  animation: spin-slow 15s linear infinite;
}
.orbit-ring:nth-child(2) {
  inset: 20px;
  border-color: rgba(0,212,255,0.15);
  animation-duration: 10s;
  animation-direction: reverse;
}
.orbit-dot {
  width: 8px; height: 8px;
  background: var(--accent-gold);
  border-radius: 50%;
  position: absolute;
  top: 50%; left: 0;
  transform: translateY(-50%);
  box-shadow: 0 0 8px var(--accent-gold);
}

/* ── Ripple effect ─────────────────────────────────────────── */
.ripple-container {
  position: relative;
  display: inline-flex;
}
.ripple-ring {
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(201,165,90,0.4);
  border-radius: 50%;
  animation: ripple 2s ease-out infinite;
}
.ripple-ring:nth-child(2) { animation-delay: 0.6s; }
.ripple-ring:nth-child(3) { animation-delay: 1.2s; }

/* ── Stagger animation for lists ───────────────────────────── */
.stagger-children > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.26s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.33s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.40s; }

/* ── Loading skeleton ──────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

/* ── Hover glow card ───────────────────────────────────────── */
.hover-glow {
  transition: all 0.4s var(--ease);
  position: relative;
}
.hover-glow::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(201,165,90,0.15) 0%, transparent 60%);
  transition: opacity 0.4s;
  pointer-events: none;
}
.hover-glow:hover::after { opacity: 1; }

/* ── 3D tilt card ──────────────────────────────────────────── */
.tilt-card {
  transform-style: preserve-3d;
  transform: perspective(1000px);
  transition: transform 0.1s;
}
.tilt-card-inner {
  transform: translateZ(20px);
}

/* ── Progress bar animation ────────────────────────────────── */
.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
}
.progress-fill {
  height: 100%;
  background: var(--gradient-gold);
  border-radius: 2px;
  width: 0%;
  transition: width 1.5s var(--ease);
}

/* ── Counter animation ─────────────────────────────────────── */
.counter { display: inline-block; }

/* ── Hero decorative elements ──────────────────────────────── */
.hero-deco {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}
.hero-deco-circle {
  border: 1px solid rgba(201,165,90,0.08);
  border-radius: 50%;
}
.hero-deco-1 {
  width: 600px; height: 600px;
  top: -200px; right: -200px;
  animation: spin-slow 40s linear infinite;
}
.hero-deco-2 {
  width: 400px; height: 400px;
  top: -100px; right: -100px;
  border-color: rgba(0,212,255,0.06);
  animation: spin-slow-reverse 30s linear infinite;
}
.hero-deco-dot {
  width: 6px; height: 6px;
  background: var(--accent-gold);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-gold);
  animation: glow-pulse 2s ease-in-out infinite;
}

/* ── Page loader ───────────────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}
#page-loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-icon {
  width: 56px;
  height: 56px;
  position: relative;
}
.loader-ring {
  width: 100%; height: 100%;
  border: 2px solid var(--border);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin-slow 1s linear infinite;
  position: absolute;
  animation-duration: 0.8s;
}

/* ── Cursor glow ───────────────────────────────────────────── */
#cursor-glow {
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,165,90,0.06) 0%, transparent 70%);
  position: fixed;
  pointer-events: none;
  transform: translate(-50%,-50%);
  z-index: 0;
  transition: opacity 0.3s;
}

/* ── Back to top ───────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px; height: 44px;
  background: rgba(201,165,90,0.1);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s var(--ease);
  z-index: 100;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
#back-to-top:hover {
  background: var(--accent-gold);
  box-shadow: var(--shadow-gold);
}
#back-to-top:hover svg { color: #000; }
#back-to-top svg { width: 18px; height: 18px; color: var(--accent-gold); transition: color 0.2s; }

/* ── Notification toast ────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 80px;
  right: 32px;
  padding: 14px 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-primary);
  transform: translateX(calc(100% + 40px));
  transition: transform 0.4s var(--ease);
  z-index: 200;
  max-width: 320px;
}
#toast.show { transform: translateX(0); }
#toast.success { border-color: #28c840; }
#toast.error { border-color: #ff5f57; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: rgba(201,165,90,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201,165,90,0.5); }

/* ── Selection ─────────────────────────────────────────────── */
::selection { background: rgba(201,165,90,0.25); color: var(--text-primary); }
