/* ===============================================
   MOBILE OPTIMIZED ANIMATIONS
   =============================================== */

@media (max-width: 768px) {
  /* Reduce animation complexity on mobile */
  [data-aos] {
    transition-duration: 0.4s !important;
  }

  /* Disable heavy animations on mobile */
  .floating,
  .parallax,
  .subtle-rotate {
    animation: none !important;
    transform: none !important;
  }

  /* Simplified hover effects for mobile */
  .btn:hover {
    transform: none;
    box-shadow: none;
  }

  .service-item:hover {
    transform: none;
    box-shadow: none;
  }

  /* Touch-friendly interactions */
  .btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }

  .service-item:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }

  /* Mobile optimizations for about background */
  .about__background {
    height: 400px !important;
    object-position: center center;
  }

  /* Disable all transforms on mobile for about background */
  .about__background {
    transform: none !important;
    animation: none !important;
    transition: opacity 0.3s ease;
  }
}

@media (max-width: 480px) {
  .about__background {
    height: 300px !important;
    opacity: 0.8;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .about__background {
    height: 550px;
    object-position: center bottom;
  }
}

/* ===============================================
   ACCESSIBILITY IMPROVEMENTS
   =============================================== */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-aos] {
    transition: none !important;
    animation: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .preloader {
    background: #000;
    color: #fff;
  }

  .scroll-progress {
    background: #fff;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .preloader {
    background: linear-gradient(135deg, #0f2ddb 0%, #1b43fe 100%);
  }
}

/* ===============================================
   PERFORMANCE OPTIMIZATIONS
   =============================================== */

/* GPU acceleration for animated elements */
.btn,
.service-item,
.accordion__item,
.nav__link,
[data-aos] {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Remove will-change after animation completes */
.aos-animate {
  will-change: auto;
}

/* Optimize images for animation */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* ===============================================
   LOADING STATES & SKELETON SCREENS
   =============================================== */

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

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

/* ===============================================
   MICRO-INTERACTIONS
   =============================================== */

/* Button ripple effect */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

/* Form field focus states */
.form__input:focus,
.form__textarea:focus {
  animation: form-focus 0.3s ease;
}

@keyframes form-focus {
  0% {
    box-shadow: 0 0 0 0 rgba(27, 67, 254, 0.4);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(27, 67, 254, 0.1);
  }
}

/* Icon animations */
.service-item__icon svg {
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.service-item:hover .service-item__icon svg {
  animation: icon-bounce 0.6s ease;
}

@keyframes icon-bounce {
  0%,
  20%,
  60%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  40% {
    transform: translateY(-10px) rotate(10deg);
  }
  80% {
    transform: translateY(-5px) rotate(-5deg);
  }
}

/* ===============================================
   SCROLL-TRIGGERED ANIMATIONS
   =============================================== */

/* Counter animation */
.counter {
  font-variant-numeric: tabular-nums;
}

.counter[data-count] {
  animation: counter-up 2s ease-out;
}

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

/* Progress bars */
.progress-bar {
  position: relative;
  background: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 8px;
  background: linear-gradient(90deg, #1b43fe, #0f2ddb);
  border-radius: 10px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar.animate .progress-bar__fill {
  transform: scaleX(1);
}

/* ===============================================
   PAGE TRANSITION EFFECTS
   =============================================== */

.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1b43fe 0%, #0f2ddb 100%);
  z-index: 10000;
  transform: translateX(-100%);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition.active {
  transform: translateX(0);
}

.page-transition.leaving {
  transform: translateX(100%);
}

/* ===============================================
   SCROLL ANIMATIONS
   =============================================== */

/* Smooth reveal animation */
.reveal {
  position: relative;
  overflow: hidden;
}

.reveal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1b43fe;
  transform: translateX(-100%);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active::before {
  transform: translateX(100%);
}

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

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

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

/* Stagger animation for multiple elements */
.stagger-animation .stagger-item {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-animation.active .stagger-item {
  opacity: 1;
  transform: translateY(0);
}

.stagger-animation.active .stagger-item:nth-child(1) {
  transition-delay: 0.1s;
}
.stagger-animation.active .stagger-item:nth-child(2) {
  transition-delay: 0.2s;
}
.stagger-animation.active .stagger-item:nth-child(3) {
  transition-delay: 0.3s;
}
.stagger-animation.active .stagger-item:nth-child(4) {
  transition-delay: 0.4s;
}
.stagger-animation.active .stagger-item:nth-child(5) {
  transition-delay: 0.5s;
}
.stagger-animation.active .stagger-item:nth-child(6) {
  transition-delay: 0.6s;
}
