/* Performance Analytics Dashboard Styles */

#performance-dashboard-container {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Tab Navigation */
.performance-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 16px 20px;
    background: none;
    border: none;
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #495057;
    background: rgba(0, 0, 0, 0.02);
}

.tab-btn.active {
    color: #5d5fef;
    background: white;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #5d5fef;
}

/* Tab Content */
.performance-content {
    padding: 24px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Performance Grid */
.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

/* Chart Containers */
.chart-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    position: relative;
}

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

/* Heatmap Container */
.heatmap-container {
    grid-column: 1 / -1;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
}

.heatmap-container h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

/* Performance Heatmap Specific Styles */
#performanceHeatmap {
    min-width: 800px;
}

.heatmap-tooltip {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    z-index: 1000;
    pointer-events: none;
}

.heatmap-cell {
    cursor: pointer;
    transition: all 0.2s ease;
}

.heatmap-cell:hover {
    stroke: #333;
    stroke-width: 2;
}

.heatmap-cell.selected {
    stroke: #5d5fef;
    stroke-width: 3;
}

/* Performance Levels */
.performance-levels {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.performance-levels h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.performance-level {
    margin-bottom: 20px;
}

.performance-level h4 {
    margin: 0 0 8px 0;
    color: #4a5568;
    font-size: 14px;
    font-weight: 600;
}

.level-bar {
    height: 24px;
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.level-fill {
    height: 100%;
    background: linear-gradient(90deg, #5d5fef, #7c7ff2);
    transition: width 0.6s ease;
    position: relative;
}

.level-fill.beginner {
    background: linear-gradient(90deg, #94a3b8, #cbd5e1);
}

.level-fill.novice {
    background: linear-gradient(90deg, #60a5fa, #93c5fd);
}

.level-fill.intermediate {
    background: linear-gradient(90deg, #34d399, #6ee7b7);
}

.level-fill.advanced {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.level-fill.elite {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Insights Panel */
.insights-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.insights-panel h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.insight {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid #5d5fef;
}

.insight i {
    font-size: 20px;
    color: #5d5fef;
}

.insight p {
    margin: 0;
    color: #4a5568;
    font-size: 14px;
}

.insight.positive {
    border-left-color: #10b981;
}

.insight.positive i {
    color: #10b981;
}

.insight.warning {
    border-left-color: #f59e0b;
}

.insight.warning i {
    color: #f59e0b;
}

.insight.negative {
    border-left-color: #ef4444;
}

.insight.negative i {
    color: #ef4444;
}

/* Balance Analysis */
.balance-analysis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.muscle-balance-chart {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.balance-recommendations {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.balance-recommendations h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

/* Recovery Analysis */
.recovery-analysis {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
}

.recovery-gauge {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recovery-details,
.recovery-recommendations {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.recovery-details h3,
.recovery-recommendations h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

/* Recommendations */
.recommendation {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
}

.recommendation i {
    font-size: 18px;
    color: #5d5fef;
    margin-top: 2px;
}

.recommendation h4 {
    margin: 0 0 4px 0;
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
}

.recommendation p {
    margin: 0;
    color: #718096;
    font-size: 13px;
}

.recommendation.high {
    border-left: 4px solid #ef4444;
}

.recommendation.high i {
    color: #ef4444;
}

.recommendation.medium {
    border-left: 4px solid #f59e0b;
}

.recommendation.medium i {
    color: #f59e0b;
}

/* Recovery Factors */
.factor {
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.factor h4 {
    margin: 0;
    color: #4a5568;
    font-size: 14px;
    font-weight: 600;
}

.factor p {
    margin: 0;
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
}

.factor.good {
    border-left: 4px solid #10b981;
}

.factor.warning {
    border-left: 4px solid #f59e0b;
}

.factor.poor {
    border-left: 4px solid #ef4444;
}

/* Export Actions */
.performance-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.export-btn,
.share-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-btn {
    background: white;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.export-btn:hover {
    background: #f8f9fa;
    border-color: #cbd5e1;
}

.share-btn {
    background: #5d5fef;
    color: white;
}

.share-btn:hover {
    background: #4c4ee8;
}

/* Dark Mode Support */
.dark-mode #performance-dashboard-container {
    background: #1a202c;
}

.dark-mode .performance-tabs {
    background: #2d3748;
    border-bottom-color: #4a5568;
}

.dark-mode .tab-btn {
    color: #a0aec0;
}

.dark-mode .tab-btn:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}

.dark-mode .tab-btn.active {
    color: #7c7ff2;
    background: #1a202c;
}

.dark-mode .chart-container,
.dark-mode .heatmap-container,
.dark-mode .performance-levels,
.dark-mode .insights-panel,
.dark-mode .muscle-balance-chart,
.dark-mode .balance-recommendations,
.dark-mode .recovery-gauge,
.dark-mode .recovery-details,
.dark-mode .recovery-recommendations {
    background: #2d3748;
}

.dark-mode .insight,
.dark-mode .recommendation,
.dark-mode .factor {
    background: #374151;
}

.dark-mode h3,
.dark-mode h4 {
    color: #e2e8f0;
}

.dark-mode p {
    color: #cbd5e1;
}

.dark-mode .level-bar {
    background: #374151;
}

.dark-mode .performance-actions {
    background: #2d3748;
    border-top-color: #4a5568;
}

.dark-mode .export-btn {
    background: #374151;
    color: #e2e8f0;
    border-color: #4a5568;
}

.dark-mode .export-btn:hover {
    background: #4a5568;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .balance-analysis {
        grid-template-columns: 1fr;
    }
    
    .recovery-analysis {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .performance-tabs {
        padding: 0;
    }
    
    .tab-btn {
        padding: 12px 16px;
        font-size: 13px;
        min-width: 100px;
    }
    
    .performance-content {
        padding: 16px;
    }
    
    .performance-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .performance-actions {
        flex-wrap: wrap;
        padding: 16px;
    }
    
    .export-btn,
    .share-btn {
        flex: 1;
        min-width: 140px;
        justify-content: center;
    }
    
    #performanceHeatmap {
        min-width: 100%;
        overflow-x: auto;
    }
}

/* Loading States */
.chart-container.loading,
.heatmap-container.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.chart-container.loading::after,
.heatmap-container.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #5d5fef;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-state i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
    display: block;
}

.empty-state h4 {
    color: #4a5568;
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin: 0;
}