/* LLM Analytics Header Styles */
.llm-analytics-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideInFromTop 0.5s ease-out;
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.analytics-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.analytics-period-selector select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 14px;
    min-width: 150px;
}

.analytics-period-selector select option {
    background: #333;
    color: white;
}

.analytics-stats {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    align-items: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 80px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 2px;
    white-space: nowrap;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.analytics-toggle button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.analytics-toggle button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Detailed Analytics Styles */
.detailed-analytics {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.analytics-charts {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.chart-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}

.chart-container canvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    background: white;
}

.provider-stats, .model-stats {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 15px;
}

.provider-stats h5, .model-stats h5 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
}

.provider-item, .model-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
}

.provider-item:last-child, .model-item:last-child {
    border-bottom: none;
}

.provider-name, .model-name {
    font-weight: 500;
    flex: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.provider-calls, .provider-tokens, .provider-success,
.model-calls, .model-tokens, .model-success {
    flex: 1;
    text-align: right;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .analytics-charts {
        grid-template-columns: 1fr;
    }
    
    .analytics-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .analytics-stats {
        justify-content: space-around;
    }
}

@media (max-width: 768px) {
    .analytics-stats {
        gap: 15px;
    }
    
    .stat-item {
        min-width: 60px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .llm-analytics-header {
        padding: 10px;
    }
    
    .analytics-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        width: 100%;
    }
    
    .stat-item {
        min-width: auto;
    }
}

/* Alert styles for errors */
.analytics-stats .alert {
    margin: 0;
    padding: 10px;
    border-radius: 4px;
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.4);
    color: #fff3cd;
    width: 100%;
    text-align: center;
}

/* Loading animation */
.stat-value.loading {
    opacity: 0.6;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Success indicator for high success rates */
.stat-value.success-high {
    color: #28a745 !important;
    text-shadow: 0 0 5px rgba(40, 167, 69, 0.3);
}

/* Warning indicator for medium success rates */
.stat-value.success-medium {
    color: #ffc107 !important;
    text-shadow: 0 0 5px rgba(255, 193, 7, 0.3);
}

/* Danger indicator for low success rates */
.stat-value.success-low {
    color: #dc3545 !important;
    text-shadow: 0 0 5px rgba(220, 53, 69, 0.3);
}