/* Dedicated Animations CSS for Mpano Services */

/* Advanced Animation Keyframes */
@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes zoomInUp {
  from {
    opacity: 0;
    transform: scale(0.3) translateY(50px);
  }
  50% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes flipInX {
  from {
    opacity: 0;
    transform: perspective(400px) rotateX(90deg);
  }
  40% {
    transform: perspective(400px) rotateX(-20deg);
  }
  60% {
    transform: perspective(400px) rotateX(10deg);
  }
  80% {
    transform: perspective(400px) rotateX(-5deg);
  }
  to {
    opacity: 1;
    transform: perspective(400px) rotateX(0deg);
  }
}

@keyframes flipInY {
  from {
    opacity: 0;
    transform: perspective(400px) rotateY(90deg);
  }
  40% {
    transform: perspective(400px) rotateY(-20deg);
  }
  60% {
    transform: perspective(400px) rotateY(10deg);
  }
  80% {
    transform: perspective(400px) rotateY(-5deg);
  }
  to {
    opacity: 1;
    transform: perspective(400px) rotateY(0deg);
  }
}

@keyframes bounceInLeft {
  from {
    opacity: 0;
    transform: translateX(-3000px);
  }
  60% {
    opacity: 1;
    transform: translateX(25px);
  }
  75% {
    transform: translateX(-10px);
  }
  90% {
    transform: translateX(5px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bounceInRight {
  from {
    opacity: 0;
    transform: translateX(3000px);
  }
  60% {
    opacity: 1;
    transform: translateX(-25px);
  }
  75% {
    transform: translateX(10px);
  }
  90% {
    transform: translateX(-5px);
  }
  to {
    opacity: 1;
    transform: translateX(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 fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

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

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

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

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

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

/* Animation Utility Classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

.animate-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-left.animated {
  opacity: 1;
  transform: translateX(0);
}

.animate-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-right.animated {
  opacity: 1;
  transform: translateX(0);
}

.animate-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-scale.animated {
  opacity: 1;
  transform: scale(1);
}

.animate-bottom {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-bottom.animated {
  opacity: 1;
  transform: translateY(0);
}

.animate-top {
  opacity: 0;
  transform: translateY(-50px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-top.animated {
  opacity: 1;
  transform: translateY(0);
}

.animate-zoom {
  opacity: 0;
  transform: scale(0.3);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-zoom.animated {
  opacity: 1;
  transform: scale(1);
}

.animate-flip-x {
  opacity: 0;
  transform: perspective(400px) rotateX(90deg);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-flip-x.animated {
  opacity: 1;
  transform: perspective(400px) rotateX(0deg);
}

.animate-flip-y {
  opacity: 0;
  transform: perspective(400px) rotateY(90deg);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-flip-y.animated {
  opacity: 1;
  transform: perspective(400px) rotateY(0deg);
}

.animate-bounce-left {
  opacity: 0;
  transform: translateX(-3000px);
  transition: all 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-bounce-left.animated {
  opacity: 1;
  transform: translateX(0);
}

.animate-bounce-right {
  opacity: 0;
  transform: translateX(3000px);
  transition: all 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-bounce-right.animated {
  opacity: 1;
  transform: translateX(0);
}

/* Delay Classes */
.animate-delay-1 {
  transition-delay: 0.1s;
}

.animate-delay-2 {
  transition-delay: 0.2s;
}

.animate-delay-3 {
  transition-delay: 0.3s;
}

.animate-delay-4 {
  transition-delay: 0.4s;
}

.animate-delay-5 {
  transition-delay: 0.5s;
}

.animate-delay-6 {
  transition-delay: 0.6s;
}

.animate-delay-7 {
  transition-delay: 0.7s;
}

.animate-delay-8 {
  transition-delay: 0.8s;
}

/* Staggered Animations */
.stagger-animate .card,
.stagger-animate .gallery-item,
.stagger-animate .service-item {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.stagger-animate.animated .card,
.stagger-animate.animated .gallery-item,
.stagger-animate.animated .service-item {
  opacity: 1;
  transform: translateY(0);
}

.stagger-animate.animated .card:nth-child(1),
.stagger-animate.animated .gallery-item:nth-child(1),
.stagger-animate.animated .service-item:nth-child(1) { transition-delay: 0.1s; }

.stagger-animate.animated .card:nth-child(2),
.stagger-animate.animated .gallery-item:nth-child(2),
.stagger-animate.animated .service-item:nth-child(2) { transition-delay: 0.2s; }

.stagger-animate.animated .card:nth-child(3),
.stagger-animate.animated .gallery-item:nth-child(3),
.stagger-animate.animated .service-item:nth-child(3) { transition-delay: 0.3s; }

.stagger-animate.animated .card:nth-child(4),
.stagger-animate.animated .gallery-item:nth-child(4),
.stagger-animate.animated .service-item:nth-child(4) { transition-delay: 0.4s; }

.stagger-animate.animated .card:nth-child(5),
.stagger-animate.animated .gallery-item:nth-child(5),
.stagger-animate.animated .service-item:nth-child(5) { transition-delay: 0.5s; }

.stagger-animate.animated .card:nth-child(6),
.stagger-animate.animated .gallery-item:nth-child(6),
.stagger-animate.animated .service-item:nth-child(6) { transition-delay: 0.6s; }

/* Hover Animations */
.hover-lift {
  transition: all 0.3s ease;
}

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

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

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

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

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

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

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(25, 135, 84, 0.5);
}

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

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

/* Continuous Animations */
.float-continuous {
  animation: float 3s ease-in-out infinite;
}

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

spin-continuous {
  animation: spin 2s linear infinite;
}

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

.text-reveal span {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  animation: textReveal 0.8s ease forwards;
}

@keyframes textReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading Animations */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(25, 135, 84, 0.3);
  border-top: 4px solid #198754;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-dots {
  display: inline-block;
}

.loading-dots::after {
  content: '';
  animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
  0%, 20% {
    content: '';
  }
  40% {
    content: '.';
  }
  60% {
    content: '..';
  }
  80%, 100% {
    content: '...';
  }
}

/* Progress Bar Animation */
.progress-bar-animated {
  background: linear-gradient(90deg, #198754, #007bff, #198754);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

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

.parallax-medium {
  transition: transform 0.05s ease-out;
}

.parallax-fast {
  transition: transform 0.02s ease-out;
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #198754, #007bff, #198754);
  z-index: 9999;
  transition: width 0.1s ease;
}

/* Lightbox Animations */
.lightbox {
  animation: fadeIn 0.3s ease;
}

.lightbox-content {
  animation: scaleIn 0.3s ease;
}

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

/* Form Animations */
.form-field {
  transition: all 0.3s ease;
}

.form-field.focused {
  transform: scale(1.02);
}

.form-field.error {
  animation: shake 0.5s ease;
}

.form-field.success {
  border-color: #198754;
  box-shadow: 0 0 10px rgba(25, 135, 84, 0.3);
}

/* Button Animations */
.btn-animated {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-animated::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.btn-animated:hover::before {
  left: 100%;
}

.btn-animated:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Card Animations */
.card-animated {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-animated:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Enhanced Image Animations and Loading */
.image-animated {
  transition: all 0.4s ease;
  opacity: 0;
  transform: scale(0.95);
  animation: imageLoad 0.6s ease-out forwards;
}

.image-animated:hover {
  transform: scale(1.1) rotate(2deg);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Image Loading Animation */
@keyframes imageLoad {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Image Placeholder */
.image-placeholder {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 1.2rem;
  min-height: 200px;
  transition: all 0.3s ease;
}

.image-placeholder:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  transform: scale(1.02);
}

/* Lazy Loading Images */
.lazy-image {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.lazy-image.loaded {
  opacity: 1;
}

/* Image Loading Spinner */
.image-loading {
  position: relative;
  display: inline-block;
}

.image-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid rgba(25, 135, 84, 0.3);
  border-top: 3px solid #198754;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1;
}

/* Optimized Image Sizes */
.hero img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

.service-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 15px;
}

.gallery-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
}

.team-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 50%;
}

/* Image Hover Effects */
.image-hover-zoom {
  overflow: hidden;
  border-radius: 15px;
}

.image-hover-zoom img {
  transition: transform 0.6s ease;
}

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

/* Image Caption Overlay */
.image-caption {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
}

.image-caption::after {
  content: attr(data-caption);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 20px 15px 15px;
  font-size: 0.9rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.image-caption:hover::after {
  transform: translateY(0);
}

/* Navigation Animations */
.nav-item-animated {
  transition: all 0.3s ease;
}

.nav-item-animated:hover {
  transform: translateY(-2px);
}

.nav-link-animated {
  position: relative;
  transition: all 0.3s ease;
}

.nav-link-animated::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #007bff, #198754);
  transition: left 0.3s ease;
}

.nav-link-animated:hover::before {
  left: 0;
}

/* Footer Animations */
.footer-animated {
  position: relative;
  overflow: hidden;
}

.footer-animated::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #198754, #007bff, #198754);
  animation: shimmer 4s ease-in-out infinite;
}

/* Responsive Animation Adjustments */
@media (max-width: 768px) {
  .animate-on-scroll,
  .animate-left,
  .animate-right,
  .animate-scale,
  .animate-bottom,
  .animate-top,
  .animate-zoom,
  .animate-flip-x,
  .animate-flip-y,
  .animate-bounce-left,
  .animate-bounce-right {
    opacity: 1;
    transform: none;
  }
  
  .parallax-slow,
  .parallax-medium,
  .parallax-fast {
    background-attachment: scroll;
  }
}

/* Print Styles */
@media print {
  .animate-on-scroll,
  .animate-left,
  .animate-right,
  .animate-scale,
  .animate-bottom,
  .animate-top,
  .animate-zoom,
  .animate-flip-x,
  .animate-flip-y,
  .animate-bounce-left,
  .animate-bounce-right,
  .stagger-animate {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  
  .scroll-progress,
  .lightbox {
    display: none !important;
  }
}
