/* Stats Dashboard Styles */

.stats-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.stats-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.community-name {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

.period-selector select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
}

/* Overview Cards */
.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.stat-card:nth-child(1) {
    border-left: 4px solid #4285f4;
}

.stat-card:nth-child(2) {
    border-left: 4px solid #34a853;
}

.stat-card:nth-child(3) {
    border-left: 4px solid #fbbc04;
}

.stat-card:nth-child(4) {
    border-left: 4px solid #ea4335;
}

.card-icon {
    font-size: 3rem;
}

.stat-card:nth-child(1) .card-icon {
    color: #4285f4;
}

.stat-card:nth-child(2) .card-icon {
    color: #34a853;
}

.stat-card:nth-child(3) .card-icon {
    color: #fbbc04;
}

.stat-card:nth-child(4) .card-icon {
    color: #ea4335;
}

.card-content {
    flex: 1;
}

.card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.card-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-box {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid var(--border);
}

.chart-box h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.chart-box canvas {
    max-height: 300px;
}

/* Leaderboards */
.leaderboards-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.leaderboard {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid var(--border);
}

.leaderboard h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    transition: all 0.2s;
}

.leaderboard-item:hover {
    background: rgba(0, 0, 0, 0.1);
}

.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: 700;
    width: 40px;
    text-align: center;
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
    color: #ffd700;
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
    color: #c0c0c0;
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
    color: #cd7f32;
}

.leaderboard-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.leaderboard-stat {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.leaderboard-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Recent Activity */
.recent-activity {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid var(--border);
}

.recent-activity h2 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
}

.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    border-left: 4px solid var(--activity-color);
}

.activity-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-text {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.activity-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.activity-item[data-type="member"] {
    --activity-color: #4285f4;
}

.activity-item[data-type="ship"] {
    --activity-color: #34a853;
}

.activity-item[data-type="event"] {
    --activity-color: #fbbc04;
}

.activity-item[data-type="post"] {
    --activity-color: #ea4335;
}

.activity-item[data-type="budget"] {
    --activity-color: #9c27b0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
}

/* Responsive */
@media (max-width: 1200px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-container {
        padding: 1rem;
    }

    .stats-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .overview-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .leaderboards-section {
        grid-template-columns: 1fr;
    }

    .activity-item {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .overview-cards {
        grid-template-columns: 1fr;
    }
}
