:root {
    /* Dark Mode Color System - High Contrast */
    --background: #0f172a;        /* Deep navy background */
    --bg-primary: #1e293b;        /* Card/primary surface */
    --bg-secondary: #263446;      /* Alternating rows */
    --card: #1e293b;              /* Card background */
    --border: #334155;            /* Borders */
    
    /* Text Colors - High Contrast */
    --text: #f1f5f9;              /* Primary text - bright white */
    --text-secondary: #cbd5e1;    /* Secondary text - light gray */
    --text-muted: #94a3b8;        /* Muted text */
    
    /* Interactive Colors */
    --primary: #6366f1;           /* Primary blue */
    --primary-hover: #818cf8;     /* Lighter on hover */
    --secondary: #8b5cf6;         /* Purple */
    --accent: #3b82f6;            /* Accent blue */
    
    /* Metric Colors - Bright & Visible */
    --metric-0-20: #f87171;       /* Bright red */
    --metric-21-40: #fb923c;      /* Bright orange */
    --metric-41-60: #fbbf24;      /* Bright yellow */
    --metric-61-80: #4ade80;      /* Bright green */
    --metric-81-100: #22c55e;     /* Strong green */
    
    /* State Colors - High Contrast */
    --success: #4ade80;
    --warning: #fb923c;
    --error: #f87171;
    --info: #60a5fa;
    
    /* Version Colors */
    --new-orchestration: #60a5fa;
    --current-ai: #a78bfa;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.5;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-lg) var(--spacing-xl);
    box-shadow: var(--shadow-sm);
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.header-controls {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

/* Data Status */
.data-status {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-md) var(--spacing-xl);
    display: flex;
    gap: var(--spacing-xl);
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.status-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.status-value {
    color: var(--text);
    font-weight: 400;
}

.status-value.loaded {
    color: var(--metric-61-80);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: var(--spacing-xl);
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

/* View Container */
.view-container {
    display: none;
}

.view-container.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.view-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #5558e3;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #7c3aed;
}

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: #2563eb;
}

.btn-small {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.8125rem;
}

/* Metric Display */
.metric {
    font-weight: 600;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.metric-0-20 {
    color: var(--metric-0-20);
}

.metric-21-40 {
    color: var(--metric-21-40);
}

.metric-41-60 {
    color: var(--metric-41-60);
}

.metric-61-80 {
    color: var(--metric-61-80);
}

.metric-81-100 {
    color: var(--metric-81-100);
}

/* Version Tags */
.version-tag {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.version-tag.new {
    background: rgba(59, 130, 246, 0.1);
    color: var(--new-orchestration);
}

.version-tag.current {
    background: rgba(139, 92, 246, 0.1);
    color: var(--current-ai);
}

/* Cards */
.metric-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.metric-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border);
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-row span:first-child {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.metric-row span:last-child {
    font-weight: 600;
    font-size: 0.9375rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-md);
}

/* Info Icons & Tooltips */
.info-text {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 6px;
    line-height: 1.5;
    opacity: 0.9;
    max-width: 100%;
}

.section-help-text {
    display: block;
    font-size: 0.9rem;
    color: var(--text);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(139, 92, 246, 0.15));
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin: 16px 0;
    border-left: 4px solid var(--info);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.6;
}

.info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: var(--info);
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid var(--info);
    border-radius: 50%;
    cursor: help;
    margin-left: 4px;
    vertical-align: middle;
    transition: all 0.2s ease;
}

.info-icon:hover {
    background: rgba(96, 165, 250, 0.25);
    transform: scale(1.1);
}

.section-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    margin-left: 8px;
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid var(--info);
    border-radius: 50%;
    color: var(--info);
    cursor: help;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.section-info-btn:hover {
    background: rgba(96, 165, 250, 0.25);
    transform: scale(1.1);
}

.section-info-btn svg {
    width: 14px;
    height: 14px;
}

.tooltip-popup {
    position: fixed;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    max-width: 400px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text);
    pointer-events: none;
}

.tooltip-section {
    line-height: 1.6;
}

.tooltip-section strong {
    color: var(--info);
    font-size: 0.95rem;
}

.tooltip-section em {
    color: var(--text-secondary);
}

.metric-with-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-with-info .metric-label {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.metric-with-info .metric-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        padding: var(--spacing-md);
    }
    
    .header-controls {
        flex-direction: column;
    }
    
    .main-content {
        padding: var(--spacing-md);
    }
    
    .data-status {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}
