/* 読み上げボタンのスタイル */
.tts-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  border-radius: 50%;
  background-color: #3b82f6;
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  margin-left: 12px;
  vertical-align: middle;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 0;
  overflow: hidden;
  flex-shrink: 0;
}

/* ボタン内のSVGアイコンのサイズ調整 */
.tts-button svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.tts-button:hover {
  background-color: #2563eb;
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.tts-button:active {
  transform: scale(0.95);
}

.tts-button.playing {
  background-color: #ef4444;
  animation: pulse 2s infinite;
}

.tts-button.playing:hover {
  background-color: #dc2626;
}

/* パルスアニメーション */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* ダークモード対応 */
.dark .tts-button {
  background-color: #60a5fa;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dark .tts-button:hover {
  background-color: #3b82f6;
}

.dark .tts-button.playing {
  background-color: #f87171;
}

.dark .tts-button.playing:hover {
  background-color: #ef4444;
}

/* レスポンシブ対応 */
@media (max-width: 640px) {
  .tts-button {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    max-width: 36px;
    max-height: 36px;
    margin-left: 8px;
  }
  
  .tts-button svg {
    width: 16px;
    height: 16px;
  }
}

/* アクセシビリティ向上 */
.tts-button:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.tts-button:focus:not(:focus-visible) {
  outline: none;
}

/* 読み上げ中の視覚的フィードバック */
.tts-button.playing svg {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-2px);
  }
  60% {
    transform: translateY(-1px);
  }
}
