/* Voice-search animation layer. Existing Search dimensions and colors remain intact. */
#searchFeedSectionView .voice-search-shell {
  isolation: isolate;
}

#searchFeedSectionView .voice-search-bar {
  position: relative;
  z-index: 2;
  overflow: hidden;
}

#searchFeedSectionView .voice-search-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transform: translateX(-90%);
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.04) 28%, rgba(208, 174, 255, 0.25) 47%, rgba(138, 199, 255, 0.22) 57%, transparent 76%);
}

#searchFeedSectionView .voice-search-bar::after {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: -2;
  border-radius: inherit;
  opacity: 0;
  background: linear-gradient(100deg, rgba(120, 155, 253, 0.32), rgba(239, 98, 212, 0.25), rgba(155, 193, 253, 0.31));
  filter: blur(18px);
  transition: opacity 240ms ease;
}

#searchFeedSectionView .voice-search-bar__search-icon,
#searchFeedSectionView .voice-search-bar__divider {
  transition: opacity 180ms ease, transform 240ms ease;
}

#searchFeedSectionView .voice-search-button {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  background: transparent;
  transition: transform 240ms cubic-bezier(.2, .85, .35, 1.25), filter 220ms ease;
}

#searchFeedSectionView .voice-search-button:hover { transform: scale(1.08) rotate(5deg); }
#searchFeedSectionView .voice-search-button:active { transform: scale(0.94); }

#searchFeedSectionView .voice-search-button__halo {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle, rgba(239, 98, 212, 0.3), rgba(142, 112, 247, 0.12) 54%, transparent 72%);
  transform: scale(0.5);
}

#searchFeedSectionView .voice-search-button__sparkle,
#searchFeedSectionView .voice-search-button__microphone {
  position: absolute;
  transition: opacity 180ms ease, transform 260ms cubic-bezier(.2, .85, .35, 1.25);
}

#searchFeedSectionView .voice-search-button__sparkle { width: 27px; height: 27px; }
#searchFeedSectionView .voice-search-button__microphone { width: 24px; height: 24px; opacity: 0; transform: scale(0.55) rotate(-14deg); }

#searchFeedSectionView .voice-search-bar__listening-copy {
  position: absolute;
  left: 52px;
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: #746de9;
  font-size: clamp(14px, 1.5vw, 18px);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 190ms ease, transform 240ms ease;
}

#searchFeedSectionView .voice-search-bar__listening-dots { display: inline-flex; gap: 4px; }
#searchFeedSectionView .voice-search-bar__listening-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.32; }

#searchFeedSectionView .voice-search-burst {
  position: absolute;
  z-index: 6;
  top: 50%;
  right: 20px;
  width: 20px;
  height: 20px;
  opacity: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

#searchFeedSectionView .voice-search-burst i { position: absolute; top: 9px; left: 9px; width: 4px; height: 4px; border-radius: 50%; background: #ef62d4; }
#searchFeedSectionView .voice-search-burst i:nth-child(2) { background: #789bfd; }
#searchFeedSectionView .voice-search-burst i:nth-child(3) { background: #b494fd; }
#searchFeedSectionView .voice-search-burst i:nth-child(4) { background: #9bc1fd; }
#searchFeedSectionView .voice-search-burst i:nth-child(5) { background: #f6a5df; }
#searchFeedSectionView .voice-search-burst i:nth-child(6) { background: #9f86fb; }

#searchFeedSectionView .voice-search-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

#searchFeedSectionView .voice-search-shell.is-listening .voice-search-bar {
  transform: translateY(-2px) scale(1.006);
  box-shadow: 0 20px 54px rgba(112, 98, 190, 0.18), 0 0 0 5px rgba(169, 115, 239, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

#searchFeedSectionView .voice-search-shell.is-listening .voice-search-bar::before { opacity: 1; animation: voiceShimmer 1.55s linear infinite; }
#searchFeedSectionView .voice-search-shell.is-listening .voice-search-bar::after { opacity: 1; animation: voiceGlow 1.8s ease-in-out infinite; }
#searchFeedSectionView .voice-search-shell.is-listening .voice-search-bar__input { opacity: 0; pointer-events: none; }
#searchFeedSectionView .voice-search-shell.is-listening .voice-search-bar__search-icon { opacity: 0.55; transform: scale(0.88); }
#searchFeedSectionView .voice-search-shell.is-listening .voice-search-bar__listening-copy { opacity: 1; transform: translateY(0); }
#searchFeedSectionView .voice-search-shell.is-listening .voice-search-bar__listening-dots i { animation: voiceDot 1s ease-in-out infinite; }
#searchFeedSectionView .voice-search-shell.is-listening .voice-search-bar__listening-dots i:nth-child(2) { animation-delay: 0.14s; }
#searchFeedSectionView .voice-search-shell.is-listening .voice-search-bar__listening-dots i:nth-child(3) { animation-delay: 0.28s; }
#searchFeedSectionView .voice-search-shell.is-listening .voice-search-button { transform: scale(1.04); filter: drop-shadow(0 0 10px rgba(239, 98, 212, 0.46)); }
#searchFeedSectionView .voice-search-shell.is-listening .voice-search-button__halo { opacity: 1; animation: voiceHalo 1.35s ease-out infinite; }
#searchFeedSectionView .voice-search-shell.is-listening .voice-search-button__sparkle { opacity: 0; transform: scale(0.4) rotate(90deg); }
#searchFeedSectionView .voice-search-shell.is-listening .voice-search-button__microphone { opacity: 1; transform: scale(1) rotate(0); }

#searchFeedSectionView .voice-search-shell.has-result .voice-search-button__sparkle {
  animation: voiceResultSparkle 540ms cubic-bezier(.2, .85, .35, 1.3);
}

#searchFeedSectionView .voice-search-shell.has-result .voice-search-burst {
  animation: voiceBurstContainer 680ms ease-out;
}

#searchFeedSectionView .voice-search-shell.has-result .voice-search-burst i:nth-child(1) { animation: voiceBurst1 680ms ease-out; }
#searchFeedSectionView .voice-search-shell.has-result .voice-search-burst i:nth-child(2) { animation: voiceBurst2 680ms ease-out; }
#searchFeedSectionView .voice-search-shell.has-result .voice-search-burst i:nth-child(3) { animation: voiceBurst3 680ms ease-out; }
#searchFeedSectionView .voice-search-shell.has-result .voice-search-burst i:nth-child(4) { animation: voiceBurst4 680ms ease-out; }
#searchFeedSectionView .voice-search-shell.has-result .voice-search-burst i:nth-child(5) { animation: voiceBurst5 680ms ease-out; }
#searchFeedSectionView .voice-search-shell.has-result .voice-search-burst i:nth-child(6) { animation: voiceBurst6 680ms ease-out; }

@keyframes voiceShimmer { from { transform: translateX(-90%); } to { transform: translateX(90%); } }
@keyframes voiceGlow { 0%, 100% { opacity: 0.42; transform: scale(0.985); } 50% { opacity: 0.78; transform: scale(1.015); } }
@keyframes voiceHalo { 0% { transform: scale(0.55); opacity: 0.65; } 100% { transform: scale(1.75); opacity: 0; } }
@keyframes voiceDot { 0%, 100% { transform: translateY(0); opacity: 0.28; } 50% { transform: translateY(-4px); opacity: 1; } }
@keyframes voiceResultSparkle { 0% { transform: scale(0.5) rotate(-35deg); opacity: 0.3; } 65% { transform: scale(1.35) rotate(18deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes voiceBurstContainer { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes voiceBurst1 { to { transform: translate(34px, -20px) scale(0); } }
@keyframes voiceBurst2 { to { transform: translate(30px, 15px) scale(0); } }
@keyframes voiceBurst3 { to { transform: translate(-5px, 30px) scale(0); } }
@keyframes voiceBurst4 { to { transform: translate(-28px, 17px) scale(0); } }
@keyframes voiceBurst5 { to { transform: translate(-30px, -17px) scale(0); } }
@keyframes voiceBurst6 { to { transform: translate(0, -32px) scale(0); } }

@media (max-width: 620px) {
  #searchFeedSectionView .voice-search-bar__listening-copy { left: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  #searchFeedSectionView .voice-search-bar,
  #searchFeedSectionView .voice-search-button,
  #searchFeedSectionView .voice-search-star,
  #searchFeedSectionView .voice-search-burst { animation: none; transition: none; }
}
