/* ==========================================================================
   LIVE MARKET ANIMATIONS & DYNAMIC MICRO-INTERACTIONS CSS
   ========================================================================== */

/* ==========================================================================
   0. EXECUTIVE BRANDING TYPOGRAPHY & COMMODITY DATA NUMBER FONTS
   ========================================================================== */
/* All Headings, Titles & Brand Elements use Plus Jakarta Sans */
h1, h2, h3, h4, .font-display, .font-headline-lg, .font-headline-md {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  letter-spacing: -0.028em;
}

/* ALL Data Text, Egg Prices, Mandi Rates, Table Numbers, Calculator Output & Statistics use Space Grotesk Tabular Nums */
table td, table th,
#live-prices .font-extrabold,
#live-prices .text-2xl,
#live-prices .text-3xl,
#state-breakdown-card .text-2xl,
#state-breakdown-card .font-extrabold,
#calc-retail-total,
#calc-wholesale-total,
#calc-tray-total,
#calc-peti-total,
.calc-quick-btn,
#calc-qty-input,
.font-mono,
.font-data,
[class*="price-val"],
.animate-marquee b,
.animate-marquee span {
  font-family: 'Space Grotesk', 'JetBrains Mono', sans-serif !important;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "cv01" 1, "ss01" 1;
  letter-spacing: -0.015em;
}

/* Crisp Technical & Code labels */
code, pre, .font-label-sm {
  font-family: 'JetBrains Mono', monospace !important;
}

/* 1. Scroll-Triggered Fade-Up Section & Card Animations */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delay helpers for table rows and cards */
.delay-1 { transition-delay: 100ms; }
.delay-2 { transition-delay: 200ms; }
.delay-3 { transition-delay: 300ms; }
.delay-4 { transition-delay: 400ms; }

/* 2. Live Market Pulse Dot & Shimmer Effects */
@keyframes livePulseGlow {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  50% {
    transform: scale(1.15);
    opacity: 0.85;
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
}

.live-indicator-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background-color: #10B981;
  animation: livePulseGlow 2s infinite ease-in-out;
}

/* 3. Live Price Update Flash Micro-Animations */
@keyframes priceFlashUp {
  0% {
    background-color: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.6);
  }
  100% {
    background-color: transparent;
    border-color: inherit;
  }
}

@keyframes priceFlashGolden {
  0% {
    background-color: rgba(251, 191, 36, 0.25);
    border-color: rgba(251, 191, 36, 0.6);
  }
  100% {
    background-color: transparent;
    border-color: inherit;
  }
}

.animate-price-flash {
  animation: priceFlashUp 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-price-flash-golden {
  animation: priceFlashGolden 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 4. Enhanced Interactive Card Elevation on Hover */
.glass-card-hover {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.3s ease;
}

.glass-card-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -10px rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.35);
}

/* 5. Shimmer Ticker Animation for Transit Freight Ribbon */
@keyframes shimmerPass {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer-badge {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(251, 191, 36, 0.2) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 200% 100%;
  animation: shimmerPass 4s infinite linear;
}

/* ==========================================================================
   6. FULL-SCREEN FIXED EGG DOODLE WALLPAPER BACKGROUND (7% SUBTLE OPACITY)
   ========================================================================== */
.egg-doodle-wallpaper {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 0;
  pointer-events: none;
  background-image: url('../images/egg-doodle-bg.svg');
  background-repeat: repeat;
  background-size: 340px 340px;
  background-position: center;
  opacity: 0.15; /* Increased to 15% for beautiful, rich visibility while keeping text crisp */
  animation: floatDoodlePattern 60s infinite linear;
}

@keyframes floatDoodlePattern {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: -340px 340px;
  }
}

/* ==========================================================================
   7. POPULAR MANDI CITIES WORD CLOUD (FLOATING / OSCILLATING TAGS)
   ========================================================================== */
@keyframes floatCloud1 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(0, -9px) rotate(1deg); }
}
@keyframes floatCloud2 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-7px, -6px) rotate(-1deg); }
}
@keyframes floatCloud3 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(8px, -8px) rotate(1deg); }
}
@keyframes floatCloud4 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(0, -11px) rotate(-1.5deg); }
}
@keyframes floatCloud5 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-6px, 6px) rotate(1deg); }
}
@keyframes floatCloud6 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(6px, -10px) rotate(-1deg); }
}

.cloud-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease,
              background-color 0.3s ease;
  will-change: transform;
  cursor: pointer;
  user-select: none;
  opacity: 1 !important;
  visibility: visible !important;
}

.cloud-tag:hover {
  animation-play-state: paused !important;
  transform: scale(1.12) translateY(-4px) !important;
  z-index: 20;
  box-shadow: 0 15px 35px -5px rgba(251, 191, 36, 0.25);
  border-color: rgba(251, 191, 36, 0.6) !important;
}

/* Staggered floating classes */
.float-tag-1 { animation: floatCloud1 4.2s infinite ease-in-out; }
.float-tag-2 { animation: floatCloud2 5.1s infinite ease-in-out -1.1s; }
.float-tag-3 { animation: floatCloud3 3.8s infinite ease-in-out -0.6s; }
.float-tag-4 { animation: floatCloud4 5.8s infinite ease-in-out -2.2s; }
.float-tag-5 { animation: floatCloud5 4.6s infinite ease-in-out -1.7s; }
.float-tag-6 { animation: floatCloud6 6.2s infinite ease-in-out -3.1s; }

#popular-cities-cloud,
#popular-cities-cloud .glass-card {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

