.tts-spin {
  animation: tts-spin 2s linear infinite;
}

@keyframes tts-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.fade-in {
  opacity: 0;
  transition: opacity 500ms ease-in;
}

.fade-in.visible {
  opacity: 1;
}

.tts-toolbar {
}

.tts-toolbar-player {
  display: flex;
  padding: 0 var(--size-4-3);
  height: 32px;
  gap: var(--size-4-2);
  align-items: stretch;
}

.tts-toolbar-player-button-group {
  display: flex;
  align-items: center;
}

.tts-toolbar-player-item-margin-right {
  margin-right: 0.5rem;
}

.tts-audio-status-container {
  flex: 1 1 auto;
  display: flex;
  overflow: hidden;
  align-items: center;
}

.tts-audio-visualizer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 2rem;
  height: 80%;
}

.tts-audio-visualizer-bar {
  background-color: var(--icon-color);
  border-radius: 10px;
  width: 6%;
  transition: height 0.04s linear;
}

.tts-audio-status-error {
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: left;
}

.tts-audio-status-error-text {
  /* marginLeft: `${spacer}`, */
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  background-color: rgba(var(--background-modifier-error-rgb), 0.5);
  font-style: italic;
  font-size: var(--font-ui-small);
  padding: 0.15rem;
  border-radius: var(--radius-s);
}

.tts-audio-status-loading {
  display: flex;
  justify-content: center;
  align-items: center;
}
.tts-audio-status-error-icon {
  display: inline-flex;
  padding-right: 0.33rem;
  justify-content: center;
  align-items: center;
}

.tts-tab-playing-icon {
  --icon-size: var(--icon-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.tts-tab-playing-icon .tts-toolbar-icon {
  padding-top: 0.1rem;
  padding-right: 0.33rem;
}

/**
 * Settings tab
 */

.tts-settings-model-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: row;
}

@media (max-width: 1024px) {
  .tts-settings-model-header {
    flex-direction: column;
  }
}

.tts-settings-model-header h1 {
  flex: 1 1 auto;
}

.tts-settings-error-container details {
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-s);
  background-color: var(--background-primary-alt);
}

.tts-settings-error-container summary:hover {
  cursor: pointer;
}

.tts-settings-error-container summary > div {
  display: inline-flex;
  flex-direction: row;
  float: right;
  width: calc(100% - 1rem);
  justify-content: space-between;
}

.tts-error-input {
  border-color: var(--background-modifier-error);
}

.tts-error-text {
  color: var(--text-error);
  display: block;
  width: 100%;
  margin-top: 4px;
}

.tts-instructions-textarea {
  width: 100%;
  margin-top: 12px;
}

.tts-settings-block {
  display: block;
}



/** player view */

details .tts-error-details {
  opacity: 0;
}

details[open] .tts-error-details {
  animation: fadeIn 0.25s linear forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

