.leaderboard-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.tab-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 12px;
    width: fit-content;
}

.tab-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--accent-color);
    color: white;
}

.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
}

.leaderboard-table th {
    text-align: left;
    padding: 0 1.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.4;
    font-weight: 400;
}

.rank-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s;
}

.rank-row:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(1.01);
}

.rank-row td {
    padding: 1.25rem 1.5rem;
}

.rank-row td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    font-weight: 800;
    width: 60px;
}

.rank-row td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    text-align: right;
}

.rank-1 {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.05) !important;
    border: 1px solid rgba(255, 215, 0, 0.2) !important;
}

.rank-2 {
    color: #c0c0c0;
    background: rgba(192, 192, 192, 0.05) !important;
    border: 1px solid rgba(192, 192, 192, 0.2) !important;
}

.rank-3 {
    color: #cd7f32;
    background: rgba(205, 127, 50, 0.05) !important;
    border: 1px solid rgba(205, 127, 50, 0.2) !important;
}

.stock-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 0.5rem;
}

.profit-val {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--up-color);
}

.loss-val {
    color: var(--down-color);
}

/* Detail Expansion */
.rank-row {
    cursor: pointer;
}

.detail-row {
    background: rgba(255, 255, 255, 0.015);
    display: none;
}

.detail-row.active {
    display: table-row;
}

.detail-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-bottom-left-radius: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: -0.75rem;
    margin-bottom: 0.75rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.4;
    min-width: 120px;
}

.detail-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filter-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.4;
    font-weight: 700;
}

.filter-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    min-width: 140px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:hover {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.08);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .leaderboard-container {
        padding: 1rem;
    }

    .header-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select {
        width: 100%;
        min-width: 0;
    }

    .leaderboard-table th,
    .rank-row td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }

    .rank-row td:first-child {
        width: 40px;
        padding-left: 1rem;
    }

    .rank-row td:last-child {
        padding-right: 1rem;
    }

    .stock-badge {
        font-size: 0.65rem;
        padding: 0.1rem 0.3rem;
    }

    .detail-content {
        padding: 1rem;
    }

    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .detail-label {
        min-width: 0;
    }

    /* Stacking Logic */
    .hide-mobile {
        display: none !important;
    }

    .mobile-only-info {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
        margin-top: 0.3rem;
    }

    .trader-cell {
        display: flex;
        flex-direction: column;
    }

    .username {
        display: block;
        margin-bottom: 0.1rem;
    }

    .sl-small {
        font-size: 0.7rem;
        opacity: 0.5;
        font-weight: 400;
    }
}

@media (min-width: 769px) {
    .mobile-only-info {
        display: none !important;
    }
}