/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 0.5rem;
}

.btn:hover {
  background: var(--color-bg-secondary);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

/* Icons */
.icon {
  display: none !important;
}

.icon-sm {
  width: 1em;
  height: 1em;
}

.icon-lg {
  width: 1.5em;
  height: 1.5em;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25em 0.5em;
  border-radius: 1em;
  font-size: 0.75em;
  font-weight: 500;
  line-height: 1;
  background: var(--color-bg-secondary);
  color: var(--color-text);
}

.badge-primary {
  background: var(--color-primary);
  color: white;
}

/* Tooltips */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5em 1em;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.875em;
  white-space: nowrap;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
}

/* Spinners */
.spinner {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  border: 2px solid var(--color-bg-secondary);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Progress bars */
.progress {
  width: 100%;
  height: 0.5rem;
  background: var(--color-bg-secondary);
  border-radius: 0.25rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

/* Form elements */
.input {
  display: block;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Checkboxes and radio buttons */
.checkbox,
.radio {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox input[type="checkbox"],
.radio input[type="radio"] {
  margin: 0;
}

/* Dividers */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: 1rem 0;
}

.divider-vertical {
  width: 1px;
  height: 100%;
  background: var(--color-border);
  margin: 0 1rem;
}

/* Streaming Indicator */
.streaming-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.25rem auto;
  width: 100%;
  max-width: 500px;
}

.streaming-avatar {
  width: 120px;
  height: 120px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Animations */
@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInChar {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes gradientRotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Hide scrollbars */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
}

/* Footer */
.footer-text {
  font-size: 0.8rem;
  color: #999;
  font-style: italic;
  text-align: center;
  margin: 1rem 0;
  font-family: var(--font-inclusive);
  bottom: 5px;
}

.footer-text a {
  color: #87CEEB;
  text-decoration: none !important;
  border-bottom: none;
}

.footer-text a:hover {
  color: #4682B4;
  border-bottom: none;
}

/* Upload Area */
.upload-icon {
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.upload-area:hover .upload-icon {
  color: var(--color-hover);
  opacity: 1;
  transform: scale(1.05);
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
}

.theme-button {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-standard);
  box-shadow: 0 2px 4px var(--color-shadow-subtle);
}

/* Login Section */




.login-btn:hover {
  background: var(--color-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px var(--color-shadow-subtle);
}

/* Refresh Button */
.refresh-button {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface);
  color: var(--color-text-primary);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-standard);
  z-index: 1000;
  box-shadow: 0 2px 8px var(--color-shadow-primary);
}

.refresh-button svg {
  transition: transform 0.3s ease;
}

.refresh-button:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 4px 12px var(--color-shadow-primary);
}

.refresh-button:hover svg {
  transform: rotate(180deg);
}

.container-controls {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.control-group {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  width: 100%;
}

#ttsContainer {
  display: inline-flex;
}

/* Remove old positioning styles */
.controls-left, .controls-right {
  display: none;
}

.copy-confirmation {
  position: absolute;
  bottom: 3.5rem;
  right: 0.5rem;
  background: var(--color-success);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  animation: fadeOut 1.5s ease forwards;
  z-index: 3;
}

.play-icon, .pause-icon {
  transition: opacity 0.2s ease;
}

.pause-icon {
  position: absolute;
  left: 0;
}

/* Add copy icon to copy button */
.copy-button {
  position: relative;
  padding-right: 2.5rem !important;
}

.copy-button::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.2rem;
  height: 1.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232c1810'%3E%3Cpath d='M15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-4V3zM5 5h6v4H5V5zm14 14H5V9h14v10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  filter: var(--icon-filter);
}

/* Dark theme adjustment */
:root[data-theme="dark"] .copy-button::after {
  filter: invert(1) brightness(1.5);
}