/* ============================================
   AutoServisTop — Animations & Effects CSS
   ============================================ */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

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

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

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

@keyframes floatGlow {
  0%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-8px) scale(1.05);
    opacity: 1;
  }
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

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

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

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

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.6;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

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

/* ============================================
   HERO ANIMATIONS
   ============================================ */

.hero-animate-1 {
  animation: fadeInUp 0.8s ease both;
  animation-delay: 0.1s;
}

.hero-animate-2 {
  animation: fadeInUp 0.8s ease both;
  animation-delay: 0.25s;
}

.hero-animate-3 {
  animation: fadeInUp 0.8s ease both;
  animation-delay: 0.4s;
}

.hero-animate-4 {
  animation: fadeInUp 0.8s ease both;
  animation-delay: 0.55s;
}

.hero-animate-5 {
  animation: fadeInUp 0.8s ease both;
  animation-delay: 0.7s;
}

/* ============================================
   FLOATING ANIMATION
   ============================================ */

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

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

/* ============================================
   SHIMMER TEXT
   ============================================ */

.shimmer-text {
  background: linear-gradient(
    90deg,
    var(--clr-text) 0%,
    #e62e2e 30%,
    #ff6a00 50%,
    #e62e2e 70%,
    var(--clr-text) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

/* ============================================
   ANIMATED GRADIENT BORDER
   ============================================ */

.gradient-border {
  position: relative;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(230,46,46,0.5), rgba(255,106,0,0.5), rgba(230,46,46,0.1));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ============================================
   TYPED CURSOR
   ============================================ */

.typed-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--clr-primary);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

/* ============================================
   PARTICLE DOTS BACKGROUND
   ============================================ */

.particles-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(230,46,46,0.5);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.particle:nth-child(2) { animation-delay: 1s; animation-duration: 8s; }
.particle:nth-child(3) { animation-delay: 2s; animation-duration: 5s; }
.particle:nth-child(4) { animation-delay: 3s; animation-duration: 7s; }
.particle:nth-child(5) { animation-delay: 4s; animation-duration: 9s; }

/* ============================================
   COUNTER ANIMATION
   ============================================ */

.counter-animated {
  animation: countUp 0.6s ease both;
}

/* ============================================
   BUTTON RIPPLE
   ============================================ */

.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  pointer-events: none;
  animation: ripple 0.6s linear;
}

/* ============================================
   HOVER LIFT
   ============================================ */

.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* ============================================
   GRADIENT ANIMATED BG
   ============================================ */

.grad-animated {
  background-size: 200% 200%;
  animation: gradientMove 6s ease infinite;
}

/* ============================================
   SPIN ICON
   ============================================ */

.spin-on-hover:hover svg {
  animation: rotateSlow 1s linear infinite;
}

/* ============================================
   UNDERLINE HOVER EFFECT
   ============================================ */

.underline-hover {
  position: relative;
}

.underline-hover::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--grad-primary);
  transition: width var(--transition-base);
  border-radius: 2px;
}

.underline-hover:hover::after {
  width: 100%;
}

/* ============================================
   NOTIFICATION BADGE PULSE
   ============================================ */

.badge-pulse {
  position: relative;
}

.badge-pulse::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(230,46,46,0.3);
  animation: ripple 2s ease infinite;
}

/* ============================================
   IMAGE OVERLAY EFFECT
   ============================================ */

.img-overlay-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.img-overlay-wrap img {
  transition: transform 0.5s ease;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-overlay-wrap:hover img {
  transform: scale(1.05);
}

.img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-base);
  display: flex;
  align-items: flex-end;
  padding: var(--space-md);
}

.img-overlay-wrap:hover .img-overlay {
  opacity: 1;
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 3px;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1s ease 0.3s;
}

.progress-fill.animated {
  transform: scaleX(1);
}

/* ============================================
   SKELETON LOADING
   ============================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 400% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: var(--radius-sm);
}
