/**
 * Enhanced Statistics UI Styles
 * Modern card-based layout for solo mode final statistics
 * @version 1.0
 * @date 2026-02-03
 */

/* Main container */
.enhanced-stats-container {
    padding: 1rem;
    max-width: 100%;
    margin: 0 auto;
    height:64vh;
}

/* Stats card base styles */
.stats-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Card header */
.stats-card-header {
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    font-weight: 600;
}

.stats-card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.stats-card-header i {
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Card body */
.stats-card-body {
    padding: 1.5rem;
}

/* Performance Card */
.performance-card .main-score-display {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.performance-card .score-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.performance-card .score-value {
    font-size: 3rem;
    font-weight: bold;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.stat-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: bold;
}

/* Goal Card */
.goal-card {
    /* border: 2px solid rgba(255, 193, 7, 0.3); */
}

.goal-card.goal-achieved {
    border-color: rgba(40, 167, 69, 0.5);
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
}

.goal-card.goal-not-achieved {
    border-color: rgba(220, 53, 69, 0.3);
}

.goal-info {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
    padding: 1rem;
}

.goal-type-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.75rem;
    text-align: center;
}

.goal-progress-bar {
    height: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    margin-bottom: 0.5rem;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    border-radius: 1rem;
    transition: width 0.8s ease-out;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.goal-card.goal-not-achieved .goal-progress-fill {
    background: linear-gradient(90deg, #dc3545 0%, #fd7e14 100%);
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

.goal-progress-text {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.goal-current {
    font-weight: bold;
    font-size: 1.5rem;
}

.goal-separator {
    opacity: 0.5;
}

.goal-target {
    opacity: 0.7;
}

.global-points-earned {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 193, 7, 0.1) 100%);
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin-top: 1rem;
}

.global-points-earned .points-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.global-points-earned .points-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

/* Progression Card */
.level-display {
    margin: 1rem 0;
}

.level-badge-1 {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 1rem;
}

.level-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.level-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.level-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.level-number {
    font-size: 0.9rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.next-level-progress {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
    padding: 1rem;
}

.next-level-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.75rem;
    text-align: center;
}

.level-progress-bar {
    height: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    margin-bottom: 0.5rem;
}

.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff 0%, #17a2b8 100%);
    border-radius: 1rem;
    transition: width 0.8s ease-out;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

.level-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    opacity: 0.8;
}

.points-remaining {
    opacity: 0.6;
    font-style: italic;
}

.achievement-stats {
    text-align: center;
    margin-top: 1rem;
}

.achievement-rate-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.achievement-rate-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.achievement-details {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Ranking Card */
.ranking-display {
    font-size: 2rem;
    font-weight: bold;
    padding: 1.5rem;
}

.ranking-display sup {
    font-size: 1rem;
}

/* Action buttons */
.stats-actions {
    padding: 1rem 0;
}

.restart-button {
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: none !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.restart-button i {
    transition: transform 0.3s ease;
}

.restart-button:hover i {
    transform: rotate(-360deg);
}

/* Badge styles */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge i {
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .enhanced-stats-container {
        padding: 0.5rem;
    }
    
    .stats-card-body {
        padding: 1rem;
    }
    
    .performance-card .score-value {
        font-size: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .level-badge {
        padding: 1rem 1.5rem;
    }
    
    .level-icon {
        font-size: 2.5rem;
    }
    
    .level-name {
        font-size: 1.25rem;
    }
    
    .achievement-rate-value {
        font-size: 2rem;
    }
    
    .ranking-display {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .performance-card .score-value {
        font-size: 2rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .goal-current {
        font-size: 1.25rem;
    }
}

/* Animation for cards on load */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-card {
    animation: slideInUp 0.4s ease-out;
}

.stats-card:nth-child(1) { animation-delay: 0.1s; }
.stats-card:nth-child(2) { animation-delay: 0.2s; }
.stats-card:nth-child(3) { animation-delay: 0.3s; }
.stats-card:nth-child(4) { animation-delay: 0.4s; }

/* Ensure compatibility with existing styles */
#final-statistics {
    display: none;
}

.enhanced-stats-container + #final-statistics {
    display: none;
}
