/* stats.css - Styling for the statistics page */

.stats-container {
    padding: 40px 20px;
    max-width: 1200px;
}

.stats-header {
    text-align: center;
    margin-bottom: 40px;
}

.stats-header h1 {
    font-size: 36px;
    margin-bottom: 15px;
    background: linear-gradient(90deg, #6c5ce7, #00b894);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats-header p {
    color: var(--muted-text);
    max-width: 600px;
    margin: 0 auto 20px;
}

.time-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.time-filter span {
    font-weight: 500;
}

.time-filter select {
    width: auto;
    padding: 8px 12px;
}

/* Loading indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 50px 0;
    gap: 20px;
}

.vibetris-spinner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 5px;
    width: 60px;
    height: 60px;
    animation: spin 2s infinite ease;
}

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

.vibetris-spinner .block {
    background-color: var(--primary-color);
    border-radius: 2px;
    animation: pulse 2s infinite ease;
}

.vibetris-spinner .block:nth-child(1) { animation-delay: 0s; }
.vibetris-spinner .block:nth-child(2) { animation-delay: 0.2s; }
.vibetris-spinner .block:nth-child(3) { animation-delay: 0.4s; }
.vibetris-spinner .block:nth-child(4) { animation-delay: 0.6s; }

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

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stats-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background-color: rgba(108, 92, 231, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-color);
}

#total-games-card .stats-card-icon {
    background-color: rgba(108, 92, 231, 0.2);
    color: #6c5ce7;
}

#total-players-card .stats-card-icon {
    background-color: rgba(0, 184, 148, 0.2);
    color: #00b894;
}

#total-lines-card .stats-card-icon {
    background-color: rgba(253, 121, 168, 0.2);
    color: #fd79a8;
}

#total-powerups-card .stats-card-icon {
    background-color: rgba(255, 159, 67, 0.2);
    color: #ff9f43;
}

.stats-card-content {
    flex: 1;
}

.stats-card h3 {
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--muted-text);
}

.stats-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--light-text);
}

.stats-subtitle {
    font-size: 14px;
    color: var(--muted-text);
}

/* Chart Container */
.stats-chart-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

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

.stats-chart-header h2 {
    font-size: 20px;
    margin: 0;
}

.chart-toggle {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

/* Custom toggle button styles */
#toggle-games {
    background-color: #6c5ce7;
    border-color: #6c5ce7;
}

#toggle-players {
    background-color: #00b894;
    border-color: #00b894;
}

#toggle-lines {
    background-color: #fd79a8 !important;
    border-color: #fd79a8 !important;
    color: white;
}

.btn-sm.active {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    font-weight: bold;
}

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

/* Stats Sections */
.stats-section {
    margin-bottom: 40px;
}

.stats-section h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 24px;
}

/* Info Cards */
.stats-info-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stats-info-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
}

.stats-info-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(108, 92, 231, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary-color);
}

/* Fun Facts */
.fun-facts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.fun-fact-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.fun-fact-card:hover {
    transform: translateY(-5px);
}

.fun-fact-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(108, 92, 231, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary-color);
    margin: 0 auto 15px;
}

.fun-fact-card:nth-child(1) .fun-fact-icon {
    background-color: rgba(108, 92, 231, 0.2);
    color: #6c5ce7;
}

.fun-fact-card:nth-child(2) .fun-fact-icon {
    background-color: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.fun-fact-card:nth-child(3) .fun-fact-icon {
    background-color: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.fun-fact-card:nth-child(4) .fun-fact-icon {
    background-color: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.fun-fact-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.fun-fact-subtitle {
    font-size: 14px;
    color: var(--muted-text);
}

/* Footer */
.stats-footer {
    background-color: var(--darker-bg);
    padding: 20px 0;
    margin-top: 60px;
}

.stats-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-footer p {
    margin: 0;
    color: var(--muted-text);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stats-card {
        flex-direction: column;
        text-align: center;
    }

    .stats-chart-header {
        flex-direction: column;
        gap: 15px;
    }

    .stats-footer .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .stats-header h1 {
        font-size: 28px;
    }

    .time-filter {
        flex-direction: column;
    }
}