/* Form Elements */
.input-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.input-group {
  display: flex;
  position: relative;
  width: 100%;
}

.form-input,
.form-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.text-shimmer {
  animation: textShimmer 2s infinite ease-in-out;
  transition: opacity 0.3s ease, color 0.3s ease;
}

@keyframes textShimmer {
  0% {
    opacity: 1;
    color: var(--text-primary);
  }

  50% {
    opacity: 0.7;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
  }

  100% {
    opacity: 1;
    color: var(--text-primary);
  }
}

.text-dimming {
  opacity: 0.4;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.input-group.error-caution .form-textarea {
  border-color: var(--warning);
  animation: cautionPulse 1.5s ease-out;
}

.input-group.error-caution .form-textarea::placeholder {
  color: rgba(245, 158, 11, 0.6);
}

@keyframes cautionPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }

  50% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0);
    background: rgba(245, 158, 11, 0.05);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* AI Generation */
.alt-text-container {
  width: 100%;
}

/* Make space for the button inside the input */
#alt-text-input {
  padding-right: 3.5rem;
  resize: none;
}

.ai-btn-tooltip-wrapper {
  position: absolute;
  right: 0.25rem;
  bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-generate-btn {
  color: #a855f7;
  /* AI Purple vibe */
  background: transparent;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ai-btn-tooltip-wrapper .tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 0.5rem;
  width: max-content;
  max-width: 250px;
  background: var(--bg-gradient);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  z-index: 50;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  transform: translateY(5px);
  white-space: nowrap;
}

.ai-btn-tooltip-wrapper:hover .tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.ai-generate-btn svg {
  position: absolute;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.ai-generate-btn svg.icon-hidden-transition,
.ai-generate-btn.loading svg {
  opacity: 0 !important;
  transform: scale(0.3) rotate(-90deg);
  pointer-events: none;
}

.ai-generate-btn:not(:disabled):hover {
  background: rgba(168, 85, 247, 0.1);
  color: #d8b4fe;
}

.ai-generate-btn:disabled {
  color: var(--text-muted);
}

.ai-generate-btn.error-state {
  color: var(--warning);
}

.ai-generate-btn.error-state:not(:disabled):hover {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
}

.ai-generate-btn.error-state:disabled {
  color: rgba(245, 158, 11, 0.5);
}

