/* Stats Page Styles - Dark Mode */

.stats-page {
    padding: 30px 0 50px;
    padding-top: 100px;
    scroll-margin-top: 70px;
}

.stats-page .section-header a {
    color: var(--text-secondary);
    text-decoration: none;
}

.stats-page .section-header a:hover {
    text-decoration: underline;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px 24px;
    text-align: center;
}

.stat-card .number {
    font-size: 2.2rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-card .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 8px;
}

.releases-section {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px 28px 16px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.downloads-section {
    padding-bottom: 24px;
}

.releases-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.release-table {
    width: 100%;
    border-collapse: collapse;
}

.release-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.release-table th:first-child {
    border-radius: 8px 0 0 8px;
}

.release-table th:last-child {
    border-radius: 0 8px 8px 0;
}

.release-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.release-table tr:last-child td {
    border-bottom: none;
}

.release-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.build-name {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 90px;
}

.build-name a {
    color: var(--text-primary);
    text-decoration: none;
}

.build-name a:hover {
    color: var(--accent-cyan);
}

.download-count {
    font-weight: 700;
    color: var(--accent-cyan);
    font-family: 'Orbitron', sans-serif;
}

.file-size {
    color: var(--text-secondary);
}

.release-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.error {
    text-align: center;
    padding: 40px;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
}

.refresh-btn {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-cyan);
}

.last-updated {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 12px;
}

.chart-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    width: 70px;
    font-size: 0.85rem;
    font-weight: 600;
}

.bar-label a {
    color: var(--text-primary);
    text-decoration: none;
}

.bar-label a:hover {
    color: var(--accent-cyan);
}

.bar-track {
    flex: 1;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 14px;
    transition: width 0.5s ease-out;
    min-width: 30px;
}

.bar-value {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-cyan);
    font-family: 'Orbitron', sans-serif;
}

.refresh-container {
    text-align: center;
    margin-top: 10px;
}

.error .refresh-btn {
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 600px) {
    .stats-page {
        padding-top: 84px;
    }

    .stat-card .number {
        font-size: 1.6rem;
    }

    .release-table th,
    .release-table td {
        padding: 10px 8px;
        font-size: 0.8rem;
    }

    .bar-label {
        width: 55px;
        font-size: 0.75rem;
    }
}

@media (max-width: 599px) {
    .stat-card:nth-child(3),
    .stat-card:nth-child(4) {
        display: none;
    }
}

@media (min-width: 600px) and (max-width: 900px) {
    .stat-card:nth-child(4) {
        display: none;
    }
}
