/* ActivityItem Molecule */
/* Activity feed item for live updates and event logs */

.activity-item {
  background: var(--bg-surface);
  border-radius: var(--border-radius-sm);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  border: var(--border-width-1) solid var(--border-subtle);
  transition: all var(--duration-200) var(--easing-out);
  /* One line of text: the tall padding belonged to the two-line card. */
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.activity-item.interactive {
  cursor: pointer;
}

.activity-item.interactive:hover {
  background: var(--bg-surface-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.activity-item.interactive:focus-visible {
  outline: var(--border-width-2) solid var(--color-primary);
  outline-offset: var(--border-width-2);
}

/* ONE ROW: title, then detail, then the meta hard right. A feed is scanned, not
   read -- stacking the detail under the title halved how many rows fit in a panel
   for no gain, since the detail is a supporting clause, not a paragraph. Both text
   cells truncate rather than wrap, so a row is always exactly one line tall. */
.activity-item-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.activity-item-content {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  line-height: 1.4;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-item-meta {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex: 0 0 auto;
}

.activity-item-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.activity-item-type {
  padding: var(--border-width-2) var(--space-2);
  border-radius: var(--border-radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}

/* The detail shares the title's row and takes the slack, which is what pushes the
   meta to the right edge -- no margin needed for that alignment. */
.activity-item-body {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: var(--border-width-1) solid var(--border-subtle);
}

/* Alert Levels */
.activity-item.alert-high {
  border-left: var(--border-width-2) solid var(--color-error);
}

.activity-item.alert-high .activity-item-type {
  background: var(--color-error);
  color: white;
}

.activity-item.alert-medium {
  border-left: var(--border-width-2) solid var(--color-warning);
}

.activity-item.alert-medium .activity-item-type {
  background: var(--color-warning);
  color: white;
}

.activity-item.alert-low {
  border-left: var(--border-width-2) solid var(--color-info);
}

.activity-item.alert-low .activity-item-type {
  background: var(--color-info);
  color: white;
}

.activity-item.alert-success {
  border-left: var(--border-width-2) solid var(--color-success);
}

.activity-item.alert-success .activity-item-type {
  background: var(--color-success);
  color: white;
}

/* Compact variant */
.activity-item-compact {
  padding: var(--space-2);
}

.activity-item-compact .activity-item-content {
  font-size: var(--text-xs);
}

/* Activity List Container */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.activity-list-empty {
  text-align: center;
  padding: var(--space-6);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Responsive */
@media (max-width: 768px) {
  /* Too narrow for one line: the detail drops to its own line rather than being
     clipped away entirely. */
  .activity-item-header {
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-2);
  }

  .activity-item-body {
    flex-basis: 100%;
    order: 3;
    white-space: normal;
  }
}
