/*
 * The connection card, shared by HolyAgent and Daenerys.
 *
 * Both apps already define the same tokens (--bg-card, --border-color,
 * --holy-purple, --text-*), so this file only composes them. It is vendored
 * into each app next to the component it styles; edit the copy in
 * packages/shared-ui and run scripts/sync-shared-ui.mjs.
 */

.connection-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 0.85rem 0.95rem;
  display: grid;
  gap: 0.55rem;
  transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.connection-card.is-selectable {
  cursor: pointer;
}

.connection-card.is-selectable:hover,
.connection-card.is-selectable:focus-visible {
  border-color: var(--holy-purple);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.15);
  outline: none;
}

.connection-card.is-selected {
  border-color: var(--holy-purple);
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.35) inset;
}

/* Over budget, disabled, unreachable: still readable, plainly not usable. */
.connection-card.is-muted {
  opacity: 0.6;
}

.connection-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.connection-card-identity {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}

.connection-card-naming {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}

.connection-card-title {
  font-weight: 600;
  color: var(--text-primary);
  /* A pasted key or a long account id must not push the actions off the card. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.connection-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Grid tracks keep min-width: auto, so a long detail value («Голосовой ввод и
   голосовые Telegram») widened the card's track past its padding and the
   ellipsis on .connection-card-detail-value never kicked in. */
.connection-card > *,
.connection-card-detail {
  min-width: 0;
}

.connection-card-details {
  display: grid;
  gap: 0.25rem;
}

.connection-card-detail {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
}

.connection-card-detail-label {
  color: var(--text-muted);
  white-space: nowrap;
}

.connection-card-detail-value {
  color: var(--text-secondary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
