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

// =============================================================================
// Settings Panel — token management and future settings
// =============================================================================

.container {
  padding: var(--space-lg);
  overflow-y: auto;
  height: 100%;
}

.heading {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-heavy);
  color: var(--text-primary);
  margin: 0 0 var(--space-lg);
}

.section {
  @include surface-card;
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.sectionTitle {
  @include section-label;
  margin: 0 0 var(--space-xs);
}

.sectionDescription {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  margin: 0 0 var(--space-lg);
}

.emptyState {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  padding: var(--space-lg) 0;
  text-align: center;
}

// ─── Token List ─────────────────────────────────────

.tokenList {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.tokenRow {
  @include surface-inset;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
}

.tokenBadge {
  @include surface-inset;
  font-size: var(--font-size-xs);
  padding: 2px var(--space-sm);
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.tokenName {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  min-width: 100px;
}

.tokenTarget {
  flex: 1;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deleteButton {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: var(--font-size-lg);
  cursor: pointer;
  padding: 0 var(--space-xs);
  line-height: 1;
  transition: color var(--transition-fast);

  &:hover {
    color: var(--accent-red);
  }
}

// ─── Add Form ───────────────────────────────────────

.addForm {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.formRow {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.input {
  @include input-field;
  flex: 1;
  font-size: var(--font-size-sm);
}

.select {
  @include select-field;
  flex: 0 0 auto;
  min-width: 160px;
}

.addButton {
  @include btn-primary;
  white-space: nowrap;
}

// ---------------------------------------------------------------------------
// Empty state info message
// ---------------------------------------------------------------------------

.emptyStateInfo {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  padding: var(--space-lg) 0 var(--space-sm);
  text-align: center;
  line-height: var(--line-height);
}

// ---------------------------------------------------------------------------
// Appearance — theme radio-card selector (T3-style)
// ---------------------------------------------------------------------------

.themeOptions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.themeOption {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  cursor: pointer;
  transition: border-color var(--transition-fast),
              background var(--transition-fast);
  font-family: var(--font-ui);

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

.themeOptionSelected {
  border-color: var(--accent-green);
  background: var(--accent-green-subtle);
}

.themeOptionHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.themeOptionLabel {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  display: block;
}

.themeOptionDesc {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  display: block;
}

// ─── Variant Light/Dark Toggle ────────────────────────

.variantToggle {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  margin-left: var(--space-sm);
}

.variantButton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-tertiary);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast);

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

.variantActive {
  background: var(--accent-green-dim);
  color: var(--accent-green);
  border-color: var(--accent-green);
}

// ─── Swatches ─────────────────────────────────────────

.themeSwatches {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.themeSwatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(128, 128, 128, 0.4);
  flex-shrink: 0;
}

// ─── System Preference Toggle ─────────────────────────

.systemToggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  cursor: pointer;

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

.systemToggleHint {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: 2px;
  margin-left: 24px;
}

.themeActive {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-sm);
}

// ---------------------------------------------------------------------------
// About Panel
// ---------------------------------------------------------------------------

.aboutGrid {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.aboutItem {
  @include surface-inset;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
}

.aboutLabel {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  font-weight: var(--font-weight-medium);
}

.aboutValue {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.aboutDot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.aboutDotConnected {
  background: var(--accent-green);
}

.aboutDotDisconnected {
  background: var(--accent-red);
}

.aboutDotConnecting {
  background: var(--accent-yellow);
  animation: pulse 1.5s ease-in-out infinite;
}
