/* =====================================================
   ETAPA 5: ANALYTICS AVANÇADO - DASHBOARD VISUAL
   ===================================================== */

/* Container Principal do Analytics */
.analytics-dashboard {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

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

.analytics-title {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.analytics-subtitle {
    font-size: 14px;
    color: #6b7280;
}

/* Grid de Cards de Estatísticas */
.analytics-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

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

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card-icon.blue {
    background: #dbeafe;
    color: #2563eb;
}

.stat-card-icon.green {
    background: #dcfce7;
    color: #16a34a;
}

.stat-card-icon.purple {
    background: #f3e8ff;
    color: #9333ea;
}

.stat-card-icon.orange {
    background: #fed7aa;
    color: #ea580c;
}

.stat-card-icon.pink {
    background: #fce7f3;
    color: #db2777;
}

.stat-card-icon.yellow {
    background: #fef3c7;
    color: #d97706;
}

.stat-card-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.stat-card-trend.up {
    background: #dcfce7;
    color: #16a34a;
}

.stat-card-trend.down {
    background: #fee2e2;
    color: #dc2626;
}

.stat-card-trend.neutral {
    background: #f3f4f6;
    color: #6b7280;
}

.stat-card-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
}

.stat-card-subtitle {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Gráficos */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.chart-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.chart-card-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.chart-period-selector {
    display: flex;
    gap: 8px;
}

.period-btn {
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.period-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.period-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* Predição de Aprovação */
.prediction-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 30px;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.prediction-header {
    margin-bottom: 24px;
}

.prediction-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.prediction-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.prediction-probability {
    text-align: center;
    margin-bottom: 24px;
}

.prediction-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border: 8px solid rgba(255, 255, 255, 0.3);
}

.prediction-percentage {
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
}

.prediction-label {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 4px;
}

.prediction-level {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.prediction-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.prediction-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
}

.prediction-section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prediction-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.prediction-list li {
    padding: 6px 0;
    font-size: 13px;
    opacity: 0.95;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.prediction-list li::before {
    content: '•';
    font-size: 18px;
}

/* Temas e Desempenho */
.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.theme-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

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

.theme-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.theme-name {
    font-weight: 600;
    color: #111827;
    font-size: 15px;
}

.theme-level {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.theme-level.iniciante {
    background: #fee2e2;
    color: #dc2626;
}

.theme-level.intermediario {
    background: #fef3c7;
    color: #d97706;
}

.theme-level.avancado {
    background: #dbeafe;
    color: #2563eb;
}

.theme-level.expert {
    background: #dcfce7;
    color: #16a34a;
}

.theme-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.theme-accuracy {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.theme-questions {
    font-size: 12px;
    color: #6b7280;
}

.theme-progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.theme-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Comparativo e Ranking */
.ranking-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.ranking-header {
    margin-bottom: 20px;
}

.ranking-position {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.ranking-medal {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.ranking-info {
    flex: 1;
}

.ranking-info-position {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
}

.ranking-info-total {
    font-size: 14px;
    color: #6b7280;
}

.ranking-percentile {
    text-align: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ranking-percentile-value {
    font-size: 36px;
    font-weight: 700;
    color: #3b82f6;
}

.ranking-percentile-label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.ranking-comparison {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.comparison-item {
    text-align: center;
}

.comparison-value {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.comparison-label {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.comparison-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-top: 4px;
}

.comparison-badge.above {
    background: #dcfce7;
    color: #16a34a;
}

.comparison-badge.below {
    background: #fee2e2;
    color: #dc2626;
}

.comparison-badge.average {
    background: #f3f4f6;
    color: #6b7280;
}

/* Recomendações */
.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recommendation-item {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #3b82f6;
    transition: all 0.3s ease;
}

.recommendation-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.recommendation-item.high {
    border-left-color: #dc2626;
}

.recommendation-item.medium {
    border-left-color: #f59e0b;
}

.recommendation-item.low {
    border-left-color: #10b981;
}

.recommendation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.recommendation-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.recommendation-icon.high {
    background: #fee2e2;
    color: #dc2626;
}

.recommendation-icon.medium {
    background: #fef3c7;
    color: #f59e0b;
}

.recommendation-icon.low {
    background: #d1fae5;
    color: #10b981;
}

.recommendation-title {
    font-weight: 600;
    color: #111827;
    font-size: 15px;
}

.recommendation-description {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.recommendation-action {
    font-size: 13px;
    color: #3b82f6;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Responsividade */
@media (max-width: 768px) {
    .analytics-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .prediction-circle {
        width: 140px;
        height: 140px;
    }
    
    .prediction-percentage {
        font-size: 42px;
    }
    
    .themes-grid {
        grid-template-columns: 1fr;
    }
    
    .ranking-comparison {
        grid-template-columns: 1fr;
    }
}
