/* Dashboard V2 Styles */

/* Header buttons */
.header-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-dashboard-v2 {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-dashboard-v2:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Dashboard V2 Panel */
.dashboard-v2-panel {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.dashboard-v2-panel.hidden {
    display: none;
}

.dashboard-v2-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .dashboard-v2-grid {
        grid-template-columns: 1fr;
    }
}

.v2-panel {
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.1);
    min-height: 300px;
}

/* Agent Status Component */
.agent-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.agent-status-header h3 {
    margin: 0;
    color: #e2e8f0;
    font-size: 1.1rem;
}

.agent-summary {
    display: flex;
    gap: 0.5rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-total {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.badge-tasks {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.agent-card {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.1);
    transition: all 0.2s;
}

.agent-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.agent-card.agent-status-online {
    border-left: 3px solid #22c55e;
}

.agent-card.agent-status-busy {
    border-left: 3px solid #eab308;
}

.agent-card.agent-status-offline {
    border-left: 3px solid #64748b;
}

.agent-card.agent-status-error {
    border-left: 3px solid #ef4444;
}

.agent-card.agent-status-learning {
    border-left: 3px solid #8b5cf6;
}

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

.agent-icon {
    font-size: 1.2rem;
}

.agent-name {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.agent-type {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.agent-meta {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.agent-task {
    font-size: 0.75rem;
    color: #fbbf24;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 4px;
}

.agent-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.agent-metrics .metric {
    font-size: 0.65rem;
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

/* Knowledge Graph */
.knowledge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.knowledge-header h3 {
    margin: 0;
    color: #e2e8f0;
    font-size: 1.1rem;
}

.knowledge-header .stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.knowledge-legend {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.knowledge-empty {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

#knowledge-svg {
    width: 100%;
    max-height: 350px;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 8px;
}

/* Evolution Timeline */
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.timeline-header h3 {
    margin: 0;
    color: #e2e8f0;
    font-size: 1.1rem;
}

.timeline-filters select {
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

.timeline-container {
    max-height: 350px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.timeline-container::-webkit-scrollbar {
    width: 6px;
}

.timeline-container::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.1);
    border-radius: 3px;
}

.timeline-container::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 3px;
}

.timeline-event {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.timeline-event:last-child {
    border-bottom: none;
}

.event-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 30px;
}

.event-icon {
    font-size: 1.2rem;
}

.event-line {
    flex: 1;
    width: 2px;
    background: rgba(148, 163, 184, 0.2);
    margin-top: 0.5rem;
}

.event-content {
    flex: 1;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.event-title {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.event-version {
    font-size: 0.7rem;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.event-date {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.event-description {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.4;
}

.event-patterns {
    font-size: 0.75rem;
    color: #f59e0b;
    margin-top: 0.5rem;
}

.timeline-event.impact-high {
    border-left: 3px solid #ef4444;
    padding-left: 0.5rem;
}

.timeline-event.impact-medium {
    border-left: 3px solid #f59e0b;
    padding-left: 0.5rem;
}

.timeline-event.impact-low {
    border-left: 3px solid #22c55e;
    padding-left: 0.5rem;
}

.timeline-empty {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

/* Learning Curves */
.learning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.learning-header h3 {
    margin: 0;
    color: #e2e8f0;
    font-size: 1.1rem;
}

.learning-controls {
    display: flex;
    gap: 0.5rem;
}

.learning-controls select {
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

.learning-summary {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.summary-card {
    background: rgba(15, 23, 42, 0.6);
    padding: 0.75rem;
    border-radius: 8px;
    min-width: 100px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.summary-metric {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.summary-agent {
    font-size: 0.65rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e2e8f0;
}

.summary-trend {
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.trend-improving {
    color: #22c55e;
}

.trend-declining {
    color: #ef4444;
}

.trend-stable {
    color: #94a3b8;
}

.learning-empty {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.learning-empty .subtitle {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

#learningChart {
    max-height: 250px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard-v2-grid {
        grid-template-columns: 1fr;
    }

    .agent-grid {
        grid-template-columns: 1fr;
    }

    .learning-summary {
        flex-direction: column;
    }

    .header-buttons {
        flex-direction: column;
    }
}
