/*--------------------------------------------------------------
# Antbuild Software Pvt Ltd — Micro-Interactions & Text Animations
--------------------------------------------------------------*/

/* Animated Shimmering Text Gradient */
.text-gradient-animated,
.hero-gradient-text {
  background: linear-gradient(135deg, #007AA5 0%, #00b4d8 40%, #005F82 80%, #007AA5 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shinyTextGradient 6s ease-in-out infinite;
  display: inline-block;
}

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

/* Prevent Layout Height Shifting & Page Jitter During Typewriter Animation */
.hero-section h1 {
  min-height: 165px;
}

@media (max-width: 991px) {
  .hero-section h1 {
    min-height: 140px;
  }
}

/* Dedicated Next Line Animated Text Block */
.hero-animated-line {
  display: block;
  min-height: 1.2em;
  margin-top: 4px;
}

#hero-dynamic-text {
  display: inline-block;
  min-height: 1.15em;
}

/* Typist Cursor Animation */
.typing-cursor {
  display: inline-block;
  margin-left: 3px;
  font-weight: 400;
  color: var(--color-primary);
  animation: blinkCursor 0.8s infinite;
  vertical-align: bottom;
}

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

/* Staggered Fade Up Entrance Animations */
.hero-fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: heroFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }

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

/* General Fade In & Keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* Brand Logo Loader Animations & Page Preloader */
.logo-loader {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--color-primary, #007AA5);
}

.logo-loader-img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  animation: logoPulseSpin 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  display: inline-block;
  vertical-align: middle;
}

.logo-loader-img.sm {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.logo-loader-img.lg {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

@keyframes logoPulseSpin {
  0% {
    transform: scale(0.92) rotate(0deg);
    box-shadow: 0 0 4px rgba(0, 122, 165, 0.3);
  }
  50% {
    transform: scale(1.15) rotate(180deg);
    box-shadow: 0 0 18px rgba(0, 122, 165, 0.6);
  }
  100% {
    transform: scale(0.92) rotate(360deg);
    box-shadow: 0 0 4px rgba(0, 122, 165, 0.3);
  }
}

/* Page Logo Preloader Overlay */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#preloader.preloader-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.preloader-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 122, 165, 0.25);
  animation: logoPulseSpin 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.preloader-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-weight: 800;
  font-size: 20px;
  color: #0f172a;
  letter-spacing: -0.02em;
}

/* Respect Accessibility Prefers-Reduced-Motion */
@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;
  }
}
