/* Dashboard Styles */
:root {
    --tier-frontier: #9333ea;
    --tier-production: #3b82f6;
    --tier-efficient: #10b981;
    --tier-frontier-rgb: 147, 51, 234;
    --tier-production-rgb: 59, 130, 246;
    --tier-efficient-rgb: 16, 185, 129;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

/* Base Layout */
.dashboard-container,
.analytics-dashboard,
.model-comparison,
.tier-analyzer,
.cost-optimizer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Headers */
.dashboard-header,
.comparison-header,
.analyzer-header,
.optimizer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h2,
.comparison-header h2,
.analyzer-header h2,
.optimizer-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.subtitle {
    color: var(--gray-600);
    margin-top: 0.25rem;
}

/* Metric Cards */
.metrics-grid,
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card,
.summary-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.metric-card:hover,
.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.metric-header .icon {
    width: 40px;
    height: 40px;
    background: var(--gray-100);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--gray-600);
}

.metric-header h4 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    margin: 0;
}

.metric-value {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.metric-value .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
}

.trend {
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend.up {
    color: var(--success);
}

.trend.down {
    color: var(--error);
}

.trend.neutral {
    color: var(--gray-500);
}

/* Charts Section */
.charts-section,
.charts-row {
    margin-bottom: 2rem;
}

.chart-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-row .large {
    grid-column: 1 / -1;
}

.chart-container {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 1rem 0;
}

.chart-container canvas {
    max-height: 300px;
}

/* Loading States */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--gray-500);
}

.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--tier-production);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Error States */
.error-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-600);
}

.error-state .icon-alert-circle {
    font-size: 3rem;
    color: var(--error);
    margin-bottom: 1rem;
}

.error-state h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.5rem 0;
}

.error-state p {
    margin: 0 0 1.5rem 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* Forms */
.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    transition: all 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--tier-production);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Tier Colors */
.tier-frontier {
    color: var(--tier-frontier);
}

.tier-production {
    color: var(--tier-production);
}

.tier-efficient {
    color: var(--tier-efficient);
}

.tier {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

.tier.tier-frontier {
    background: rgba(147, 51, 234, 0.1);
    color: var(--tier-frontier);
}

.tier.tier-production {
    background: rgba(59, 130, 246, 0.1);
    color: var(--tier-production);
}

.tier.tier-efficient {
    background: rgba(16, 185, 129, 0.1);
    color: var(--tier-efficient);
}

/* Insights */
.insights-section {
    margin-top: 2rem;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.insight-card {
    display: flex;
    gap: 1rem;
    background: var(--gray-50);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--gray-200);
}

.insight-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tier-production);
}

.insight-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.25rem 0;
}

.insight-content p {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin: 0;
}

/* Messages */
.message {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-1rem);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.message-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.message-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.message-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.message-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container,
    .analytics-dashboard,
    .model-comparison,
    .tier-analyzer,
    .cost-optimizer {
        padding: 1rem;
    }
    
    .metrics-grid,
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header,
    .comparison-header,
    .analyzer-header,
    .optimizer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Icons (using simple CSS icons) */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
}

.icon-activity::before { content: "📊"; }
.icon-dollar::before { content: "💵"; }
.icon-token::before { content: "🎟️"; }
.icon-average::before { content: "📈"; }
.icon-alert-circle::before { content: "⚠️"; }
.icon-download::before { content: "⬇️"; }
.icon-highlight::before { content: "🖍️"; }
.icon-arrow-right::before { content: "→"; }
.icon-zap::before { content: "⚡"; }
.icon-cpu::before { content: "🖥️"; }
.icon-trending-down::before { content: "📉"; }
.icon-trending-up::before { content: "📈"; }
.icon-percent::before { content: "%"; }
.icon-check-circle::before { content: "✅"; }
.icon-target::before { content: "🎯"; }
.icon-clock::before { content: "⏰"; }
.icon-pie-chart::before { content: "📊"; }
.icon-dollar-sign::before { content: "$"; }
.icon-refresh-cw::before { content: "🔄"; }
.icon-layers::before { content: "📚"; }
.icon-package::before { content: "📦"; }
.icon-edit-3::before { content: "✏️"; }