/* ============================================================
   Agent V2 — Agent Tree & Activity Feed Styles
   Companion to agent-v2-cards.css (split for 500-line limit).
   Depends on: agent-v2-tokens.css
   ============================================================ */

/* ── Agent Tree ─────────────────────────────────────────────── */

.agent-tree {
    padding: var(--card-padding);
}

.agent-tree--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.agent-tree__empty-msg {
    font-size: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.6;
}

.agent-tree__node {
    position: relative;
}

.agent-tree__row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    min-height: 28px;
}

.agent-tree__expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 10px;
    cursor: pointer;
    border-radius: 3px;
    flex-shrink: 0;
    transition: color var(--duration-fast) ease;
}

.agent-tree__expand:hover {
    color: var(--md-sys-color-on-surface);
    background: var(--md-sys-color-surface-hover);
}

.agent-tree__expand-spacer {
    width: 16px;
    flex-shrink: 0;
}

/* ── Status Dot ─────────────────────────────────────────────── */

.agent-tree__dot {
    width: var(--timeline-dot-size);
    height: var(--timeline-dot-size);
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--dot-color, var(--md-sys-color-primary));
    transition: background var(--duration-fast) ease;
}

.agent-tree__dot--active {
    animation: agent-dot-pulse 1.5s ease-in-out infinite;
}

.agent-tree__dot--waiting {
    opacity: 0.4;
}

.agent-tree__dot--delegating {
    animation: agent-dot-pulse 2s ease-in-out infinite;
}

.agent-tree__dot--done {
    opacity: 0.5;
}

.agent-tree__dot--error {
    background: var(--status-error);
}

@keyframes agent-dot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.3); opacity: 0.6; }
}

/* ── Agent Name & Meta ──────────────────────────────────────── */

.agent-tree__name {
    font-size: var(--md-sys-typescale-body-medium);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.agent-tree__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.agent-tree__status-text {
    font-size: 10px;
    color: var(--md-sys-color-on-surface-variant);
    white-space: nowrap;
}

.agent-tree__elapsed {
    font-size: 10px;
    font-feature-settings: 'tnum';
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.7;
}

.agent-tree__current-tool {
    font-size: 10px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--md-sys-color-primary);
    opacity: 0.8;
}

/* ── Children Container (tree lines) ────────────────────────── */

.agent-tree__children {
    margin-left: 20px;
    padding-left: 12px;
    border-left: var(--timeline-line-width) solid var(--timeline-line-color);
}

/* ── Reduced Motion (tree-specific) ─────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .agent-tree__dot--active,
    .agent-tree__dot--delegating {
        animation: none;
    }
}
