/* ============================================
   STATS PAGE - Ravendawn Theme
   ============================================ */

/* Stats page section */
.stats-page {
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(19, 20, 22, 0.6);
    z-index: 0;
}

.stats-page > * {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Stats Layout */
.stats-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   SIDEBAR MENU
   ============================================ */
.stats-sidebar-menu {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(87, 87, 87, 0.3);
    border-radius: 6px;
    padding: 16px;
}

.stats-category-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid rgba(87, 87, 87, 0.3);
    padding-bottom: 8px;
    margin-bottom: 10px;
    margin-top: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.stats-category-title:first-child {
    margin-top: 0;
}

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

.stats-menu-item {
    margin-bottom: 2px;
}

.stats-menu-link {
    display: block;
    padding: 8px 12px;
    color: var(--color-005);
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.15s;
    border-left: 2px solid transparent;
    cursor: pointer;
}

.stats-menu-link:hover {
    color: var(--color-001);
    background: rgba(119, 212, 99, 0.08);
}

.stats-menu-link.active {
    color: var(--color-001);
    background: rgba(119, 212, 99, 0.12);
    border-left: 2px solid var(--primary);
    font-weight: 500;
}

/* ============================================
   CONTENT AREA
   ============================================ */
.stats-content-area {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(87, 87, 87, 0.3);
    border-radius: 6px;
    padding: 24px;
    min-height: 500px;
}

.stats-section-header {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(87, 87, 87, 0.3);
    padding-bottom: 12px;
}

.stats-section-title {
    font-family: var(--font-heading);
    font-size: 22px;
    color: var(--primary);
    text-align: center;
    margin: 0;
}

.stats-section-subtitle {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    margin-top: 5px;
}

/* ============================================
   TABLES
   ============================================ */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.stats-table th {
    background: rgba(119, 212, 99, 0.1);
    color: var(--primary);
    font-weight: 600;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 2px solid rgba(87, 87, 87, 0.3);
    font-family: var(--font-heading);
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.stats-table td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(87, 87, 87, 0.15);
    color: var(--color-005);
}

.stats-table tbody tr {
    transition: background 0.15s;
}

.stats-table tbody tr:hover td {
    background: rgba(119, 212, 99, 0.05);
}

.stats-table tbody tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.15);
}

.rank-number {
    font-weight: bold;
    color: var(--primary);
    width: 40px;
}

.rank-1 { color: var(--accent); text-shadow: 0 0 6px rgba(251, 195, 33, 0.3); }
.rank-2 { color: #c0c0c0; text-shadow: 0 0 6px rgba(192, 192, 192, 0.3); }
.rank-3 { color: #cd7f32; text-shadow: 0 0 6px rgba(205, 127, 50, 0.3); }

/* ============================================
   LOADING
   ============================================ */
.loading-spinner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 300px;
    color: var(--primary);
    font-size: 14px;
    gap: 12px;
}

.loading-spinner-circle {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(119, 212, 99, 0.2);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-message {
    color: #ef4444;
    text-align: center;
    padding: 40px;
    font-size: 14px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .stats-layout {
        grid-template-columns: 1fr;
    }

    .stats-sidebar-menu {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stats-category-title {
        grid-column: 1 / -1;
        margin-top: 10px;
    }

    .stats-category-title:first-child {
        margin-top: 0;
    }
}

@media (max-width: 640px) {
    .stats-sidebar-menu {
        grid-template-columns: 1fr;
    }

    .stats-table {
        font-size: 11px;
    }
}
