<script setup lang="ts">
defineProps<{ label: string }>()
</script>

<template>
  <div class="thinking" aria-hidden="true">
    <span class="dot" /><span class="dot" /><span class="dot" />
    <span class="label">{{ label }}</span>
  </div>
</template>

<style scoped>
.thinking {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--c-text-faint);
  font-family: var(--f-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dot {
  width: 5px;
  height: 5px;
  background: var(--c-accent);
  border-radius: 50%;
  animation: pulse-dot var(--dur-thinking-pulse) infinite;
}

.dot:nth-child(2) {
  animation-delay: var(--delay-thinking-pulse);
}

.dot:nth-child(3) {
  animation-delay: calc(2 * var(--delay-thinking-pulse));
}

.label {
  margin-left: var(--s-1);
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 0.25;
  }

  50% {
    opacity: 1;
  }
}
</style>
