/**
 * Analytics Dashboard Styles
 * Feature: 003-advanced-analytics
 */

/* ========== Analytics Dashboard Layout ========== */
.analytics-dashboard {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.analytics-header {
    margin-bottom: 30px;
}

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

.analytics-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.analytics-header p {
    font-size: 14px;
    color: #7f8c8d;
}

.season-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.season-selector-wrapper label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.season-selector {
    padding: 8px 16px;
    border: 2px solid #3498db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    color: #2c3e50;
    cursor: pointer;
    min-width: 180px;
}

.season-selector:hover {
    border-color: #2980b9;
    background: #f8f9fa;
}

/* ========== Statistics Grid ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

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

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
}

.stat-help {
    font-size: 11px;
    color: #95a5a6;
    margin-top: 4px;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
}

.stat-trend.up {
    color: #27ae60;
}

.stat-trend.down {
    color: #e74c3c;
}

.stat-trend.stable {
    color: #95a5a6;
}

/* ========== Charts Grid ========== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-container h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
}

.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

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

/* ========== Test Chart (Temporary) ========== */
.test-chart-container {
    background: #f8f9fa;
    border: 2px dashed #3498db;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
}

.test-chart-container h3 {
    color: #3498db;
    margin-bottom: 16px;
}

.test-chart-container .chart-wrapper {
    background: white;
    border-radius: 8px;
    padding: 16px;
}

/* ========== Loading States ========== */
.analytics-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.analytics-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========== Empty States ========== */
.analytics-empty {
    text-align: center;
    padding: 60px 20px;
}

.analytics-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.analytics-empty h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.analytics-empty p {
    color: #7f8c8d;
    font-size: 14px;
}

/* ========== Insights Section ========== */
.insights-section {
    margin: 40px 0;
}

.insights-section h3 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
}

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

.insight-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

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

.insight-card.success {
    border-color: #27ae60;
    background: linear-gradient(135deg, #ffffff, #f0fff4);
}

.insight-card.warning {
    border-color: #f39c12;
    background: linear-gradient(135deg, #ffffff, #fffbf0);
}

.insight-card.info {
    border-color: #3498db;
    background: linear-gradient(135deg, #ffffff, #f0f8ff);
}

.insight-card.error {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #ffffff, #fff5f5);
}

.insight-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.insight-content {
    flex: 1;
}

.insight-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
}

.insight-description {
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.5;
}

/* ========== Comparison Section ========== */
.comparison-section h3,
.league-trends-section h3,
.export-section h3 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
}

.comparison-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.comparison-controls select {
    flex: 1;
    max-width: 300px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.comparison-results {
    background: white;
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
}

.player-comparison {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-bottom: 24px;
}

.player-side {
    text-align: center;
}

.player-side h4 {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 12px;
}

.big-stat {
    font-size: 48px;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 4px;
}

.vs-divider {
    font-size: 24px;
    font-weight: 700;
    color: #95a5a6;
    padding: 0 24px;
}

.comparison-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.comparison-stat {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.comparison-stat .label {
    font-weight: 600;
    color: #2c3e50;
}

.comparison-stat .value {
    font-weight: 700;
}

.comparison-stat .value.positive {
    color: #27ae60;
}

.comparison-stat .value.negative {
    color: #e74c3c;
}

.comparison-stat .value.neutral {
    color: #95a5a6;
}

/* ========== Export Section ========== */
.export-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.export-buttons .btn {
    min-width: 160px;
}

/* ========== Predictions Section ========== */
.predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.prediction-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.prediction-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.2);
    border-color: #2980b9;
}

.prediction-label {
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prediction-value {
    font-size: 36px;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 8px;
}

.prediction-range {
    font-size: 12px;
    color: #95a5a6;
    font-weight: 500;
}

.prediction-help {
    font-size: 11px;
    color: #95a5a6;
    font-style: italic;
    margin-top: 8px;
}

.prediction-insights {
    margin-top: 24px;
}

/* ========== Achievements Section ========== */
.achievements-section h3 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.achievement-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card.earned {
    border-color: #27ae60;
    background: linear-gradient(135deg, #ffffff, #f0fff4);
}

.achievement-card.locked {
    opacity: 0.6;
    filter: grayscale(50%);
}

.achievement-card.earned:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
}

/* Rarity borders */
.achievement-card.rarity-common.earned {
    border-color: #95a5a6;
}

.achievement-card.rarity-rare.earned {
    border-color: #3498db;
    background: linear-gradient(135deg, #ffffff, #ebf5fb);
}

.achievement-card.rarity-epic.earned {
    border-color: #9b59b6;
    background: linear-gradient(135deg, #ffffff, #f4ecf7);
}

.achievement-card.rarity-legendary.earned {
    border-color: #f39c12;
    background: linear-gradient(135deg, #ffffff, #fef5e7);
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.3);
}

.achievement-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.achievement-content {
    flex: 1;
}

.achievement-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.achievement-description {
    font-size: 13px;
    color: #7f8c8d;
    line-height: 1.4;
    margin-bottom: 8px;
}

.achievement-earned {
    font-size: 11px;
    color: #27ae60;
    font-weight: 600;
}

.achievement-locked {
    font-size: 11px;
    color: #95a5a6;
    font-style: italic;
}

.achievement-rarity {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 9px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievement-rarity.common {
    background: #95a5a6;
    color: white;
}

.achievement-rarity.rare {
    background: #3498db;
    color: white;
}

.achievement-rarity.epic {
    background: #9b59b6;
    color: white;
}

.achievement-rarity.legendary {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ========== League Trends ========== */
.league-insights {
    margin-top: 24px;
}

/* ========== Career Statistics ========== */
.career-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.career-stat-card {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.career-stat-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.career-stat-value {
    font-size: 36px;
    font-weight: 700;
}

/* ========== Simulator Section ========== */
.simulator-controls {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: end;
    margin-bottom: 24px;
}

.simulator-controls .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.simulator-controls label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.simulator-controls .form-control {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.simulation-results {
    background: white;
    border: 2px solid #9b59b6;
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
}

.simulation-comparison {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-bottom: 24px;
}

.scenario-side {
    text-align: center;
}

.scenario-side h4 {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 12px;
}

.scenario-team {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.scenario-points {
    font-size: 32px;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 4px;
}

.scenario-label {
    font-size: 12px;
    color: #95a5a6;
}

.scenario-side.alternative .scenario-points {
    color: #9b59b6;
}

.simulation-impact {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.simulation-impact.positive {
    background: linear-gradient(135deg, #f0fff4, #d4edda);
    border: 2px solid #27ae60;
}

.simulation-impact.negative {
    background: linear-gradient(135deg, #fff5f5, #f8d7da);
    border: 2px solid #e74c3c;
}

.simulation-impact.neutral {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #95a5a6;
}

.impact-icon {
    font-size: 48px;
}

.impact-content {
    flex: 1;
}

.impact-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
}

.impact-description {
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.5;
}

/* ========== Responsive Design ========== */

/* Tablet */
@media screen and (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    .analytics-dashboard {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .charts-grid {
        gap: 16px;
    }
    
    .chart-container {
        padding: 16px;
    }
    
    .chart-wrapper {
        height: 250px;
    }
}

/* Small Mobile */
@media screen and (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 24px;
    }
}

