/* Futuristic Guided Tour Overlay Styling */
.tour-highlight {
  position: relative !important;
  z-index: 10000 !important;
  box-shadow: 0 0 0 4px rgba(0, 255, 200, 0.5), 0 0 30px rgba(0, 255, 200, 0.8) !important;
  border-radius: 12px;
  background-color: #1e293b !important;
  /* Force a solid background so it isn't transparent */
  transition: all 0.3s ease-out;
  pointer-events: auto;
}

/* Helper to ensure parent stacking contexts don't trap the highlight */
.tour-ancestor-fix {
  position: relative !important;
  isolation: isolate;
}

.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.85);
  /* Slightly more solid for tour focus */
  z-index: 9998;
  animation: fadeInOverlay 0.3s ease-out;
}

.tour-tooltip {
  position: absolute;
  background: rgba(20, 25, 40, 0.95);
  border: 1px solid rgba(0, 255, 200, 0.5);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 255, 200, 0.2), inset 0 0 20px rgba(0, 255, 200, 0.05);
  max-width: 320px;
  z-index: 10001;
  color: #fff;
  pointer-events: auto;
}

@keyframes fadeInOverlay {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================= */
/*       EXPERIENCE OS: GAMIFICATION         */
/* ========================================= */

.xp-popup {
  position: fixed;
  right: 24px;
  background: #0f172a;
  border: 1px solid rgba(16, 185, 129, 0.6);
  padding: 12px 20px;
  border-radius: 16px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  animation: floatUpFade 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}

@keyframes floatUpFade {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }

  15% {
    opacity: 1;
    transform: translateY(0) scale(1.05);
  }

  30% {
    transform: translateY(0) scale(1);
  }

  80% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-40px);
  }
}

@keyframes levelUpPulse {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.animate-level-up {
  animation: levelUpPulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.animate-slide-up-fade {
  animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-pulse-once {
  animation: pulseOnce 0.6s ease-in-out;
}

@keyframes pulseOnce {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
    color: #00ffc8;
  }
}

/* ========================================= */
/*       PHASE 19: MICRO-POLISH LAYER        */
/* ========================================= */

:root {
  --ease: cubic-bezier(.4, 0, .2, 1);
  --fast: 120ms;
  --normal: 220ms;
  --slow: 350ms;
}

/* Premium Elements Smoothness */
.card,
.achievement-card,
.roadmap-card,
.strategy-card,
.btn,
button,
input,
select {
  transition: background-color var(--normal) var(--ease),
    box-shadow var(--normal) var(--ease),
    transform var(--fast) var(--ease),
    border-color var(--normal) var(--ease);
}

/* Premium SaaS Feel Card Hover Elevation */
.card,
.achievement-card,
.roadmap-card,
.strategy-card {
  position: relative;
  overflow: hidden;
}

.card:hover,
.achievement-card:hover,
.roadmap-card:hover,
.strategy-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 35px rgba(0, 0, 0, .35);
}

/* Gamification Aura */
.glow {
  box-shadow: 0 0 15px rgba(34, 197, 94, .35);
}

.glow-gold {
  box-shadow: 0 0 18px rgba(250, 204, 21, .4);
}

/* Button Micro-Interaction Upgrade */
button,
.btn {
  cursor: pointer;
}

button:hover,
.btn:hover {
  transform: translateY(-2px);
}

button:active,
.btn:active {
  transform: translateY(0px) scale(.97);
}

/* XP Counter Micro-Bounce */
@keyframes xpPop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
  }
}

.xp-pop {
  animation: xpPop .25s ease;
}

/* Modal Soft Entrance Animation */
@keyframes modalFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.achievement-toast {
  animation: modalFade .25s ease;
}

/* Shimmer Loading State (Perceived Speed Boost) */
.skeleton {
  background: linear-gradient(90deg,
      #1f2937 25%,
      #374151 50%,
      #1f2937 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Smooth Page Section Reveal */
.reveal {
  opacity: 0;
  transform: translateY(15px);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Subtle Background Depth Layer */
body {
  background-image: radial-gradient(circle at top right, rgba(37, 99, 235, .08), transparent 60%);
  background-attachment: fixed;
}

@media (max-width: 768px) {
  body {
    background-attachment: scroll !important;
  }
}