/* Agent Monitor v3 - Hybrid Style */

:root {
    --bg-primary: #0a0a0f;
    --bg-card: rgba(30, 35, 45, 0.9);
    --border: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --status-idle: #10b981;
    --status-busy: #f59e0b;
    --status-thinking: #8b5cf6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand h1 { font-size: 1.25rem; font-weight: 600; }
.live-badge { color: var(--status-idle); font-weight: 600; font-size: 0.875rem; }

.main-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1rem;
    padding: 1rem;
    height: calc(100vh - 140px);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    overflow-y: auto;
}

.agent-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--status-offline);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.agent-card[data-status="idle"] { border-left-color: var(--status-idle); }
.agent-card[data-status="busy"] { border-left-color: var(--status-busy); }
.agent-card[data-status="thinking"] { border-left-color: var(--status-thinking); }

.agent-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.card-avatar {
    width: 44px; height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}

.card-info h3 { font-size: 0.9375rem; font-weight: 600; }
.card-role { font-size: 0.6875rem; color: var(--text-secondary); text-transform: uppercase; }

.status-badge {
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.1);
}

.status-badge.idle { color: var(--status-idle); background: rgba(16, 185, 129, 0.15); }
.status-badge.busy { color: var(--status-busy); background: rgba(245, 158, 11, 0.15); }
.status-badge.thinking { color: var(--status-thinking); background: rgba(139, 92, 246, 0.15); }

.card-task {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Timeline */
.timeline-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex; flex-direction: column;
}

.section-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem; border-bottom: 1px solid var(--border);
}

.section-header h2 { font-size: 0.875rem; }

.timeline {
    flex: 1; overflow-y: auto; padding: 0.75rem;
}

.timeline-entry {
    display: flex; gap: 0.75rem;
    padding: 0.5rem; border-radius: 6px;
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
}

.timeline-entry:hover { background: rgba(255, 255, 255, 0.03); }
.timeline-time { font-family: monospace; font-size: 0.6875rem; color: var(--text-secondary); }
.timeline-avatar { width: 20px; display: flex; justify-content: center; }
.timeline-content { flex: 1; }
.timeline-text { color: var(--text-secondary); }

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
}

.footer-stats {
    display: flex; justify-content: space-between;
}

.stat { display: flex; flex-direction: column; gap: 0.25rem; }
.stat .label { font-size: 0.6875rem; color: var(--text-secondary); text-transform: uppercase; }
.stat .value { font-size: 0.9375rem; font-weight: 600; }
