/* Narration Button & Progress Bar */

/* Play button - bottom-left fixed */
.narration-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--ts-blue, #3178c6);
  background: rgba(26, 26, 46, 0.9);
  color: var(--ts-blue, #3178c6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  padding: 0;
}

.narration-btn:hover {
  background: var(--ts-blue, #3178c6);
  color: white;
  transform: scale(1.1);
}

.narration-btn.hidden {
  display: none;
}

/* Playing state */
.narration-btn.playing {
  background: var(--ts-blue, #3178c6);
  color: white;
  animation: narration-pulse 1.5s ease-in-out infinite;
}

@keyframes narration-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(49, 120, 198, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(49, 120, 198, 0); }
}

/* Play/Stop icons (SVG inline) */
.narration-btn .icon-play,
.narration-btn .icon-stop {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.narration-btn .icon-stop { display: none; }
.narration-btn.playing .icon-play { display: none; }
.narration-btn.playing .icon-stop { display: block; }

/* Top progress bar */
.narration-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--ts-blue, #3178c6);
  z-index: 101;
  width: 0%;
  transition: width 0.3s linear;
  opacity: 0;
}

.narration-progress.active {
  opacity: 1;
}

/* Keyboard shortcut hint */
.narration-btn::after {
  content: 'Space';
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #666;
  font-family: 'JetBrains Mono', monospace;
  opacity: 0;
  transition: opacity 0.2s;
}

.narration-btn:hover::after {
  opacity: 1;
}
