/* LLM Metrics Specific Styles */

/* Fix for tab content layout */
#llm-metrics-tab {
    width: 100%;
    padding: 0;
    margin: 0;
}

#llm-metrics-tab .dashboard-row {
    width: 100%;
    margin: 0;
}

/* Remove any custom header styling that might conflict */
#llm-metrics-tab .metrics-header {
    display: none !important;
}

/* Ensure content stays within bounds */
#llm-metrics-tab .dashboard-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.llm-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.llm-metric-card {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color, #e0e0e0);
}

.llm-metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.llm-metric-title {
    font-size: 14px;
    color: var(--text-secondary, #666);
    font-weight: 500;
}

.llm-metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #1a1a1a);
    margin: 10px 0;
}

.llm-metric-change {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
}

.llm-metric-change.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.llm-metric-change.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Provider Distribution Chart */
.llm-provider-chart {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color, #e0e0e0);
}

.llm-provider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.llm-provider-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

/* Chart container fixes */
.chart-container {
    min-height: 300px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-card {
    background: var(--bg-card-dark, #111c3a) !important;
}

.chart-container > div {
    width: 100%;
    height: 100%;
}

/* Fix for dashboard cards in dark theme */
.dashboard-card {
    background-color: var(--bg-card-dark, #111c3a) !important;
    color: var(--text-light, #e4ebff);
}

/* Performance Timeline */
.llm-timeline {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color, #e0e0e0);
}

.llm-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.llm-timeline-controls {
    display: flex;
    gap: 10px;
}

.llm-timeline-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color, #e0e0e0);
    background: var(--bg-primary, #ffffff);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.llm-timeline-btn:hover {
    background: var(--bg-hover, #f5f5f5);
}

.llm-timeline-btn.active {
    background: var(--primary-color, #4f46e5);
    color: white;
    border-color: var(--primary-color, #4f46e5);
}

/* Cost Analysis */
.llm-cost-analysis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.llm-cost-card {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color, #e0e0e0);
}

.llm-cost-breakdown {
    margin-top: 15px;
}

.llm-cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.llm-cost-item:last-child {
    border-bottom: none;
}

.llm-cost-provider {
    display: flex;
    align-items: center;
    gap: 10px;
}

.llm-cost-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.llm-cost-amount {
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

/* Error Tracking */
.llm-errors {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color, #e0e0e0);
}

.llm-error-list {
    margin-top: 15px;
}

.llm-error-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 8px;
    margin-bottom: 10px;
}

.llm-error-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.llm-error-details {
    flex: 1;
}

.llm-error-message {
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 4px;
}

.llm-error-time {
    font-size: 12px;
    color: var(--text-secondary, #666);
}