/* =====================================================
   TRENDPULSE — Extra Animations & Visual Effects
   ===================================================== */

/* ===== ANIMATED HEADLINE ===== */
.hero-title .glow-word {
  position: relative;
}
.hero-title .glow-word::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent2) 40%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: blur(18px);
  opacity: 0.5;
  z-index: -1;
}

/* ===== SPLASH PARTICLES ===== */
@keyframes float-particle {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-120px) rotate(180deg); opacity: 0; }
}

/* ===== CARD SHIMMER ===== */
.shimmer {
  position: relative;
  overflow: hidden;
}
.shimmer::after {
  content: '';
  position: absolute;
  top: 0; left: -150%;
  width: 75%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
  animation: shimmer-move 2s infinite;
}
@keyframes shimmer-move {
  from { left: -150%; }
  to   { left: 200%; }
}

/* ===== GRADIENT BORDER PULSE ===== */
.gradient-border {
  position: relative;
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), var(--accent2), var(--secondary), var(--primary));
  background-size: 300% 300%;
  animation: border-pulse 3s ease infinite;
  z-index: -1;
}
@keyframes border-pulse {
  0%, 100% { background-position: 0% 50%; opacity: 0.7; }
  50%       { background-position: 100% 50%; opacity: 1; }
}

/* ===== TRENDING BADGE PULSE ===== */
@keyframes trending-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,45,120,0.4); }
  50%       { transform: scale(1.02); box-shadow: 0 0 0 8px rgba(255,45,120,0); }
}
.trending-1 { animation: trending-pulse 2.5s ease-in-out infinite; }

/* ===== RANK NUMBER ANIMATIONS ===== */
.trend-card:nth-child(1) .trend-rank { color: rgba(255,184,0,0.3); }
.trend-card:nth-child(2) .trend-rank { color: rgba(148,163,184,0.4); }
.trend-card:nth-child(3) .trend-rank { color: rgba(255,107,53,0.3); }
.trend-card:nth-child(1):hover .trend-rank { color: rgba(255,184,0,0.6); }
.trend-card:nth-child(2):hover .trend-rank { color: rgba(148,163,184,0.7); }
.trend-card:nth-child(3):hover .trend-rank { color: rgba(255,107,53,0.6); }

/* ===== YEAR ITEM HOVER GLOW ===== */
.year-item:hover {
  box-shadow: 0 0 24px rgba(124,58,255,0.25);
}

/* ===== COUNTRY CARD REGION ACCENT ===== */
[data-region="Americas"]             { --card-accent: var(--secondary); }
[data-region="Europe"]               { --card-accent: var(--accent2); }
[data-region="Asia-Pacific"]         { --card-accent: var(--primary); }
[data-region="Middle East & Africa"] { --card-accent: var(--accent1); }
[data-region="Other"]                { --card-accent: var(--accent3); }

.country-card[data-region]::after {
  background: linear-gradient(90deg, var(--card-accent), var(--primary));
}

/* ===== LIVE PULSE INDICATOR ===== */
@keyframes live-ring {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}
.live-ring {
  position: absolute;
  width: 6px; height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: live-ring 1.5s ease-out infinite;
}

/* ===== WORD MORPHING ANIMATION ===== */
@keyframes word-in {
  0%   { opacity: 0; transform: translateY(60%) skewY(3deg); filter: blur(4px); }
  100% { opacity: 1; transform: translateY(0)   skewY(0deg); filter: blur(0px); }
}
/* Override the slide-word animation with a more dramatic word-in */
.hero-title .word {
  animation-name: word-in !important;
  animation-duration: 0.85s !important;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1) !important;
  animation-fill-mode: both !important;
  /* animation-delay is set via inline styles on each element */
}

/* ===== TREND CARD ENTRANCE ===== */
.trends-list .trend-card:nth-child(1)  { animation-delay: 0.05s; }
.trends-list .trend-card:nth-child(2)  { animation-delay: 0.10s; }
.trends-list .trend-card:nth-child(3)  { animation-delay: 0.15s; }
.trends-list .trend-card:nth-child(4)  { animation-delay: 0.20s; }
.trends-list .trend-card:nth-child(5)  { animation-delay: 0.25s; }
.trends-list .trend-card:nth-child(6)  { animation-delay: 0.30s; }
.trends-list .trend-card:nth-child(7)  { animation-delay: 0.35s; }
.trends-list .trend-card:nth-child(8)  { animation-delay: 0.40s; }
.trends-list .trend-card:nth-child(9)  { animation-delay: 0.45s; }
.trends-list .trend-card:nth-child(10) { animation-delay: 0.50s; }

/* ===== COUNTRY GRID STAGGER ===== */
.country-grid .country-card:nth-child(1)  { --reveal-delay: 0.03s; }
.country-grid .country-card:nth-child(2)  { --reveal-delay: 0.06s; }
.country-grid .country-card:nth-child(3)  { --reveal-delay: 0.09s; }
.country-grid .country-card:nth-child(4)  { --reveal-delay: 0.12s; }
.country-grid .country-card:nth-child(5)  { --reveal-delay: 0.15s; }
.country-grid .country-card:nth-child(6)  { --reveal-delay: 0.18s; }

/* ===== TICKER GLOW ===== */
.ticker-bar { box-shadow: 0 8px 32px rgba(0,0,0,0.3); }

/* ===== SECTION TRANSITIONS ===== */
.section { transition: background 0.3s ease; }

/* ===== STAT NUMBER ===== */
.stat-num {
  background: linear-gradient(135deg, currentColor 0%, currentColor 100%);
  -webkit-background-clip: text;
  background-clip: text;
  position: relative;
}

/* ===== HOVER EFFECT: READING LINE ===== */
.trend-card { position: relative; }
.trend-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent2));
  border-radius: 3px 0 0 3px;
  opacity: 0;
  transition: opacity 0.2s;
}
.trend-card:hover::before { opacity: 1; }

/* ===== YEAR GRID COLORFUL RANKS ===== */
.year-item:nth-child(1) .year-item-rank  { color: rgba(255,184,0,0.5); }
.year-item:nth-child(2) .year-item-rank  { color: rgba(148,163,184,0.5); }
.year-item:nth-child(3) .year-item-rank  { color: rgba(255,107,53,0.5); }
.year-item:nth-child(4) .year-item-rank,
.year-item:nth-child(5) .year-item-rank,
.year-item:nth-child(6) .year-item-rank  { color: rgba(124,58,255,0.4); }
.year-item:nth-child(7) .year-item-rank,
.year-item:nth-child(8) .year-item-rank,
.year-item:nth-child(9) .year-item-rank,
.year-item:nth-child(10) .year-item-rank { color: rgba(0,102,255,0.4); }

/* ===== SNAPSHOT CARD TIMELINE LINE ===== */
.snapshot-list { position: relative; }
.snapshot-list::before {
  content: '';
  position: absolute;
  left: 36px;
  top: 24px; bottom: 24px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--accent2) 50%, transparent 100%);
  opacity: 0.2;
  pointer-events: none;
}

/* ===== ABOUT/PROMO BOX ===== */
@media (max-width: 768px) {
  .section [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ===== ANIMATED GRADIENT BORDERS ===== */
.year-item {
  background: linear-gradient(rgba(255,255,255,0.06), rgba(255,255,255,0.06)) padding-box,
              linear-gradient(135deg, rgba(124,58,255,0.2), rgba(0,212,255,0.1)) border-box;
  border: 1px solid transparent;
}
.year-item:hover {
  background: linear-gradient(rgba(255,255,255,0.1), rgba(255,255,255,0.1)) padding-box,
              linear-gradient(135deg, rgba(124,58,255,0.5), rgba(0,212,255,0.3)) border-box;
}

/* ===== NAV ACTIVE UNDERLINE ===== */
.nav-links a.active {
  position: relative;
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 14px; right: 14px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* ===== GLOBE DOTS ===== */
@keyframes dot-pulse {
  0%, 100% { r: 5; opacity: 0.85; }
  50%       { r: 7; opacity: 1; }
}
@keyframes dot-pulse-2 {
  0%, 100% { r: 4; opacity: 0.8; }
  50%       { r: 6; opacity: 1; }
}
@keyframes dot-pulse-3 {
  0%, 100% { r: 5.5; opacity: 0.85; }
  50%       { r: 7.5; opacity: 1; }
}
