/* ============================================
   KATHMANDU SERVICES - ANIMATIONS
   ============================================ */

/* ---------- Keyframe Animations ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

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

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

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

@keyframes scaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.8);
  }
}

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

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

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

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

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

@keyframes elasticIn {
  0% {
    opacity: 0;
    transform: scale(1.3);
  }
  50% {
    transform: scale(0.9);
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes heartBeat {
  0% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.3);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.3);
  }
  70% {
    transform: scale(1);
  }
}

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

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

@keyframes float {
  0%, 100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(10px, -10px);
  }
  50% {
    transform: translate(0, -20px);
  }
  75% {
    transform: translate(-10px, -10px);
  }
}

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

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

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

@keyframes slideRight {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

@keyframes countdown {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: 100;
  }
}

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

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

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

@keyframes grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* ---------- Animation Classes ---------- */
.animate-fadeIn {
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-fadeOut {
  animation: fadeOut 0.3s ease-in forwards;
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fadeInDown {
  animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fadeInLeft {
  animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fadeInRight {
  animation: fadeInRight 0.6s ease-out forwards;
}

.animate-scaleIn {
  animation: scaleIn 0.4s ease-out forwards;
}

.animate-scaleOut {
  animation: scaleOut 0.3s ease-in forwards;
}

.animate-bounce {
  animation: bounce 1s ease-in-out infinite;
}

.animate-bounceIn {
  animation: bounceIn 0.8s ease-out forwards;
}

.animate-elasticIn {
  animation: elasticIn 0.8s ease-out forwards;
}

.animate-shake {
  animation: shake 0.6s ease-in-out;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-heartBeat {
  animation: heartBeat 1.2s ease-in-out infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

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

.animate-slideInUp {
  animation: slideInUp 0.5s ease-out forwards;
}

.animate-slideInLeft {
  animation: slideInLeft 0.5s ease-out forwards;
}

.animate-slideInRight {
  animation: slideInRight 0.5s ease-out forwards;
}

/* ---------- Animation Delays ---------- */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }
.delay-900 { animation-delay: 900ms; }
.delay-1000 { animation-delay: 1000ms; }

/* ---------- Animation Duration ---------- */
.duration-fast { animation-duration: 0.15s; }
.duration-normal { animation-duration: 0.3s; }
.duration-slow { animation-duration: 0.5s; }
.duration-slower { animation-duration: 0.8s; }
.duration-fastest { animation-duration: 0.1s; }

/* ---------- Scroll Reveal Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s ease-out;
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s ease-out;
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s ease-out;
}

.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

.reveal-rotate {
  opacity: 0;
  transform: rotate(-10deg) scale(0.9);
  transition: all 0.8s ease-out;
}

.reveal-rotate.active {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* ---------- Hover Animations ---------- */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.hover-scale {
  transition: transform 0.3s ease;
}

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

.hover-grow {
  transition: transform 0.3s ease;
}

.hover-grow:hover {
  transform: scale(1.1);
}

.hover-float {
  transition: transform 0.3s ease;
}

.hover-float:hover {
  transform: translateY(-3px);
}

.hover-shake {
  transition: transform 0.3s ease;
}

.hover-shake:hover {
  animation: shake 0.5s ease-in-out;
}

.hover-bounce {
  transition: transform 0.3s ease;
}

.hover-bounce:hover {
  animation: bounce 0.6s ease-in-out;
}

.hover-pulse {
  transition: transform 0.3s ease;
}

.hover-pulse:hover {
  animation: pulse 1s ease-in-out infinite;
}

.hover-rotate {
  transition: transform 0.3s ease;
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* ---------- Interactive Animations ---------- */
.ripple-effect {
  position: relative;
  overflow: hidden;
}

.ripple-effect::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--secondary) 10%, transparent 10%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10);
  opacity: 0;
  transition: transform 0.5s, opacity 0.8s;
}

.ripple-effect:active::after {
  transform: scale(0);
  opacity: 0.3;
  transition: 0s;
}

/* ---------- Loading Animations ---------- */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.loading-spinner-lg {
  width: 60px;
  height: 60px;
  border-width: 4px;
}

.loading-dots {
  display: flex;
  gap: 4px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0s;
}

.loading-bars {
  display: flex;
  gap: 4px;
  align-items: flex-end;
}

.loading-bars span {
  width: 4px;
  height: 20px;
  background: var(--primary);
  animation: grow 0.8s ease-in-out infinite alternate;
}

.loading-bars span:nth-child(1) {
  animation-delay: 0s;
}

.loading-bars span:nth-child(2) {
  animation-delay: 0.1s;
}

.loading-bars span:nth-child(3) {
  animation-delay: 0.2s;
}

.loading-bars span:nth-child(4) {
  animation-delay: 0.3s;
}

/* ---------- Page Transition Animations ---------- */
.page-transition-enter {
  opacity: 0;
  transform: translateY(20px);
}

.page-transition-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.page-transition-exit {
  opacity: 1;
}

.page-transition-exit-active {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ---------- Modal Animations ---------- */
.modal-enter {
  opacity: 0;
}

.modal-enter-active {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-enter .modal-content {
  transform: scale(0.9) translateY(20px);
}

.modal-enter-active .modal-content {
  transform: scale(1) translateY(0);
  transition: transform 0.3s ease;
}

.modal-exit {
  opacity: 1;
}

.modal-exit-active {
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* ---------- Sidebar Animations ---------- */
.sidebar-slide-left {
  animation: slideInLeft 0.3s ease forwards;
}

.sidebar-slide-right {
  animation: slideInRight 0.3s ease forwards;
}

/* ---------- Dropdown Animations ---------- */
.dropdown-enter {
  opacity: 0;
  transform: translateY(-10px);
}

.dropdown-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dropdown-exit {
  opacity: 1;
}

.dropdown-exit-active {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* ---------- Tabs Animation ---------- */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

/* ---------- Accordion Animation ---------- */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.accordion-content.open {
  max-height: 500px;
}

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

.count-up {
  transition: none;
}

/* ---------- Image Hover Effects ---------- */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform 0.5s ease;
}

.img-zoom:hover img {
  transform: scale(1.1);
}

.img-slide {
  overflow: hidden;
}

.img-slide img {
  transition: transform 0.5s ease;
}

.img-slide:hover img {
  transform: translateX(5%);
}

/* ---------- Gradient Animation ---------- */
.animated-gradient {
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
}

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

/* ---------- Blur In Animation ---------- */
.blur-in {
  filter: blur(10px);
  opacity: 0;
  transition: filter 0.6s ease, opacity 0.6s ease;
}

.blur-in.active {
  filter: blur(0);
  opacity: 1;
}

/* ---------- Text Animations ---------- */
.text-reveal {
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.text-reveal.active span {
  transform: translateY(0);
}

.typing-effect {
  overflow: hidden;
  border-right: 2px solid var(--primary);
  white-space: nowrap;
  animation: typewriter 3s steps(40) 1s forwards, blink 0.75s step-end infinite;
}

/* ---------- Marquee Animation ---------- */
.marquee {
  display: flex;
  overflow: hidden;
  user-select: none;
}

.marquee-content {
  display: flex;
  animation: marquee 20s linear infinite;
}

.marquee-content:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ---------- Parallax Effect ---------- */
.parallax {
  transition: transform 0.1s ease-out;
}

/* ---------- Wave Animation ---------- */
.wave {
  position: relative;
}

.wave::before,
.wave::after {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -100%;
  left: -50%;
  background: var(--white);
  border-radius: 40%;
  animation: wave 15s linear infinite;
}

.wave::after {
  animation-duration: 20s;
  opacity: 0.5;
}

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

/* ---------- Drawing Animation ---------- */
.draw-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw 3s ease forwards;
}

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

/* ---------- Notification Ping ---------- */
.ping {
  position: relative;
}

.ping::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--danger);
  animation: ping 1.5s ease-out infinite;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* ---------- Success Check Animation ---------- */
.checkmark {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: var(--accent);
  stroke-miterlimit: 10;
  box-shadow: inset 0 0 0 var(--accent);
}

.checkmark path {
  transform-origin: 50% 50%;
  animation: checkmark 0.4s ease-in-out forwards;
}

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

/* ---------- Attention Grabbers ---------- */
wiggle {
  display: inline-block;
  animation: shake 0.5s ease-in-out infinite;
}

.jello {
  display: inline-block;
  animation: jello 0.9s ease-in-out infinite;
}

@keyframes jello {
  0%, 100% {
    transform: scale3d(1, 1, 1);
  }
  30% {
    transform: scale3d(1.25, 0.75, 1);
  }
  40% {
    transform: scale3d(0.75, 1.25, 1);
  }
  50% {
    transform: scale3d(1.15, 0.85, 1);
  }
  65% {
    transform: scale3d(0.95, 1.05, 1);
  }
  75% {
    transform: scale3d(1.05, 0.95, 1);
  }
}
