@use '../../styles/mixins' as *;

// Edit wrapper that supports wrapping hint/error below the input
.editFieldWrapper {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: var(--space-xs);
}

.editInput {
  @include input-field;
  font-size: var(--font-size-sm);
  padding: 2px var(--space-xs);
  flex: 1;
  min-width: 0;
}

.editTextarea {
  @include input-field;
  font-size: var(--font-size-sm);
  padding: var(--space-xs) var(--space-sm);
  flex: 1;
  min-width: 0;
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
  line-height: 1.5;
}

.editSelect {
  @include input-field;
  font-size: var(--font-size-sm);
  padding: 2px var(--space-xs);
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

// Validation error message
.editError {
  font-size: 10px;
  color: var(--accent-red);
  margin-top: 2px;
  flex-basis: 100%;
}

// Red border for invalid inputs
.editInputInvalid {
  border-color: var(--accent-red) !important;
  box-shadow: 0 0 0 1px var(--accent-red-dim);
}

// Keyboard hint shown below editing inputs
.editHint {
  font-size: 10px;
  color: var(--text-tertiary);
  opacity: 0.7;
  margin-top: 2px;
  font-family: var(--font-mono);
  flex-basis: 100%;
}

// Unsaved dot indicator
.unsavedDot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-yellow);
  flex-shrink: 0;
}

// Click-to-edit wrapper — makes the whole value area clickable
.metaValueClickable {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 1px var(--space-xs);
  margin: -1px calc(-1 * var(--space-xs));
  transition: background var(--transition-fast);
  background: none;
  border: none;
  text-align: left;
  color: inherit;
  font: inherit;

  &:hover {
    background: var(--bg-overlay);
  }
}

// Pencil icon with opacity transition
.editButton {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 2px;
  font-size: var(--font-size-sm);
  opacity: 0.4;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;

  &:hover {
    opacity: 1;
    color: var(--accent-green);
  }
}

// Italic gray placeholder for empty values
.metaPlaceholder {
  color: var(--text-tertiary);
  font-style: italic;
}

// Checkbox + label styling
.worktreeToggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;

  input[type="checkbox"] {
    accent-color: var(--accent-green);
    width: 16px;
    height: 16px;
    cursor: pointer;
  }
}
