/* 
 * Custom CSS for Elevate SaaS Landing Page 
 * Augmenting Tailwind CSS utility classes
 */

/* Ambient Blob Backgrounds */
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: rgba(36, 65, 134, 0.15);
  /* #244186 (Blue) */
  animation: drift 20s infinite alternate ease-in-out;
}

.blob-2 {
  top: 20%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: rgba(83, 41, 112, 0.15);
  /* #532970 (Purple) */
  animation: drift 25s infinite alternate-reverse ease-in-out;
}

@keyframes drift {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(50px, 30px) scale(1.05);
  }
}

/* Glassmorphism Utilities */
.glass-nav {
  background: rgba(248, 250, 252, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glass-nav.scrolled {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

.glass-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Typography Tweaks for Premium Feel */
h1,
h2,
h3 {
  letter-spacing: -0.03em;
}

/* Focus ring for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #244186;
  outline-offset: 2px;
}

/* Animations & Transitions */
.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-up.active {
  opacity: 1;
  transform: translateY(0);
}

/* Hero Floating Elements Animation */
.hero-float-main {
  animation: float-slow 8s ease-in-out infinite;
}

.hero-float-1 {
  animation: float-fast 6s ease-in-out infinite;
}

.hero-float-2 {
  animation: float-medium 7s ease-in-out infinite reverse;
}

@keyframes float-slow {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0px);
  }
}

@keyframes float-medium {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-15px);
  }

  100% {
    transform: translateY(0px);
  }
}

@keyframes float-fast {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-20px);
  }

  100% {
    transform: translateY(0px);
  }
}

/* Specific component styles */
.btn-lift {
  will-change: transform, box-shadow;
}

/* Hide scrollbar for a cleaner look when appropriate, but allow scrolling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f8fafc;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Custom Animation for Marquee */
@keyframes scroll {
  0% {
    transform: translate3d(0, 0, 0);
  }

  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes text-gradient {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.animate-text-gradient {
  background-size: 200% auto;
  animation: text-gradient 3s ease infinite;
}

/* Process Step Animations */
@keyframes process-dot {
  0% {
    left: 0%;
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  95% {
    opacity: 1;
    left: 100%;
    transform: scale(1);
  }
  100% {
    left: 100%;
    opacity: 0;
    transform: scale(0);
  }
}

@keyframes process-trail {
  0% {
    width: 0%;
    opacity: 1;
  }
  95% {
    width: 100%;
    opacity: 1;
  }
  100% {
    width: 100%;
    opacity: 0;
  }
}

@keyframes activate-box-1 {
  0%,
  10% {
    background-color: #ffffff;
    color: #244186;
    border-color: #e5e9f6;
  }
  15%,
  95% {
    background-color: #244186;
    color: #ffffff;
    border-color: #532970;
  }
  96%,
  100% {
    background-color: #ffffff;
    color: #244186;
    border-color: #e5e9f6;
  }
}

@keyframes activate-box-2 {
  0%,
  35% {
    background-color: #ffffff;
    color: #244186;
    border-color: #e5e9f6;
  }
  40%,
  95% {
    background-color: #244186;
    color: #ffffff;
    border-color: #532970;
  }
  96%,
  100% {
    background-color: #ffffff;
    color: #244186;
    border-color: #e5e9f6;
  }
}

@keyframes activate-box-3 {
  0%,
  60% {
    background-color: #ffffff;
    color: #244186;
    border-color: #e5e9f6;
  }
  65%,
  95% {
    background-color: #244186;
    color: #ffffff;
    border-color: #532970;
  }
  96%,
  100% {
    background-color: #ffffff;
    color: #244186;
    border-color: #e5e9f6;
  }
}

/* Celebration effect */
@keyframes celebrate-box-4 {
  0%,
  85% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(36, 65, 134, 0.6);
  }
  88% {
    transform: scale(1.15);
    box-shadow: 0 0 0 20px rgba(36, 65, 134, 0);
  }
  95% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(36, 65, 134, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(36, 65, 134, 0);
  }
}

.animate-process-dot {
  animation: process-dot 5s ease-in-out infinite;
}

.animate-process-trail {
  animation: process-trail 5s ease-in-out infinite;
}

.animate-box-1 {
  animation: activate-box-1 5s ease-in-out infinite;
}

.animate-box-2 {
  animation: activate-box-2 5s ease-in-out infinite;
}

.animate-box-3 {
  animation: activate-box-3 5s ease-in-out infinite;
}

.animate-box-4 {
  animation: celebrate-box-4 5s ease-in-out infinite;
}

/* --- Mobile Optimization & Accessibility Enhancements --- */

/* Ensure responsive images globally */
img,
video,
svg,
canvas {
  max-width: 100%;
  height: auto;
}

/* Prevent layout breaking on small screens */
html,
body {
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Improve button touch area (min 44px height) and Typography tweaks for smaller screens */
@media (max-width: 1024px) {
  /* Make interactive elements finger-friendly */
  a.btn-lift,
  button,
  select,
  input,
  .mobile-link {
    min-height: 44px;
    min-width: 44px;
  }

  /* Opt out line-height links to prevent layout shifts */
  p a {
    min-height: auto;
    min-width: auto;
  }
}

@media (max-width: 640px) {
  /* Optimize typography for readability */
  body {
    font-size: 16px;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
  }

  /* Make spacing consistent */
  section {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }
}
