/* ============================================
   animations.css — Complete Animation Library
   DevWhiz Premium Theme
   ============================================ */

/* ===== GLOWING CARD ANIMATIONS ===== */
.card-glow-pulse {
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,
  100% {
    box-shadow: var(--card-glow);
  }
  50% {
    box-shadow:
      var(--card-glow),
      0 0 80px var(--card-color-alpha);
  }
}

/* ===== FLOATING ANIMATIONS ===== */
.float-slow {
  animation: floatSlow 6s ease-in-out infinite;
}

.float-medium {
  animation: floatMedium 4s ease-in-out infinite;
}

.float-fast {
  animation: floatFast 3s ease-in-out infinite;
}

@keyframes floatSlow {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-18px) rotate(1deg);
  }
}

@keyframes floatMedium {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes floatFast {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ===== SHIMMER TEXT ===== */
.text-shimmer {
  background: var(--gradient-master);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shiftGradient 4s linear infinite;
}

.text-shimmer-slow {
  background: var(--gradient-master);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shiftGradient 8s linear infinite;
}

@keyframes shiftGradient {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* ===== BORDER ROTATION ===== */
.border-rotate {
  position: relative;
}

.border-rotate::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--angle, 0deg),
    #2563eb,
    #a855f7,
    #d946ef,
    #f59e0b,
    #10b981,
    #2563eb
  );
  -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;
  animation: rotateBorder 4s linear infinite;
}

.border-rotate-fast::before {
  animation-duration: 2s;
}

.border-rotate-slow::before {
  animation-duration: 8s;
}

@keyframes rotateBorder {
  to {
    --angle: 360deg;
  }
}

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* ===== PARTICLE EFFECT ===== */
.particle-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--card-color, #a855f7);
  animation: particleFloat 8s linear infinite;
  opacity: 0;
}

.particle:nth-child(2) {
  animation-delay: 1.5s;
  width: 6px;
  height: 6px;
}
.particle:nth-child(3) {
  animation-delay: 3s;
  width: 3px;
  height: 3px;
}
.particle:nth-child(4) {
  animation-delay: 4.5s;
  width: 5px;
  height: 5px;
}
.particle:nth-child(5) {
  animation-delay: 6s;
  width: 4px;
  height: 4px;
}

@keyframes particleFloat {
  0% {
    opacity: 0;
    transform: translateY(100%) scale(0) rotate(0deg);
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-200%) scale(1.5) rotate(720deg);
  }
}

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--border-color);
  border-top-color: #a855f7;
  animation: spin 0.8s linear infinite;
}

.spinner-lg {
  width: 60px;
  height: 60px;
  border-width: 4px;
}

.spinner-sm {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== SLIDE IN ===== */
.slide-in-left {
  animation: slideInLeft 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.slide-in-right {
  animation: slideInRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.slide-in-up {
  animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.slide-in-down {
  animation: slideInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== SCALE ON HOVER ===== */
.hover-scale {
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.hover-scale:hover {
  transform: scale(1.05);
}

.hover-scale-lg:hover {
  transform: scale(1.08);
}

.hover-scale-sm:hover {
  transform: scale(1.03);
}

/* ===== GLOWING DOTS ===== */
.glow-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: glowDot 2s ease-in-out infinite;
}

.glow-dot-green {
  background: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
}
.glow-dot-purple {
  background: #a855f7;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
}
.glow-dot-blue {
  background: #3b82f6;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
}
.glow-dot-pink {
  background: #ec4899;
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.6);
}
.glow-dot-gold {
  background: #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
}

@keyframes glowDot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.7);
  }
}

/* ===== PULSE ===== */
.pulse {
  animation: pulse 2s ease-in-out infinite;
}

.pulse-fast {
  animation: pulse 1s ease-in-out infinite;
}

.pulse-slow {
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

/* ===== SHAKE ===== */
.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-10px);
  }
  40% {
    transform: translateX(10px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(6px);
  }
}

/* ===== FADE IN ===== */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.fade-in-slow {
  animation: fadeIn 1.2s ease forwards;
}

.fade-in-fast {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===== FADE IN UP ===== */
.fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== ZOOM IN ===== */
.zoom-in {
  animation: zoomIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== GLOWING BORDER PULSE ===== */
.glow-border-pulse {
  animation: glowBorderPulse 3s ease-in-out infinite;
}

@keyframes glowBorderPulse {
  0%,
  100% {
    border-color: rgba(168, 85, 247, 0.2);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.05);
  }
  50% {
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.15);
  }
}

/* ===== TEXT REVEAL ===== */
.text-reveal {
  overflow: hidden;
  display: inline-block;
}

.text-reveal span {
  display: inline-block;
  animation: textReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes textReveal {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== TYPEWRITER ===== */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid #a855f7;
  animation:
    typewriter 3s steps(40) 1s forwards,
    blinkCursor 0.8s step-end infinite;
}

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blinkCursor {
  0%,
  100% {
    border-color: #a855f7;
  }
  50% {
    border-color: transparent;
  }
}

/* ===== ROTATE ===== */
.rotate {
  animation: rotate 4s linear infinite;
}

.rotate-slow {
  animation: rotate 8s linear infinite;
}

.rotate-fast {
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

/* ===== BOUNCE ===== */
.bounce {
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
    animation-timing-function: ease-out;
  }
  50% {
    transform: translateY(-20px);
    animation-timing-function: ease-in;
  }
}

/* ===== WAVE ===== */
.wave {
  animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(15deg);
  }
  75% {
    transform: rotate(-15deg);
  }
}

/* ===== HEARTBEAT ===== */
.heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.2);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.15);
  }
  56% {
    transform: scale(1);
  }
}

/* ===== SWING ===== */
.swing {
  animation: swing 2s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes swing {
  0%,
  100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

/* ===== TILT ===== */
.tilt {
  animation: tilt 3s ease-in-out infinite;
}

@keyframes tilt {
  0%,
  100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
}

/* ===== FLIP ===== */
.flip {
  animation: flip 0.6s ease forwards;
}

@keyframes flip {
  from {
    transform: perspective(400px) rotateY(90deg);
    opacity: 0;
  }
  to {
    transform: perspective(400px) rotateY(0deg);
    opacity: 1;
  }
}

/* ===== STAGGERED CHILDREN ===== */
.stagger > *:nth-child(1) {
  animation-delay: 0.05s;
}
.stagger > *:nth-child(2) {
  animation-delay: 0.1s;
}
.stagger > *:nth-child(3) {
  animation-delay: 0.15s;
}
.stagger > *:nth-child(4) {
  animation-delay: 0.2s;
}
.stagger > *:nth-child(5) {
  animation-delay: 0.25s;
}
.stagger > *:nth-child(6) {
  animation-delay: 0.3s;
}
.stagger > *:nth-child(7) {
  animation-delay: 0.35s;
}
.stagger > *:nth-child(8) {
  animation-delay: 0.4s;
}
.stagger > *:nth-child(9) {
  animation-delay: 0.45s;
}
.stagger > *:nth-child(10) {
  animation-delay: 0.5s;
}
.stagger > *:nth-child(11) {
  animation-delay: 0.55s;
}
.stagger > *:nth-child(12) {
  animation-delay: 0.6s;
}

/* ===== RAINBOW TEXT ===== */
.rainbow-text {
  background: conic-gradient(
    from var(--angle, 0deg),
    #ff6b6b,
    #ffd93d,
    #6bcb77,
    #4d96ff,
    #9b59b6,
    #ff6b6b
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rotateBorder 6s linear infinite;
}

/* ===== NEON PULSE ===== */
.neon-pulse {
  animation: neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {
  0%,
  100% {
    box-shadow:
      0 0 20px rgba(168, 85, 247, 0.3),
      0 0 40px rgba(168, 85, 247, 0.1);
  }
  50% {
    box-shadow:
      0 0 40px rgba(168, 85, 247, 0.6),
      0 0 80px rgba(168, 85, 247, 0.2);
  }
}

/* ===== GLITCH ===== */
.glitch {
  animation: glitch 3s infinite;
}

@keyframes glitch {
  0%,
  100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(2px, -2px);
  }
  60% {
    transform: translate(-2px, -2px);
  }
  80% {
    transform: translate(2px, 2px);
  }
}

/* ===== SCROLL INDICATOR ===== */
.scroll-indicator {
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(12px);
    opacity: 0.5;
  }
}

/* ===== COUNT UP ===== */
.count-up {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ===== MORPHING BACKGROUND ===== */
.morph-bg {
  animation: morphBg 8s ease-in-out infinite;
  background-size: 400% 400%;
}

@keyframes morphBg {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ===== FLOATING PARTICLES (Background) ===== */
.floating-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(168, 85, 247, 0.3);
  border-radius: 50%;
  animation: floatParticle 15s linear infinite;
}

@keyframes floatParticle {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ===== RESPONSIVE ANIMATIONS ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 768px) {
  .float-slow,
  .float-medium,
  .float-fast {
    animation-duration: 8s, 6s, 4s;
  }
}
