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

/* Stats Grid - 3 columns for leaderboard */
.lb-stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* Current Leader Card */
.leader-value {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.leader-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.leader-name {
    font-size: 38px;
    font-weight: 800;
    color: #2E77AE;
    line-height: 1.1;
}

/* Monthly Ranking */
.ranking-value {
    font-size: 42px !important;
}

.ranking-suffix {
    font-size: 22px;
    font-weight: 600;
    color: #2E77AE;
}

/* ===== FILTERS ROW ===== */
.lb-filters-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.lb-filter-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lb-filter-label {
    font-size: 14px;
    font-weight: 500;
    color: #7F7F7F;
}

.lb-select {
    width: 150px;
}

.lb-filter-center {
    flex: 1;
    text-align: center;
}

.lb-month-label {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
}

.lb-filter-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lb-time-tab {
    font-size: 13px;
    font-weight: 500;
    color: #7F7F7F;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.lb-time-tab:hover {
    color: #2E77AE;
}

.lb-time-tab.active {
    color: #1a1a2e;
    border-bottom-color: #1a1a2e;
    font-weight: 600;
}

/* ===== TABLE VIEW ===== */
.lb-table-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e8ecf1;
    overflow: hidden;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.lb-table thead {
    background-color: #f0f5fa;
}

.lb-table thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #7F7F7F;
    padding: 14px 16px;
    border-bottom: 1px solid #e8ecf1;
}

.lb-table tbody tr {
    border-bottom: 1px solid #f0f2f5;
    transition: background-color 0.15s ease;
}

.lb-table tbody tr:hover {
    background-color: #f8fafd;
}

.lb-table tbody td {
    padding: 14px 16px;
    color: #7F7F7F;
    vertical-align: middle;
    white-space: nowrap;
}

/* Rank Badges */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 10px;
    color: #b0b7c3;
    background-color: #f0f2f5;
    margin-right: 6px;
}

.rank-badge.gold {
    background-color: #fff3d6;
    color: #FF8E2B;
}

.rank-badge.silver {
    background-color: #e8ecf1;
    color: #7F7F7F;
}

.rank-badge.bronze {
    background-color: #fce8d5;
    color: #d4901e;
}

/* Trend */
.trend-up,
td.trend-up,
.lb-table tbody td.trend-up {
    color: #34a853;
    font-weight: 600;
    font-size: 13px;
}

.trend-down,
td.trend-down,
.lb-table tbody td.trend-down {
    color: #FF4747;
    font-weight: 600;
    font-size: 13px;
}

.trend-up i,
.trend-down i {
    margin-right: 2px;
}

/* View Profile Button */
.view-profile-btn {
    padding: 5px 20px;
    border: 1px solid #2E77AE;
    background: #fff;
    color: #2E77AE;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.view-profile-btn:hover {
    background: #2E77AE;
    color: #fff;
}

/* ===== CARD/GRID VIEW ===== */
.lb-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.lb-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    border: 2.5px solid #2E77AE;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
}

.lb-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.lb-card-top {
    border: 2.5px solid #2E77AE;
    border-top: 4px solid #2E77AE;
}

.lb-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lb-card-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lb-card-user img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.lb-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
}

.lb-card-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #7F7F7F;
    gap: 12px;
}

.lb-card-details i {
    margin-right: 4px;
    color: #2E77AE;
    font-size: 11px;
}

.lb-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #f0f2f5;
}

.lb-place-label {
    font-size: 15px;
    font-weight: 700;
    color: #7F7F7F;
}

.lb-place-label.gold {
    color: #FF8E2B;
}

.lb-place-label.silver {
    color: #7F7F7F;
}

.lb-place-label.bronze {
    color: #d4901e;
}

/* ===== BOTTOM ROW ===== */
.lb-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.lb-bottom-row .pagination {
    margin-top: 0;
}

/* View Toggle Buttons */
.view-toggle {
    display: flex;
    gap: 8px;
}

.view-toggle-btn {
    width: 42px;
    height: 42px;
    border: 1px solid #e8ecf1;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #7F7F7F;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    border-color: #2E77AE;
    color: #2E77AE;
}

.view-toggle-btn.active {
    background-color: #2E77AE;
    color: #fff;
    border-color: #2E77AE;
}

/* ===== LEADERBOARD DRAWER ===== */
.lb-drawer-user-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lb-drawer-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
}

.lb-drawer-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lb-drawer-name-row .drawer-title {
    font-size: 20px;
}

.lb-drawer-rank-label {
    font-size: 16px;
    font-weight: 700;
    color: #7F7F7F;
}

.lb-drawer-rank-label.gold {
    color: #FF8E2B;
}

/* User Meta */
.lb-drawer-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 12px 0 6px;
}

.lb-drawer-meta-item {
    font-size: 13px;
    color: #7F7F7F;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lb-drawer-meta-item i {
    color: #2E77AE;
    width: 16px;
    text-align: center;
    font-size: 12px;
}

.lb-drawer-joined {
    font-size: 12px;
    color: #b0b7c3;
    display: block;
    text-align: right;
    margin-top: 4px;
    margin-bottom: 8px;
}

/* Rank History Table */
.lb-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 4px;
}

.lb-history-table thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: #7F7F7F;
    padding: 8px 4px;
    border-bottom: 1px solid #e8ecf1;
}

.lb-history-table tbody tr {
    border-bottom: 1px solid #f0f2f5;
}

.lb-history-table tbody td {
    padding: 10px 4px;
    color: #7F7F7F;
    vertical-align: middle;
}

.lb-history-table .user-cell img {
    width: 28px;
    height: 28px;
}

/* Insight sub label */
.insight-sublabel {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 2px;
}

/* Edit User Button */
.action-btn.edit-user {
    background-color: #2E77AE;
    color: #fff;
    padding: 10px 32px;
    margin-left: auto;
    flex: unset;
}

.action-btn.edit-user:hover {
    background-color: #245F8B;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .lb-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .lb-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lb-filters-row {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .lb-stats-grid {
        grid-template-columns: 1fr !important;
    }

    .lb-cards-grid {
        grid-template-columns: 1fr;
    }

    .lb-filters-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .lb-filter-center {
        text-align: left;
    }

    .lb-table-card {
        overflow-x: auto;
    }

    .lb-bottom-row {
        flex-direction: column;
        gap: 16px;
    }
}
