/* ============================================
   TECHNICAL ENHANCEMENTS & ANIMATIONS
   ============================================ */

/* 1. IMAGE LAZY LOADING */
img[loading="lazy"][data-src] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img[loading="lazy"][data-src].loaded {
  opacity: 1;
}

/* Normal lazy images (with src) should be visible immediately */
img[loading="lazy"]:not([data-src]) {
  opacity: 1;
}

/* Loading skeleton for images */
.image-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 8px;
}

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

/* 2. SCROLL ANIMATIONS */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* 3. MICRO-INTERACTIONS */
.main-btn, .border-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-btn::before {
  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.6s, height 0.6s;
}

.main-btn:hover::before {
  width: 300px;
  height: 300px;
}

.main-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(4, 93, 233, 0.3);
}

.main-btn:active {
  transform: translateY(0);
}

/* Feature items hover */
.feature-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.feature-item .icon {
  transition: transform 0.3s ease;
}

.feature-item:hover .icon {
  transform: scale(1.1) rotate(5deg);
}

/* 4. PARALLAX EFFECTS (Subtle) - DISABLED FOR IMAGES */
.parallax-slow {
  transition: transform 0.1s ease-out;
}

/* Disable all animations for images */
img,
.pb-image img,
.pb-image,
img.fade-in-left,
img.fade-in-right,
img.fade-in-up,
.pb-image.fade-in-left,
.pb-image.fade-in-right,
.pb-image.fade-in-up {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;
}

/* Ensure hero image is visible */
.hero-image,
.hero-image img,
.hero-image picture,
.hero-image picture img {
  opacity: 1 !important;
  display: block !important;
  visibility: visible !important;
  max-width: 100% !important;
  height: auto !important;
}

/* Accessibility - Improve contrast ratios */
.section-title p {
  color: #333333 !important;
}

.features-wrapper .feature-item p {
  color: #333333 !important;
}

.features-wrapper .section-title p {
  color: #333333 !important;
}

/* Ensure FontAwesome icons are visible */
.fa,
.fas,
.far,
.fal,
.fab,
.fa-shield,
.fa-shield-check,
.fa-microchip,
.fa-memory,
.fa-hdd,
.fa-users,
.fa-headset,
.fa-check-circle,
.fa-chevron-right,
.fa-chevron-down,
.fa-times,
.fa-bars,
.fa-bolt,
.fa-cloud,
.faq-head span i,
.faq-head span .fa-chevron-down,
i.fa,
i.fas,
i.far,
i.fal,
i.fab,
.feature-item .icon i,
.f-item .icon i,
.f-item .icon span i,
.notification-icon i,
.call-us-wrap i,
.faq-head span i,
.faq-head span .fa-chevron-down {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
  font-weight: 900 !important;
  font-style: normal !important;
  font-variant: normal !important;
  text-rendering: auto !important;
  line-height: 1 !important;
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

.far {
  font-weight: 400 !important;
}

/* 5. LOADING STATES */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 6. SMOOTH TRANSITIONS */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

a, button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 7. BACK TO TOP BUTTON */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #045de9 0%, #09c6f9 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(4, 93, 233, 0.4);
  z-index: 9998;
  transition: all 0.3s ease;
  opacity: 0;
  transform: scale(0.8);
}

.back-to-top.show {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

.back-to-top:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 6px 20px rgba(4, 93, 233, 0.5);
}

.back-to-top i {
  font-size: 20px;
}

/* 8. ACCESSIBILITY IMPROVEMENTS */
*:focus {
  outline: 2px solid #045de9;
  outline-offset: 2px;
}

button:focus,
a:focus {
  outline: 2px solid #045de9;
  outline-offset: 2px;
}

/* Remove outline from logo link */
.logo a:focus,
.logo a:active {
  outline: none !important;
  box-shadow: none !important;
}

/* Skip to content link for screen readers */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #045de9;
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 10000;
}

.skip-to-content:focus {
  top: 0;
}

/* 9. MOBILE OPTIMIZATIONS */
@media (max-width: 768px) {
  .fade-in-up,
  .fade-in-left,
  .fade-in-right {
    opacity: 1;
    transform: none;
  }
  
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
  
  /* Disable parallax on mobile for performance */
  .parallax-slow {
    transform: none !important;
  }
}

/* 10. PERFORMANCE OPTIMIZATIONS */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 11. CARD HOVER EFFECTS */
.horizontal-pricing-table,
.feature-item,
.pb-content {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.horizontal-pricing-table:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 50px rgba(4, 93, 233, 0.15);
}

/* 12. SMOOTH SCROLLING */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* 13. IMAGE OPTIMIZATION */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 14. FORM VALIDATION STYLES */
.form-control:invalid {
  border-color: #dc3545;
}

.form-control:valid {
  border-color: #28a745;
}

.form-feedback {
  display: none;
  color: #dc3545;
  font-size: 14px;
  margin-top: 5px;
}

.form-control:invalid ~ .form-feedback {
  display: block;
}

/* 15. LOADING OVERLAY */
.page-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.page-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #045de9;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
