/*
 * KPI Banner CSS — Modern Deep Gradient with Bottom Flare
 * Replaces the old flow waves to match the premium design image
 */

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

.sp-kpi-ticker-wrapper {
  margin: 6px auto;
  max-width: 1500px;
  width: 98%;
  height: 85px;
  border-radius: 20px;
  /* Deep vibrant gradient: dark purple left -> vibrant blue/purple right */
  background: linear-gradient(
    90deg,
    #120933 0%,
    #1a0e4a 12%,
    #7c3aed 28%,
    #a78bfa 42%,
    #462ddf 56%,
    #7c3aed 72%,
    #1a0e4a 88%,
    #120933 100%
  );
  background-size: 200% 100%;
  animation: gradientPan 5s ease-in-out infinite alternate;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 15px 40px rgba(20, 11, 46, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

/* Bright glowing flare at the bottom center */
.sp-kpi-ticker-wrapper::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 30px;
  background: radial-gradient(
    ellipse at center,
    rgba(167, 139, 250, 0.9) 0%,
    rgba(139, 92, 246, 0.4) 40%,
    transparent 70%
  );
  filter: blur(14px);
  pointer-events: none;
  z-index: 1;
}

/* Hide old pattern elements */
.sp-kpi-pattern,
.sp-kpi-glow-bloom,
.sp-kpi-corner-glow {
  display: none !important;
}

.sp-kpi-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.sp-kpi-message {
  position: absolute;
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.25rem, 2.5vw, 1.9rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.sp-kpi-message strong {
  font-family: "Outfit", sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: inherit;
  position: relative;
  display: inline-block;
  background: linear-gradient(135deg, #a5b4fc, #c7d2fe, #e0e7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 24px rgba(99, 102, 241, 0.4);
  z-index: 0;
}

.sp-kpi-message strong::before {
  content: '';
  position: absolute;
  inset: -4px -8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(8px);
  z-index: -1;
}

.sp-kpi-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.04);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s ease;
}

.sp-kpi-icon-wrap i {
  font-size: 1.4rem;
  color: #fff;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sp-kpi-enter .sp-kpi-icon-wrap {
  animation: kpiIconPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

@keyframes kpiIconPop {
  0% { transform: scale(0) rotate(-20deg); box-shadow: 0 0 0 rgba(255,255,255,0); }
  60% { transform: scale(1.2) rotate(5deg); box-shadow: 0 0 30px rgba(255,255,255,0.15); }
  100% { transform: scale(1) rotate(0deg); box-shadow: 0 0 20px rgba(255,255,255,0.04); }
}

/* Animations */
.sp-kpi-enter {
  animation: kpiEnter 0.7s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
  pointer-events: auto;
}

.sp-kpi-leave {
  animation: kpiLeave 0.5s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
  pointer-events: none;
}

@keyframes kpiEnter {
  0% {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes kpiLeave {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-16px) scale(0.95);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .sp-kpi-ticker-wrapper {
    margin-top: 32px;
    height: auto;
    min-height: 80px;
    padding: 20px 0;
  }
  .sp-kpi-message {
    white-space: normal;
    text-align: center;
    font-size: 1.15rem;
    padding: 0 20px;
    gap: 10px;
    font-weight: 900;
    letter-spacing: -0.02em;
  }
  .sp-kpi-message strong {
    font-size: inherit;
    letter-spacing: -0.01em;
  }
  .sp-kpi-icon-wrap {
    width: 32px;
    height: 32px;
  }
  .sp-kpi-glow-bloom {
    width: 280px;
    height: 280px;
    top: -140px;
    left: 10%;
    filter: blur(60px);
  }
  .corner-left {
    width: 120px;
    height: 120px;
    top: -60px;
    left: -40px;
    filter: blur(35px);
  }
  .corner-right {
    width: 100px;
    height: 100px;
    top: -50px;
    right: -35px;
    filter: blur(35px);
  }
}
