/* Statistics Dashboard Styles */

/* Navigation Buttons */
.stats-nav-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.stats-nav-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(20, 30, 40, 0.9);
    border: 2px solid #ff8c00;
    border-radius: 8px;
    color: #ff8c00;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.stats-nav-button:hover {
    background: rgba(255, 140, 0, 0.2);
    border-color: #ffa500;
    color: #ffa500;
}

.stats-nav-button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Overview Counter Cards */
.stats-counters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.counter-card {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    border-left: 5px solid #ff8c00;
    padding: 10px 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.counter-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #ff8c00;
    line-height: 1;
    margin-bottom: 8px;
}

.counter-label {
    display: block;
    font-size: 0.9rem;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Section Title */
.stats-section {
    margin-bottom: 40px;
}

.stats-section-title {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 140, 0, 0.3);
    text-align: center;
}

/* Chart Container */
.chart-container {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    border: 1px solid rgba(255, 140, 0, 0.2);
    padding: 20px;
    height: 400px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Dual Panel Layout */
.stats-dual-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.stats-panel {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.stats-panel .loading,
.stats-panel .error {
    text-align: center;
    color: #a0a0a0;
    padding: 40px;
}

.stats-panel .error {
    color: #ff6b6b;
}

/* Games Mini Cards */
.games-mini-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-mini-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(20, 19, 19, 0.9);
    border-radius: 8px;
    border-left: 5px solid #ff8c00;
    text-decoration: none;
    color: #ffffff;
    transition: background 0.2s, transform 0.2s;
}

.game-mini-card:hover {
    background: rgba(255, 140, 0, 0.1);
    transform: translateX(5px);
}

.game-mini-img {
    width: 80px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.game-mini-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.game-mini-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.game-mini-stat {
    font-size: 0.85rem;
    color: #a0a0a0;
}

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

.enviro-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(20, 19, 19, 0.9);
    border-radius: 6px;
    border-left: 3px solid #ff8c00;
}

.enviro-stat-item.enviro-stat-inactive {
    opacity: 0.3;
    border-left-color: #666;
}

.enviro-stat-icon {
    height: 28px;
    width: auto;
    flex-shrink: 0;
}

.enviro-stat-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
}

.enviro-stat-count {
    color: #ff8c00;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Leaderboard Toggle Buttons */
.leaderboard-toggle-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.leaderboard-toggle {
    padding: 6px 16px;
    background: rgba(100, 100, 100, 0.3);
    border: 2px solid #666;
    border-radius: 20px;
    color: #999;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.leaderboard-toggle:hover {
    background: rgba(150, 150, 150, 0.3);
    border-color: #888;
    color: #bbb;
}

.leaderboard-toggle.active {
    background: rgba(255, 140, 0, 0.2);
    border-color: #ff8c00;
    color: #ff8c00;
}

/* Leaderboard List */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    max-height: 470px;
    overflow-y: auto;
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 35px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(20, 19, 19, 0.9);
    border-radius: 6px;
    border-left: 5px solid #ff8c00;
    transition: background 0.2s;
}

.leaderboard-entry:hover {
    background: rgba(255, 140, 0, 0.1);
}

.leaderboard-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.3rem;
    overflow: hidden;
}

.leaderboard-info {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

.leaderboard-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-count {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}

.leaderboard-entry .rank-medal {
    height: 2rem;
    width: auto;
}

/* Cheater styling */
.leaderboard-entry.has-cheated {
    color: #ff6b6b;
    font-style: italic;
    border-left-color: #ff6b6b;
}

.leaderboard-entry.has-cheated .leaderboard-name,
.leaderboard-entry.has-cheated .leaderboard-count,
.leaderboard-entry.has-cheated .player-rank-text {
    color: #ff6b6b;
}

.leaderboard-entry .player-rank-text {
    color: #ff8c00;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
}

.leaderboard-entry .player-flag {
    height: 24px;
    width: auto;
    flex-shrink: 0;
}

/* See All Button */
.see-all-button {
    display: block;
    text-align: center;
    padding: 10px;
    margin-top: 15px;
    color: #ff8c00;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid rgba(255, 140, 0, 0.3);
    border-radius: 6px;
    transition: all 0.2s;
}

.see-all-button:hover {
    background: rgba(255, 140, 0, 0.1);
}

.see-all-button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .stats-counters {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .stats-dual-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-counters {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .counter-value {
        font-size: 2rem;
    }

    .chart-container {
        height: 300px;
        padding: 15px;
    }

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

    .stats-nav-buttons {
        flex-direction: column;
        align-items: center;
    }

    .leaderboard-entry {
        padding: 6px 8px;
        border-left-width: 4px;
    }

    .leaderboard-name {
        font-size: 0.85rem;
    }

    .leaderboard-entry .player-flag {
        height: 20px;
    }

    .leaderboard-entry .rank-medal {
        height: 1.6rem;
    }
}

@media (max-width: 480px) {
    .stats-counters {
        grid-template-columns: 1fr;
    }

    .counter-card {
        padding: 15px;
    }

    .counter-value {
        font-size: 1.8rem;
    }

    .chart-container {
        height: 250px;
        padding: 10px;
    }

    .game-mini-img {
        width: 60px;
        height: 38px;
    }

    .leaderboard-entry {
        padding: 5px 6px;
        border-left-width: 3px;
        gap: 4px;
    }

    .leaderboard-name {
        font-size: 0.75rem;
    }

    .leaderboard-entry .player-flag {
        height: 16px;
    }

    .leaderboard-entry .rank-medal {
        height: 1.4rem;
    }
}
