/* ==========================================
   RDGH STATS PAGE - Platform Statistics
   Dark theme using system.css variables
   ========================================== */

/* Page Layout */
.stats-page {
    background: var(--bg-primary);
    min-height: 100vh;
}

.stats-main {
    padding-top: 80px;
    padding-bottom: 100px;
}

.stats-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
}

/* Page Header */
.stats-header {
    text-align: center;
    margin-bottom: 48px;
    padding: 40px 0;
}

.stats-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--text-gradient-titanium);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

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

/* Section Styles */
.stats-section {
    margin-bottom: 64px;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    backdrop-filter: blur(20px);
}

.section-header {
    margin-bottom: 32px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-title svg,
.section-title i {
    color: var(--accent-primary);
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-left: 36px;
}

/* ==========================================
   SYSTEM STATUS DASHBOARD
   Professional monitoring-style UI
   ========================================== */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
}

.system-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--success);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    position: relative;
}

.status-indicator.online::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--success);
    opacity: 0.4;
    animation: status-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes status-ping {
    0% { transform: scale(1); opacity: 0.4; }
    75%, 100% { transform: scale(2); opacity: 0; }
}

/* System Grid */
.system-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* System Card */
.system-card {
    background: var(--surface-0);
    border: 1px solid var(--border-secondary);
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.system-card:hover {
    border-color: var(--border-primary);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.system-card.primary {
    border-left: 3px solid var(--accent-primary);
}

.system-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.system-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border-radius: 10px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.system-icon.accent {
    background: rgba(148, 184, 212, 0.15);
    color: var(--accent-primary);
}

.system-meta {
    flex: 1;
    min-width: 0;
}

.system-meta h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.system-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--surface-2);
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.system-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.system-status.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.system-status .pulse {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
}

/* System Metrics */
.system-metrics {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
}

.metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* System Bar */
.system-bar {
    height: 4px;
    background: var(--surface-2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.system-bar .bar-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: width 0.6s ease;
}

.system-bar.secure .bar-fill {
    background: var(--success);
}

.bar-label {
    font-size: 0.7rem;
    color: var(--text-dimmed);
}

/* System Features Tags */
.system-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.feature-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border-secondary);
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.feature-tag:hover {
    background: var(--surface-3);
    color: var(--text-secondary);
    border-color: var(--border-primary);
}

/* System Card Animations */
.system-card {
    opacity: 0;
    transform: translateY(20px);
    animation: cardFadeIn 0.5s ease forwards;
}

.system-card:nth-child(1) { animation-delay: 0s; }
.system-card:nth-child(2) { animation-delay: 0.08s; }
.system-card:nth-child(3) { animation-delay: 0.16s; }
.system-card:nth-child(4) { animation-delay: 0.24s; }
.system-card:nth-child(5) { animation-delay: 0.32s; }
.system-card:nth-child(6) { animation-delay: 0.4s; }

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status Pulse Animation */
.system-status.online .pulse {
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}

/* Icon Hover Animation */
.system-card:hover .system-icon {
    transform: scale(1.05);
}

.system-icon {
    transition: transform 0.2s ease;
}

/* Metric Value Animation on Hover */
.system-card:hover .metric-value {
    color: var(--accent-primary);
}

.metric-value {
    transition: color 0.2s ease;
}

/* ==========================================
   SERVER INFRASTRUCTURE - World Map
   ========================================== */

.server-map-container {
    position: relative;
    width: 100%;
    padding: 24px;
    padding-top: 60px; /* Extra space for top tooltips */
    background: var(--surface-1);
    border-radius: 16px;
    border: 1px solid var(--border-primary);
    overflow: visible; /* Allow tooltips to overflow */
}

/* World Map Container - D3 */
.world-map {
    position: relative;
    width: 100%;
    height: 380px;
    border-radius: 12px;
    overflow: visible; /* Allow tooltips to overflow */
    background: var(--surface-0);
}

.world-map svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* D3 Map Countries */
.world-map .map-country {
    fill: var(--surface-2);
    stroke: var(--border-primary);
    stroke-width: 0.4;
    opacity: 0.8;
}

/* Graticule Grid */
.world-map .map-graticule {
    pointer-events: none;
}

/* Connection Arc */
.world-map .connection-arc {
    pointer-events: none;
}

/* Server Marker Group */
.world-map .server-marker-group {
    cursor: pointer;
}

.world-map .server-marker-group:hover .marker-dot {
    transform: scale(1.3);
}

.world-map .marker-dot {
    transition: transform 0.2s ease;
}

.world-map .marker-dot:not(.planned) {
    filter: drop-shadow(0 0 6px var(--success));
}

.world-map .marker-dot.planned {
    filter: drop-shadow(0 0 6px var(--warning));
}

.world-map .marker-glow {
    pointer-events: none;
}

/* Pulse Ring Animation for SVG */
@keyframes pulse-ring {
    0% {
        r: 8;
        opacity: 0.8;
    }
    100% {
        r: 30;
        opacity: 0;
    }
}

.world-map .marker-pulse-ring {
    transform-origin: center;
}

/* Hover Area for Tooltips */
.marker-hover-area {
    position: absolute;
    width: 30px;
    height: 30px;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 20;
    border-radius: 50%;
}

/* Server Tooltip - Positioned by JS */
.server-tooltip {
    position: absolute;
    transform: translate(-50%, -100%) translateY(-20px);
    padding: 12px 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-titanium);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    pointer-events: none;
    backdrop-filter: blur(8px);
}

.server-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border-titanium);
}

.server-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -100%) translateY(-12px);
}

.tooltip-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tooltip-region {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.tooltip-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tooltip-status.active {
    color: var(--success);
}

.tooltip-status.planned {
    color: var(--warning);
}

.tooltip-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: status-blink 1.5s ease-in-out infinite;
}

@keyframes status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}


.server-legend {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.active {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.legend-dot.planned {
    background: var(--warning);
    opacity: 0.7;
}

/* ==========================================
   VOLUME CHARTS
   ========================================== */

.volume-controls {
    margin-bottom: 24px;
}

.time-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    background: var(--surface-1);
    border: 1px solid var(--border-secondary);
    border-radius: 12px;
    width: fit-content;
}

.time-btn {
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-btn:hover {
    color: var(--text-primary);
    background: var(--surface-2);
}

.time-btn.active {
    color: var(--text-on-accent);
    background: var(--btn-primary-bg);
    box-shadow: var(--btn-primary-shadow);
}

/* Volume Stats Row */
.volume-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.volume-stat-card {
    padding: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border-secondary);
    border-radius: 12px;
    text-align: center;
}

.volume-stat-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.volume-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Chart Container */
.chart-container {
    position: relative;
    min-height: 400px;
}

.chart-wrapper {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-1);
    border: 1px solid var(--border-secondary);
}

#volumeChart {
    width: 100%;
    height: 100%;
}

.chart-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--bg-overlay);
    color: var(--text-muted);
    font-size: 0.9rem;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.chart-loading.visible {
    opacity: 1;
    pointer-events: auto;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-primary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ==========================================
   LEADERBOARD
   ========================================== */

.leaderboard-container {
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--border-secondary);
}

.leaderboard-table {
    width: 100%;
}

.leaderboard-header {
    display: grid;
    grid-template-columns: 60px 1fr 80px 120px;
    padding: 16px 20px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-secondary);
}

.lb-col {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lb-col.vip {
    text-align: center;
}

.lb-col.volume {
    text-align: right;
}

.leaderboard-body {
    max-height: 600px;
    overflow-y: auto;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 60px 1fr 80px 120px;
    padding: 16px 20px;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.2s ease;
}

.leaderboard-row:hover {
    background: var(--surface-1);
}

.leaderboard-row:last-child {
    border-bottom: none;
}

/* Rank styling */
.lb-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
}

.lb-rank.gold {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.15);
}

.lb-rank.silver {
    color: #C0C0C0;
    background: rgba(192, 192, 192, 0.15);
}

.lb-rank.bronze {
    color: #CD7F32;
    background: rgba(205, 127, 50, 0.15);
}

.lb-rank.default {
    color: var(--text-muted);
    background: var(--surface-2);
}

/* User cell */
.lb-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lb-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lb-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--titanium-glow);
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-primary);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.lb-username {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
    transition: all 0.3s ease;
}

/* VIP Level Column */
.lb-vip-level {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 auto;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--text-muted);
}

.lb-vip-level.vip-none {
    color: var(--text-dimmed);
    font-size: 1rem;
}

/* VIP Badge (legacy) */
.lb-vip-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    width: fit-content;
}

/* ==========================================
   VIP Level Styles - Using unified system.css colors
   Matches the VIP badge colors from system.css
   ========================================== */

/* Level 0 - Slate Gray */
.lb-avatar.vip-level-0,
.lb-username.vip-level-0 {
    color: var(--text-muted);
}
.lb-vip-level.vip-level-0 {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.15), rgba(100, 116, 139, 0.1));
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Level 1-2 - Bronze */
.lb-avatar.vip-level-1,
.lb-avatar.vip-level-2 {
    border-color: #d4a574;
    box-shadow: 0 0 8px rgba(212, 165, 116, 0.3);
}
.lb-username.vip-level-1,
.lb-username.vip-level-2 {
    color: #d4a574;
}
.lb-vip-level.vip-level-1,
.lb-vip-level.vip-level-2 {
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.15), rgba(184, 147, 95, 0.1));
    color: #d4a574;
    border: 1px solid rgba(212, 165, 116, 0.3);
}

/* Level 3-4 - Silver */
.lb-avatar.vip-level-3,
.lb-avatar.vip-level-4 {
    border-color: #e4e4e7;
    box-shadow: 0 0 8px rgba(228, 228, 231, 0.3);
}
.lb-username.vip-level-3,
.lb-username.vip-level-4 {
    color: #e4e4e7;
}
.lb-vip-level.vip-level-3,
.lb-vip-level.vip-level-4 {
    background: linear-gradient(135deg, rgba(228, 228, 231, 0.15), rgba(212, 212, 216, 0.1));
    color: #e4e4e7;
    border: 1px solid rgba(228, 228, 231, 0.3);
}

/* Level 5-6 - Gold */
.lb-avatar.vip-level-5,
.lb-avatar.vip-level-6 {
    border-color: #fbbf24;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}
.lb-username.vip-level-5,
.lb-username.vip-level-6 {
    color: #fbbf24;
}
.lb-vip-level.vip-level-5,
.lb-vip-level.vip-level-6 {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Level 7 - Platinum (animated shine) */
.lb-avatar.vip-level-7 {
    border-color: #e8eaed;
    box-shadow: 0 0 12px rgba(232, 234, 237, 0.5);
    background: linear-gradient(135deg, rgba(232, 234, 237, 0.2), rgba(214, 217, 220, 0.1));
}
.lb-username.vip-level-7 {
    color: #e8eaed;
    text-shadow: 0 0 8px rgba(232, 234, 237, 0.3);
}
.lb-vip-level.vip-level-7 {
    background: linear-gradient(135deg, #e8eaed, #f5f5f5, #d6d9dc, #e8eaed);
    background-size: 200% 200%;
    color: #1e293b;
    border: 1px solid rgba(232, 234, 237, 0.5);
    animation: vipShine 4s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(232, 234, 237, 0.4);
}

/* Level 8 - Titanium (brand signature) */
.lb-avatar.vip-level-8 {
    border-color: #94B8D4;
    box-shadow: 0 0 14px rgba(148, 184, 212, 0.5);
    background: linear-gradient(135deg, rgba(148, 184, 212, 0.2), rgba(122, 160, 192, 0.1));
}
.lb-username.vip-level-8 {
    color: #94B8D4;
    text-shadow: 0 0 10px rgba(148, 184, 212, 0.4);
}
.lb-vip-level.vip-level-8 {
    background: linear-gradient(135deg, #94B8D4, #7AA0C0, #6B9AC0, #94B8D4);
    background-size: 200% 200%;
    color: #0f172a;
    border: 1px solid rgba(148, 184, 212, 0.5);
    animation: vipShine 4s ease-in-out infinite;
    box-shadow: 0 0 14px rgba(148, 184, 212, 0.4);
}

/* Level 9 - Elite (cyan diamond) */
.lb-avatar.vip-level-9 {
    border-color: #22d3ee;
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.5);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(6, 182, 212, 0.1));
}
.lb-username.vip-level-9 {
    color: #22d3ee;
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.4);
}
.lb-vip-level.vip-level-9 {
    background: linear-gradient(135deg, #22d3ee, #06b6d4, #0891b2, #22d3ee);
    background-size: 200% 200%;
    color: #0f172a;
    border: 1px solid rgba(34, 211, 238, 0.5);
    animation: vipShine 3s ease-in-out infinite;
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.4);
}

/* Level 10 - Legendary (red-gold animated) */
.lb-avatar.vip-level-10 {
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6), 0 0 40px rgba(251, 191, 36, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(251, 191, 36, 0.2));
    animation: legendaryPulse 2s ease-in-out infinite;
}
.lb-username.vip-level-10 {
    background: linear-gradient(90deg, #ef4444, #fbbf24, #ef4444);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: legendaryText 3s linear infinite;
    font-weight: 700;
}
.lb-vip-level.vip-level-10 {
    background: linear-gradient(135deg, #ef4444, #f97316, #fbbf24, #ef4444);
    background-size: 300% 300%;
    color: #fff;
    border: 1px solid rgba(239, 68, 68, 0.5);
    animation: legendaryBadge 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4), 0 0 40px rgba(251, 191, 36, 0.2);
}

/* VIP Animations */
@keyframes vipShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes legendaryPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.6), 0 0 40px rgba(251, 191, 36, 0.3); }
    50% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.8), 0 0 60px rgba(251, 191, 36, 0.5); }
}

@keyframes legendaryText {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

@keyframes legendaryBadge {
    0%, 100% { background-position: 0% 50%; transform: scale(1); }
    50% { background-position: 100% 50%; transform: scale(1.05); }
}

/* Volume */
.lb-volume {
    text-align: right;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--success);
}

/* Loading state */
.leaderboard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* Empty state */
.leaderboard-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dimmed);
}

.leaderboard-empty i {
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

/* Tablet - 2 column system grid */
@media (max-width: 1024px) {
    .system-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-main {
        padding-top: 70px;
        padding-bottom: 120px;
    }

    .stats-container {
        padding: 0 16px;
    }

    .stats-header {
        padding: 24px 0;
        margin-bottom: 32px;
    }

    .stats-title {
        font-size: 1.75rem;
    }

    .stats-subtitle {
        font-size: 0.95rem;
    }

    .stats-section {
        padding: 20px;
        margin-bottom: 24px;
        border-radius: 12px;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .section-desc {
        margin-left: 0;
        margin-top: 8px;
    }

    /* System Status on mobile */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .system-status-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .system-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .system-card {
        padding: 16px;
    }

    .system-icon {
        width: 36px;
        height: 36px;
    }

    .system-meta h3 {
        font-size: 0.9rem;
    }

    .system-metrics {
        gap: 16px;
    }

    .metric-value {
        font-size: 1rem;
    }

    /* Feature Tags Mobile */
    .system-features {
        gap: 4px;
        margin-top: 10px;
        padding-top: 10px;
    }

    .feature-tag {
        padding: 3px 8px;
        font-size: 0.65rem;
    }

    /* Server Map Mobile */
    .server-map-container {
        padding: 16px;
    }

    .world-map {
        height: 280px;
    }

    .server-legend {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    /* Time Filter Mobile */
    .time-filter {
        width: 100%;
        justify-content: center;
    }

    .time-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    /* Volume Stats Mobile */
    .volume-stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .volume-stat-card {
        padding: 16px;
    }

    .volume-stat-value {
        font-size: 1.2rem;
    }

    /* Chart Mobile */
    .chart-wrapper {
        height: 300px;
    }

    /* Leaderboard Mobile */
    .leaderboard-header {
        grid-template-columns: 40px 1fr 50px 80px;
        padding: 12px 16px;
    }

    .leaderboard-row {
        grid-template-columns: 40px 1fr 50px 80px;
        padding: 12px 16px;
    }

    .lb-vip-level {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .lb-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .lb-username {
        font-size: 0.85rem;
    }

    .lb-volume {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .stats-title {
        font-size: 1.5rem;
    }

    /* System Status - extra small */
    .system-card {
        padding: 14px;
    }

    .system-card-header {
        gap: 10px;
    }

    .system-icon {
        width: 32px;
        height: 32px;
    }

    .system-icon i,
    .system-icon svg {
        width: 18px;
        height: 18px;
    }

    .system-meta h3 {
        font-size: 0.85rem;
    }

    .system-tag {
        font-size: 0.6rem;
    }

    .metric-value {
        font-size: 0.95rem;
    }

    .metric-label {
        font-size: 0.65rem;
    }

    .volume-stats-row {
        grid-template-columns: 1fr;
    }

    .time-filter {
        gap: 4px;
        padding: 4px;
    }

    .time-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

/* Fade in animation for sections */
.stats-section {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth scrollbar for leaderboard */
.leaderboard-body::-webkit-scrollbar {
    width: 6px;
}

.leaderboard-body::-webkit-scrollbar-track {
    background: var(--surface-1);
}

.leaderboard-body::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 3px;
}

.leaderboard-body::-webkit-scrollbar-thumb:hover {
    background: var(--border-titanium);
}

/* ==========================================
   SECURITY & PROTECTION SECTION
   ========================================== */

/* Cloudflare Colors */
:root {
    --cf-orange: #F6821F;
    --cf-yellow: #FAAD3F;
}

.security-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.security-card {
    background: var(--surface-1);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.security-card:hover {
    border-color: var(--border-titanium);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.cloudflare-card {
    background: linear-gradient(135deg, var(--surface-1) 0%, var(--surface-2) 100%);
    border: 1px solid var(--cf-orange);
    position: relative;
    overflow: hidden;
}

.cloudflare-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cf-orange), var(--cf-yellow));
}

.security-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-secondary);
}

.cloudflare-logo-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cloudflare-logo {
    height: 36px;
    width: auto;
}

.cf-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.security-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.security-badge.active::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.security-card-body h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.security-card-body > p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.security-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface-0);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.feature-item:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}

.feature-item svg {
    color: var(--cf-orange);
    flex-shrink: 0;
}

/* Security Stats Grid */
.security-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.security-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--surface-1);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.security-stat-card:hover {
    border-color: var(--border-titanium);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--surface-2), var(--surface-0));
    border-radius: 12px;
    color: var(--titanium-silver-light);
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Security Section Responsive */
@media (max-width: 1024px) {
    .security-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .security-features {
        grid-template-columns: 1fr;
    }

    .security-stats-grid {
        grid-template-columns: 1fr;
    }

    .security-stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

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

@media (max-width: 480px) {
    .security-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .feature-item {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}
